Skip to content

Instantly share code, notes, and snippets.

View wadealexc's full-sized avatar

Alex wadealexc

View GitHub Profile
@wadealexc
wadealexc / Proxy.sol
Created November 8, 2018 12:56
Simple delegate-proxy implementation
pragma solidity ^0.4.24;
contract Proxy {
// Default delegatecall target
address destination;
/**
* @dev Constructor. Sets the default destination
* @param _dest The address to which this contract will forward execution
@wadealexc
wadealexc / RegisterAccount.sol
Created November 8, 2018 15:32
Sample Account Registry utility
pragma solidity ^0.4.24;
contract ERC20_Utility {
function transfer(address _sender, address _to, uint _amt) external returns (bool);
}
contract RegisterAccount {
// Maps addresses to registry status
mapping (address => bool) public registered;

Keybase proof

I hereby claim:

  • I am wadealexc on github.
  • I am wadealexc (https://keybase.io/wadealexc) on keybase.
  • I have a public key ASDJ0x7qstpcrBfn9UxO_uDuVFwKfA9TsEDkToDX-bO7-wo

To claim this, I am signing this object:

@wadealexc
wadealexc / MIBToken.sol
Last active February 8, 2019 15:10
MIBToken.sol - Source file
pragma solidity ^0.4.24;
contract DMIBLog {
//because gas price
//event MIBLog(bytes4 indexed sig, address indexed sender, uint _value, bytes _call4) anonymous;
event MIBLog(bytes4 indexed sig, address indexed sender, uint _value) anonymous;
modifier mlog {
//emit MIBLog(msg.sig, msg.sender, msg.value, msg.data);
emit MIBLog(msg.sig, msg.sender, msg.value);
pragma solidity ^0.4.23;
contract Solver {
bytes4 internal constant SEL = bytes4(keccak256('Set(uint256)'));
function execute(address) public pure {
// constants are not accessible in assembly
bytes4 sel = SEL;
assembly {
pragma solidity ^0.5.0;
library LibError {
function err(address sender, uint amt, string memory password) public pure returns (string memory errMessage) {
return string(abi.encodePacked("Call failed, please try again:: ", sender, amt, password));
}
}
contract Auth {