Skip to content

Instantly share code, notes, and snippets.

View hudhaifahz's full-sized avatar

Hudhaifah Zahid hudhaifahz

View GitHub Profile
@hudhaifahz
hudhaifahz / erc20token.sol
Last active October 20, 2021 22:58 — forked from victorleejw/erc20token.sol
Erc20 Smart Contract for a Standard, Capped, Mintable, Burnable, Payable Token.
// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/GSN/Context.sol
// https://ropsten.etherscan.io/address/0x8df55a60a1c98281a60d6c89f59398bee854fbc8#code
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
@hudhaifahz
hudhaifahz / signandrecoveraddress.js
Created October 20, 2021 06:05 — forked from marc-queiroz/signandrecoveraddress.js
Truffle console commands - Learning how to sign a message using a private key and restore the address from hashed message
var ethUtil = require('ethereumjs-util')
var data = 'Hello World!'
var message = new Buffer(data)
var msgHash = ethUtil.hashPersonalMessage(message)
// privateKey = 0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3
// publicKey = 0x627306090abaB3A6e1400e9345bC60c78a8BEf57
var privateKey = new Buffer('c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3', "hex")
var sig = ethUtil.ecsign(msgHash, privateKey)
@hudhaifahz
hudhaifahz / README.txt
Created October 20, 2021 02:07
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.0+commit.c7dfd78e.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS

Keybase proof

I hereby claim:

  • I am hudhaifahz on github.
  • I am hudhaifahz (https://keybase.io/hudhaifahz) on keybase.
  • I have a public key ASD_ZurFdZAYt8lJI_ptnO97Vhckv4n-yK1JyL4pzDM1dAo

To claim this, I am signing this object:

@hudhaifahz
hudhaifahz / 0main.md
Created January 16, 2018 18:24 — forked from pandeiro/0main.md
Git Best Practices

Git Best Practices

This is a fairly common question, and there isn't a One True Answer, but still, this represents a consensus from #git

Read about git

Knowing where to look is half the battle. I strongly urge everyone to read (and support) the Pro Git book. The other resources are highly