Skip to content

Instantly share code, notes, and snippets.

@simondlr
Created July 16, 2015 11:36
Show Gist options
  • Save simondlr/b74e40039e570747b6e2 to your computer and use it in GitHub Desktop.
Save simondlr/b74e40039e570747b6e2 to your computer and use it in GitHub Desktop.
Generic Code
contract Generic is owned {
function() {
if(functions[msg.sig] != 0x0) {
functions[msg.sig].callcode(msg.data);
}
}
function changeMapping(bytes4 _functionSignature, address _addrOfFunction) {
if(msg.sender == owner) {
functions[_functionSignature] = _addrOfFunction;
}
}
mapping (bytes4 => address) functions;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment