Skip to content

Instantly share code, notes, and snippets.

@jacqueswww
Created August 20, 2019 15:01
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 jacqueswww/331a520dfd985772d87f9663aa7c9351 to your computer and use it in GitHub Desktop.
Save jacqueswww/331a520dfd985772d87f9663aa7c9351 to your computer and use it in GitHub Desktop.
[seq,
[return,
0,
[lll,
[seq,
[mstore, 28, [calldataload, 0]],
[mstore, 32, 1461501637330902918203684832716283019655932542976],
[mstore, 64, 170141183460469231731687303715884105727],
[mstore, 96, -170141183460469231731687303715884105728],
[mstore, 128, 1701411834604692317316873037158841057270000000000],
[mstore, 160, -1701411834604692317316873037158841057280000000000],
# Line 8
[if,
[eq, [mload, 0], '288887854' <becomeKing(string)>],
[seq,
[calldatacopy,
320,
[add, 4, [calldataload, 4]],
132],
[assert,
[le,
[calldataload, [add, 4, [calldataload, 4]]],
100]],
# Line 11
[if,
[gt,
callvalue,
[sload, '2' <self.king_value>]],
[seq,
# Line 12
[with,
_pos,
'320' <name>,
/* copy byte slice src: _pos dst: [sha3_32, '0' <self.king_name>] */
[with,
_pos,
_pos,
[with,
_opos,
[sha3_32, '0' <self.king_name>],
[with,
_actual_len,
[add, [mload, _pos], 32],
[repeat,
288,
0,
5,
[seq,
[if,
[gt, [mul, 32, [mload, 288]], _actual_len],
break],
[sstore,
[add, _opos, [mload, 288]],
[mload, [add, _pos, [mul, 32, [mload, 288]]]]]]]]]]],
# Line 13
[sstore, '1' <self.king_addr>, caller],
# Line 14
[sstore, '2' <self.king_value>, callvalue],
# Line 15
[mstore, 608, callvalue],
[mstore, 544, 64],
[mstore, 640, [mload, 544]],
/* Memory copy */
[with,
_source,
'320' <name>,
[with,
_sz,
[add, 32, [mload, _source]],
[assert,
[call,
[add, 18, [div, _sz, 10]],
4,
0,
_source,
_sz,
/* pack_args_by_32:dest_placeholder */
[add,
608,
[mload, 544]],
_sz]]]],
[with,
_ceil32_end,
[ceil32,
[mload,
/* pack_args_by_32:dest_placeholder */
[add,
608,
[mload, 544]]]],
[seq,
[with,
_bytearray_loc,
/* pack_args_by_32:dest_placeholder */
[add,
608,
[mload, 544]],
[seq,
[repeat,
512,
[mload, _bytearray_loc],
128,
[seq,
[if,
[ge, [mload, 512], _ceil32_end],
break],
[mstore8,
[add, [add, _bytearray_loc, 32], [mload, 512]],
0]]]]]]],
/* Increment dynamic offset counter */
[mstore,
544,
[add,
[add,
[mload, 544],
[ceil32,
[mload,
/* pack_args_by_32:dest_placeholder */
[add,
608,
[mload, 544]]]]],
32]],
[log1,
608,
[mload, 544],
107596540145291663266956530779964963561789478698508214324205756382661732490734]]],
# Line 8
stop]],
# Line 4
[if,
[eq, [mload, 0], '358099321' <king_name()>],
[seq,
[assert, [iszero, callvalue]],
# Line 6
[with,
_pos,
'0' <self.king_name>,
/* copy byte slice src: [sha3_32, _pos] dst: 384 */
[with,
_pos,
[sha3_32, _pos],
[with,
_opos,
384,
[with,
_actual_len,
[add, [sload, _pos], 32],
[repeat,
288,
0,
5,
[seq,
[if,
[gt, [mul, 32, [mload, 288]], _actual_len],
break],
[mstore,
[add, _opos, [mul, 32, [mload, 288]]],
[sload, [add, _pos, [mload, 288]]]]]]]]]],
/* Zero pad */
[with,
_ceil32_end,
[ceil32, [mload, 384]],
[repeat,
576,
[mload, 384],
100,
[seq,
[if,
[gt, [mload, 576], _ceil32_end],
break],
[mstore8, [add, 416, [mload, 576]], 0]]]],
[mstore, 352, 32],
[seq_unchecked,
pass,
[return,
352,
[ceil32, [add, [mload, 384], 64]]]],
# Line 4
stop]],
# Line 5
[if,
[eq, [mload, 0], '626964935' <king_addr()>],
[seq,
[assert, [iszero, callvalue]],
# Line 7
[mstore, 0, [sload, '1' <self.king_addr>]],
[seq_unchecked, pass, [return, 0, 32]],
# Line 5
stop]],
# Line 6
[if,
[eq, [mload, 0], '1567933537' <king_value()>],
[seq,
[assert, [iszero, callvalue]],
# Line 8
[mstore, 0, [sload, '2' <self.king_value>]],
[seq_unchecked, pass, [return, 0, 32]],
# Line 6
stop]],
/* Default function */ [revert, 0, 0]],
0]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment