2020-11-23 18:06:44 +00:00
|
|
|
pragma abicoder v2;
|
2019-06-19 02:46:47 +00:00
|
|
|
|
|
|
|
// 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
|
2021-02-12 12:45:15 +00:00
|
|
|
// compileViaYul: also
|
2019-06-19 02:46:47 +00:00
|
|
|
// ----
|
2020-10-12 08:45:00 +00:00
|
|
|
// h(uint256[2][]): 0x20, 3, 123, 124, 223, 224, 323, 324 -> 32, 256, 0x20, 3, 123, 124, 223, 224, 323, 324
|
2021-04-22 14:07:57 +00:00
|
|
|
// gas irOptimized: 172488
|
2021-02-12 12:45:15 +00:00
|
|
|
// gas legacy: 175929
|
2021-03-11 11:17:50 +00:00
|
|
|
// gas legacyOptimized: 172504
|
2019-06-19 02:46:47 +00:00
|
|
|
// i(uint256[2][2]): 123, 124, 223, 224 -> 32, 128, 123, 124, 223, 224
|
2021-04-22 14:07:57 +00:00
|
|
|
// gas irOptimized: 107381
|
2021-02-12 12:45:15 +00:00
|
|
|
// gas legacy: 109868
|
|
|
|
// gas legacyOptimized: 107388
|