mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
22c7cd22b9
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
15 lines
358 B
Solidity
15 lines
358 B
Solidity
contract C {
|
|
bytes data;
|
|
|
|
function f(bytes memory _data) public returns (uint256, bytes memory) {
|
|
data = _data;
|
|
return abi.decode(data, (uint256, bytes));
|
|
}
|
|
}
|
|
|
|
// ----
|
|
// f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg"
|
|
// gas irOptimized: 135699
|
|
// gas legacy: 137325
|
|
// gas legacyOptimized: 136059
|