solidity/test/libsolidity/semanticTests/abiEncoderV2/calldata_nested_array_reencode.sol

23 lines
931 B
Solidity
Raw Normal View History

2022-04-07 11:37:48 +00:00
pragma abicoder v2;
contract C {
function h(uint[][] calldata a) public {
abi.encode(a);
}
struct S { uint[] x; }
function f(S calldata a) public {
abi.encode(a);
}
}
// ====
// revertStrings: debug
// ----
// h(uint256[][]): 0x20, 1, 0x20, 0 ->
2022-04-07 11:38:22 +00:00
// h(uint256[][]): 0x20, 1, 0x20, 1 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
// h(uint256[][]): 0x20, 1, 0x20, 2 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
2022-04-07 11:37:48 +00:00
// h(uint256[][]): 0x20, 1, 0x20, 3 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
// f((uint256[])): 0x20, 0x20, 0 ->
2022-04-07 11:38:22 +00:00
// f((uint256[])): 0x20, 0x20, 1 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
// f((uint256[])): 0x20, 0x20, 2 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
2022-04-07 11:37:48 +00:00
// f((uint256[])): 0x20, 0x20, 3 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"