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 / 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