solidity/test/libsolidity/semanticTests/abiEncoderV2/storage_array_encoding.sol
Daniel Kirchner 1a0605c594 Update tests.
2021-11-03 12:39:55 +01:00

29 lines
809 B
Solidity

pragma abicoder v2;
// tests encoding from storage arrays
contract C {
uint256[2][] tmp_h;
function h(uint256[2][] calldata s) external returns (bytes memory) {
tmp_h = s;
return abi.encode(tmp_h);
}
uint256[2][2] tmp_i;
function i(uint256[2][2] calldata s) external returns (bytes memory) {
tmp_i = s;
return abi.encode(tmp_i);
}
}
// ====
// EVMVersion: >homestead
// compileViaYul: also
// ----
// h(uint256[2][]): 0x20, 3, 123, 124, 223, 224, 323, 324 -> 32, 256, 0x20, 3, 123, 124, 223, 224, 323, 324
// gas irOptimized: 180925
// gas legacy: 184929
// gas legacyOptimized: 181504
// i(uint256[2][2]): 123, 124, 223, 224 -> 32, 128, 123, 124, 223, 224
// gas irOptimized: 112535
// gas legacy: 115468
// gas legacyOptimized: 112988