mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11106 from ethereum/respectMemoryModel
Respect memory model
This commit is contained in:
commit
589c4a9a05
@ -205,12 +205,12 @@ string ABIFunctions::tupleDecoder(TypePointers const& _types, bool _fromMemory)
|
|||||||
|
|
||||||
Whiskers templ(R"(
|
Whiskers templ(R"(
|
||||||
function <functionName>(headStart, dataEnd) <arrow> <valueReturnParams> {
|
function <functionName>(headStart, dataEnd) <arrow> <valueReturnParams> {
|
||||||
if slt(sub(dataEnd, headStart), <minimumSize>) { <revertString> }
|
if slt(sub(dataEnd, headStart), <minimumSize>) { <revertString>() }
|
||||||
<decodeElements>
|
<decodeElements>
|
||||||
}
|
}
|
||||||
)");
|
)");
|
||||||
templ("functionName", functionName);
|
templ("functionName", functionName);
|
||||||
templ("revertString", revertReasonIfDebug("ABI decoding: tuple data too short"));
|
templ("revertString", revertReasonIfDebugFunction("ABI decoding: tuple data too short"));
|
||||||
templ("minimumSize", to_string(headSize(decodingTypes)));
|
templ("minimumSize", to_string(headSize(decodingTypes)));
|
||||||
|
|
||||||
string decodeElements;
|
string decodeElements;
|
||||||
@ -235,7 +235,7 @@ string ABIFunctions::tupleDecoder(TypePointers const& _types, bool _fromMemory)
|
|||||||
{
|
{
|
||||||
<?dynamic>
|
<?dynamic>
|
||||||
let offset := <load>(add(headStart, <pos>))
|
let offset := <load>(add(headStart, <pos>))
|
||||||
if gt(offset, 0xffffffffffffffff) { <revertString> }
|
if gt(offset, 0xffffffffffffffff) { <revertString>() }
|
||||||
<!dynamic>
|
<!dynamic>
|
||||||
let offset := <pos>
|
let offset := <pos>
|
||||||
</dynamic>
|
</dynamic>
|
||||||
@ -244,7 +244,7 @@ string ABIFunctions::tupleDecoder(TypePointers const& _types, bool _fromMemory)
|
|||||||
)");
|
)");
|
||||||
elementTempl("dynamic", decodingTypes[i]->isDynamicallyEncoded());
|
elementTempl("dynamic", decodingTypes[i]->isDynamicallyEncoded());
|
||||||
// TODO add test
|
// TODO add test
|
||||||
elementTempl("revertString", revertReasonIfDebug("ABI decoding: invalid tuple offset"));
|
elementTempl("revertString", revertReasonIfDebugFunction("ABI decoding: invalid tuple offset"));
|
||||||
elementTempl("load", _fromMemory ? "mload" : "calldataload");
|
elementTempl("load", _fromMemory ? "mload" : "calldataload");
|
||||||
elementTempl("values", boost::algorithm::join(valueNamesLocal, ", "));
|
elementTempl("values", boost::algorithm::join(valueNamesLocal, ", "));
|
||||||
elementTempl("pos", to_string(headPos));
|
elementTempl("pos", to_string(headPos));
|
||||||
@ -487,12 +487,12 @@ string ABIFunctions::abiEncodingFunctionCalldataArrayWithoutCleanup(
|
|||||||
else
|
else
|
||||||
templ("scaleLengthByStride",
|
templ("scaleLengthByStride",
|
||||||
Whiskers(R"(
|
Whiskers(R"(
|
||||||
if gt(length, <maxLength>) { <revertString> }
|
if gt(length, <maxLength>) { <revertString>() }
|
||||||
length := mul(length, <stride>)
|
length := mul(length, <stride>)
|
||||||
)")
|
)")
|
||||||
("stride", toCompactHexWithPrefix(fromArrayType.calldataStride()))
|
("stride", toCompactHexWithPrefix(fromArrayType.calldataStride()))
|
||||||
("maxLength", toCompactHexWithPrefix(u256(-1) / fromArrayType.calldataStride()))
|
("maxLength", toCompactHexWithPrefix(u256(-1) / fromArrayType.calldataStride()))
|
||||||
("revertString", revertReasonIfDebug("ABI encoding: array data too long"))
|
("revertString", revertReasonIfDebugFunction("ABI encoding: array data too long"))
|
||||||
.render()
|
.render()
|
||||||
// TODO add revert test
|
// TODO add revert test
|
||||||
);
|
);
|
||||||
@ -1148,14 +1148,14 @@ string ABIFunctions::abiDecodingFunctionArray(ArrayType const& _type, bool _from
|
|||||||
R"(
|
R"(
|
||||||
// <readableTypeName>
|
// <readableTypeName>
|
||||||
function <functionName>(offset, end) -> array {
|
function <functionName>(offset, end) -> array {
|
||||||
if iszero(slt(add(offset, 0x1f), end)) { <revertString> }
|
if iszero(slt(add(offset, 0x1f), end)) { <revertString>() }
|
||||||
let length := <retrieveLength>
|
let length := <retrieveLength>
|
||||||
array := <abiDecodeAvailableLen>(<offset>, length, end)
|
array := <abiDecodeAvailableLen>(<offset>, length, end)
|
||||||
}
|
}
|
||||||
)"
|
)"
|
||||||
);
|
);
|
||||||
// TODO add test
|
// TODO add test
|
||||||
templ("revertString", revertReasonIfDebug("ABI decoding: invalid calldata array offset"));
|
templ("revertString", revertReasonIfDebugFunction("ABI decoding: invalid calldata array offset"));
|
||||||
templ("functionName", functionName);
|
templ("functionName", functionName);
|
||||||
templ("readableTypeName", _type.toString(true));
|
templ("readableTypeName", _type.toString(true));
|
||||||
templ("retrieveLength", _type.isDynamicallySized() ? (load + "(offset)") : toCompactHexWithPrefix(_type.length()));
|
templ("retrieveLength", _type.isDynamicallySized() ? (load + "(offset)") : toCompactHexWithPrefix(_type.length()));
|
||||||
@ -1188,13 +1188,13 @@ string ABIFunctions::abiDecodingFunctionArrayAvailableLength(ArrayType const& _t
|
|||||||
</dynamic>
|
</dynamic>
|
||||||
let src := offset
|
let src := offset
|
||||||
if gt(add(src, mul(length, <stride>)), end) {
|
if gt(add(src, mul(length, <stride>)), end) {
|
||||||
<revertInvalidStride>
|
<revertInvalidStride>()
|
||||||
}
|
}
|
||||||
for { let i := 0 } lt(i, length) { i := add(i, 1) }
|
for { let i := 0 } lt(i, length) { i := add(i, 1) }
|
||||||
{
|
{
|
||||||
<?dynamicBase>
|
<?dynamicBase>
|
||||||
let innerOffset := <load>(src)
|
let innerOffset := <load>(src)
|
||||||
if gt(innerOffset, 0xffffffffffffffff) { <revertStringOffset> }
|
if gt(innerOffset, 0xffffffffffffffff) { <revertStringOffset>() }
|
||||||
let elementPos := add(offset, innerOffset)
|
let elementPos := add(offset, innerOffset)
|
||||||
<!dynamicBase>
|
<!dynamicBase>
|
||||||
let elementPos := src
|
let elementPos := src
|
||||||
@ -1215,9 +1215,9 @@ string ABIFunctions::abiDecodingFunctionArrayAvailableLength(ArrayType const& _t
|
|||||||
templ("dynamicBase", _type.baseType()->isDynamicallyEncoded());
|
templ("dynamicBase", _type.baseType()->isDynamicallyEncoded());
|
||||||
templ(
|
templ(
|
||||||
"revertInvalidStride",
|
"revertInvalidStride",
|
||||||
revertReasonIfDebug("ABI decoding: invalid calldata array stride")
|
revertReasonIfDebugFunction("ABI decoding: invalid calldata array stride")
|
||||||
);
|
);
|
||||||
templ("revertStringOffset", revertReasonIfDebug("ABI decoding: invalid calldata array offset"));
|
templ("revertStringOffset", revertReasonIfDebugFunction("ABI decoding: invalid calldata array offset"));
|
||||||
templ("decodingFun", abiDecodingFunction(*_type.baseType(), _fromMemory, false));
|
templ("decodingFun", abiDecodingFunction(*_type.baseType(), _fromMemory, false));
|
||||||
return templ.render();
|
return templ.render();
|
||||||
});
|
});
|
||||||
@ -1241,15 +1241,15 @@ string ABIFunctions::abiDecodingFunctionCalldataArray(ArrayType const& _type)
|
|||||||
w = Whiskers(R"(
|
w = Whiskers(R"(
|
||||||
// <readableTypeName>
|
// <readableTypeName>
|
||||||
function <functionName>(offset, end) -> arrayPos, length {
|
function <functionName>(offset, end) -> arrayPos, length {
|
||||||
if iszero(slt(add(offset, 0x1f), end)) { <revertStringOffset> }
|
if iszero(slt(add(offset, 0x1f), end)) { <revertStringOffset>() }
|
||||||
length := calldataload(offset)
|
length := calldataload(offset)
|
||||||
if gt(length, 0xffffffffffffffff) { <revertStringLength> }
|
if gt(length, 0xffffffffffffffff) { <revertStringLength>() }
|
||||||
arrayPos := add(offset, 0x20)
|
arrayPos := add(offset, 0x20)
|
||||||
if gt(add(arrayPos, mul(length, <stride>)), end) { <revertStringPos> }
|
if gt(add(arrayPos, mul(length, <stride>)), end) { <revertStringPos>() }
|
||||||
}
|
}
|
||||||
)");
|
)");
|
||||||
w("revertStringOffset", revertReasonIfDebug("ABI decoding: invalid calldata array offset"));
|
w("revertStringOffset", revertReasonIfDebugFunction("ABI decoding: invalid calldata array offset"));
|
||||||
w("revertStringLength", revertReasonIfDebug("ABI decoding: invalid calldata array length"));
|
w("revertStringLength", revertReasonIfDebugFunction("ABI decoding: invalid calldata array length"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1257,12 +1257,12 @@ string ABIFunctions::abiDecodingFunctionCalldataArray(ArrayType const& _type)
|
|||||||
// <readableTypeName>
|
// <readableTypeName>
|
||||||
function <functionName>(offset, end) -> arrayPos {
|
function <functionName>(offset, end) -> arrayPos {
|
||||||
arrayPos := offset
|
arrayPos := offset
|
||||||
if gt(add(arrayPos, mul(<length>, <stride>)), end) { <revertStringPos> }
|
if gt(add(arrayPos, mul(<length>, <stride>)), end) { <revertStringPos>() }
|
||||||
}
|
}
|
||||||
)");
|
)");
|
||||||
w("length", toCompactHexWithPrefix(_type.length()));
|
w("length", toCompactHexWithPrefix(_type.length()));
|
||||||
}
|
}
|
||||||
w("revertStringPos", revertReasonIfDebug("ABI decoding: invalid calldata array stride"));
|
w("revertStringPos", revertReasonIfDebugFunction("ABI decoding: invalid calldata array stride"));
|
||||||
w("functionName", functionName);
|
w("functionName", functionName);
|
||||||
w("readableTypeName", _type.toString(true));
|
w("readableTypeName", _type.toString(true));
|
||||||
w("stride", toCompactHexWithPrefix(_type.calldataStride()));
|
w("stride", toCompactHexWithPrefix(_type.calldataStride()));
|
||||||
@ -1288,11 +1288,11 @@ string ABIFunctions::abiDecodingFunctionByteArrayAvailableLength(ArrayType const
|
|||||||
array := <allocate>(<allocationSize>(length))
|
array := <allocate>(<allocationSize>(length))
|
||||||
mstore(array, length)
|
mstore(array, length)
|
||||||
let dst := add(array, 0x20)
|
let dst := add(array, 0x20)
|
||||||
if gt(add(src, length), end) { <revertStringLength> }
|
if gt(add(src, length), end) { <revertStringLength>() }
|
||||||
<copyToMemFun>(src, dst, length)
|
<copyToMemFun>(src, dst, length)
|
||||||
}
|
}
|
||||||
)");
|
)");
|
||||||
templ("revertStringLength", revertReasonIfDebug("ABI decoding: invalid byte array length"));
|
templ("revertStringLength", revertReasonIfDebugFunction("ABI decoding: invalid byte array length"));
|
||||||
templ("functionName", functionName);
|
templ("functionName", functionName);
|
||||||
templ("allocate", m_utils.allocationFunction());
|
templ("allocate", m_utils.allocationFunction());
|
||||||
templ("allocationSize", m_utils.arrayAllocationSizeFunction(_type));
|
templ("allocationSize", m_utils.arrayAllocationSizeFunction(_type));
|
||||||
@ -1312,12 +1312,12 @@ string ABIFunctions::abiDecodingFunctionCalldataStruct(StructType const& _type)
|
|||||||
Whiskers w{R"(
|
Whiskers w{R"(
|
||||||
// <readableTypeName>
|
// <readableTypeName>
|
||||||
function <functionName>(offset, end) -> value {
|
function <functionName>(offset, end) -> value {
|
||||||
if slt(sub(end, offset), <minimumSize>) { <revertString> }
|
if slt(sub(end, offset), <minimumSize>) { <revertString>() }
|
||||||
value := offset
|
value := offset
|
||||||
}
|
}
|
||||||
)"};
|
)"};
|
||||||
// TODO add test
|
// TODO add test
|
||||||
w("revertString", revertReasonIfDebug("ABI decoding: struct calldata too short"));
|
w("revertString", revertReasonIfDebugFunction("ABI decoding: struct calldata too short"));
|
||||||
w("functionName", functionName);
|
w("functionName", functionName);
|
||||||
w("readableTypeName", _type.toString(true));
|
w("readableTypeName", _type.toString(true));
|
||||||
w("minimumSize", to_string(_type.isDynamicallyEncoded() ? _type.calldataEncodedTailSize() : _type.calldataEncodedSize(true)));
|
w("minimumSize", to_string(_type.isDynamicallyEncoded() ? _type.calldataEncodedTailSize() : _type.calldataEncodedSize(true)));
|
||||||
@ -1337,7 +1337,7 @@ string ABIFunctions::abiDecodingFunctionStruct(StructType const& _type, bool _fr
|
|||||||
Whiskers templ(R"(
|
Whiskers templ(R"(
|
||||||
// <readableTypeName>
|
// <readableTypeName>
|
||||||
function <functionName>(headStart, end) -> value {
|
function <functionName>(headStart, end) -> value {
|
||||||
if slt(sub(end, headStart), <minimumSize>) { <revertString> }
|
if slt(sub(end, headStart), <minimumSize>) { <revertString>() }
|
||||||
value := <allocate>(<memorySize>)
|
value := <allocate>(<memorySize>)
|
||||||
<#members>
|
<#members>
|
||||||
{
|
{
|
||||||
@ -1348,7 +1348,7 @@ string ABIFunctions::abiDecodingFunctionStruct(StructType const& _type, bool _fr
|
|||||||
}
|
}
|
||||||
)");
|
)");
|
||||||
// TODO add test
|
// TODO add test
|
||||||
templ("revertString", revertReasonIfDebug("ABI decoding: struct data too short"));
|
templ("revertString", revertReasonIfDebugFunction("ABI decoding: struct data too short"));
|
||||||
templ("functionName", functionName);
|
templ("functionName", functionName);
|
||||||
templ("readableTypeName", _type.toString(true));
|
templ("readableTypeName", _type.toString(true));
|
||||||
templ("allocate", m_utils.allocationFunction());
|
templ("allocate", m_utils.allocationFunction());
|
||||||
@ -1365,7 +1365,7 @@ string ABIFunctions::abiDecodingFunctionStruct(StructType const& _type, bool _fr
|
|||||||
Whiskers memberTempl(R"(
|
Whiskers memberTempl(R"(
|
||||||
<?dynamic>
|
<?dynamic>
|
||||||
let offset := <load>(add(headStart, <pos>))
|
let offset := <load>(add(headStart, <pos>))
|
||||||
if gt(offset, 0xffffffffffffffff) { <revertString> }
|
if gt(offset, 0xffffffffffffffff) { <revertString>() }
|
||||||
<!dynamic>
|
<!dynamic>
|
||||||
let offset := <pos>
|
let offset := <pos>
|
||||||
</dynamic>
|
</dynamic>
|
||||||
@ -1373,7 +1373,7 @@ string ABIFunctions::abiDecodingFunctionStruct(StructType const& _type, bool _fr
|
|||||||
)");
|
)");
|
||||||
memberTempl("dynamic", decodingType->isDynamicallyEncoded());
|
memberTempl("dynamic", decodingType->isDynamicallyEncoded());
|
||||||
// TODO add test
|
// TODO add test
|
||||||
memberTempl("revertString", revertReasonIfDebug("ABI decoding: invalid struct offset"));
|
memberTempl("revertString", revertReasonIfDebugFunction("ABI decoding: invalid struct offset"));
|
||||||
memberTempl("load", _fromMemory ? "mload" : "calldataload");
|
memberTempl("load", _fromMemory ? "mload" : "calldataload");
|
||||||
memberTempl("pos", to_string(headPos));
|
memberTempl("pos", to_string(headPos));
|
||||||
memberTempl("memoryOffset", toCompactHexWithPrefix(_type.memoryOffsetOfMember(member.name)));
|
memberTempl("memoryOffset", toCompactHexWithPrefix(_type.memoryOffsetOfMember(member.name)));
|
||||||
@ -1441,7 +1441,7 @@ string ABIFunctions::calldataAccessFunction(Type const& _type)
|
|||||||
Whiskers w(R"(
|
Whiskers w(R"(
|
||||||
function <functionName>(base_ref, ptr) -> <return> {
|
function <functionName>(base_ref, ptr) -> <return> {
|
||||||
let rel_offset_of_tail := calldataload(ptr)
|
let rel_offset_of_tail := calldataload(ptr)
|
||||||
if iszero(slt(rel_offset_of_tail, sub(sub(calldatasize(), base_ref), sub(<neededLength>, 1)))) { <revertStringOffset> }
|
if iszero(slt(rel_offset_of_tail, sub(sub(calldatasize(), base_ref), sub(<neededLength>, 1)))) { <revertStringOffset>() }
|
||||||
value := add(rel_offset_of_tail, base_ref)
|
value := add(rel_offset_of_tail, base_ref)
|
||||||
<handleLength>
|
<handleLength>
|
||||||
}
|
}
|
||||||
@ -1453,14 +1453,14 @@ string ABIFunctions::calldataAccessFunction(Type const& _type)
|
|||||||
w("handleLength", Whiskers(R"(
|
w("handleLength", Whiskers(R"(
|
||||||
length := calldataload(value)
|
length := calldataload(value)
|
||||||
value := add(value, 0x20)
|
value := add(value, 0x20)
|
||||||
if gt(length, 0xffffffffffffffff) { <revertStringLength> }
|
if gt(length, 0xffffffffffffffff) { <revertStringLength>() }
|
||||||
if sgt(base_ref, sub(calldatasize(), mul(length, <calldataStride>))) { <revertStringStride> }
|
if sgt(base_ref, sub(calldatasize(), mul(length, <calldataStride>))) { <revertStringStride>() }
|
||||||
)")
|
)")
|
||||||
("calldataStride", toCompactHexWithPrefix(arrayType->calldataStride()))
|
("calldataStride", toCompactHexWithPrefix(arrayType->calldataStride()))
|
||||||
// TODO add test
|
// TODO add test
|
||||||
("revertStringLength", revertReasonIfDebug("Invalid calldata access length"))
|
("revertStringLength", revertReasonIfDebugFunction("Invalid calldata access length"))
|
||||||
// TODO add test
|
// TODO add test
|
||||||
("revertStringStride", revertReasonIfDebug("Invalid calldata access stride"))
|
("revertStringStride", revertReasonIfDebugFunction("Invalid calldata access stride"))
|
||||||
.render());
|
.render());
|
||||||
w("return", "value, length");
|
w("return", "value, length");
|
||||||
}
|
}
|
||||||
@ -1471,7 +1471,7 @@ string ABIFunctions::calldataAccessFunction(Type const& _type)
|
|||||||
}
|
}
|
||||||
w("neededLength", toCompactHexWithPrefix(tailSize));
|
w("neededLength", toCompactHexWithPrefix(tailSize));
|
||||||
w("functionName", functionName);
|
w("functionName", functionName);
|
||||||
w("revertStringOffset", revertReasonIfDebug("Invalid calldata access offset"));
|
w("revertStringOffset", revertReasonIfDebugFunction("Invalid calldata access offset"));
|
||||||
return w.render();
|
return w.render();
|
||||||
}
|
}
|
||||||
else if (_type.isValueType())
|
else if (_type.isValueType())
|
||||||
@ -1555,7 +1555,7 @@ size_t ABIFunctions::numVariablesForType(Type const& _type, EncodingOptions cons
|
|||||||
return _type.sizeOnStack();
|
return _type.sizeOnStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ABIFunctions::revertReasonIfDebug(std::string const& _message)
|
std::string ABIFunctions::revertReasonIfDebugFunction(std::string const& _message)
|
||||||
{
|
{
|
||||||
return YulUtilFunctions::revertReasonIfDebug(m_revertStrings, _message);
|
return m_utils.revertReasonIfDebugFunction(_message);
|
||||||
}
|
}
|
||||||
|
@ -273,9 +273,9 @@ private:
|
|||||||
/// is true), for which it is two.
|
/// is true), for which it is two.
|
||||||
static size_t numVariablesForType(Type const& _type, EncodingOptions const& _options);
|
static size_t numVariablesForType(Type const& _type, EncodingOptions const& _options);
|
||||||
|
|
||||||
/// @returns code that stores @param _message for revert reason
|
/// @returns the name of a function that uses @param _message for revert reason
|
||||||
/// if m_revertStrings is debug.
|
/// if m_revertStrings is debug.
|
||||||
std::string revertReasonIfDebug(std::string const& _message = "");
|
std::string revertReasonIfDebugFunction(std::string const& _message = "");
|
||||||
|
|
||||||
langutil::EVMVersion m_evmVersion;
|
langutil::EVMVersion m_evmVersion;
|
||||||
RevertStrings const m_revertStrings;
|
RevertStrings const m_revertStrings;
|
||||||
|
@ -560,7 +560,11 @@ void CompilerContext::optimizeYul(yul::Object& _object, yul::EVMDialect const& _
|
|||||||
|
|
||||||
string CompilerContext::revertReasonIfDebug(string const& _message)
|
string CompilerContext::revertReasonIfDebug(string const& _message)
|
||||||
{
|
{
|
||||||
return YulUtilFunctions::revertReasonIfDebug(m_revertStrings, _message);
|
return YulUtilFunctions::revertReasonIfDebugBody(
|
||||||
|
m_revertStrings,
|
||||||
|
"mload(" + to_string(CompilerUtils::freeMemoryPointer) + ")",
|
||||||
|
_message
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompilerContext::updateSourceLocation()
|
void CompilerContext::updateSourceLocation()
|
||||||
|
@ -268,7 +268,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
/// If m_revertStrings is debug, @returns inline assembly code that
|
/// If m_revertStrings is debug, @returns inline assembly code that
|
||||||
/// stores @param _message in memory position 0 and reverts.
|
/// stores @param _message at the free memory pointer and reverts.
|
||||||
/// Otherwise returns "revert(0, 0)".
|
/// Otherwise returns "revert(0, 0)".
|
||||||
std::string revertReasonIfDebug(std::string const& _message = "");
|
std::string revertReasonIfDebug(std::string const& _message = "");
|
||||||
|
|
||||||
|
@ -2220,16 +2220,16 @@ string YulUtilFunctions::calldataArrayIndexRangeAccess(ArrayType const& _type)
|
|||||||
return m_functionCollector.createFunction(functionName, [&]() {
|
return m_functionCollector.createFunction(functionName, [&]() {
|
||||||
return Whiskers(R"(
|
return Whiskers(R"(
|
||||||
function <functionName>(offset, length, startIndex, endIndex) -> offsetOut, lengthOut {
|
function <functionName>(offset, length, startIndex, endIndex) -> offsetOut, lengthOut {
|
||||||
if gt(startIndex, endIndex) { <revertSliceStartAfterEnd> }
|
if gt(startIndex, endIndex) { <revertSliceStartAfterEnd>() }
|
||||||
if gt(endIndex, length) { <revertSliceGreaterThanLength> }
|
if gt(endIndex, length) { <revertSliceGreaterThanLength>() }
|
||||||
offsetOut := add(offset, mul(startIndex, <stride>))
|
offsetOut := add(offset, mul(startIndex, <stride>))
|
||||||
lengthOut := sub(endIndex, startIndex)
|
lengthOut := sub(endIndex, startIndex)
|
||||||
}
|
}
|
||||||
)")
|
)")
|
||||||
("functionName", functionName)
|
("functionName", functionName)
|
||||||
("stride", to_string(_type.calldataStride()))
|
("stride", to_string(_type.calldataStride()))
|
||||||
("revertSliceStartAfterEnd", revertReasonIfDebug("Slice starts after end"))
|
("revertSliceStartAfterEnd", revertReasonIfDebugFunction("Slice starts after end"))
|
||||||
("revertSliceGreaterThanLength", revertReasonIfDebug("Slice is greater than length"))
|
("revertSliceGreaterThanLength", revertReasonIfDebugFunction("Slice is greater than length"))
|
||||||
.render();
|
.render();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -2243,13 +2243,13 @@ string YulUtilFunctions::accessCalldataTailFunction(Type const& _type)
|
|||||||
return Whiskers(R"(
|
return Whiskers(R"(
|
||||||
function <functionName>(base_ref, ptr_to_tail) -> addr<?dynamicallySized>, length</dynamicallySized> {
|
function <functionName>(base_ref, ptr_to_tail) -> addr<?dynamicallySized>, length</dynamicallySized> {
|
||||||
let rel_offset_of_tail := calldataload(ptr_to_tail)
|
let rel_offset_of_tail := calldataload(ptr_to_tail)
|
||||||
if iszero(slt(rel_offset_of_tail, sub(sub(calldatasize(), base_ref), sub(<neededLength>, 1)))) { <invalidCalldataTailOffset> }
|
if iszero(slt(rel_offset_of_tail, sub(sub(calldatasize(), base_ref), sub(<neededLength>, 1)))) { <invalidCalldataTailOffset>() }
|
||||||
addr := add(base_ref, rel_offset_of_tail)
|
addr := add(base_ref, rel_offset_of_tail)
|
||||||
<?dynamicallySized>
|
<?dynamicallySized>
|
||||||
length := calldataload(addr)
|
length := calldataload(addr)
|
||||||
if gt(length, 0xffffffffffffffff) { <invalidCalldataTailLength> }
|
if gt(length, 0xffffffffffffffff) { <invalidCalldataTailLength>() }
|
||||||
addr := add(addr, 32)
|
addr := add(addr, 32)
|
||||||
if sgt(addr, sub(calldatasize(), mul(length, <calldataStride>))) { <shortCalldataTail> }
|
if sgt(addr, sub(calldatasize(), mul(length, <calldataStride>))) { <shortCalldataTail>() }
|
||||||
</dynamicallySized>
|
</dynamicallySized>
|
||||||
}
|
}
|
||||||
)")
|
)")
|
||||||
@ -2257,9 +2257,9 @@ string YulUtilFunctions::accessCalldataTailFunction(Type const& _type)
|
|||||||
("dynamicallySized", _type.isDynamicallySized())
|
("dynamicallySized", _type.isDynamicallySized())
|
||||||
("neededLength", toCompactHexWithPrefix(_type.calldataEncodedTailSize()))
|
("neededLength", toCompactHexWithPrefix(_type.calldataEncodedTailSize()))
|
||||||
("calldataStride", toCompactHexWithPrefix(_type.isDynamicallySized() ? dynamic_cast<ArrayType const&>(_type).calldataStride() : 0))
|
("calldataStride", toCompactHexWithPrefix(_type.isDynamicallySized() ? dynamic_cast<ArrayType const&>(_type).calldataStride() : 0))
|
||||||
("invalidCalldataTailOffset", revertReasonIfDebug("Invalid calldata tail offset"))
|
("invalidCalldataTailOffset", revertReasonIfDebugFunction("Invalid calldata tail offset"))
|
||||||
("invalidCalldataTailLength", revertReasonIfDebug("Invalid calldata tail length"))
|
("invalidCalldataTailLength", revertReasonIfDebugFunction("Invalid calldata tail length"))
|
||||||
("shortCalldataTail", revertReasonIfDebug("Calldata tail too short"))
|
("shortCalldataTail", revertReasonIfDebugFunction("Calldata tail too short"))
|
||||||
.render();
|
.render();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -4212,42 +4212,52 @@ string YulUtilFunctions::readFromMemoryOrCalldata(Type const& _type, bool _fromC
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
string YulUtilFunctions::revertReasonIfDebug(RevertStrings revertStrings, string const& _message)
|
string YulUtilFunctions::revertReasonIfDebugFunction(string const& _message)
|
||||||
{
|
{
|
||||||
if (revertStrings >= RevertStrings::Debug && !_message.empty())
|
string functionName = "revert_error_" + util::toHex(util::keccak256(_message).asBytes());
|
||||||
{
|
return m_functionCollector.createFunction(functionName, [&](auto&, auto&) -> string {
|
||||||
Whiskers templ(R"({
|
return revertReasonIfDebugBody(m_revertStrings, allocateUnboundedFunction() + "()", _message);
|
||||||
mstore(0, <sig>)
|
});
|
||||||
mstore(4, 0x20)
|
|
||||||
mstore(add(4, 0x20), <length>)
|
|
||||||
let reasonPos := add(4, 0x40)
|
|
||||||
<#word>
|
|
||||||
mstore(add(reasonPos, <offset>), <wordValue>)
|
|
||||||
</word>
|
|
||||||
revert(0, add(reasonPos, <end>))
|
|
||||||
})");
|
|
||||||
templ("sig", util::selectorFromSignature("Error(string)").str());
|
|
||||||
templ("length", to_string(_message.length()));
|
|
||||||
|
|
||||||
size_t words = (_message.length() + 31) / 32;
|
|
||||||
vector<map<string, string>> wordParams(words);
|
|
||||||
for (size_t i = 0; i < words; ++i)
|
|
||||||
{
|
|
||||||
wordParams[i]["offset"] = to_string(i * 32);
|
|
||||||
wordParams[i]["wordValue"] = formatAsStringOrNumber(_message.substr(32 * i, 32));
|
|
||||||
}
|
|
||||||
templ("word", wordParams);
|
|
||||||
templ("end", to_string(words * 32));
|
|
||||||
|
|
||||||
return templ.render();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return "revert(0, 0)";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string YulUtilFunctions::revertReasonIfDebug(string const& _message)
|
string YulUtilFunctions::revertReasonIfDebugBody(
|
||||||
|
RevertStrings _revertStrings,
|
||||||
|
string const& _allocation,
|
||||||
|
string const& _message
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return revertReasonIfDebug(m_revertStrings, _message);
|
if (_revertStrings < RevertStrings::Debug || _message.empty())
|
||||||
|
return "revert(0, 0)";
|
||||||
|
|
||||||
|
Whiskers templ(R"(
|
||||||
|
let start := <allocate>
|
||||||
|
let pos := start
|
||||||
|
mstore(pos, <sig>)
|
||||||
|
pos := add(pos, 4)
|
||||||
|
mstore(pos, 0x20)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
mstore(pos, <length>)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
<#word>
|
||||||
|
mstore(add(pos, <offset>), <wordValue>)
|
||||||
|
</word>
|
||||||
|
revert(start, <overallLength>)
|
||||||
|
)");
|
||||||
|
templ("allocate", _allocation);
|
||||||
|
templ("sig", util::selectorFromSignature("Error(string)").str());
|
||||||
|
templ("length", to_string(_message.length()));
|
||||||
|
|
||||||
|
size_t words = (_message.length() + 31) / 32;
|
||||||
|
vector<map<string, string>> wordParams(words);
|
||||||
|
for (size_t i = 0; i < words; ++i)
|
||||||
|
{
|
||||||
|
wordParams[i]["offset"] = to_string(i * 32);
|
||||||
|
wordParams[i]["wordValue"] = formatAsStringOrNumber(_message.substr(32 * i, 32));
|
||||||
|
}
|
||||||
|
templ("word", wordParams);
|
||||||
|
templ("overallLength", to_string(4 + 0x20 + 0x20 + words * 32));
|
||||||
|
|
||||||
|
return templ.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
string YulUtilFunctions::panicFunction(util::PanicCode _code)
|
string YulUtilFunctions::panicFunction(util::PanicCode _code)
|
||||||
|
@ -453,12 +453,18 @@ public:
|
|||||||
/// signature: (slot, offset) ->
|
/// signature: (slot, offset) ->
|
||||||
std::string storageSetToZeroFunction(Type const& _type);
|
std::string storageSetToZeroFunction(Type const& _type);
|
||||||
|
|
||||||
/// If revertStrings is debug, @returns inline assembly code that
|
/// If revertStrings is debug, @returns the name of a function that
|
||||||
/// stores @param _message in memory position 0 and reverts.
|
/// stores @param _message in memory position 0 and reverts.
|
||||||
/// Otherwise returns "revert(0, 0)".
|
/// Otherwise returns the name of a function that uses "revert(0, 0)".
|
||||||
static std::string revertReasonIfDebug(RevertStrings revertStrings, std::string const& _message = "");
|
std::string revertReasonIfDebugFunction(std::string const& _message = "");
|
||||||
|
|
||||||
std::string revertReasonIfDebug(std::string const& _message = "");
|
/// @returns the function body of ``revertReasonIfDebug``.
|
||||||
|
/// Should only be used internally and by the old code generator.
|
||||||
|
static std::string revertReasonIfDebugBody(
|
||||||
|
RevertStrings _revertStrings,
|
||||||
|
std::string const& _allocation,
|
||||||
|
std::string const& _message
|
||||||
|
);
|
||||||
|
|
||||||
/// Reverts with ``Panic(uint256)`` and the given code.
|
/// Reverts with ``Panic(uint256)`` and the given code.
|
||||||
std::string panicFunction(util::PanicCode _code);
|
std::string panicFunction(util::PanicCode _code);
|
||||||
|
@ -177,8 +177,3 @@ ABIFunctions IRGenerationContext::abiFunctions()
|
|||||||
{
|
{
|
||||||
return ABIFunctions(m_evmVersion, m_revertStrings, m_functions);
|
return ABIFunctions(m_evmVersion, m_revertStrings, m_functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string IRGenerationContext::revertReasonIfDebug(std::string const& _message)
|
|
||||||
{
|
|
||||||
return YulUtilFunctions::revertReasonIfDebug(m_revertStrings, _message);
|
|
||||||
}
|
|
||||||
|
@ -143,10 +143,6 @@ public:
|
|||||||
|
|
||||||
ABIFunctions abiFunctions();
|
ABIFunctions abiFunctions();
|
||||||
|
|
||||||
/// @returns code that stores @param _message for revert reason
|
|
||||||
/// if m_revertStrings is debug.
|
|
||||||
std::string revertReasonIfDebug(std::string const& _message = "");
|
|
||||||
|
|
||||||
RevertStrings revertStrings() const { return m_revertStrings; }
|
RevertStrings revertStrings() const { return m_revertStrings; }
|
||||||
|
|
||||||
std::set<ContractDefinition const*, ASTNode::CompareByID>& subObjectsCreated() { return m_subObjects; }
|
std::set<ContractDefinition const*, ASTNode::CompareByID>& subObjectsCreated() { return m_subObjects; }
|
||||||
|
@ -839,7 +839,7 @@ string IRGenerator::deployCode(ContractDefinition const& _contract)
|
|||||||
|
|
||||||
string IRGenerator::callValueCheck()
|
string IRGenerator::callValueCheck()
|
||||||
{
|
{
|
||||||
return "if callvalue() { " + m_context.revertReasonIfDebug("Ether sent to non-payable function") + " }";
|
return "if callvalue() { " + m_utils.revertReasonIfDebugFunction("Ether sent to non-payable function") + "() }";
|
||||||
}
|
}
|
||||||
|
|
||||||
string IRGenerator::dispatchRoutine(ContractDefinition const& _contract)
|
string IRGenerator::dispatchRoutine(ContractDefinition const& _contract)
|
||||||
@ -885,8 +885,8 @@ string IRGenerator::dispatchRoutine(ContractDefinition const& _contract)
|
|||||||
// we revert.
|
// we revert.
|
||||||
delegatecallCheck =
|
delegatecallCheck =
|
||||||
"if iszero(called_via_delegatecall) { " +
|
"if iszero(called_via_delegatecall) { " +
|
||||||
m_context.revertReasonIfDebug("Non-view function of library called without DELEGATECALL") +
|
m_utils.revertReasonIfDebugFunction("Non-view function of library called without DELEGATECALL") +
|
||||||
" }";
|
"() }";
|
||||||
}
|
}
|
||||||
templ["delegatecallCheck"] = delegatecallCheck;
|
templ["delegatecallCheck"] = delegatecallCheck;
|
||||||
templ["callValueCheck"] = (type->isPayable() || _contract.isLibrary()) ? "" : callValueCheck();
|
templ["callValueCheck"] = (type->isPayable() || _contract.isLibrary()) ? "" : callValueCheck();
|
||||||
@ -937,12 +937,11 @@ string IRGenerator::dispatchRoutine(ContractDefinition const& _contract)
|
|||||||
t("fallback", fallbackCode);
|
t("fallback", fallbackCode);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
t(
|
t("fallback", (
|
||||||
"fallback",
|
|
||||||
etherReceiver ?
|
etherReceiver ?
|
||||||
m_context.revertReasonIfDebug("Unknown signature and no fallback defined") :
|
m_utils.revertReasonIfDebugFunction("Unknown signature and no fallback defined") :
|
||||||
m_context.revertReasonIfDebug("Contract does not have fallback nor receive functions")
|
m_utils.revertReasonIfDebugFunction("Contract does not have fallback nor receive functions")
|
||||||
);
|
) + "()");
|
||||||
return t.render();
|
return t.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2433,7 +2433,7 @@ void IRGeneratorForStatements::appendExternalFunctionCall(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Whiskers templ(R"(
|
Whiskers templ(R"(
|
||||||
if iszero(extcodesize(<address>)) { <revertNoCode> }
|
if iszero(extcodesize(<address>)) { <revertNoCode>() }
|
||||||
|
|
||||||
// storage for arguments and returned data
|
// storage for arguments and returned data
|
||||||
let <pos> := <allocateUnbounded>()
|
let <pos> := <allocateUnbounded>()
|
||||||
@ -2458,7 +2458,7 @@ void IRGeneratorForStatements::appendExternalFunctionCall(
|
|||||||
<?+retVars> <retVars> := </+retVars> <abiDecode>(<pos>, add(<pos>, <returnSize>))
|
<?+retVars> <retVars> := </+retVars> <abiDecode>(<pos>, add(<pos>, <returnSize>))
|
||||||
}
|
}
|
||||||
)");
|
)");
|
||||||
templ("revertNoCode", m_context.revertReasonIfDebug("Target contract does not contain code"));
|
templ("revertNoCode", m_utils.revertReasonIfDebugFunction("Target contract does not contain code"));
|
||||||
templ("pos", m_context.newYulVariable());
|
templ("pos", m_context.newYulVariable());
|
||||||
templ("end", m_context.newYulVariable());
|
templ("end", m_context.newYulVariable());
|
||||||
if (_functionCall.annotation().tryCall)
|
if (_functionCall.annotation().tryCall)
|
||||||
|
@ -10,54 +10,38 @@
|
|||||||
"ast":
|
"ast":
|
||||||
{
|
{
|
||||||
"nodeType": "YulBlock",
|
"nodeType": "YulBlock",
|
||||||
"src": "0:825:1",
|
"src": "0:1856:1",
|
||||||
"statements":
|
"statements":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"body":
|
"body":
|
||||||
{
|
{
|
||||||
"nodeType": "YulBlock",
|
"nodeType": "YulBlock",
|
||||||
"src": "114:277:1",
|
"src": "114:478:1",
|
||||||
"statements":
|
"statements":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"body":
|
"body":
|
||||||
{
|
{
|
||||||
"nodeType": "YulBlock",
|
"nodeType": "YulBlock",
|
||||||
"src": "163:16:1",
|
"src": "163:83:1",
|
||||||
"statements":
|
"statements":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"expression":
|
"expression":
|
||||||
{
|
{
|
||||||
"arguments":
|
"arguments": [],
|
||||||
[
|
|
||||||
{
|
|
||||||
"kind": "number",
|
|
||||||
"nodeType": "YulLiteral",
|
|
||||||
"src": "172:1:1",
|
|
||||||
"type": "",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kind": "number",
|
|
||||||
"nodeType": "YulLiteral",
|
|
||||||
"src": "175:1:1",
|
|
||||||
"type": "",
|
|
||||||
"value": "0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "revert",
|
"name": "revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "165:6:1"
|
"src": "165:77:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "165:12:1"
|
"src": "165:79:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulExpressionStatement",
|
"nodeType": "YulExpressionStatement",
|
||||||
"src": "165:12:1"
|
"src": "165:79:1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -123,7 +107,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nodeType": "YulAssignment",
|
"nodeType": "YulAssignment",
|
||||||
"src": "188:30:1",
|
"src": "255:30:1",
|
||||||
"value":
|
"value":
|
||||||
{
|
{
|
||||||
"arguments":
|
"arguments":
|
||||||
@ -131,24 +115,24 @@
|
|||||||
{
|
{
|
||||||
"name": "offset",
|
"name": "offset",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "211:6:1"
|
"src": "278:6:1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "calldataload",
|
"name": "calldataload",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "198:12:1"
|
"src": "265:12:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "198:20:1"
|
"src": "265:20:1"
|
||||||
},
|
},
|
||||||
"variableNames":
|
"variableNames":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "length",
|
"name": "length",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "188:6:1"
|
"src": "255:6:1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -156,40 +140,24 @@
|
|||||||
"body":
|
"body":
|
||||||
{
|
{
|
||||||
"nodeType": "YulBlock",
|
"nodeType": "YulBlock",
|
||||||
"src": "261:16:1",
|
"src": "328:83:1",
|
||||||
"statements":
|
"statements":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"expression":
|
"expression":
|
||||||
{
|
{
|
||||||
"arguments":
|
"arguments": [],
|
||||||
[
|
|
||||||
{
|
|
||||||
"kind": "number",
|
|
||||||
"nodeType": "YulLiteral",
|
|
||||||
"src": "270:1:1",
|
|
||||||
"type": "",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kind": "number",
|
|
||||||
"nodeType": "YulLiteral",
|
|
||||||
"src": "273:1:1",
|
|
||||||
"type": "",
|
|
||||||
"value": "0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "revert",
|
"name": "revert_error_15abf5612cd996bc235ba1e55a4a30ac60e6bb601ff7ba4ad3f179b6be8d0490",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "263:6:1"
|
"src": "330:77:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "263:12:1"
|
"src": "330:79:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulExpressionStatement",
|
"nodeType": "YulExpressionStatement",
|
||||||
"src": "263:12:1"
|
"src": "330:79:1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -200,12 +168,12 @@
|
|||||||
{
|
{
|
||||||
"name": "length",
|
"name": "length",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "233:6:1"
|
"src": "300:6:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "number",
|
"kind": "number",
|
||||||
"nodeType": "YulLiteral",
|
"nodeType": "YulLiteral",
|
||||||
"src": "241:18:1",
|
"src": "308:18:1",
|
||||||
"type": "",
|
"type": "",
|
||||||
"value": "0xffffffffffffffff"
|
"value": "0xffffffffffffffff"
|
||||||
}
|
}
|
||||||
@ -214,17 +182,17 @@
|
|||||||
{
|
{
|
||||||
"name": "gt",
|
"name": "gt",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "230:2:1"
|
"src": "297:2:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "230:30:1"
|
"src": "297:30:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulIf",
|
"nodeType": "YulIf",
|
||||||
"src": "227:2:1"
|
"src": "294:2:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nodeType": "YulAssignment",
|
"nodeType": "YulAssignment",
|
||||||
"src": "286:29:1",
|
"src": "420:29:1",
|
||||||
"value":
|
"value":
|
||||||
{
|
{
|
||||||
"arguments":
|
"arguments":
|
||||||
@ -232,12 +200,12 @@
|
|||||||
{
|
{
|
||||||
"name": "offset",
|
"name": "offset",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "302:6:1"
|
"src": "436:6:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "number",
|
"kind": "number",
|
||||||
"nodeType": "YulLiteral",
|
"nodeType": "YulLiteral",
|
||||||
"src": "310:4:1",
|
"src": "444:4:1",
|
||||||
"type": "",
|
"type": "",
|
||||||
"value": "0x20"
|
"value": "0x20"
|
||||||
}
|
}
|
||||||
@ -246,17 +214,17 @@
|
|||||||
{
|
{
|
||||||
"name": "add",
|
"name": "add",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "298:3:1"
|
"src": "432:3:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "298:17:1"
|
"src": "432:17:1"
|
||||||
},
|
},
|
||||||
"variableNames":
|
"variableNames":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "arrayPos",
|
"name": "arrayPos",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "286:8:1"
|
"src": "420:8:1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -264,40 +232,24 @@
|
|||||||
"body":
|
"body":
|
||||||
{
|
{
|
||||||
"nodeType": "YulBlock",
|
"nodeType": "YulBlock",
|
||||||
"src": "369:16:1",
|
"src": "503:83:1",
|
||||||
"statements":
|
"statements":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"expression":
|
"expression":
|
||||||
{
|
{
|
||||||
"arguments":
|
"arguments": [],
|
||||||
[
|
|
||||||
{
|
|
||||||
"kind": "number",
|
|
||||||
"nodeType": "YulLiteral",
|
|
||||||
"src": "378:1:1",
|
|
||||||
"type": "",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kind": "number",
|
|
||||||
"nodeType": "YulLiteral",
|
|
||||||
"src": "381:1:1",
|
|
||||||
"type": "",
|
|
||||||
"value": "0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "revert",
|
"name": "revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "371:6:1"
|
"src": "505:77:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "371:12:1"
|
"src": "505:79:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulExpressionStatement",
|
"nodeType": "YulExpressionStatement",
|
||||||
"src": "371:12:1"
|
"src": "505:79:1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -311,7 +263,7 @@
|
|||||||
{
|
{
|
||||||
"name": "arrayPos",
|
"name": "arrayPos",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "334:8:1"
|
"src": "468:8:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments":
|
"arguments":
|
||||||
@ -319,12 +271,12 @@
|
|||||||
{
|
{
|
||||||
"name": "length",
|
"name": "length",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "348:6:1"
|
"src": "482:6:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "number",
|
"kind": "number",
|
||||||
"nodeType": "YulLiteral",
|
"nodeType": "YulLiteral",
|
||||||
"src": "356:4:1",
|
"src": "490:4:1",
|
||||||
"type": "",
|
"type": "",
|
||||||
"value": "0x20"
|
"value": "0x20"
|
||||||
}
|
}
|
||||||
@ -333,38 +285,38 @@
|
|||||||
{
|
{
|
||||||
"name": "mul",
|
"name": "mul",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "344:3:1"
|
"src": "478:3:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "344:17:1"
|
"src": "478:17:1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "add",
|
"name": "add",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "330:3:1"
|
"src": "464:3:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "330:32:1"
|
"src": "464:32:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "end",
|
"name": "end",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "364:3:1"
|
"src": "498:3:1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "gt",
|
"name": "gt",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "327:2:1"
|
"src": "461:2:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "327:41:1"
|
"src": "461:41:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulIf",
|
"nodeType": "YulIf",
|
||||||
"src": "324:2:1"
|
"src": "458:2:1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -400,53 +352,37 @@
|
|||||||
"type": ""
|
"type": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"src": "24:367:1"
|
"src": "24:568:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"body":
|
"body":
|
||||||
{
|
{
|
||||||
"nodeType": "YulBlock",
|
"nodeType": "YulBlock",
|
||||||
"src": "498:324:1",
|
"src": "699:458:1",
|
||||||
"statements":
|
"statements":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"body":
|
"body":
|
||||||
{
|
{
|
||||||
"nodeType": "YulBlock",
|
"nodeType": "YulBlock",
|
||||||
"src": "544:16:1",
|
"src": "745:83:1",
|
||||||
"statements":
|
"statements":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"expression":
|
"expression":
|
||||||
{
|
{
|
||||||
"arguments":
|
"arguments": [],
|
||||||
[
|
|
||||||
{
|
|
||||||
"kind": "number",
|
|
||||||
"nodeType": "YulLiteral",
|
|
||||||
"src": "553:1:1",
|
|
||||||
"type": "",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kind": "number",
|
|
||||||
"nodeType": "YulLiteral",
|
|
||||||
"src": "556:1:1",
|
|
||||||
"type": "",
|
|
||||||
"value": "0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "revert",
|
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "546:6:1"
|
"src": "747:77:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "546:12:1"
|
"src": "747:79:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulExpressionStatement",
|
"nodeType": "YulExpressionStatement",
|
||||||
"src": "546:12:1"
|
"src": "747:79:1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -460,27 +396,27 @@
|
|||||||
{
|
{
|
||||||
"name": "dataEnd",
|
"name": "dataEnd",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "519:7:1"
|
"src": "720:7:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "headStart",
|
"name": "headStart",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "528:9:1"
|
"src": "729:9:1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "sub",
|
"name": "sub",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "515:3:1"
|
"src": "716:3:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "515:23:1"
|
"src": "716:23:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "number",
|
"kind": "number",
|
||||||
"nodeType": "YulLiteral",
|
"nodeType": "YulLiteral",
|
||||||
"src": "540:2:1",
|
"src": "741:2:1",
|
||||||
"type": "",
|
"type": "",
|
||||||
"value": "32"
|
"value": "32"
|
||||||
}
|
}
|
||||||
@ -489,22 +425,22 @@
|
|||||||
{
|
{
|
||||||
"name": "slt",
|
"name": "slt",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "511:3:1"
|
"src": "712:3:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "511:32:1"
|
"src": "712:32:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulIf",
|
"nodeType": "YulIf",
|
||||||
"src": "508:2:1"
|
"src": "709:2:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nodeType": "YulBlock",
|
"nodeType": "YulBlock",
|
||||||
"src": "570:245:1",
|
"src": "838:312:1",
|
||||||
"statements":
|
"statements":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"nodeType": "YulVariableDeclaration",
|
"nodeType": "YulVariableDeclaration",
|
||||||
"src": "585:45:1",
|
"src": "853:45:1",
|
||||||
"value":
|
"value":
|
||||||
{
|
{
|
||||||
"arguments":
|
"arguments":
|
||||||
@ -515,12 +451,12 @@
|
|||||||
{
|
{
|
||||||
"name": "headStart",
|
"name": "headStart",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "616:9:1"
|
"src": "884:9:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "number",
|
"kind": "number",
|
||||||
"nodeType": "YulLiteral",
|
"nodeType": "YulLiteral",
|
||||||
"src": "627:1:1",
|
"src": "895:1:1",
|
||||||
"type": "",
|
"type": "",
|
||||||
"value": "0"
|
"value": "0"
|
||||||
}
|
}
|
||||||
@ -529,27 +465,27 @@
|
|||||||
{
|
{
|
||||||
"name": "add",
|
"name": "add",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "612:3:1"
|
"src": "880:3:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "612:17:1"
|
"src": "880:17:1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "calldataload",
|
"name": "calldataload",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "599:12:1"
|
"src": "867:12:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "599:31:1"
|
"src": "867:31:1"
|
||||||
},
|
},
|
||||||
"variables":
|
"variables":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "offset",
|
"name": "offset",
|
||||||
"nodeType": "YulTypedName",
|
"nodeType": "YulTypedName",
|
||||||
"src": "589:6:1",
|
"src": "857:6:1",
|
||||||
"type": ""
|
"type": ""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -558,40 +494,24 @@
|
|||||||
"body":
|
"body":
|
||||||
{
|
{
|
||||||
"nodeType": "YulBlock",
|
"nodeType": "YulBlock",
|
||||||
"src": "677:16:1",
|
"src": "945:83:1",
|
||||||
"statements":
|
"statements":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"expression":
|
"expression":
|
||||||
{
|
{
|
||||||
"arguments":
|
"arguments": [],
|
||||||
[
|
|
||||||
{
|
|
||||||
"kind": "number",
|
|
||||||
"nodeType": "YulLiteral",
|
|
||||||
"src": "686:1:1",
|
|
||||||
"type": "",
|
|
||||||
"value": "0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kind": "number",
|
|
||||||
"nodeType": "YulLiteral",
|
|
||||||
"src": "689:1:1",
|
|
||||||
"type": "",
|
|
||||||
"value": "0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "revert",
|
"name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "679:6:1"
|
"src": "947:77:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "679:12:1"
|
"src": "947:79:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulExpressionStatement",
|
"nodeType": "YulExpressionStatement",
|
||||||
"src": "679:12:1"
|
"src": "947:79:1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -602,12 +522,12 @@
|
|||||||
{
|
{
|
||||||
"name": "offset",
|
"name": "offset",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "649:6:1"
|
"src": "917:6:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "number",
|
"kind": "number",
|
||||||
"nodeType": "YulLiteral",
|
"nodeType": "YulLiteral",
|
||||||
"src": "657:18:1",
|
"src": "925:18:1",
|
||||||
"type": "",
|
"type": "",
|
||||||
"value": "0xffffffffffffffff"
|
"value": "0xffffffffffffffff"
|
||||||
}
|
}
|
||||||
@ -616,17 +536,17 @@
|
|||||||
{
|
{
|
||||||
"name": "gt",
|
"name": "gt",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "646:2:1"
|
"src": "914:2:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "646:30:1"
|
"src": "914:30:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulIf",
|
"nodeType": "YulIf",
|
||||||
"src": "643:2:1"
|
"src": "911:2:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nodeType": "YulAssignment",
|
"nodeType": "YulAssignment",
|
||||||
"src": "707:98:1",
|
"src": "1042:98:1",
|
||||||
"value":
|
"value":
|
||||||
{
|
{
|
||||||
"arguments":
|
"arguments":
|
||||||
@ -637,49 +557,49 @@
|
|||||||
{
|
{
|
||||||
"name": "headStart",
|
"name": "headStart",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "777:9:1"
|
"src": "1112:9:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "offset",
|
"name": "offset",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "788:6:1"
|
"src": "1123:6:1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "add",
|
"name": "add",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "773:3:1"
|
"src": "1108:3:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "773:22:1"
|
"src": "1108:22:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "dataEnd",
|
"name": "dataEnd",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "797:7:1"
|
"src": "1132:7:1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"functionName":
|
"functionName":
|
||||||
{
|
{
|
||||||
"name": "abi_decode_t_array$_t_uint256_$dyn_calldata_ptr",
|
"name": "abi_decode_t_array$_t_uint256_$dyn_calldata_ptr",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "725:47:1"
|
"src": "1060:47:1"
|
||||||
},
|
},
|
||||||
"nodeType": "YulFunctionCall",
|
"nodeType": "YulFunctionCall",
|
||||||
"src": "725:80:1"
|
"src": "1060:80:1"
|
||||||
},
|
},
|
||||||
"variableNames":
|
"variableNames":
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "value0",
|
"name": "value0",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "707:6:1"
|
"src": "1042:6:1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "value1",
|
"name": "value1",
|
||||||
"nodeType": "YulIdentifier",
|
"nodeType": "YulIdentifier",
|
||||||
"src": "715:6:1"
|
"src": "1050:6:1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -694,13 +614,13 @@
|
|||||||
{
|
{
|
||||||
"name": "headStart",
|
"name": "headStart",
|
||||||
"nodeType": "YulTypedName",
|
"nodeType": "YulTypedName",
|
||||||
"src": "460:9:1",
|
"src": "661:9:1",
|
||||||
"type": ""
|
"type": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "dataEnd",
|
"name": "dataEnd",
|
||||||
"nodeType": "YulTypedName",
|
"nodeType": "YulTypedName",
|
||||||
"src": "471:7:1",
|
"src": "672:7:1",
|
||||||
"type": ""
|
"type": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -709,21 +629,301 @@
|
|||||||
{
|
{
|
||||||
"name": "value0",
|
"name": "value0",
|
||||||
"nodeType": "YulTypedName",
|
"nodeType": "YulTypedName",
|
||||||
"src": "483:6:1",
|
"src": "684:6:1",
|
||||||
"type": ""
|
"type": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "value1",
|
"name": "value1",
|
||||||
"nodeType": "YulTypedName",
|
"nodeType": "YulTypedName",
|
||||||
"src": "491:6:1",
|
"src": "692:6:1",
|
||||||
"type": ""
|
"type": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"src": "397:425:1"
|
"src": "598:559:1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"body":
|
||||||
|
{
|
||||||
|
"nodeType": "YulBlock",
|
||||||
|
"src": "1203:35:1",
|
||||||
|
"statements":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"nodeType": "YulAssignment",
|
||||||
|
"src": "1213:19:1",
|
||||||
|
"value":
|
||||||
|
{
|
||||||
|
"arguments":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"kind": "number",
|
||||||
|
"nodeType": "YulLiteral",
|
||||||
|
"src": "1229:2:1",
|
||||||
|
"type": "",
|
||||||
|
"value": "64"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functionName":
|
||||||
|
{
|
||||||
|
"name": "mload",
|
||||||
|
"nodeType": "YulIdentifier",
|
||||||
|
"src": "1223:5:1"
|
||||||
|
},
|
||||||
|
"nodeType": "YulFunctionCall",
|
||||||
|
"src": "1223:9:1"
|
||||||
|
},
|
||||||
|
"variableNames":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "memPtr",
|
||||||
|
"nodeType": "YulIdentifier",
|
||||||
|
"src": "1213:6:1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"name": "allocate_unbounded",
|
||||||
|
"nodeType": "YulFunctionDefinition",
|
||||||
|
"returnVariables":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "memPtr",
|
||||||
|
"nodeType": "YulTypedName",
|
||||||
|
"src": "1196:6:1",
|
||||||
|
"type": ""
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"src": "1163:75:1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"body":
|
||||||
|
{
|
||||||
|
"nodeType": "YulBlock",
|
||||||
|
"src": "1333:28:1",
|
||||||
|
"statements":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"expression":
|
||||||
|
{
|
||||||
|
"arguments":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"kind": "number",
|
||||||
|
"nodeType": "YulLiteral",
|
||||||
|
"src": "1350:1:1",
|
||||||
|
"type": "",
|
||||||
|
"value": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "number",
|
||||||
|
"nodeType": "YulLiteral",
|
||||||
|
"src": "1353:1:1",
|
||||||
|
"type": "",
|
||||||
|
"value": "0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functionName":
|
||||||
|
{
|
||||||
|
"name": "revert",
|
||||||
|
"nodeType": "YulIdentifier",
|
||||||
|
"src": "1343:6:1"
|
||||||
|
},
|
||||||
|
"nodeType": "YulFunctionCall",
|
||||||
|
"src": "1343:12:1"
|
||||||
|
},
|
||||||
|
"nodeType": "YulExpressionStatement",
|
||||||
|
"src": "1343:12:1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"name": "revert_error_15abf5612cd996bc235ba1e55a4a30ac60e6bb601ff7ba4ad3f179b6be8d0490",
|
||||||
|
"nodeType": "YulFunctionDefinition",
|
||||||
|
"src": "1244:117:1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"body":
|
||||||
|
{
|
||||||
|
"nodeType": "YulBlock",
|
||||||
|
"src": "1456:28:1",
|
||||||
|
"statements":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"expression":
|
||||||
|
{
|
||||||
|
"arguments":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"kind": "number",
|
||||||
|
"nodeType": "YulLiteral",
|
||||||
|
"src": "1473:1:1",
|
||||||
|
"type": "",
|
||||||
|
"value": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "number",
|
||||||
|
"nodeType": "YulLiteral",
|
||||||
|
"src": "1476:1:1",
|
||||||
|
"type": "",
|
||||||
|
"value": "0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functionName":
|
||||||
|
{
|
||||||
|
"name": "revert",
|
||||||
|
"nodeType": "YulIdentifier",
|
||||||
|
"src": "1466:6:1"
|
||||||
|
},
|
||||||
|
"nodeType": "YulFunctionCall",
|
||||||
|
"src": "1466:12:1"
|
||||||
|
},
|
||||||
|
"nodeType": "YulExpressionStatement",
|
||||||
|
"src": "1466:12:1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"name": "revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d",
|
||||||
|
"nodeType": "YulFunctionDefinition",
|
||||||
|
"src": "1367:117:1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"body":
|
||||||
|
{
|
||||||
|
"nodeType": "YulBlock",
|
||||||
|
"src": "1579:28:1",
|
||||||
|
"statements":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"expression":
|
||||||
|
{
|
||||||
|
"arguments":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"kind": "number",
|
||||||
|
"nodeType": "YulLiteral",
|
||||||
|
"src": "1596:1:1",
|
||||||
|
"type": "",
|
||||||
|
"value": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "number",
|
||||||
|
"nodeType": "YulLiteral",
|
||||||
|
"src": "1599:1:1",
|
||||||
|
"type": "",
|
||||||
|
"value": "0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functionName":
|
||||||
|
{
|
||||||
|
"name": "revert",
|
||||||
|
"nodeType": "YulIdentifier",
|
||||||
|
"src": "1589:6:1"
|
||||||
|
},
|
||||||
|
"nodeType": "YulFunctionCall",
|
||||||
|
"src": "1589:12:1"
|
||||||
|
},
|
||||||
|
"nodeType": "YulExpressionStatement",
|
||||||
|
"src": "1589:12:1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"name": "revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef",
|
||||||
|
"nodeType": "YulFunctionDefinition",
|
||||||
|
"src": "1490:117:1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"body":
|
||||||
|
{
|
||||||
|
"nodeType": "YulBlock",
|
||||||
|
"src": "1702:28:1",
|
||||||
|
"statements":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"expression":
|
||||||
|
{
|
||||||
|
"arguments":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"kind": "number",
|
||||||
|
"nodeType": "YulLiteral",
|
||||||
|
"src": "1719:1:1",
|
||||||
|
"type": "",
|
||||||
|
"value": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "number",
|
||||||
|
"nodeType": "YulLiteral",
|
||||||
|
"src": "1722:1:1",
|
||||||
|
"type": "",
|
||||||
|
"value": "0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functionName":
|
||||||
|
{
|
||||||
|
"name": "revert",
|
||||||
|
"nodeType": "YulIdentifier",
|
||||||
|
"src": "1712:6:1"
|
||||||
|
},
|
||||||
|
"nodeType": "YulFunctionCall",
|
||||||
|
"src": "1712:12:1"
|
||||||
|
},
|
||||||
|
"nodeType": "YulExpressionStatement",
|
||||||
|
"src": "1712:12:1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db",
|
||||||
|
"nodeType": "YulFunctionDefinition",
|
||||||
|
"src": "1613:117:1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"body":
|
||||||
|
{
|
||||||
|
"nodeType": "YulBlock",
|
||||||
|
"src": "1825:28:1",
|
||||||
|
"statements":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"expression":
|
||||||
|
{
|
||||||
|
"arguments":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"kind": "number",
|
||||||
|
"nodeType": "YulLiteral",
|
||||||
|
"src": "1842:1:1",
|
||||||
|
"type": "",
|
||||||
|
"value": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"kind": "number",
|
||||||
|
"nodeType": "YulLiteral",
|
||||||
|
"src": "1845:1:1",
|
||||||
|
"type": "",
|
||||||
|
"value": "0"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"functionName":
|
||||||
|
{
|
||||||
|
"name": "revert",
|
||||||
|
"nodeType": "YulIdentifier",
|
||||||
|
"src": "1835:6:1"
|
||||||
|
},
|
||||||
|
"nodeType": "YulFunctionCall",
|
||||||
|
"src": "1835:12:1"
|
||||||
|
},
|
||||||
|
"nodeType": "YulExpressionStatement",
|
||||||
|
"src": "1835:12:1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
|
||||||
|
"nodeType": "YulFunctionDefinition",
|
||||||
|
"src": "1736:117:1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"contents": "{\n\n // uint256[]\n function abi_decode_t_array$_t_uint256_$dyn_calldata_ptr(offset, end) -> arrayPos, length {\n if iszero(slt(add(offset, 0x1f), end)) { revert(0, 0) }\n length := calldataload(offset)\n if gt(length, 0xffffffffffffffff) { revert(0, 0) }\n arrayPos := add(offset, 0x20)\n if gt(add(arrayPos, mul(length, 0x20)), end) { revert(0, 0) }\n }\n\n function abi_decode_tuple_t_array$_t_uint256_$dyn_calldata_ptr(headStart, dataEnd) -> value0, value1 {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n\n {\n\n let offset := calldataload(add(headStart, 0))\n if gt(offset, 0xffffffffffffffff) { revert(0, 0) }\n\n value0, value1 := abi_decode_t_array$_t_uint256_$dyn_calldata_ptr(add(headStart, offset), dataEnd)\n }\n\n }\n\n}\n",
|
"contents": "{\n\n // uint256[]\n function abi_decode_t_array$_t_uint256_$dyn_calldata_ptr(offset, end) -> arrayPos, length {\n if iszero(slt(add(offset, 0x1f), end)) { revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() }\n length := calldataload(offset)\n if gt(length, 0xffffffffffffffff) { revert_error_15abf5612cd996bc235ba1e55a4a30ac60e6bb601ff7ba4ad3f179b6be8d0490() }\n arrayPos := add(offset, 0x20)\n if gt(add(arrayPos, mul(length, 0x20)), end) { revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef() }\n }\n\n function abi_decode_tuple_t_array$_t_uint256_$dyn_calldata_ptr(headStart, dataEnd) -> value0, value1 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := calldataload(add(headStart, 0))\n if gt(offset, 0xffffffffffffffff) { revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() }\n\n value0, value1 := abi_decode_t_array$_t_uint256_$dyn_calldata_ptr(add(headStart, offset), dataEnd)\n }\n\n }\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function revert_error_15abf5612cd996bc235ba1e55a4a30ac60e6bb601ff7ba4ad3f179b6be8d0490() {\n revert(0, 0)\n }\n\n function revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() {\n revert(0, 0)\n }\n\n function revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef() {\n revert(0, 0)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n}\n",
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"language": "Yul",
|
"language": "Yul",
|
||||||
"name": "#utility.yul"
|
"name": "#utility.yul"
|
||||||
|
@ -10,7 +10,7 @@ IR:
|
|||||||
object "C_81" {
|
object "C_81" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
constructor_C_81()
|
constructor_C_81()
|
||||||
|
|
||||||
@ -27,6 +27,10 @@ object "C_81" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
object "C_81_deployed" {
|
object "C_81_deployed" {
|
||||||
code {
|
code {
|
||||||
@ -41,7 +45,7 @@ object "C_81" {
|
|||||||
{
|
{
|
||||||
// f(uint256,uint256,uint256,uint256)
|
// f(uint256,uint256,uint256,uint256)
|
||||||
|
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
let param_0, param_1, param_2, param_3 := abi_decode_tuple_t_uint256t_uint256t_uint256t_uint256(4, calldatasize())
|
let param_0, param_1, param_2, param_3 := abi_decode_tuple_t_uint256t_uint256t_uint256t_uint256(4, calldatasize())
|
||||||
let ret_0, ret_1, ret_2, ret_3 := fun_f_80(param_0, param_1, param_2, param_3)
|
let ret_0, ret_1, ret_2, ret_3 := fun_f_80(param_0, param_1, param_2, param_3)
|
||||||
let memPos := allocate_unbounded()
|
let memPos := allocate_unbounded()
|
||||||
@ -52,7 +56,7 @@ object "C_81" {
|
|||||||
default {}
|
default {}
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
function abi_decode_t_uint256(offset, end) -> value {
|
function abi_decode_t_uint256(offset, end) -> value {
|
||||||
value := calldataload(offset)
|
value := calldataload(offset)
|
||||||
@ -60,7 +64,7 @@ object "C_81" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function abi_decode_tuple_t_uint256t_uint256t_uint256t_uint256(headStart, dataEnd) -> value0, value1, value2, value3 {
|
function abi_decode_tuple_t_uint256t_uint256t_uint256t_uint256(headStart, dataEnd) -> value0, value1, value2, value3 {
|
||||||
if slt(sub(dataEnd, headStart), 128) { revert(0, 0) }
|
if slt(sub(dataEnd, headStart), 128) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -290,6 +294,22 @@ object "C_81" {
|
|||||||
revert(0, 0x24)
|
revert(0, 0x24)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
function shift_right_224_unsigned(value) -> newValue {
|
function shift_right_224_unsigned(value) -> newValue {
|
||||||
newValue :=
|
newValue :=
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ object "C_59" {
|
|||||||
for { } lt(i, _4) { i := add(i, 1) }
|
for { } lt(i, _4) { i := add(i, 1) }
|
||||||
{
|
{
|
||||||
if slt(sub(calldatasize(), src), _2) { revert(_1, _1) }
|
if slt(sub(calldatasize(), src), _2) { revert(_1, _1) }
|
||||||
let value := allocate_memory_1238()
|
let value := allocate_memory_1228()
|
||||||
mstore(value, calldataload(src))
|
mstore(value, calldataload(src))
|
||||||
mstore(dst, value)
|
mstore(dst, value)
|
||||||
dst := add(dst, _2)
|
dst := add(dst, _2)
|
||||||
@ -76,7 +76,7 @@ object "C_59" {
|
|||||||
}
|
}
|
||||||
tail := add(add(headStart, and(add(length, 31), not(31))), 96)
|
tail := add(add(headStart, and(add(length, 31), not(31))), 96)
|
||||||
}
|
}
|
||||||
function allocate_memory_1238() -> memPtr
|
function allocate_memory_1228() -> memPtr
|
||||||
{
|
{
|
||||||
memPtr := mload(64)
|
memPtr := mload(64)
|
||||||
let newFreePtr := add(memPtr, 32)
|
let newFreePtr := add(memPtr, 32)
|
||||||
|
1
test/cmdlineTests/revert_strings/args
Normal file
1
test/cmdlineTests/revert_strings/args
Normal file
@ -0,0 +1 @@
|
|||||||
|
--revert-strings debug --ir
|
7
test/cmdlineTests/revert_strings/input.sol
Normal file
7
test/cmdlineTests/revert_strings/input.sol
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
pragma solidity >=0.0;
|
||||||
|
// SPDX-License-Identifier: GPL-3.0
|
||||||
|
contract C {
|
||||||
|
enum E { X }
|
||||||
|
function f(uint[][] memory, E e) public pure {
|
||||||
|
}
|
||||||
|
}
|
362
test/cmdlineTests/revert_strings/output
Normal file
362
test/cmdlineTests/revert_strings/output
Normal file
@ -0,0 +1,362 @@
|
|||||||
|
IR:
|
||||||
|
/*******************************************************
|
||||||
|
* WARNING *
|
||||||
|
* Solidity to Yul compilation is still EXPERIMENTAL *
|
||||||
|
* It can result in LOSS OF FUNDS or worse *
|
||||||
|
* !USE AT YOUR OWN RISK! *
|
||||||
|
*******************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
object "C_15" {
|
||||||
|
code {
|
||||||
|
mstore(64, 128)
|
||||||
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
|
constructor_C_15()
|
||||||
|
|
||||||
|
let _1 := allocate_unbounded()
|
||||||
|
codecopy(_1, dataoffset("C_15_deployed"), datasize("C_15_deployed"))
|
||||||
|
|
||||||
|
return(_1, datasize("C_15_deployed"))
|
||||||
|
|
||||||
|
function allocate_unbounded() -> memPtr {
|
||||||
|
memPtr := mload(64)
|
||||||
|
}
|
||||||
|
|
||||||
|
function constructor_C_15() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
|
||||||
|
let start := allocate_unbounded()
|
||||||
|
let pos := start
|
||||||
|
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
|
||||||
|
pos := add(pos, 4)
|
||||||
|
mstore(pos, 0x20)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
mstore(pos, 34)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
|
||||||
|
mstore(add(pos, 0), "Ether sent to non-payable functi")
|
||||||
|
|
||||||
|
mstore(add(pos, 32), "on")
|
||||||
|
|
||||||
|
revert(start, 132)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
object "C_15_deployed" {
|
||||||
|
code {
|
||||||
|
mstore(64, 128)
|
||||||
|
|
||||||
|
if iszero(lt(calldatasize(), 4))
|
||||||
|
{
|
||||||
|
let selector := shift_right_224_unsigned(calldataload(0))
|
||||||
|
switch selector
|
||||||
|
|
||||||
|
case 0x02e8cd18
|
||||||
|
{
|
||||||
|
// f(uint256[][],uint8)
|
||||||
|
|
||||||
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
let param_0, param_1 := abi_decode_tuple_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptrt_enum$_E_$3(4, calldatasize())
|
||||||
|
fun_f_14(param_0, param_1)
|
||||||
|
let memPos := allocate_unbounded()
|
||||||
|
let memEnd := abi_encode_tuple__to__fromStack(memPos )
|
||||||
|
return(memPos, sub(memEnd, memPos))
|
||||||
|
}
|
||||||
|
|
||||||
|
default {}
|
||||||
|
}
|
||||||
|
if iszero(calldatasize()) { }
|
||||||
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
|
// uint256[][]
|
||||||
|
function abi_decode_available_length_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(offset, length, end) -> array {
|
||||||
|
array := allocate_memory(array_allocation_size_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(length))
|
||||||
|
let dst := array
|
||||||
|
|
||||||
|
mstore(array, length)
|
||||||
|
dst := add(array, 0x20)
|
||||||
|
|
||||||
|
let src := offset
|
||||||
|
if gt(add(src, mul(length, 0x20)), end) {
|
||||||
|
revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef()
|
||||||
|
}
|
||||||
|
for { let i := 0 } lt(i, length) { i := add(i, 1) }
|
||||||
|
{
|
||||||
|
|
||||||
|
let innerOffset := calldataload(src)
|
||||||
|
if gt(innerOffset, 0xffffffffffffffff) { revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() }
|
||||||
|
let elementPos := add(offset, innerOffset)
|
||||||
|
|
||||||
|
mstore(dst, abi_decode_t_array$_t_uint256_$dyn_memory_ptr(elementPos, end))
|
||||||
|
dst := add(dst, 0x20)
|
||||||
|
src := add(src, 0x20)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// uint256[]
|
||||||
|
function abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr(offset, length, end) -> array {
|
||||||
|
array := allocate_memory(array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length))
|
||||||
|
let dst := array
|
||||||
|
|
||||||
|
mstore(array, length)
|
||||||
|
dst := add(array, 0x20)
|
||||||
|
|
||||||
|
let src := offset
|
||||||
|
if gt(add(src, mul(length, 0x20)), end) {
|
||||||
|
revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef()
|
||||||
|
}
|
||||||
|
for { let i := 0 } lt(i, length) { i := add(i, 1) }
|
||||||
|
{
|
||||||
|
|
||||||
|
let elementPos := src
|
||||||
|
|
||||||
|
mstore(dst, abi_decode_t_uint256(elementPos, end))
|
||||||
|
dst := add(dst, 0x20)
|
||||||
|
src := add(src, 0x20)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// uint256[][]
|
||||||
|
function abi_decode_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(offset, end) -> array {
|
||||||
|
if iszero(slt(add(offset, 0x1f), end)) { revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() }
|
||||||
|
let length := calldataload(offset)
|
||||||
|
array := abi_decode_available_length_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(add(offset, 0x20), length, end)
|
||||||
|
}
|
||||||
|
|
||||||
|
// uint256[]
|
||||||
|
function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset, end) -> array {
|
||||||
|
if iszero(slt(add(offset, 0x1f), end)) { revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() }
|
||||||
|
let length := calldataload(offset)
|
||||||
|
array := abi_decode_available_length_t_array$_t_uint256_$dyn_memory_ptr(add(offset, 0x20), length, end)
|
||||||
|
}
|
||||||
|
|
||||||
|
function abi_decode_t_enum$_E_$3(offset, end) -> value {
|
||||||
|
value := calldataload(offset)
|
||||||
|
validator_revert_t_enum$_E_$3(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
function abi_decode_t_uint256(offset, end) -> value {
|
||||||
|
value := calldataload(offset)
|
||||||
|
validator_revert_t_uint256(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
function abi_decode_tuple_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptrt_enum$_E_$3(headStart, dataEnd) -> value0, value1 {
|
||||||
|
if slt(sub(dataEnd, headStart), 64) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
let offset := calldataload(add(headStart, 0))
|
||||||
|
if gt(offset, 0xffffffffffffffff) { revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() }
|
||||||
|
|
||||||
|
value0 := abi_decode_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(add(headStart, offset), dataEnd)
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
let offset := 32
|
||||||
|
|
||||||
|
value1 := abi_decode_t_enum$_E_$3(add(headStart, offset), dataEnd)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function abi_encode_tuple__to__fromStack(headStart ) -> tail {
|
||||||
|
tail := add(headStart, 0)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function allocate_memory(size) -> memPtr {
|
||||||
|
memPtr := allocate_unbounded()
|
||||||
|
finalize_allocation(memPtr, size)
|
||||||
|
}
|
||||||
|
|
||||||
|
function allocate_unbounded() -> memPtr {
|
||||||
|
memPtr := mload(64)
|
||||||
|
}
|
||||||
|
|
||||||
|
function array_allocation_size_t_array$_t_array$_t_uint256_$dyn_memory_ptr_$dyn_memory_ptr(length) -> size {
|
||||||
|
// Make sure we can allocate memory without overflow
|
||||||
|
if gt(length, 0xffffffffffffffff) { panic_error_0x41() }
|
||||||
|
|
||||||
|
size := mul(length, 0x20)
|
||||||
|
|
||||||
|
// add length slot
|
||||||
|
size := add(size, 0x20)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length) -> size {
|
||||||
|
// Make sure we can allocate memory without overflow
|
||||||
|
if gt(length, 0xffffffffffffffff) { panic_error_0x41() }
|
||||||
|
|
||||||
|
size := mul(length, 0x20)
|
||||||
|
|
||||||
|
// add length slot
|
||||||
|
size := add(size, 0x20)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanup_t_uint256(value) -> cleaned {
|
||||||
|
cleaned := value
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
function fun_f_14(var__7_mpos, var_e_10) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function panic_error_0x41() {
|
||||||
|
mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)
|
||||||
|
mstore(4, 0x41)
|
||||||
|
revert(0, 0x24)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_1b9f4a0a5773e33b91aa01db23bf8c55fce1411167c872835e7fa00a4f17d46d() {
|
||||||
|
|
||||||
|
let start := allocate_unbounded()
|
||||||
|
let pos := start
|
||||||
|
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
|
||||||
|
pos := add(pos, 4)
|
||||||
|
mstore(pos, 0x20)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
mstore(pos, 43)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
|
||||||
|
mstore(add(pos, 0), "ABI decoding: invalid calldata a")
|
||||||
|
|
||||||
|
mstore(add(pos, 32), "rray offset")
|
||||||
|
|
||||||
|
revert(start, 132)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
|
||||||
|
let start := allocate_unbounded()
|
||||||
|
let pos := start
|
||||||
|
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
|
||||||
|
pos := add(pos, 4)
|
||||||
|
mstore(pos, 0x20)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
mstore(pos, 53)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
|
||||||
|
mstore(add(pos, 0), "Contract does not have fallback ")
|
||||||
|
|
||||||
|
mstore(add(pos, 32), "nor receive functions")
|
||||||
|
|
||||||
|
revert(start, 132)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_81385d8c0b31fffe14be1da910c8bd3a80be4cfa248e04f42ec0faea3132a8ef() {
|
||||||
|
|
||||||
|
let start := allocate_unbounded()
|
||||||
|
let pos := start
|
||||||
|
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
|
||||||
|
pos := add(pos, 4)
|
||||||
|
mstore(pos, 0x20)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
mstore(pos, 43)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
|
||||||
|
mstore(add(pos, 0), "ABI decoding: invalid calldata a")
|
||||||
|
|
||||||
|
mstore(add(pos, 32), "rray stride")
|
||||||
|
|
||||||
|
revert(start, 132)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {
|
||||||
|
|
||||||
|
let start := allocate_unbounded()
|
||||||
|
let pos := start
|
||||||
|
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
|
||||||
|
pos := add(pos, 4)
|
||||||
|
mstore(pos, 0x20)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
mstore(pos, 34)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
|
||||||
|
mstore(add(pos, 0), "ABI decoding: invalid tuple offs")
|
||||||
|
|
||||||
|
mstore(add(pos, 32), "et")
|
||||||
|
|
||||||
|
revert(start, 132)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
|
||||||
|
let start := allocate_unbounded()
|
||||||
|
let pos := start
|
||||||
|
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
|
||||||
|
pos := add(pos, 4)
|
||||||
|
mstore(pos, 0x20)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
mstore(pos, 34)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
|
||||||
|
mstore(add(pos, 0), "Ether sent to non-payable functi")
|
||||||
|
|
||||||
|
mstore(add(pos, 32), "on")
|
||||||
|
|
||||||
|
revert(start, 132)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
|
||||||
|
|
||||||
|
let start := allocate_unbounded()
|
||||||
|
let pos := start
|
||||||
|
mstore(pos, 3963877391197344453575983046348115674221700746820753546331534351508065746944)
|
||||||
|
pos := add(pos, 4)
|
||||||
|
mstore(pos, 0x20)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
mstore(pos, 34)
|
||||||
|
pos := add(pos, 0x20)
|
||||||
|
|
||||||
|
mstore(add(pos, 0), "ABI decoding: tuple data too sho")
|
||||||
|
|
||||||
|
mstore(add(pos, 32), "rt")
|
||||||
|
|
||||||
|
revert(start, 132)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function round_up_to_mul_of_32(value) -> result {
|
||||||
|
result := and(add(value, 31), not(31))
|
||||||
|
}
|
||||||
|
|
||||||
|
function shift_right_224_unsigned(value) -> newValue {
|
||||||
|
newValue :=
|
||||||
|
|
||||||
|
shr(224, value)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function validator_revert_t_enum$_E_$3(value) {
|
||||||
|
if iszero(lt(value, 1)) { revert(0, 0) }
|
||||||
|
}
|
||||||
|
|
||||||
|
function validator_revert_t_uint256(value) {
|
||||||
|
if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
@ -8,7 +8,10 @@
|
|||||||
object \"C_7\" {
|
object \"C_7\" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue()
|
||||||
|
{
|
||||||
|
revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()
|
||||||
|
}
|
||||||
constructor_C_7()
|
constructor_C_7()
|
||||||
let _1 := allocate_unbounded()
|
let _1 := allocate_unbounded()
|
||||||
codecopy(_1, dataoffset(\"C_7_deployed\"), datasize(\"C_7_deployed\"))
|
codecopy(_1, dataoffset(\"C_7_deployed\"), datasize(\"C_7_deployed\"))
|
||||||
@ -17,6 +20,8 @@ object \"C_7\" {
|
|||||||
{ memPtr := mload(64) }
|
{ memPtr := mload(64) }
|
||||||
function constructor_C_7()
|
function constructor_C_7()
|
||||||
{ }
|
{ }
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()
|
||||||
|
{ revert(0, 0) }
|
||||||
}
|
}
|
||||||
object \"C_7_deployed\" {
|
object \"C_7_deployed\" {
|
||||||
code {
|
code {
|
||||||
@ -26,7 +31,10 @@ object \"C_7\" {
|
|||||||
let selector := shift_right_224_unsigned(calldataload(0))
|
let selector := shift_right_224_unsigned(calldataload(0))
|
||||||
switch selector
|
switch selector
|
||||||
case 0x26121ff0 {
|
case 0x26121ff0 {
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue()
|
||||||
|
{
|
||||||
|
revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()
|
||||||
|
}
|
||||||
abi_decode_tuple_(4, calldatasize())
|
abi_decode_tuple_(4, calldatasize())
|
||||||
fun_f_6()
|
fun_f_6()
|
||||||
let memPos := allocate_unbounded()
|
let memPos := allocate_unbounded()
|
||||||
@ -36,10 +44,13 @@ object \"C_7\" {
|
|||||||
default { }
|
default { }
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
function abi_decode_tuple_(headStart, dataEnd)
|
function abi_decode_tuple_(headStart, dataEnd)
|
||||||
{
|
{
|
||||||
if slt(sub(dataEnd, headStart), 0) { revert(0, 0) }
|
if slt(sub(dataEnd, headStart), 0)
|
||||||
|
{
|
||||||
|
revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function abi_encode_tuple__to__fromStack(headStart) -> tail
|
function abi_encode_tuple__to__fromStack(headStart) -> tail
|
||||||
{ tail := add(headStart, 0) }
|
{ tail := add(headStart, 0) }
|
||||||
@ -47,6 +58,12 @@ object \"C_7\" {
|
|||||||
{ memPtr := mload(64) }
|
{ memPtr := mload(64) }
|
||||||
function fun_f_6()
|
function fun_f_6()
|
||||||
{ }
|
{ }
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
{ revert(0, 0) }
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()
|
||||||
|
{ revert(0, 0) }
|
||||||
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b()
|
||||||
|
{ revert(0, 0) }
|
||||||
function shift_right_224_unsigned(value) -> newValue
|
function shift_right_224_unsigned(value) -> newValue
|
||||||
{ newValue := shr(224, value) }
|
{ newValue := shr(224, value) }
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
object \"C_7\" {
|
object \"C_7\" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
constructor_C_7()
|
constructor_C_7()
|
||||||
|
|
||||||
@ -26,6 +26,10 @@ object \"C_7\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
object \"C_7_deployed\" {
|
object \"C_7_deployed\" {
|
||||||
code {
|
code {
|
||||||
@ -40,7 +44,7 @@ object \"C_7\" {
|
|||||||
{
|
{
|
||||||
// f()
|
// f()
|
||||||
|
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
abi_decode_tuple_(4, calldatasize())
|
abi_decode_tuple_(4, calldatasize())
|
||||||
fun_f_6()
|
fun_f_6()
|
||||||
let memPos := allocate_unbounded()
|
let memPos := allocate_unbounded()
|
||||||
@ -51,10 +55,10 @@ object \"C_7\" {
|
|||||||
default {}
|
default {}
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
function abi_decode_tuple_(headStart, dataEnd) {
|
function abi_decode_tuple_(headStart, dataEnd) {
|
||||||
if slt(sub(dataEnd, headStart), 0) { revert(0, 0) }
|
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,6 +75,18 @@ object \"C_7\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
function shift_right_224_unsigned(value) -> newValue {
|
function shift_right_224_unsigned(value) -> newValue {
|
||||||
newValue :=
|
newValue :=
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
object \"C_3\" {
|
object \"C_3\" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
constructor_C_3()
|
constructor_C_3()
|
||||||
|
|
||||||
@ -26,6 +26,10 @@ object \"C_3\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
object \"C_3_deployed\" {
|
object \"C_3_deployed\" {
|
||||||
code {
|
code {
|
||||||
@ -39,7 +43,15 @@ object \"C_3\" {
|
|||||||
default {}
|
default {}
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
|
function allocate_unbounded() -> memPtr {
|
||||||
|
memPtr := mload(64)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
function shift_right_224_unsigned(value) -> newValue {
|
function shift_right_224_unsigned(value) -> newValue {
|
||||||
newValue :=
|
newValue :=
|
||||||
@ -65,7 +77,7 @@ object \"C_3\" {
|
|||||||
object \"D_16\" {
|
object \"D_16\" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
constructor_D_16()
|
constructor_D_16()
|
||||||
|
|
||||||
@ -82,6 +94,10 @@ object \"D_16\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
object \"D_16_deployed\" {
|
object \"D_16_deployed\" {
|
||||||
code {
|
code {
|
||||||
@ -96,7 +112,7 @@ object \"D_16\" {
|
|||||||
{
|
{
|
||||||
// f()
|
// f()
|
||||||
|
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
abi_decode_tuple_(4, calldatasize())
|
abi_decode_tuple_(4, calldatasize())
|
||||||
fun_f_15()
|
fun_f_15()
|
||||||
let memPos := allocate_unbounded()
|
let memPos := allocate_unbounded()
|
||||||
@ -107,10 +123,10 @@ object \"D_16\" {
|
|||||||
default {}
|
default {}
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
function abi_decode_tuple_(headStart, dataEnd) {
|
function abi_decode_tuple_(headStart, dataEnd) {
|
||||||
if slt(sub(dataEnd, headStart), 0) { revert(0, 0) }
|
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,6 +161,18 @@ object \"D_16\" {
|
|||||||
revert(0, 0x24)
|
revert(0, 0x24)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
function revert_forward_1() {
|
function revert_forward_1() {
|
||||||
let pos := allocate_unbounded()
|
let pos := allocate_unbounded()
|
||||||
returndatacopy(pos, 0, returndatasize())
|
returndatacopy(pos, 0, returndatasize())
|
||||||
@ -169,7 +197,7 @@ object \"D_16\" {
|
|||||||
object \"C_3\" {
|
object \"C_3\" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
constructor_C_3()
|
constructor_C_3()
|
||||||
|
|
||||||
@ -186,6 +214,10 @@ object \"D_16\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
object \"C_3_deployed\" {
|
object \"C_3_deployed\" {
|
||||||
code {
|
code {
|
||||||
@ -199,7 +231,15 @@ object \"D_16\" {
|
|||||||
default {}
|
default {}
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
|
function allocate_unbounded() -> memPtr {
|
||||||
|
memPtr := mload(64)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
function shift_right_224_unsigned(value) -> newValue {
|
function shift_right_224_unsigned(value) -> newValue {
|
||||||
newValue :=
|
newValue :=
|
||||||
|
@ -10,7 +10,7 @@ IR:
|
|||||||
object "test_11" {
|
object "test_11" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
constructor_test_11()
|
constructor_test_11()
|
||||||
|
|
||||||
@ -27,6 +27,10 @@ object "test_11" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
object "test_11_deployed" {
|
object "test_11_deployed" {
|
||||||
code {
|
code {
|
||||||
@ -41,7 +45,7 @@ object "test_11" {
|
|||||||
{
|
{
|
||||||
// f()
|
// f()
|
||||||
|
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
abi_decode_tuple_(4, calldatasize())
|
abi_decode_tuple_(4, calldatasize())
|
||||||
let ret_0 := fun_f_10()
|
let ret_0 := fun_f_10()
|
||||||
let memPos := allocate_unbounded()
|
let memPos := allocate_unbounded()
|
||||||
@ -52,10 +56,10 @@ object "test_11" {
|
|||||||
default {}
|
default {}
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
function abi_decode_tuple_(headStart, dataEnd) {
|
function abi_decode_tuple_(headStart, dataEnd) {
|
||||||
if slt(sub(dataEnd, headStart), 0) { revert(0, 0) }
|
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,6 +92,18 @@ object "test_11" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
function shift_right_224_unsigned(value) -> newValue {
|
function shift_right_224_unsigned(value) -> newValue {
|
||||||
newValue :=
|
newValue :=
|
||||||
|
|
||||||
|
@ -10,13 +10,18 @@ object "C_7" {
|
|||||||
code {
|
code {
|
||||||
{
|
{
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue()
|
||||||
|
{
|
||||||
|
revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()
|
||||||
|
}
|
||||||
let _1 := allocate_unbounded()
|
let _1 := allocate_unbounded()
|
||||||
codecopy(_1, dataoffset("C_7_deployed"), datasize("C_7_deployed"))
|
codecopy(_1, dataoffset("C_7_deployed"), datasize("C_7_deployed"))
|
||||||
return(_1, datasize("C_7_deployed"))
|
return(_1, datasize("C_7_deployed"))
|
||||||
}
|
}
|
||||||
function allocate_unbounded() -> memPtr
|
function allocate_unbounded() -> memPtr
|
||||||
{ memPtr := mload(64) }
|
{ memPtr := mload(64) }
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()
|
||||||
|
{ revert(0, 0) }
|
||||||
}
|
}
|
||||||
object "C_7_deployed" {
|
object "C_7_deployed" {
|
||||||
code {
|
code {
|
||||||
@ -28,8 +33,10 @@ object "C_7" {
|
|||||||
pop(selector)
|
pop(selector)
|
||||||
}
|
}
|
||||||
pop(iszero(calldatasize()))
|
pop(iszero(calldatasize()))
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
}
|
}
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
{ revert(0, 0) }
|
||||||
function shift_right_unsigned(value) -> newValue
|
function shift_right_unsigned(value) -> newValue
|
||||||
{ newValue := shr(224, value) }
|
{ newValue := shr(224, value) }
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
object \"C_11\" {
|
object \"C_11\" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
constructor_C_11()
|
constructor_C_11()
|
||||||
|
|
||||||
@ -26,6 +26,10 @@ object \"C_11\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
object \"C_11_deployed\" {
|
object \"C_11_deployed\" {
|
||||||
code {
|
code {
|
||||||
@ -40,7 +44,7 @@ object \"C_11\" {
|
|||||||
{
|
{
|
||||||
// f()
|
// f()
|
||||||
|
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
abi_decode_tuple_(4, calldatasize())
|
abi_decode_tuple_(4, calldatasize())
|
||||||
let ret_0 := fun_f_10()
|
let ret_0 := fun_f_10()
|
||||||
let memPos := allocate_unbounded()
|
let memPos := allocate_unbounded()
|
||||||
@ -51,10 +55,10 @@ object \"C_11\" {
|
|||||||
default {}
|
default {}
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
function abi_decode_tuple_(headStart, dataEnd) {
|
function abi_decode_tuple_(headStart, dataEnd) {
|
||||||
if slt(sub(dataEnd, headStart), 0) { revert(0, 0) }
|
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,6 +160,18 @@ object \"C_11\" {
|
|||||||
revert(0, 0x24)
|
revert(0, 0x24)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
function round_up_to_mul_of_32(value) -> result {
|
function round_up_to_mul_of_32(value) -> result {
|
||||||
result := and(add(value, 31), not(31))
|
result := and(add(value, 31), not(31))
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
object \"C_11\" {
|
object \"C_11\" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
constructor_C_11()
|
constructor_C_11()
|
||||||
|
|
||||||
@ -26,6 +26,10 @@ object \"C_11\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
object \"C_11_deployed\" {
|
object \"C_11_deployed\" {
|
||||||
code {
|
code {
|
||||||
@ -40,7 +44,7 @@ object \"C_11\" {
|
|||||||
{
|
{
|
||||||
// f()
|
// f()
|
||||||
|
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
abi_decode_tuple_(4, calldatasize())
|
abi_decode_tuple_(4, calldatasize())
|
||||||
let ret_0 := fun_f_10()
|
let ret_0 := fun_f_10()
|
||||||
let memPos := allocate_unbounded()
|
let memPos := allocate_unbounded()
|
||||||
@ -51,10 +55,10 @@ object \"C_11\" {
|
|||||||
default {}
|
default {}
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
function abi_decode_tuple_(headStart, dataEnd) {
|
function abi_decode_tuple_(headStart, dataEnd) {
|
||||||
if slt(sub(dataEnd, headStart), 0) { revert(0, 0) }
|
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,6 +94,18 @@ object \"C_11\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
function shift_right_224_unsigned(value) -> newValue {
|
function shift_right_224_unsigned(value) -> newValue {
|
||||||
newValue :=
|
newValue :=
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
object \"C_11\" {
|
object \"C_11\" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
constructor_C_11()
|
constructor_C_11()
|
||||||
|
|
||||||
@ -26,6 +26,10 @@ object \"C_11\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
object \"C_11_deployed\" {
|
object \"C_11_deployed\" {
|
||||||
code {
|
code {
|
||||||
@ -40,7 +44,7 @@ object \"C_11\" {
|
|||||||
{
|
{
|
||||||
// f()
|
// f()
|
||||||
|
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
abi_decode_tuple_(4, calldatasize())
|
abi_decode_tuple_(4, calldatasize())
|
||||||
let ret_0 := fun_f_10()
|
let ret_0 := fun_f_10()
|
||||||
let memPos := allocate_unbounded()
|
let memPos := allocate_unbounded()
|
||||||
@ -51,10 +55,10 @@ object \"C_11\" {
|
|||||||
default {}
|
default {}
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
function abi_decode_tuple_(headStart, dataEnd) {
|
function abi_decode_tuple_(headStart, dataEnd) {
|
||||||
if slt(sub(dataEnd, headStart), 0) { revert(0, 0) }
|
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,6 +99,18 @@ object \"C_11\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
function shift_left_224(value) -> newValue {
|
function shift_left_224(value) -> newValue {
|
||||||
newValue :=
|
newValue :=
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
object \"C_11\" {
|
object \"C_11\" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
constructor_C_11()
|
constructor_C_11()
|
||||||
|
|
||||||
@ -26,6 +26,10 @@ object \"C_11\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
object \"C_11_deployed\" {
|
object \"C_11_deployed\" {
|
||||||
code {
|
code {
|
||||||
@ -40,7 +44,7 @@ object \"C_11\" {
|
|||||||
{
|
{
|
||||||
// f()
|
// f()
|
||||||
|
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
abi_decode_tuple_(4, calldatasize())
|
abi_decode_tuple_(4, calldatasize())
|
||||||
let ret_0 := fun_f_10()
|
let ret_0 := fun_f_10()
|
||||||
let memPos := allocate_unbounded()
|
let memPos := allocate_unbounded()
|
||||||
@ -51,10 +55,10 @@ object \"C_11\" {
|
|||||||
default {}
|
default {}
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
function abi_decode_tuple_(headStart, dataEnd) {
|
function abi_decode_tuple_(headStart, dataEnd) {
|
||||||
if slt(sub(dataEnd, headStart), 0) { revert(0, 0) }
|
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,6 +160,18 @@ object \"C_11\" {
|
|||||||
revert(0, 0x24)
|
revert(0, 0x24)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
function round_up_to_mul_of_32(value) -> result {
|
function round_up_to_mul_of_32(value) -> result {
|
||||||
result := and(add(value, 31), not(31))
|
result := and(add(value, 31), not(31))
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
object \"C_11\" {
|
object \"C_11\" {
|
||||||
code {
|
code {
|
||||||
mstore(64, 128)
|
mstore(64, 128)
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
|
|
||||||
constructor_C_11()
|
constructor_C_11()
|
||||||
|
|
||||||
@ -26,6 +26,10 @@ object \"C_11\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
object \"C_11_deployed\" {
|
object \"C_11_deployed\" {
|
||||||
code {
|
code {
|
||||||
@ -40,7 +44,7 @@ object \"C_11\" {
|
|||||||
{
|
{
|
||||||
// f()
|
// f()
|
||||||
|
|
||||||
if callvalue() { revert(0, 0) }
|
if callvalue() { revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() }
|
||||||
abi_decode_tuple_(4, calldatasize())
|
abi_decode_tuple_(4, calldatasize())
|
||||||
let ret_0 := fun_f_10()
|
let ret_0 := fun_f_10()
|
||||||
let memPos := allocate_unbounded()
|
let memPos := allocate_unbounded()
|
||||||
@ -51,10 +55,10 @@ object \"C_11\" {
|
|||||||
default {}
|
default {}
|
||||||
}
|
}
|
||||||
if iszero(calldatasize()) { }
|
if iszero(calldatasize()) { }
|
||||||
revert(0, 0)
|
revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()
|
||||||
|
|
||||||
function abi_decode_tuple_(headStart, dataEnd) {
|
function abi_decode_tuple_(headStart, dataEnd) {
|
||||||
if slt(sub(dataEnd, headStart), 0) { revert(0, 0) }
|
if slt(sub(dataEnd, headStart), 0) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,6 +99,18 @@ object \"C_11\" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {
|
||||||
|
revert(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
function shift_left_224(value) -> newValue {
|
function shift_left_224(value) -> newValue {
|
||||||
newValue :=
|
newValue :=
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@ contract C {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// creation:
|
// creation:
|
||||||
// codeDepositCost: 1211600
|
// codeDepositCost: 1259800
|
||||||
// executionCost: 1261
|
// executionCost: 1308
|
||||||
// totalCost: 1212861
|
// totalCost: 1261108
|
||||||
// external:
|
// external:
|
||||||
// a(): 1130
|
// a(): 1130
|
||||||
// b(uint256): infinite
|
// b(uint256): infinite
|
||||||
|
@ -17,9 +17,9 @@ contract C {
|
|||||||
// optimize-yul: true
|
// optimize-yul: true
|
||||||
// ----
|
// ----
|
||||||
// creation:
|
// creation:
|
||||||
// codeDepositCost: 681000
|
// codeDepositCost: 680600
|
||||||
// executionCost: 715
|
// executionCost: 715
|
||||||
// totalCost: 681715
|
// totalCost: 681315
|
||||||
// external:
|
// external:
|
||||||
// a(): 985
|
// a(): 985
|
||||||
// b(uint256): 2052
|
// b(uint256): 2052
|
||||||
|
@ -24,9 +24,9 @@ contract Large {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// creation:
|
// creation:
|
||||||
// codeDepositCost: 902600
|
// codeDepositCost: 904400
|
||||||
// executionCost: 942
|
// executionCost: 942
|
||||||
// totalCost: 903542
|
// totalCost: 905342
|
||||||
// external:
|
// external:
|
||||||
// a(): 1175
|
// a(): 1175
|
||||||
// b(uint256): infinite
|
// b(uint256): infinite
|
||||||
|
@ -11,9 +11,9 @@ contract Medium {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// creation:
|
// creation:
|
||||||
// codeDepositCost: 349600
|
// codeDepositCost: 351400
|
||||||
// executionCost: 386
|
// executionCost: 386
|
||||||
// totalCost: 349986
|
// totalCost: 351786
|
||||||
// external:
|
// external:
|
||||||
// a(): 1152
|
// a(): 1152
|
||||||
// b(uint256): infinite
|
// b(uint256): infinite
|
||||||
|
@ -6,9 +6,9 @@ contract Small {
|
|||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// creation:
|
// creation:
|
||||||
// codeDepositCost: 112800
|
// codeDepositCost: 114600
|
||||||
// executionCost: 159
|
// executionCost: 159
|
||||||
// totalCost: 112959
|
// totalCost: 114759
|
||||||
// external:
|
// external:
|
||||||
// fallback: 129
|
// fallback: 129
|
||||||
// a(): 1107
|
// a(): 1107
|
||||||
|
@ -19,9 +19,9 @@ contract C {
|
|||||||
// optimize-yul: false
|
// optimize-yul: false
|
||||||
// ----
|
// ----
|
||||||
// creation:
|
// creation:
|
||||||
// codeDepositCost: 109000
|
// codeDepositCost: 110800
|
||||||
// executionCost: 159
|
// executionCost: 159
|
||||||
// totalCost: 109159
|
// totalCost: 110959
|
||||||
// external:
|
// external:
|
||||||
// exp_neg_one(uint256): 2259
|
// exp_neg_one(uint256): 2259
|
||||||
// exp_one(uint256): infinite
|
// exp_one(uint256): infinite
|
||||||
|
@ -37,7 +37,7 @@ contract c {
|
|||||||
// compileViaYul: also
|
// compileViaYul: also
|
||||||
// ----
|
// ----
|
||||||
// test() -> 0x02000202
|
// test() -> 0x02000202
|
||||||
// gas irOptimized: 2470372
|
// gas irOptimized: 2476392
|
||||||
// gas legacy: 2288641
|
// gas legacy: 2288641
|
||||||
// gas legacyOptimized: 2258654
|
// gas legacyOptimized: 2258654
|
||||||
// storageEmpty -> 1
|
// storageEmpty -> 1
|
||||||
|
@ -22,5 +22,5 @@ contract B {
|
|||||||
// ----
|
// ----
|
||||||
// f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004
|
// f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004
|
||||||
// gas irOptimized: 135883
|
// gas irOptimized: 135883
|
||||||
// gas legacy: 264410
|
// gas legacy: 266210
|
||||||
// gas legacyOptimized: 135699
|
// gas legacyOptimized: 135699
|
||||||
|
@ -46,5 +46,5 @@ contract C {
|
|||||||
// ----
|
// ----
|
||||||
// test() -> 5, 6, 7
|
// test() -> 5, 6, 7
|
||||||
// gas irOptimized: 345955
|
// gas irOptimized: 345955
|
||||||
// gas legacy: 500424
|
// gas legacy: 508437
|
||||||
// gas legacyOptimized: 309013
|
// gas legacyOptimized: 309013
|
||||||
|
@ -27,5 +27,5 @@ contract Creator {
|
|||||||
// ----
|
// ----
|
||||||
// f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8
|
// f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8
|
||||||
// gas irOptimized: 474718
|
// gas irOptimized: 474718
|
||||||
// gas legacy: 570900
|
// gas legacy: 578926
|
||||||
// gas legacyOptimized: 436724
|
// gas legacyOptimized: 436724
|
||||||
|
@ -27,5 +27,5 @@ contract Creator {
|
|||||||
// ----
|
// ----
|
||||||
// f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h"
|
// f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h"
|
||||||
// gas irOptimized: 330976
|
// gas irOptimized: 330976
|
||||||
// gas legacy: 414850
|
// gas legacy: 422873
|
||||||
// gas legacyOptimized: 292281
|
// gas legacyOptimized: 292281
|
||||||
|
@ -29,5 +29,5 @@ contract C {
|
|||||||
// ----
|
// ----
|
||||||
// t() -> 9
|
// t() -> 9
|
||||||
// gas irOptimized: 103953
|
// gas irOptimized: 103953
|
||||||
// gas legacy: 161097
|
// gas legacy: 162897
|
||||||
// gas legacyOptimized: 112116
|
// gas legacyOptimized: 112116
|
||||||
|
@ -24,7 +24,7 @@ contract D {
|
|||||||
// ----
|
// ----
|
||||||
// f() -> 1
|
// f() -> 1
|
||||||
// gas irOptimized: 86504
|
// gas irOptimized: 86504
|
||||||
// gas legacy: 114412
|
// gas legacy: 116212
|
||||||
// g() -> 5
|
// g() -> 5
|
||||||
// gas irOptimized: 86600
|
// gas irOptimized: 86600
|
||||||
// gas legacy: 114872
|
// gas legacy: 116672
|
||||||
|
@ -26,4 +26,4 @@ contract B {
|
|||||||
// ----
|
// ----
|
||||||
// g() -> 42
|
// g() -> 42
|
||||||
// gas irOptimized: 90635
|
// gas irOptimized: 90635
|
||||||
// gas legacy: 117797
|
// gas legacy: 126809
|
||||||
|
@ -26,5 +26,5 @@ contract B {
|
|||||||
// ----
|
// ----
|
||||||
// g() -> 42
|
// g() -> 42
|
||||||
// gas irOptimized: 119658
|
// gas irOptimized: 119658
|
||||||
// gas legacy: 180597
|
// gas legacy: 187809
|
||||||
// gas legacyOptimized: 117351
|
// gas legacyOptimized: 117351
|
||||||
|
@ -65,11 +65,11 @@ contract Test {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ====
|
// ====
|
||||||
// compileViaYul: also
|
|
||||||
// compileToEwasm: also
|
// compileToEwasm: also
|
||||||
|
// compileViaYul: also
|
||||||
// ----
|
// ----
|
||||||
// load() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
|
// load() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
|
||||||
// gas irOptimized: 111580
|
// gas irOptimized: 111532
|
||||||
// gas legacy: 113999
|
// gas legacy: 113999
|
||||||
// gas legacyOptimized: 106281
|
// gas legacyOptimized: 106281
|
||||||
// store() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
|
// store() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
|
||||||
|
Loading…
Reference in New Issue
Block a user