interface Storage { function getNumber() external view returns (uint256); }
contract Puzzle { Storage public Storage1; Storage public Storage2; Storage public Storage3;
bool public solved;
function check(bytes memory code) private returns (bool) { uint256 i = 0; while (i < code.length) { uint8 op = uint8(code[i]); if ( op == 0x3B || // EXTCODECOPY op == 0x3C || // EXTCODESIZE op == 0x3F || // EXTCODEHASH op == 0x54 || // SLOAD op == 0x55 || // SSTORE op == 0xF0 || // CREATE op == 0xF1 || // CALL op == 0xF2 || // CALLCODE op == 0xF4 || // DELEGATECALL op == 0xF5 || // CREATE2 op == 0xFA || // STATICCALL op == 0xFF // SELFDESTRUCT ) return false;
i++; }
return true; }
function reverse(bytes memory a) private returns (bytes memory) { bytes memory b = new bytes(a.length); for (uint256 i = 0; i < a.length; i++) { b[b.length - i - 1] = a[i]; } return b; }
function sum(bytes memory a, bytes memory b) private returns (bytes memory) { bytes memory c = new bytes(a.length); for (uint256 i = 0; i < a.length; i++) { uint8 q = uint8(a[i]) + uint8(b[i]); c[i] = bytes1(q); } return c; }