Skip to content

Instantly share code, notes, and snippets.

@maojui
Created March 17, 2019 16:07
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 maojui/3e7044b67d42fc3b0106589089a59dbd to your computer and use it in GitHub Desktop.
Save maojui/3e7044b67d42fc3b0106589089a59dbd to your computer and use it in GitHub Desktop.
contract DelegateCaller {
uint public n;
address public sender;
function delegatecallSetN(address _e, uint _n) {
_e.delegatecall(bytes4(keccak256("setN(uint256)")), _n); // D's storage is set, E is not modified
}
}
contract OuterContract {
uint public n;
address public sender;
function setN(uint _n) {
n = _n;
sender = msg.sender;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment