2021-04-29 14:26:21 +00:00
|
|
|
{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"generatedSources":[],"object":"<BYTECODE REMOVED>"},"deployedBytecode":{"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:4001:1","statements":[{"body":{"nodeType":"YulBlock","src":"126:620:1","statements":[{"nodeType":"YulAssignment","src":"136:90:1","value":{"arguments":[{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"218:6:1"}],"functionName":{"name":"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulIdentifier","src":"161:56:1"},"nodeType":"YulFunctionCall","src":"161:64:1"}],"functionName":{"name":"allocate_memory","nodeType":"YulIdentifier","src":"145:15:1"},"nodeType":"YulFunctionCall","src":"145:81:1"},"variableNames":[{"name":"array","nodeType":"YulIdentifier","src":"136:5:1"}]},{"nodeType":"YulVariableDeclaration","src":"235:16:1","value":{"name":"array","nodeType":"YulIdentifier","src":"246:5:1"},"variables":[{"name":"dst","nodeType":"YulTypedName","src":"239:3:1","type":""}]},{"expression":{"arguments":[{"name":"array","nodeType":"YulIdentifier","src":"268:5:1"},{"name":"length","nodeType":"YulIdentifier","src":"275:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"261:6:1"},"nodeType":"YulFunctionCall","src":"261:21:1"},"nodeType":"YulExpressionStatement","src":"261:21:1"},{"nodeType":"YulAssignment","src":"291:23:1","value":{"arguments":[{"name":"array","nodeType":"YulIdentifier","src":"302:5:1"},{"kind":"number","nodeType":"YulLiteral","src":"309:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"298:3:1"},"nodeType":"YulFunctionCall","src":"298:16:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"291:3:1"}]},{"nodeType":"YulVariableDeclaration","src":"324:17:1","value":{"name":"offset","nodeType":"YulIdentifier","src":"335:6:1"},"variables":[{"name":"src","nodeType":"YulTypedName","src":"328:3:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"390:103:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef","nodeType":"YulIdentifier","src":"404:77:1"},"nodeType":"YulFunctionCall","src":"404:79:1"},"nodeType":"YulExpressionStatement","src":"404:79:1"}]},"condition":{"arguments":[{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"360:3:1"},{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"369:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"377:4:1","type":"","value":"0x20"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"365:3:1"},"nodeType":"YulFunctionCall","src":"365:17:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"356:3:1"},"nodeType":"YulFunctionCall","src":"356:27:1"},{"name":"end","nodeType":"YulIdentifier","src":"385:3:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"353:2:1"},"nodeType":"YulFunctionCall","src":"353:36:1"},"nodeType":"YulIf","src":"350:2:1"},{"body":{"nodeType":"YulBlock","src":"562:178:1","statements":[{"nodeType":"YulVariableDeclaration","src":"577:21:1","value":{"name":"src","nodeType":"YulIdentifier","src":"595:3:1"},"variables":[{"name":"elementPos","nodeType":"YulTypedName","src":"581:10:1","type":""}]},{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"619:3:1"},{"arguments":[{"name":"elementPos","nodeType":"YulIdentifier","src":"645:10:1"},{"name":"end","nodeType":"YulIdentifier","src":"657:3:1"}],"functionName":{"name":"abi_decode_t_uint256","nodeType":"YulIdentifier","src":"624:20:1"},"nodeType":"YulFunctionCall","src":"624:37:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"612:6:1"},"nodeType":"YulFunctionCall","src":"612:50:1"},"nodeType":"YulExpressionStatement","src":"612:50:1"},{"nodeType":"YulAssignment","src":"675:21:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"686:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"691:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"682:3:1"},"node
|
2020-05-28 12:01:07 +00:00
|
|
|
|
|
|
|
// uint256[]
|
2020-11-06 11:43:11 +00:00
|
|
|
function abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr(offset, length, end) -> array {
|
2021-01-14 16:27:55 +00:00
|
|
|
array := allocate_memory(array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length))
|
2020-05-28 12:01:07 +00:00
|
|
|
let dst := array
|
2021-04-07 14:47:55 +00:00
|
|
|
|
|
|
|
mstore(array, length)
|
|
|
|
dst := add(array, 0x20)
|
|
|
|
|
2020-05-28 12:01:07 +00:00
|
|
|
let src := offset
|
2021-04-07 14:47:55 +00:00
|
|
|
if gt(add(src, mul(length, 0x20)), end) {
|
2021-04-29 14:26:21 +00:00
|
|
|
revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef()
|
2021-04-07 14:47:55 +00:00
|
|
|
}
|
2020-05-28 12:01:07 +00:00
|
|
|
for { let i := 0 } lt(i, length) { i := add(i, 1) }
|
|
|
|
{
|
2021-04-07 14:47:55 +00:00
|
|
|
|
2020-05-28 12:01:07 +00:00
|
|
|
let elementPos := src
|
2021-04-07 14:47:55 +00:00
|
|
|
|
2020-05-28 12:01:07 +00:00
|
|
|
mstore(dst, abi_decode_t_uint256(elementPos, end))
|
|
|
|
dst := add(dst, 0x20)
|
|
|
|
src := add(src, 0x20)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-06 11:43:11 +00:00
|
|
|
// uint256[]
|
|
|
|
function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset, end) -> array {
|
2021-04-29 14:26:21 +00:00
|
|
|
if iszero(slt(add(offset, 0x1f), end)) { revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() }
|
2020-11-06 11:43:11 +00:00
|
|
|
let length := calldataload(offset)
|
|
|
|
array := abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr(add(offset, 0x20), length, end)
|
|
|
|
}
|
|
|
|
|
2020-05-28 12:01:07 +00:00
|
|
|
function abi_decode_t_uint256(offset, end) -> value {
|
|
|
|
value := calldataload(offset)
|
|
|
|
validator_revert_t_uint256(value)
|
|
|
|
}
|
|
|
|
|
|
|
|
function abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr(headStart, dataEnd) -> value0 {
|
2021-04-29 14:26:21 +00:00
|
|
|
if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
|
2020-05-28 12:01:07 +00:00
|
|
|
|
|
|
|
{
|
2020-12-07 13:14:19 +00:00
|
|
|
|
2020-05-28 12:01:07 +00:00
|
|
|
let offset := calldataload(add(headStart, 0))
|
2021-04-29 14:26:21 +00:00
|
|
|
if gt(offset, 0xffffffffffffffff) { revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() }
|
2020-12-07 13:14:19 +00:00
|
|
|
|
2020-05-28 12:01:07 +00:00
|
|
|
value0 := abi_decode_t_array$_t_uint256_$dyn_memory_ptr(add(headStart, offset), dataEnd)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {
|
|
|
|
mstore(pos, cleanup_t_uint256(value))
|
|
|
|
}
|
|
|
|
|
|
|
|
function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart , value0) -> tail {
|
|
|
|
tail := add(headStart, 32)
|
|
|
|
|
|
|
|
abi_encode_t_uint256_to_t_uint256_fromStack(value0, add(headStart, 0))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-01-14 16:27:55 +00:00
|
|
|
function allocate_memory(size) -> memPtr {
|
|
|
|
memPtr := allocate_unbounded()
|
|
|
|
finalize_allocation(memPtr, size)
|
|
|
|
}
|
|
|
|
|
|
|
|
function allocate_unbounded() -> memPtr {
|
2020-05-28 12:01:07 +00:00
|
|
|
memPtr := mload(64)
|
|
|
|
}
|
|
|
|
|
|
|
|
function array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length) -> size {
|
|
|
|
// Make sure we can allocate memory without overflow
|
2020-10-13 11:28:39 +00:00
|
|
|
if gt(length, 0xffffffffffffffff) { panic_error_0x41() }
|
2020-05-28 12:01:07 +00:00
|
|
|
|
|
|
|
size := mul(length, 0x20)
|
|
|
|
|
|
|
|
// add length slot
|
|
|
|
size := add(size, 0x20)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function cleanup_t_uint256(value) -> cleaned {
|
|
|
|
cleaned := value
|
|
|
|
}
|
|
|
|
|
2021-01-14 16:27:55 +00:00
|
|
|
function finalize_allocation(memPtr, size) {
|
|
|
|
let newFreePtr := add(memPtr, round_up_to_mul_of_32(size))
|
|
|
|
// protect against overflow
|
|
|
|
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
|
|
|
|
mstore(64, newFreePtr)
|
|
|
|
}
|
|
|
|
|
2020-10-13 11:28:39 +00:00
|
|
|
function panic_error_0x41() {
|
|
|
|
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
|
|
|
|
mstore(4, 0x41)
|
|
|
|
revert(0, 0x24)
|
2020-09-24 13:45:45 +00:00
|
|
|
}
|
|
|
|
|
2021-04-29 14:26:21 +00:00
|
|
|
function revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() {
|
|
|
|
revert(0, 0)
|
|
|
|
}
|
|
|
|
|
|
|
|
function revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef() {
|
|
|
|
revert(0, 0)
|
|
|
|
}
|
|
|
|
|
|
|
|
function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {
|
|
|
|
revert(0, 0)
|
|
|
|
}
|
|
|
|
|
|
|
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
|
|
|
|
revert(0, 0)
|
|
|
|
}
|
|
|
|
|
2021-01-14 18:50:02 +00:00
|
|
|
function round_up_to_mul_of_32(value) -> result {
|
|
|
|
result := and(add(value, 31), not(31))
|
|
|
|
}
|
|
|
|
|
2020-05-28 12:01:07 +00:00
|
|
|
function validator_revert_t_uint256(value) {
|
|
|
|
if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-12-08 16:42:31 +00:00
|
|
|
","id":1,"language":"Yul","name":"#utility.yul"}]}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"Warning: Source file does not specify required compiler version!
|
2020-12-01 13:46:26 +00:00
|
|
|
--> a.sol
|
|
|
|
|
2020-05-28 12:01:07 +00:00
|
|
|
","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0}}}
|