diff --git a/test/cmdlineTests/standard_yul_cfg_json_export/in.sol b/test/cmdlineTests/standard_yul_cfg_json_export/in.sol new file mode 100644 index 000000000000..85691014f827 --- /dev/null +++ b/test/cmdlineTests/standard_yul_cfg_json_export/in.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; + +interface I { + function f() external pure returns (uint); +} + +contract C is I { + function f() public pure override returns (uint) { + return 42; + } +} + +contract D { + function f() public returns (uint) { + C c = new C(); + return c.f(); + } +} diff --git a/test/cmdlineTests/standard_yul_cfg_json_export/input.json b/test/cmdlineTests/standard_yul_cfg_json_export/input.json new file mode 100644 index 000000000000..aee56abf8600 --- /dev/null +++ b/test/cmdlineTests/standard_yul_cfg_json_export/input.json @@ -0,0 +1,13 @@ +{ + "language": "Solidity", + "sources": { + "C": {"urls": ["standard_yul_cfg_json_export/in.sol"]} + }, + "settings": { + "optimizer": { + "enabled": true + }, + "viaIR": true, + "outputSelection": {"*": {"*": ["yulCFGJson"]}} + } +} diff --git a/test/cmdlineTests/standard_yul_cfg_json_export/output.json b/test/cmdlineTests/standard_yul_cfg_json_export/output.json new file mode 100644 index 000000000000..7d6c20ff4d34 --- /dev/null +++ b/test/cmdlineTests/standard_yul_cfg_json_export/output.json @@ -0,0 +1,3969 @@ +{ + "contracts": { + "C": { + "C": { + "yulCFGJson": { + "C_19": { + "blocks": [ + { + "exit": { + "cond": "v2", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "callvalue", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "constructor_C_19", + "out": [] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v3" + ] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v4" + ] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "dataoffset", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5", + "v3" + ], + "op": "codecopy", + "out": [] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v3" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "functions": { + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "constructor_C_19": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "constructor_I_7", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "constructor_I_7": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + } + } + }, + "subObjects": { + "C_19_deployed": { + "blocks": [ + { + "exit": { + "cond": "v5", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "calldatasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x04", + "v3" + ], + "op": "lt", + "out": [ + "v4" + ] + }, + { + "in": [ + "v4" + ], + "op": "iszero", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "cond": "v9", + "targets": [ + "Block5", + "Block4" + ], + "type": "ConditionalJump" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00" + ], + "op": "calldataload", + "out": [ + "v7" + ] + }, + { + "in": [ + "v7" + ], + "op": "shift_right_224_unsigned", + "out": [ + "v8" + ] + }, + { + "in": [ + "0x26121ff0", + "v8" + ], + "op": "eq", + "out": [ + "v9" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "targets": [ + "Block3" + ], + "type": "Jump" + }, + "id": "Block5", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block4", + "instructions": [ + { + "in": [], + "op": "external_fun_f_18", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "targets": [ + "Block2" + ], + "type": "Jump" + }, + "id": "Block3", + "instructions": [] + } + ], + "functions": { + "abi_decode_tuple_": { + "arguments": [ + "headStart", + "dataEnd" + ], + "blocks": [ + { + "exit": { + "cond": "v4", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "v1" + ], + "op": "sub", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x00", + "v3" + ], + "op": "slt", + "out": [ + "v4" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_encode_t_uint256_to_t_uint256_fromStack": { + "arguments": [ + "value", + "pos" + ], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_uint256", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2", + "v1" + ], + "op": "mstore", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_encode_tuple_t_uint256__to_t_uint256__fromStack": { + "arguments": [ + "headStart", + "value0" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x20", + "v0" + ], + "op": "add", + "out": [ + "v4" + ] + }, + { + "in": [ + "0x00", + "v0" + ], + "op": "add", + "out": [ + "v5" + ] + }, + { + "in": [ + "v5", + "v1" + ], + "op": "abi_encode_t_uint256_to_t_uint256_fromStack", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "tail" + ], + "type": "Function" + }, + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "cleanup_t_rational_42_by_1": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "cleanup_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "convert_t_rational_42_by_1_to_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_rational_42_by_1", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2" + ], + "op": "identity", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3" + ], + "op": "cleanup_t_uint256", + "out": [ + "v4" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "converted" + ], + "type": "Function" + }, + "external_fun_f_18": { + "arguments": [], + "blocks": [ + { + "exit": { + "cond": "v0", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "callvalue", + "out": [ + "v0" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "calldatasize", + "out": [ + "v1" + ] + }, + { + "in": [ + "v1", + "0x04" + ], + "op": "abi_decode_tuple_", + "out": [] + }, + { + "in": [], + "op": "fun_f_18", + "out": [ + "v3" + ] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v4" + ] + }, + { + "in": [ + "v3", + "v4" + ], + "op": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5" + ], + "op": "sub", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v4" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "fun_f_18": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "zero_value_for_split_t_uint256", + "out": [ + "v1" + ] + }, + { + "in": [ + "0x2a" + ], + "op": "convert_t_rational_42_by_1_to_t_uint256", + "out": [ + "v3" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "var__13" + ], + "type": "Function" + }, + "identity": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + }, + "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "shift_right_224_unsigned": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "0xe0" + ], + "op": "shr", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "newValue" + ], + "type": "Function" + }, + "zero_value_for_split_t_uint256": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "0x00" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + } + } + }, + "subObjects": {}, + "type": "subObject" + }, + "type": "Object" + } + }, + "D": { + "yulCFGJson": { + "D_38": { + "blocks": [ + { + "exit": { + "cond": "v2", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "callvalue", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "constructor_D_38", + "out": [] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v3" + ] + }, + { + "builtinArgs": [ + "D_38_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v4" + ] + }, + { + "builtinArgs": [ + "D_38_deployed" + ], + "in": [], + "op": "dataoffset", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5", + "v3" + ], + "op": "codecopy", + "out": [] + }, + { + "builtinArgs": [ + "D_38_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v3" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "functions": { + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "constructor_D_38": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + } + } + }, + "subObjects": { + "D_38_deployed": { + "blocks": [ + { + "exit": { + "cond": "v5", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "calldatasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x04", + "v3" + ], + "op": "lt", + "out": [ + "v4" + ] + }, + { + "in": [ + "v4" + ], + "op": "iszero", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "cond": "v9", + "targets": [ + "Block5", + "Block4" + ], + "type": "ConditionalJump" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00" + ], + "op": "calldataload", + "out": [ + "v7" + ] + }, + { + "in": [ + "v7" + ], + "op": "shift_right_224_unsigned", + "out": [ + "v8" + ] + }, + { + "in": [ + "0x26121ff0", + "v8" + ], + "op": "eq", + "out": [ + "v9" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "targets": [ + "Block3" + ], + "type": "Jump" + }, + "id": "Block5", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block4", + "instructions": [ + { + "in": [], + "op": "external_fun_f_37", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "targets": [ + "Block2" + ], + "type": "Jump" + }, + "id": "Block3", + "instructions": [] + } + ], + "functions": { + "abi_decode_t_uint256_fromMemory": { + "arguments": [ + "offset", + "end" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "mload", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3" + ], + "op": "validator_revert_t_uint256", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "value" + ], + "type": "Function" + }, + "abi_decode_tuple_": { + "arguments": [ + "headStart", + "dataEnd" + ], + "blocks": [ + { + "exit": { + "cond": "v4", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "v1" + ], + "op": "sub", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x00", + "v3" + ], + "op": "slt", + "out": [ + "v4" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_decode_tuple_t_uint256_fromMemory": { + "arguments": [ + "headStart", + "dataEnd" + ], + "blocks": [ + { + "exit": { + "cond": "v5", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "v1" + ], + "op": "sub", + "out": [ + "v4" + ] + }, + { + "in": [ + "0x20", + "v4" + ], + "op": "slt", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [ + "v12" + ], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [ + { + "in": [ + "0x00", + "v0" + ], + "op": "add", + "out": [ + "v11" + ] + }, + { + "in": [ + "v1", + "v11" + ], + "op": "abi_decode_t_uint256_fromMemory", + "out": [ + "v12" + ] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "value0" + ], + "type": "Function" + }, + "abi_encode_t_uint256_to_t_uint256_fromStack": { + "arguments": [ + "value", + "pos" + ], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_uint256", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2", + "v1" + ], + "op": "mstore", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_encode_tuple__to__fromStack": { + "arguments": [ + "headStart" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "v0" + ], + "op": "add", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "tail" + ], + "type": "Function" + }, + "abi_encode_tuple_t_uint256__to_t_uint256__fromStack": { + "arguments": [ + "headStart", + "value0" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x20", + "v0" + ], + "op": "add", + "out": [ + "v4" + ] + }, + { + "in": [ + "0x00", + "v0" + ], + "op": "add", + "out": [ + "v5" + ] + }, + { + "in": [ + "v5", + "v1" + ], + "op": "abi_encode_t_uint256_to_t_uint256_fromStack", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "tail" + ], + "type": "Function" + }, + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "cleanup_t_uint160": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0xffffffffffffffffffffffffffffffffffffffff", + "v0" + ], + "op": "and", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "cleanup_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "convert_t_contract$_C_$19_to_t_address": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "convert_t_uint160_to_t_address", + "out": [ + "v2" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "converted" + ], + "type": "Function" + }, + "convert_t_uint160_to_t_address": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "convert_t_uint160_to_t_uint160", + "out": [ + "v2" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "converted" + ], + "type": "Function" + }, + "convert_t_uint160_to_t_uint160": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_uint160", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2" + ], + "op": "identity", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3" + ], + "op": "cleanup_t_uint160", + "out": [ + "v4" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "converted" + ], + "type": "Function" + }, + "external_fun_f_37": { + "arguments": [], + "blocks": [ + { + "exit": { + "cond": "v0", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "callvalue", + "out": [ + "v0" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "calldatasize", + "out": [ + "v1" + ] + }, + { + "in": [ + "v1", + "0x04" + ], + "op": "abi_decode_tuple_", + "out": [] + }, + { + "in": [], + "op": "fun_f_37", + "out": [ + "v3" + ] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v4" + ] + }, + { + "in": [ + "v3", + "v4" + ], + "op": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5" + ], + "op": "sub", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v4" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "finalize_allocation": { + "arguments": [ + "memPtr", + "size" + ], + "blocks": [ + { + "exit": { + "cond": "v7", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v1" + ], + "op": "round_up_to_mul_of_32", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2", + "v0" + ], + "op": "add", + "out": [ + "v3" + ] + }, + { + "in": [ + "v0", + "v3" + ], + "op": "lt", + "out": [ + "v4" + ] + }, + { + "in": [ + "0xffffffffffffffff", + "v3" + ], + "op": "gt", + "out": [ + "v6" + ] + }, + { + "in": [ + "v4", + "v6" + ], + "op": "or", + "out": [ + "v7" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [ + { + "in": [ + "v3", + "0x40" + ], + "op": "mstore", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "panic_error_0x41", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "fun_f_37": { + "arguments": [], + "blocks": [ + { + "exit": { + "cond": "v8", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "zero_value_for_split_t_uint256", + "out": [ + "v1" + ] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v2" + ] + }, + { + "builtinArgs": [ + "C_19" + ], + "in": [], + "op": "datasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3", + "v2" + ], + "op": "add", + "out": [ + "v4" + ] + }, + { + "in": [ + "v2", + "v4" + ], + "op": "lt", + "out": [ + "v5" + ] + }, + { + "in": [ + "0xffffffffffffffff", + "v4" + ], + "op": "gt", + "out": [ + "v7" + ] + }, + { + "in": [ + "v5", + "v7" + ], + "op": "or", + "out": [ + "v8" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v19", + "targets": [ + "Block5", + "Block4" + ], + "type": "ConditionalJump" + }, + "id": "Block2", + "instructions": [ + { + "builtinArgs": [ + "C_19" + ], + "in": [], + "op": "datasize", + "out": [ + "v9" + ] + }, + { + "builtinArgs": [ + "C_19" + ], + "in": [], + "op": "dataoffset", + "out": [ + "v10" + ] + }, + { + "in": [ + "v9", + "v10", + "v2" + ], + "op": "datacopy", + "out": [] + }, + { + "in": [ + "v4" + ], + "op": "abi_encode_tuple__to__fromStack", + "out": [ + "v16" + ] + }, + { + "in": [ + "v2", + "v16" + ], + "op": "sub", + "out": [ + "v17" + ] + }, + { + "in": [ + "v17", + "v2", + "0x00" + ], + "op": "create", + "out": [ + "v18" + ] + }, + { + "in": [ + "v18" + ], + "op": "iszero", + "out": [ + "v19" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "panic_error_0x41", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "cond": "v33", + "targets": [ + "Block8", + "Block7" + ], + "type": "ConditionalJump" + }, + "id": "Block5", + "instructions": [ + { + "in": [ + "v18" + ], + "op": "convert_t_contract$_C_$19_to_t_address", + "out": [ + "v22" + ] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v24" + ] + }, + { + "in": [ + "0x26121ff0" + ], + "op": "shift_left_224", + "out": [ + "v25" + ] + }, + { + "in": [ + "v25", + "v24" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x04", + "v24" + ], + "op": "add", + "out": [ + "v27" + ] + }, + { + "in": [ + "v27" + ], + "op": "abi_encode_tuple__to__fromStack", + "out": [ + "v28" + ] + }, + { + "in": [ + "v24", + "v28" + ], + "op": "sub", + "out": [ + "v30" + ] + }, + { + "in": [], + "op": "gas", + "out": [ + "v31" + ] + }, + { + "in": [ + "0x20", + "v24", + "v30", + "v24", + "v22", + "v31" + ], + "op": "staticcall", + "out": [ + "v32" + ] + }, + { + "in": [ + "v32" + ], + "op": "iszero", + "out": [ + "v33" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block4", + "instructions": [ + { + "in": [], + "op": "revert_forward_1", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "cond": "v32", + "targets": [ + "Block11", + "Block10" + ], + "type": "ConditionalJump" + }, + "id": "Block8", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block7", + "instructions": [ + { + "in": [], + "op": "revert_forward_1", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "entries": [ + "Block8", + "Block13" + ], + "exit": { + "returnValues": [ + "v45" + ], + "type": "FunctionReturn" + }, + "id": "Block11", + "instructions": [ + { + "in": [ + "0x00", + "v44" + ], + "op": "PhiFunction", + "out": [ + "v45" + ] + } + ] + }, + { + "exit": { + "cond": "v37", + "targets": [ + "Block13", + "Block12" + ], + "type": "ConditionalJump" + }, + "id": "Block10", + "instructions": [ + { + "in": [], + "op": "returndatasize", + "out": [ + "v36" + ] + }, + { + "in": [ + "v36", + "0x20" + ], + "op": "gt", + "out": [ + "v37" + ] + } + ], + "type": "BuiltinCall" + }, + { + "entries": [ + "Block10", + "Block12" + ], + "exit": { + "targets": [ + "Block11" + ], + "type": "Jump" + }, + "id": "Block13", + "instructions": [ + { + "in": [ + "0x20", + "v38" + ], + "op": "PhiFunction", + "out": [ + "v39" + ] + }, + { + "in": [ + "v39", + "v24" + ], + "op": "finalize_allocation", + "out": [] + }, + { + "in": [ + "v39", + "v24" + ], + "op": "add", + "out": [ + "v43" + ] + }, + { + "in": [ + "v43", + "v24" + ], + "op": "abi_decode_tuple_t_uint256_fromMemory", + "out": [ + "v44" + ] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "targets": [ + "Block13" + ], + "type": "Jump" + }, + "id": "Block12", + "instructions": [ + { + "in": [], + "op": "returndatasize", + "out": [ + "v38" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "var__22" + ], + "type": "Function" + }, + "identity": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + }, + "panic_error_0x41": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x4e487b7100000000000000000000000000000000000000000000000000000000", + "0x00" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x41", + "0x04" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x24", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_0cc013b6b3b6beabea4e3a74a6d380f0df81852ca99887912475e1f66b2a2c20": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_forward_1": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v0" + ] + }, + { + "in": [], + "op": "returndatasize", + "out": [ + "v1" + ] + }, + { + "in": [ + "v1", + "0x00", + "v0" + ], + "op": "returndatacopy", + "out": [] + }, + { + "in": [], + "op": "returndatasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3", + "v0" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "round_up_to_mul_of_32": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v5" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x1f" + ], + "op": "not", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x1f", + "v0" + ], + "op": "add", + "out": [ + "v4" + ] + }, + { + "in": [ + "v3", + "v4" + ], + "op": "and", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "result" + ], + "type": "Function" + }, + "shift_left_224": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "0xe0" + ], + "op": "shl", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "newValue" + ], + "type": "Function" + }, + "shift_right_224_unsigned": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "0xe0" + ], + "op": "shr", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "newValue" + ], + "type": "Function" + }, + "validator_revert_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "cond": "v3", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_uint256", + "out": [ + "v1" + ] + }, + { + "in": [ + "v1", + "v0" + ], + "op": "eq", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2" + ], + "op": "iszero", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "zero_value_for_split_t_uint256": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "0x00" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + } + } + }, + "subObjects": { + "C_19": { + "blocks": [ + { + "exit": { + "cond": "v2", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "callvalue", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "constructor_C_19", + "out": [] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v3" + ] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v4" + ] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "dataoffset", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5", + "v3" + ], + "op": "codecopy", + "out": [] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v3" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "functions": { + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "constructor_C_19": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "constructor_I_7", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "constructor_I_7": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + } + } + }, + "subObjects": { + "C_19_deployed": { + "blocks": [ + { + "exit": { + "cond": "v5", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "calldatasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x04", + "v3" + ], + "op": "lt", + "out": [ + "v4" + ] + }, + { + "in": [ + "v4" + ], + "op": "iszero", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "cond": "v9", + "targets": [ + "Block5", + "Block4" + ], + "type": "ConditionalJump" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00" + ], + "op": "calldataload", + "out": [ + "v7" + ] + }, + { + "in": [ + "v7" + ], + "op": "shift_right_224_unsigned", + "out": [ + "v8" + ] + }, + { + "in": [ + "0x26121ff0", + "v8" + ], + "op": "eq", + "out": [ + "v9" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "targets": [ + "Block3" + ], + "type": "Jump" + }, + "id": "Block5", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block4", + "instructions": [ + { + "in": [], + "op": "external_fun_f_18", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "targets": [ + "Block2" + ], + "type": "Jump" + }, + "id": "Block3", + "instructions": [] + } + ], + "functions": { + "abi_decode_tuple_": { + "arguments": [ + "headStart", + "dataEnd" + ], + "blocks": [ + { + "exit": { + "cond": "v4", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "v1" + ], + "op": "sub", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x00", + "v3" + ], + "op": "slt", + "out": [ + "v4" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_encode_t_uint256_to_t_uint256_fromStack": { + "arguments": [ + "value", + "pos" + ], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_uint256", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2", + "v1" + ], + "op": "mstore", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_encode_tuple_t_uint256__to_t_uint256__fromStack": { + "arguments": [ + "headStart", + "value0" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x20", + "v0" + ], + "op": "add", + "out": [ + "v4" + ] + }, + { + "in": [ + "0x00", + "v0" + ], + "op": "add", + "out": [ + "v5" + ] + }, + { + "in": [ + "v5", + "v1" + ], + "op": "abi_encode_t_uint256_to_t_uint256_fromStack", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "tail" + ], + "type": "Function" + }, + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "cleanup_t_rational_42_by_1": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "cleanup_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "convert_t_rational_42_by_1_to_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_rational_42_by_1", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2" + ], + "op": "identity", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3" + ], + "op": "cleanup_t_uint256", + "out": [ + "v4" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "converted" + ], + "type": "Function" + }, + "external_fun_f_18": { + "arguments": [], + "blocks": [ + { + "exit": { + "cond": "v0", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "callvalue", + "out": [ + "v0" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "calldatasize", + "out": [ + "v1" + ] + }, + { + "in": [ + "v1", + "0x04" + ], + "op": "abi_decode_tuple_", + "out": [] + }, + { + "in": [], + "op": "fun_f_18", + "out": [ + "v3" + ] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v4" + ] + }, + { + "in": [ + "v3", + "v4" + ], + "op": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5" + ], + "op": "sub", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v4" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "fun_f_18": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "zero_value_for_split_t_uint256", + "out": [ + "v1" + ] + }, + { + "in": [ + "0x2a" + ], + "op": "convert_t_rational_42_by_1_to_t_uint256", + "out": [ + "v3" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "var__13" + ], + "type": "Function" + }, + "identity": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + }, + "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "shift_right_224_unsigned": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "0xe0" + ], + "op": "shr", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "newValue" + ], + "type": "Function" + }, + "zero_value_for_split_t_uint256": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "0x00" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + } + } + }, + "subObjects": {}, + "type": "subObject" + }, + "type": "subObject" + }, + "type": "subObject" + }, + "type": "Object" + } + } + } + }, + "sources": { + "C": { + "id": 0 + } + } +} diff --git a/test/cmdlineTests/strict_asm_yul_cfg_json_export/args b/test/cmdlineTests/strict_asm_yul_cfg_json_export/args new file mode 100644 index 000000000000..1147466b54ef --- /dev/null +++ b/test/cmdlineTests/strict_asm_yul_cfg_json_export/args @@ -0,0 +1 @@ +--strict-assembly --optimize --yul-cfg-json --pretty-json --json-indent 4 diff --git a/test/cmdlineTests/strict_asm_yul_cfg_json_export/input.yul b/test/cmdlineTests/strict_asm_yul_cfg_json_export/input.yul new file mode 100644 index 000000000000..70addb5c08a7 --- /dev/null +++ b/test/cmdlineTests/strict_asm_yul_cfg_json_export/input.yul @@ -0,0 +1,128 @@ +/// @use-src 0:"input.sol" +object "D_38" { + code { + { + /// @src 0:225:331 "contract D {..." + let _1 := memoryguard(0x80) + mstore(64, _1) + if callvalue() { revert(0, 0) } + let _2 := datasize("D_38_deployed") + codecopy(_1, dataoffset("D_38_deployed"), _2) + return(_1, _2) + } + } + /// @use-src 0:"input.sol" + object "D_38_deployed" { + code { + { + /// @src 0:225:331 "contract D {..." + let _1 := memoryguard(0x80) + mstore(64, _1) + if iszero(lt(calldatasize(), 4)) + { + if eq(0x26121ff0, shr(224, calldataload(0))) + { + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + /// @src 0:293:300 "new C()" + let _2 := datasize("C_19") + let _3 := add(_1, _2) + if or(gt(_3, 0xffffffffffffffff), lt(_3, _1)) + { + /// @src 0:225:331 "contract D {..." + mstore(0, shl(224, 0x4e487b71)) + mstore(4, 0x41) + revert(0, 0x24) + } + /// @src 0:293:300 "new C()" + datacopy(_1, dataoffset("C_19"), _2) + let expr_address := create(/** @src 0:225:331 "contract D {..." */ 0, /** @src 0:293:300 "new C()" */ _1, sub(_3, _1)) + if iszero(expr_address) + { + /// @src 0:225:331 "contract D {..." + let pos := mload(64) + returndatacopy(pos, 0, returndatasize()) + revert(pos, returndatasize()) + } + /// @src 0:317:322 "c.f()" + let _4 := /** @src 0:225:331 "contract D {..." */ mload(64) + /// @src 0:317:322 "c.f()" + mstore(_4, /** @src 0:225:331 "contract D {..." */ shl(228, 0x026121ff)) + /// @src 0:317:322 "c.f()" + let _5 := staticcall(gas(), /** @src 0:225:331 "contract D {..." */ and(/** @src 0:317:320 "c.f" */ expr_address, /** @src 0:225:331 "contract D {..." */ sub(shl(160, /** @src 0:293:300 "new C()" */ 1), 1)), /** @src 0:317:322 "c.f()" */ _4, /** @src 0:225:331 "contract D {..." */ 4, /** @src 0:317:322 "c.f()" */ _4, 32) + if iszero(_5) + { + /// @src 0:225:331 "contract D {..." + let pos_1 := mload(64) + returndatacopy(pos_1, 0, returndatasize()) + revert(pos_1, returndatasize()) + } + /// @src 0:317:322 "c.f()" + let expr := /** @src 0:225:331 "contract D {..." */ 0 + /// @src 0:317:322 "c.f()" + if _5 + { + let _6 := 32 + if gt(32, returndatasize()) { _6 := returndatasize() } + /// @src 0:225:331 "contract D {..." + let newFreePtr := add(_4, and(add(_6, 31), not(31))) + if or(gt(newFreePtr, /** @src 0:293:300 "new C()" */ 0xffffffffffffffff), /** @src 0:225:331 "contract D {..." */ lt(newFreePtr, _4)) + { + mstore(0, shl(224, 0x4e487b71)) + mstore(4, 0x41) + revert(0, 0x24) + } + mstore(64, newFreePtr) + if slt(sub(/** @src 0:317:322 "c.f()" */ add(_4, _6), /** @src 0:225:331 "contract D {..." */ _4), /** @src 0:317:322 "c.f()" */ 32) + /// @src 0:225:331 "contract D {..." + { revert(0, 0) } + /// @src 0:317:322 "c.f()" + expr := /** @src 0:225:331 "contract D {..." */ mload(_4) + } + let memPos := mload(64) + mstore(memPos, expr) + return(memPos, /** @src 0:317:322 "c.f()" */ 32) + } + } + /// @src 0:225:331 "contract D {..." + revert(0, 0) + } + } + /// @use-src 0:"input.sol" + object "C_19" { + code { + { + /// @src 0:124:223 "contract C is I {..." + let _1 := memoryguard(0x80) + mstore(64, _1) + if callvalue() { revert(0, 0) } + let _2 := datasize("C_19_deployed") + codecopy(_1, dataoffset("C_19_deployed"), _2) + return(_1, _2) + } + } + /// @use-src 0:"input.sol" + object "C_19_deployed" { + code { + { + /// @src 0:124:223 "contract C is I {..." + let _1 := memoryguard(0x80) + mstore(64, _1) + if iszero(lt(calldatasize(), 4)) + { + if eq(0x26121ff0, shr(224, calldataload(0))) + { + if callvalue() { revert(0, 0) } + if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } + mstore(_1, /** @src 0:212:214 "42" */ 0x2a) + /// @src 0:124:223 "contract C is I {..." + return(_1, 32) + } + } + revert(0, 0) + } + } + } + } + } +} diff --git a/test/cmdlineTests/strict_asm_yul_cfg_json_export/output b/test/cmdlineTests/strict_asm_yul_cfg_json_export/output new file mode 100644 index 000000000000..5aa08b312b0d --- /dev/null +++ b/test/cmdlineTests/strict_asm_yul_cfg_json_export/output @@ -0,0 +1,1440 @@ + +======= strict_asm_yul_cfg_json_export/input.yul (EVM) ======= +Yul Control Flow Graph: + +{ + "D_38": { + "blocks": [ + { + "exit": { + "cond": "v2", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "0x80" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "callvalue", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "builtinArgs": [ + "D_38_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v4" + ] + }, + { + "builtinArgs": [ + "D_38_deployed" + ], + "in": [], + "op": "dataoffset", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5", + "v0" + ], + "op": "codecopy", + "out": [] + }, + { + "in": [ + "v4", + "v0" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "functions": {} + }, + "subObjects": { + "D_38_deployed": { + "blocks": [ + { + "exit": { + "cond": "v5", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "0x80" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "calldatasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x04", + "v3" + ], + "op": "lt", + "out": [ + "v4" + ] + }, + { + "in": [ + "v4" + ], + "op": "iszero", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v11", + "targets": [ + "Block4", + "Block3" + ], + "type": "ConditionalJump" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00" + ], + "op": "calldataload", + "out": [ + "v7" + ] + }, + { + "in": [ + "v7", + "0xe0" + ], + "op": "shr", + "out": [ + "v9" + ] + }, + { + "in": [ + "v9", + "0x26121ff0" + ], + "op": "eq", + "out": [ + "v11" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "targets": [ + "Block2" + ], + "type": "Jump" + }, + "id": "Block4", + "instructions": [] + }, + { + "exit": { + "cond": "v12", + "targets": [ + "Block6", + "Block5" + ], + "type": "ConditionalJump" + }, + "id": "Block3", + "instructions": [ + { + "in": [], + "op": "callvalue", + "out": [ + "v12" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v17", + "targets": [ + "Block9", + "Block8" + ], + "type": "ConditionalJump" + }, + "id": "Block6", + "instructions": [ + { + "in": [ + "0x03" + ], + "op": "not", + "out": [ + "v14" + ] + }, + { + "in": [], + "op": "calldatasize", + "out": [ + "v15" + ] + }, + { + "in": [ + "v14", + "v15" + ], + "op": "add", + "out": [ + "v16" + ] + }, + { + "in": [ + "0x00", + "v16" + ], + "op": "slt", + "out": [ + "v17" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block5", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v28", + "targets": [ + "Block12", + "Block11" + ], + "type": "ConditionalJump" + }, + "id": "Block9", + "instructions": [ + { + "builtinArgs": [ + "C_19" + ], + "in": [], + "op": "datasize", + "out": [ + "v18" + ] + }, + { + "in": [ + "v18", + "v0" + ], + "op": "add", + "out": [ + "v24" + ] + }, + { + "in": [ + "v0", + "v24" + ], + "op": "lt", + "out": [ + "v25" + ] + }, + { + "in": [ + "0xffffffffffffffff", + "v24" + ], + "op": "gt", + "out": [ + "v27" + ] + }, + { + "in": [ + "v25", + "v27" + ], + "op": "or", + "out": [ + "v28" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block8", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v42", + "targets": [ + "Block15", + "Block14" + ], + "type": "ConditionalJump" + }, + "id": "Block12", + "instructions": [ + { + "builtinArgs": [ + "C_19" + ], + "in": [], + "op": "dataoffset", + "out": [ + "v35" + ] + }, + { + "in": [ + "v18", + "v35", + "v0" + ], + "op": "datacopy", + "out": [] + }, + { + "in": [ + "v0", + "v24" + ], + "op": "sub", + "out": [ + "v40" + ] + }, + { + "in": [ + "v40", + "v0", + "0x00" + ], + "op": "create", + "out": [ + "v41" + ] + }, + { + "in": [ + "v41" + ], + "op": "iszero", + "out": [ + "v42" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block11", + "instructions": [ + { + "in": [ + "0x4e487b71", + "0xe0" + ], + "op": "shl", + "out": [ + "v30" + ] + }, + { + "in": [ + "v30", + "0x00" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x41", + "0x04" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x24", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v60", + "targets": [ + "Block18", + "Block17" + ], + "type": "ConditionalJump" + }, + "id": "Block15", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v46" + ] + }, + { + "in": [ + "0x026121ff", + "0xe4" + ], + "op": "shl", + "out": [ + "v49" + ] + }, + { + "in": [ + "v49", + "v46" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x01", + "0xa0" + ], + "op": "shl", + "out": [ + "v53" + ] + }, + { + "in": [ + "0x01", + "v53" + ], + "op": "sub", + "out": [ + "v54" + ] + }, + { + "in": [ + "v54", + "v41" + ], + "op": "and", + "out": [ + "v57" + ] + }, + { + "in": [], + "op": "gas", + "out": [ + "v58" + ] + }, + { + "in": [ + "0x20", + "v46", + "0x04", + "v46", + "v57", + "v58" + ], + "op": "staticcall", + "out": [ + "v59" + ] + }, + { + "in": [ + "v59" + ], + "op": "iszero", + "out": [ + "v60" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block14", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v43" + ] + }, + { + "in": [], + "op": "returndatasize", + "out": [ + "v44" + ] + }, + { + "in": [ + "v44", + "0x00", + "v43" + ], + "op": "returndatacopy", + "out": [] + }, + { + "in": [], + "op": "returndatasize", + "out": [ + "v45" + ] + }, + { + "in": [ + "v45", + "v43" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v59", + "targets": [ + "Block21", + "Block20" + ], + "type": "ConditionalJump" + }, + "id": "Block18", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block17", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v61" + ] + }, + { + "in": [], + "op": "returndatasize", + "out": [ + "v62" + ] + }, + { + "in": [ + "v62", + "0x00", + "v61" + ], + "op": "returndatacopy", + "out": [] + }, + { + "in": [], + "op": "returndatasize", + "out": [ + "v63" + ] + }, + { + "in": [ + "v63", + "v61" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "entries": [ + "Block18", + "Block28" + ], + "exit": { + "type": "Terminated" + }, + "id": "Block21", + "instructions": [ + { + "in": [ + "0x00", + "v93" + ], + "op": "PhiFunction", + "out": [ + "v95" + ] + }, + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v94" + ] + }, + { + "in": [ + "v95", + "v94" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x20", + "v94" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v67", + "targets": [ + "Block23", + "Block22" + ], + "type": "ConditionalJump" + }, + "id": "Block20", + "instructions": [ + { + "in": [], + "op": "returndatasize", + "out": [ + "v66" + ] + }, + { + "in": [ + "v66", + "0x20" + ], + "op": "gt", + "out": [ + "v67" + ] + } + ], + "type": "BuiltinCall" + }, + { + "entries": [ + "Block20", + "Block22" + ], + "exit": { + "cond": "v80", + "targets": [ + "Block25", + "Block24" + ], + "type": "ConditionalJump" + }, + "id": "Block23", + "instructions": [ + { + "in": [ + "0x20", + "v68" + ], + "op": "PhiFunction", + "out": [ + "v71" + ] + }, + { + "in": [ + "0x1f" + ], + "op": "not", + "out": [ + "v70" + ] + }, + { + "in": [ + "0x1f", + "v71" + ], + "op": "add", + "out": [ + "v72" + ] + }, + { + "in": [ + "v70", + "v72" + ], + "op": "and", + "out": [ + "v73" + ] + }, + { + "in": [ + "v73", + "v46" + ], + "op": "add", + "out": [ + "v77" + ] + }, + { + "in": [ + "v46", + "v77" + ], + "op": "lt", + "out": [ + "v78" + ] + }, + { + "in": [ + "0xffffffffffffffff", + "v77" + ], + "op": "gt", + "out": [ + "v79" + ] + }, + { + "in": [ + "v78", + "v79" + ], + "op": "or", + "out": [ + "v80" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "targets": [ + "Block23" + ], + "type": "Jump" + }, + "id": "Block22", + "instructions": [ + { + "in": [], + "op": "returndatasize", + "out": [ + "v68" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v90", + "targets": [ + "Block28", + "Block27" + ], + "type": "ConditionalJump" + }, + "id": "Block25", + "instructions": [ + { + "in": [ + "v77", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "v71", + "v46" + ], + "op": "add", + "out": [ + "v88" + ] + }, + { + "in": [ + "v46", + "v88" + ], + "op": "sub", + "out": [ + "v89" + ] + }, + { + "in": [ + "0x20", + "v89" + ], + "op": "slt", + "out": [ + "v90" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block24", + "instructions": [ + { + "in": [ + "0x4e487b71", + "0xe0" + ], + "op": "shl", + "out": [ + "v81" + ] + }, + { + "in": [ + "v81", + "0x00" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x41", + "0x04" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x24", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "targets": [ + "Block21" + ], + "type": "Jump" + }, + "id": "Block28", + "instructions": [ + { + "in": [ + "v46" + ], + "op": "mload", + "out": [ + "v93" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block27", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "functions": {} + }, + "subObjects": { + "C_19": { + "blocks": [ + { + "exit": { + "cond": "v2", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "0x80" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "callvalue", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v4" + ] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "dataoffset", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5", + "v0" + ], + "op": "codecopy", + "out": [] + }, + { + "in": [ + "v4", + "v0" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "functions": {} + }, + "subObjects": { + "C_19_deployed": { + "blocks": [ + { + "exit": { + "cond": "v5", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "0x80" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "calldatasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x04", + "v3" + ], + "op": "lt", + "out": [ + "v4" + ] + }, + { + "in": [ + "v4" + ], + "op": "iszero", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v11", + "targets": [ + "Block4", + "Block3" + ], + "type": "ConditionalJump" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00" + ], + "op": "calldataload", + "out": [ + "v7" + ] + }, + { + "in": [ + "v7", + "0xe0" + ], + "op": "shr", + "out": [ + "v9" + ] + }, + { + "in": [ + "v9", + "0x26121ff0" + ], + "op": "eq", + "out": [ + "v11" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "targets": [ + "Block2" + ], + "type": "Jump" + }, + "id": "Block4", + "instructions": [] + }, + { + "exit": { + "cond": "v12", + "targets": [ + "Block6", + "Block5" + ], + "type": "ConditionalJump" + }, + "id": "Block3", + "instructions": [ + { + "in": [], + "op": "callvalue", + "out": [ + "v12" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v17", + "targets": [ + "Block9", + "Block8" + ], + "type": "ConditionalJump" + }, + "id": "Block6", + "instructions": [ + { + "in": [ + "0x03" + ], + "op": "not", + "out": [ + "v14" + ] + }, + { + "in": [], + "op": "calldatasize", + "out": [ + "v15" + ] + }, + { + "in": [ + "v14", + "v15" + ], + "op": "add", + "out": [ + "v16" + ] + }, + { + "in": [ + "0x00", + "v16" + ], + "op": "slt", + "out": [ + "v17" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block5", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block9", + "instructions": [ + { + "in": [ + "0x2a", + "v0" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x20", + "v0" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block8", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "functions": {} + }, + "type": "subObject" + }, + "type": "subObject" + }, + "type": "subObject" + }, + "type": "Object" +} diff --git a/test/cmdlineTests/yul_cfg_json_export/args b/test/cmdlineTests/yul_cfg_json_export/args new file mode 100644 index 000000000000..4af41df671fb --- /dev/null +++ b/test/cmdlineTests/yul_cfg_json_export/args @@ -0,0 +1 @@ +--via-ir --optimize --yul-cfg-json --pretty-json --json-indent 4 diff --git a/test/cmdlineTests/yul_cfg_json_export/input.sol b/test/cmdlineTests/yul_cfg_json_export/input.sol new file mode 100644 index 000000000000..85691014f827 --- /dev/null +++ b/test/cmdlineTests/yul_cfg_json_export/input.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; + +interface I { + function f() external pure returns (uint); +} + +contract C is I { + function f() public pure override returns (uint) { + return 42; + } +} + +contract D { + function f() public returns (uint) { + C c = new C(); + return c.f(); + } +} diff --git a/test/cmdlineTests/yul_cfg_json_export/output b/test/cmdlineTests/yul_cfg_json_export/output new file mode 100644 index 000000000000..34c14b28fc2d --- /dev/null +++ b/test/cmdlineTests/yul_cfg_json_export/output @@ -0,0 +1,3962 @@ + +======= yul_cfg_json_export/input.sol:C ======= +Yul Control Flow Graph: +{ + "C_19": { + "blocks": [ + { + "exit": { + "cond": "v2", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "callvalue", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "constructor_C_19", + "out": [] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v3" + ] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v4" + ] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "dataoffset", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5", + "v3" + ], + "op": "codecopy", + "out": [] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v3" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "functions": { + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "constructor_C_19": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "constructor_I_7", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "constructor_I_7": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + } + } + }, + "subObjects": { + "C_19_deployed": { + "blocks": [ + { + "exit": { + "cond": "v5", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "calldatasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x04", + "v3" + ], + "op": "lt", + "out": [ + "v4" + ] + }, + { + "in": [ + "v4" + ], + "op": "iszero", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "cond": "v9", + "targets": [ + "Block5", + "Block4" + ], + "type": "ConditionalJump" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00" + ], + "op": "calldataload", + "out": [ + "v7" + ] + }, + { + "in": [ + "v7" + ], + "op": "shift_right_224_unsigned", + "out": [ + "v8" + ] + }, + { + "in": [ + "0x26121ff0", + "v8" + ], + "op": "eq", + "out": [ + "v9" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "targets": [ + "Block3" + ], + "type": "Jump" + }, + "id": "Block5", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block4", + "instructions": [ + { + "in": [], + "op": "external_fun_f_18", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "targets": [ + "Block2" + ], + "type": "Jump" + }, + "id": "Block3", + "instructions": [] + } + ], + "functions": { + "abi_decode_tuple_": { + "arguments": [ + "headStart", + "dataEnd" + ], + "blocks": [ + { + "exit": { + "cond": "v4", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "v1" + ], + "op": "sub", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x00", + "v3" + ], + "op": "slt", + "out": [ + "v4" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_encode_t_uint256_to_t_uint256_fromStack": { + "arguments": [ + "value", + "pos" + ], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_uint256", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2", + "v1" + ], + "op": "mstore", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_encode_tuple_t_uint256__to_t_uint256__fromStack": { + "arguments": [ + "headStart", + "value0" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x20", + "v0" + ], + "op": "add", + "out": [ + "v4" + ] + }, + { + "in": [ + "0x00", + "v0" + ], + "op": "add", + "out": [ + "v5" + ] + }, + { + "in": [ + "v5", + "v1" + ], + "op": "abi_encode_t_uint256_to_t_uint256_fromStack", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "tail" + ], + "type": "Function" + }, + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "cleanup_t_rational_42_by_1": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "cleanup_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "convert_t_rational_42_by_1_to_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_rational_42_by_1", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2" + ], + "op": "identity", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3" + ], + "op": "cleanup_t_uint256", + "out": [ + "v4" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "converted" + ], + "type": "Function" + }, + "external_fun_f_18": { + "arguments": [], + "blocks": [ + { + "exit": { + "cond": "v0", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "callvalue", + "out": [ + "v0" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "calldatasize", + "out": [ + "v1" + ] + }, + { + "in": [ + "v1", + "0x04" + ], + "op": "abi_decode_tuple_", + "out": [] + }, + { + "in": [], + "op": "fun_f_18", + "out": [ + "v3" + ] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v4" + ] + }, + { + "in": [ + "v3", + "v4" + ], + "op": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5" + ], + "op": "sub", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v4" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "fun_f_18": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "zero_value_for_split_t_uint256", + "out": [ + "v1" + ] + }, + { + "in": [ + "0x2a" + ], + "op": "convert_t_rational_42_by_1_to_t_uint256", + "out": [ + "v3" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "var__13" + ], + "type": "Function" + }, + "identity": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + }, + "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "shift_right_224_unsigned": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "0xe0" + ], + "op": "shr", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "newValue" + ], + "type": "Function" + }, + "zero_value_for_split_t_uint256": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "0x00" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + } + } + }, + "subObjects": {}, + "type": "subObject" + }, + "type": "Object" +} + +======= yul_cfg_json_export/input.sol:D ======= +Yul Control Flow Graph: +{ + "D_38": { + "blocks": [ + { + "exit": { + "cond": "v2", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "callvalue", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "constructor_D_38", + "out": [] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v3" + ] + }, + { + "builtinArgs": [ + "D_38_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v4" + ] + }, + { + "builtinArgs": [ + "D_38_deployed" + ], + "in": [], + "op": "dataoffset", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5", + "v3" + ], + "op": "codecopy", + "out": [] + }, + { + "builtinArgs": [ + "D_38_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v3" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "functions": { + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "constructor_D_38": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + } + } + }, + "subObjects": { + "D_38_deployed": { + "blocks": [ + { + "exit": { + "cond": "v5", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "calldatasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x04", + "v3" + ], + "op": "lt", + "out": [ + "v4" + ] + }, + { + "in": [ + "v4" + ], + "op": "iszero", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "cond": "v9", + "targets": [ + "Block5", + "Block4" + ], + "type": "ConditionalJump" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00" + ], + "op": "calldataload", + "out": [ + "v7" + ] + }, + { + "in": [ + "v7" + ], + "op": "shift_right_224_unsigned", + "out": [ + "v8" + ] + }, + { + "in": [ + "0x26121ff0", + "v8" + ], + "op": "eq", + "out": [ + "v9" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "targets": [ + "Block3" + ], + "type": "Jump" + }, + "id": "Block5", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block4", + "instructions": [ + { + "in": [], + "op": "external_fun_f_37", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "targets": [ + "Block2" + ], + "type": "Jump" + }, + "id": "Block3", + "instructions": [] + } + ], + "functions": { + "abi_decode_t_uint256_fromMemory": { + "arguments": [ + "offset", + "end" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "mload", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3" + ], + "op": "validator_revert_t_uint256", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "value" + ], + "type": "Function" + }, + "abi_decode_tuple_": { + "arguments": [ + "headStart", + "dataEnd" + ], + "blocks": [ + { + "exit": { + "cond": "v4", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "v1" + ], + "op": "sub", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x00", + "v3" + ], + "op": "slt", + "out": [ + "v4" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_decode_tuple_t_uint256_fromMemory": { + "arguments": [ + "headStart", + "dataEnd" + ], + "blocks": [ + { + "exit": { + "cond": "v5", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "v1" + ], + "op": "sub", + "out": [ + "v4" + ] + }, + { + "in": [ + "0x20", + "v4" + ], + "op": "slt", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [ + "v12" + ], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [ + { + "in": [ + "0x00", + "v0" + ], + "op": "add", + "out": [ + "v11" + ] + }, + { + "in": [ + "v1", + "v11" + ], + "op": "abi_decode_t_uint256_fromMemory", + "out": [ + "v12" + ] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "value0" + ], + "type": "Function" + }, + "abi_encode_t_uint256_to_t_uint256_fromStack": { + "arguments": [ + "value", + "pos" + ], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_uint256", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2", + "v1" + ], + "op": "mstore", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_encode_tuple__to__fromStack": { + "arguments": [ + "headStart" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "v0" + ], + "op": "add", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "tail" + ], + "type": "Function" + }, + "abi_encode_tuple_t_uint256__to_t_uint256__fromStack": { + "arguments": [ + "headStart", + "value0" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x20", + "v0" + ], + "op": "add", + "out": [ + "v4" + ] + }, + { + "in": [ + "0x00", + "v0" + ], + "op": "add", + "out": [ + "v5" + ] + }, + { + "in": [ + "v5", + "v1" + ], + "op": "abi_encode_t_uint256_to_t_uint256_fromStack", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "tail" + ], + "type": "Function" + }, + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "cleanup_t_uint160": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0xffffffffffffffffffffffffffffffffffffffff", + "v0" + ], + "op": "and", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "cleanup_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "convert_t_contract$_C_$19_to_t_address": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "convert_t_uint160_to_t_address", + "out": [ + "v2" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "converted" + ], + "type": "Function" + }, + "convert_t_uint160_to_t_address": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "convert_t_uint160_to_t_uint160", + "out": [ + "v2" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "converted" + ], + "type": "Function" + }, + "convert_t_uint160_to_t_uint160": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_uint160", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2" + ], + "op": "identity", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3" + ], + "op": "cleanup_t_uint160", + "out": [ + "v4" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "converted" + ], + "type": "Function" + }, + "external_fun_f_37": { + "arguments": [], + "blocks": [ + { + "exit": { + "cond": "v0", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "callvalue", + "out": [ + "v0" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "calldatasize", + "out": [ + "v1" + ] + }, + { + "in": [ + "v1", + "0x04" + ], + "op": "abi_decode_tuple_", + "out": [] + }, + { + "in": [], + "op": "fun_f_37", + "out": [ + "v3" + ] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v4" + ] + }, + { + "in": [ + "v3", + "v4" + ], + "op": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5" + ], + "op": "sub", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v4" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "finalize_allocation": { + "arguments": [ + "memPtr", + "size" + ], + "blocks": [ + { + "exit": { + "cond": "v7", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v1" + ], + "op": "round_up_to_mul_of_32", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2", + "v0" + ], + "op": "add", + "out": [ + "v3" + ] + }, + { + "in": [ + "v0", + "v3" + ], + "op": "lt", + "out": [ + "v4" + ] + }, + { + "in": [ + "0xffffffffffffffff", + "v3" + ], + "op": "gt", + "out": [ + "v6" + ] + }, + { + "in": [ + "v4", + "v6" + ], + "op": "or", + "out": [ + "v7" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [ + { + "in": [ + "v3", + "0x40" + ], + "op": "mstore", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "panic_error_0x41", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "fun_f_37": { + "arguments": [], + "blocks": [ + { + "exit": { + "cond": "v8", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "zero_value_for_split_t_uint256", + "out": [ + "v1" + ] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v2" + ] + }, + { + "builtinArgs": [ + "C_19" + ], + "in": [], + "op": "datasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3", + "v2" + ], + "op": "add", + "out": [ + "v4" + ] + }, + { + "in": [ + "v2", + "v4" + ], + "op": "lt", + "out": [ + "v5" + ] + }, + { + "in": [ + "0xffffffffffffffff", + "v4" + ], + "op": "gt", + "out": [ + "v7" + ] + }, + { + "in": [ + "v5", + "v7" + ], + "op": "or", + "out": [ + "v8" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "cond": "v19", + "targets": [ + "Block5", + "Block4" + ], + "type": "ConditionalJump" + }, + "id": "Block2", + "instructions": [ + { + "builtinArgs": [ + "C_19" + ], + "in": [], + "op": "datasize", + "out": [ + "v9" + ] + }, + { + "builtinArgs": [ + "C_19" + ], + "in": [], + "op": "dataoffset", + "out": [ + "v10" + ] + }, + { + "in": [ + "v9", + "v10", + "v2" + ], + "op": "datacopy", + "out": [] + }, + { + "in": [ + "v4" + ], + "op": "abi_encode_tuple__to__fromStack", + "out": [ + "v16" + ] + }, + { + "in": [ + "v2", + "v16" + ], + "op": "sub", + "out": [ + "v17" + ] + }, + { + "in": [ + "v17", + "v2", + "0x00" + ], + "op": "create", + "out": [ + "v18" + ] + }, + { + "in": [ + "v18" + ], + "op": "iszero", + "out": [ + "v19" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "panic_error_0x41", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "cond": "v33", + "targets": [ + "Block8", + "Block7" + ], + "type": "ConditionalJump" + }, + "id": "Block5", + "instructions": [ + { + "in": [ + "v18" + ], + "op": "convert_t_contract$_C_$19_to_t_address", + "out": [ + "v22" + ] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v24" + ] + }, + { + "in": [ + "0x26121ff0" + ], + "op": "shift_left_224", + "out": [ + "v25" + ] + }, + { + "in": [ + "v25", + "v24" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x04", + "v24" + ], + "op": "add", + "out": [ + "v27" + ] + }, + { + "in": [ + "v27" + ], + "op": "abi_encode_tuple__to__fromStack", + "out": [ + "v28" + ] + }, + { + "in": [ + "v24", + "v28" + ], + "op": "sub", + "out": [ + "v30" + ] + }, + { + "in": [], + "op": "gas", + "out": [ + "v31" + ] + }, + { + "in": [ + "0x20", + "v24", + "v30", + "v24", + "v22", + "v31" + ], + "op": "staticcall", + "out": [ + "v32" + ] + }, + { + "in": [ + "v32" + ], + "op": "iszero", + "out": [ + "v33" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block4", + "instructions": [ + { + "in": [], + "op": "revert_forward_1", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "cond": "v32", + "targets": [ + "Block11", + "Block10" + ], + "type": "ConditionalJump" + }, + "id": "Block8", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block7", + "instructions": [ + { + "in": [], + "op": "revert_forward_1", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "entries": [ + "Block8", + "Block13" + ], + "exit": { + "returnValues": [ + "v45" + ], + "type": "FunctionReturn" + }, + "id": "Block11", + "instructions": [ + { + "in": [ + "0x00", + "v44" + ], + "op": "PhiFunction", + "out": [ + "v45" + ] + } + ] + }, + { + "exit": { + "cond": "v37", + "targets": [ + "Block13", + "Block12" + ], + "type": "ConditionalJump" + }, + "id": "Block10", + "instructions": [ + { + "in": [], + "op": "returndatasize", + "out": [ + "v36" + ] + }, + { + "in": [ + "v36", + "0x20" + ], + "op": "gt", + "out": [ + "v37" + ] + } + ], + "type": "BuiltinCall" + }, + { + "entries": [ + "Block10", + "Block12" + ], + "exit": { + "targets": [ + "Block11" + ], + "type": "Jump" + }, + "id": "Block13", + "instructions": [ + { + "in": [ + "0x20", + "v38" + ], + "op": "PhiFunction", + "out": [ + "v39" + ] + }, + { + "in": [ + "v39", + "v24" + ], + "op": "finalize_allocation", + "out": [] + }, + { + "in": [ + "v39", + "v24" + ], + "op": "add", + "out": [ + "v43" + ] + }, + { + "in": [ + "v43", + "v24" + ], + "op": "abi_decode_tuple_t_uint256_fromMemory", + "out": [ + "v44" + ] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "targets": [ + "Block13" + ], + "type": "Jump" + }, + "id": "Block12", + "instructions": [ + { + "in": [], + "op": "returndatasize", + "out": [ + "v38" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "var__22" + ], + "type": "Function" + }, + "identity": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + }, + "panic_error_0x41": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x4e487b7100000000000000000000000000000000000000000000000000000000", + "0x00" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x41", + "0x04" + ], + "op": "mstore", + "out": [] + }, + { + "in": [ + "0x24", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_0cc013b6b3b6beabea4e3a74a6d380f0df81852ca99887912475e1f66b2a2c20": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_forward_1": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v0" + ] + }, + { + "in": [], + "op": "returndatasize", + "out": [ + "v1" + ] + }, + { + "in": [ + "v1", + "0x00", + "v0" + ], + "op": "returndatacopy", + "out": [] + }, + { + "in": [], + "op": "returndatasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3", + "v0" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "round_up_to_mul_of_32": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v5" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x1f" + ], + "op": "not", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x1f", + "v0" + ], + "op": "add", + "out": [ + "v4" + ] + }, + { + "in": [ + "v3", + "v4" + ], + "op": "and", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "result" + ], + "type": "Function" + }, + "shift_left_224": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "0xe0" + ], + "op": "shl", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "newValue" + ], + "type": "Function" + }, + "shift_right_224_unsigned": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "0xe0" + ], + "op": "shr", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "newValue" + ], + "type": "Function" + }, + "validator_revert_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "cond": "v3", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_uint256", + "out": [ + "v1" + ] + }, + { + "in": [ + "v1", + "v0" + ], + "op": "eq", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2" + ], + "op": "iszero", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "zero_value_for_split_t_uint256": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "0x00" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + } + } + }, + "subObjects": { + "C_19": { + "blocks": [ + { + "exit": { + "cond": "v2", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "callvalue", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "constructor_C_19", + "out": [] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v3" + ] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v4" + ] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "dataoffset", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5", + "v3" + ], + "op": "codecopy", + "out": [] + }, + { + "builtinArgs": [ + "C_19_deployed" + ], + "in": [], + "op": "datasize", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v3" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "functions": { + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "constructor_C_19": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "constructor_I_7", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "constructor_I_7": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + } + } + }, + "subObjects": { + "C_19_deployed": { + "blocks": [ + { + "exit": { + "cond": "v5", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "builtinArgs": [ + "128" + ], + "in": [], + "op": "memoryguard", + "out": [ + "v0" + ] + }, + { + "in": [ + "v0", + "0x40" + ], + "op": "mstore", + "out": [] + }, + { + "in": [], + "op": "calldatasize", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x04", + "v3" + ], + "op": "lt", + "out": [ + "v4" + ] + }, + { + "in": [ + "v4" + ], + "op": "iszero", + "out": [ + "v5" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "cond": "v9", + "targets": [ + "Block5", + "Block4" + ], + "type": "ConditionalJump" + }, + "id": "Block1", + "instructions": [ + { + "in": [ + "0x00" + ], + "op": "calldataload", + "out": [ + "v7" + ] + }, + { + "in": [ + "v7" + ], + "op": "shift_right_224_unsigned", + "out": [ + "v8" + ] + }, + { + "in": [ + "0x26121ff0", + "v8" + ], + "op": "eq", + "out": [ + "v9" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "targets": [ + "Block3" + ], + "type": "Jump" + }, + "id": "Block5", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block4", + "instructions": [ + { + "in": [], + "op": "external_fun_f_18", + "out": [] + } + ], + "type": "FunctionCall" + }, + { + "exit": { + "targets": [ + "Block2" + ], + "type": "Jump" + }, + "id": "Block3", + "instructions": [] + } + ], + "functions": { + "abi_decode_tuple_": { + "arguments": [ + "headStart", + "dataEnd" + ], + "blocks": [ + { + "exit": { + "cond": "v4", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "v1" + ], + "op": "sub", + "out": [ + "v3" + ] + }, + { + "in": [ + "0x00", + "v3" + ], + "op": "slt", + "out": [ + "v4" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block2", + "instructions": [] + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_encode_t_uint256_to_t_uint256_fromStack": { + "arguments": [ + "value", + "pos" + ], + "blocks": [ + { + "exit": { + "returnValues": [], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_uint256", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2", + "v1" + ], + "op": "mstore", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "abi_encode_tuple_t_uint256__to_t_uint256__fromStack": { + "arguments": [ + "headStart", + "value0" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x20", + "v0" + ], + "op": "add", + "out": [ + "v4" + ] + }, + { + "in": [ + "0x00", + "v0" + ], + "op": "add", + "out": [ + "v5" + ] + }, + { + "in": [ + "v5", + "v1" + ], + "op": "abi_encode_t_uint256_to_t_uint256_fromStack", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "tail" + ], + "type": "Function" + }, + "allocate_unbounded": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v2" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x40" + ], + "op": "mload", + "out": [ + "v2" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "memPtr" + ], + "type": "Function" + }, + "cleanup_t_rational_42_by_1": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "cleanup_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "cleaned" + ], + "type": "Function" + }, + "convert_t_rational_42_by_1_to_t_uint256": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v4" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0" + ], + "op": "cleanup_t_rational_42_by_1", + "out": [ + "v2" + ] + }, + { + "in": [ + "v2" + ], + "op": "identity", + "out": [ + "v3" + ] + }, + { + "in": [ + "v3" + ], + "op": "cleanup_t_uint256", + "out": [ + "v4" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "converted" + ], + "type": "Function" + }, + "external_fun_f_18": { + "arguments": [], + "blocks": [ + { + "exit": { + "cond": "v0", + "targets": [ + "Block2", + "Block1" + ], + "type": "ConditionalJump" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "callvalue", + "out": [ + "v0" + ] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block2", + "instructions": [ + { + "in": [], + "op": "calldatasize", + "out": [ + "v1" + ] + }, + { + "in": [ + "v1", + "0x04" + ], + "op": "abi_decode_tuple_", + "out": [] + }, + { + "in": [], + "op": "fun_f_18", + "out": [ + "v3" + ] + }, + { + "in": [], + "op": "allocate_unbounded", + "out": [ + "v4" + ] + }, + { + "in": [ + "v3", + "v4" + ], + "op": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack", + "out": [ + "v5" + ] + }, + { + "in": [ + "v4", + "v5" + ], + "op": "sub", + "out": [ + "v6" + ] + }, + { + "in": [ + "v6", + "v4" + ], + "op": "return", + "out": [] + } + ], + "type": "BuiltinCall" + }, + { + "exit": { + "type": "Terminated" + }, + "id": "Block1", + "instructions": [ + { + "in": [], + "op": "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb", + "out": [] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "fun_f_18": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [], + "op": "zero_value_for_split_t_uint256", + "out": [ + "v1" + ] + }, + { + "in": [ + "0x2a" + ], + "op": "convert_t_rational_42_by_1_to_t_uint256", + "out": [ + "v3" + ] + } + ], + "type": "FunctionCall" + } + ], + "entry": "Block0", + "returns": [ + "var__13" + ], + "type": "Function" + }, + "identity": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v0" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + }, + "revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": { + "arguments": [], + "blocks": [ + { + "exit": { + "type": "Terminated" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "0x00", + "0x00" + ], + "op": "revert", + "out": [] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [], + "type": "Function" + }, + "shift_right_224_unsigned": { + "arguments": [ + "value" + ], + "blocks": [ + { + "exit": { + "returnValues": [ + "v3" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [ + { + "in": [ + "v0", + "0xe0" + ], + "op": "shr", + "out": [ + "v3" + ] + } + ], + "type": "BuiltinCall" + } + ], + "entry": "Block0", + "returns": [ + "newValue" + ], + "type": "Function" + }, + "zero_value_for_split_t_uint256": { + "arguments": [], + "blocks": [ + { + "exit": { + "returnValues": [ + "0x00" + ], + "type": "FunctionReturn" + }, + "id": "Block0", + "instructions": [] + } + ], + "entry": "Block0", + "returns": [ + "ret" + ], + "type": "Function" + } + } + }, + "subObjects": {}, + "type": "subObject" + }, + "type": "subObject" + }, + "type": "subObject" + }, + "type": "Object" +} + +======= yul_cfg_json_export/input.sol:I =======