solidity/test/libsolidity/semanticTests/abiencodedecode/abi_decode_simple_storage.sol

17 lines
389 B
Solidity
Raw Normal View History

contract C {
bytes data;
function f(bytes memory _data) public returns (uint256, bytes memory) {
data = _data;
return abi.decode(data, (uint256, bytes));
}
}
2020-05-25 11:40:43 +00:00
2020-10-20 15:05:58 +00:00
// ====
// compileViaYul: also
// ----
// f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg"
// gas irOptimized: 130131
2021-02-12 12:45:15 +00:00
// gas legacy: 131690
2021-03-11 11:17:50 +00:00
// gas legacyOptimized: 130577