Skip to content

Instantly share code, notes, and snippets.

@izqui
Created March 14, 2017 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save izqui/b630a1b12400d05d0cd51f21d1be22fb to your computer and use it in GitHub Desktop.
Save izqui/b630a1b12400d05d0cd51f21d1be22fb to your computer and use it in GitHub Desktop.
contract Fixeable is LiveFactory {
function executeCode(bytes _code) {
execute(deployCode(_code));
}
function execute(address fixer) {
if (!canExecuteArbitraryCode()) throw;
assembly {
calldatacopy(0x0, 0x0, calldatasize)
let a := delegatecall(sub(gas, 10000), fixer, 0x0, calldatasize, 0, 0)
return(0, 0)
}
}
function canExecuteArbitraryCode() returns (bool);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment