Skip to content

Commit d066dd2

Browse files
committed
Calldata validation tests
1 parent 3c0a735 commit d066dd2

7 files changed

+304
-15
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
pragma abicoder v2;
2+
3+
contract C {
4+
function f(uint[][] calldata a) public returns (uint[][] memory) {
5+
return a;
6+
}
7+
8+
function g(uint[][][] calldata a) public returns (uint[][][] memory) {
9+
return a;
10+
}
11+
12+
function h(uint[2][][] calldata a) public returns (uint[2][][] memory) {
13+
return a;
14+
}
15+
}
16+
17+
// ====
18+
// compileViaYul: also
19+
// ----
20+
// f(uint256[][]): 0x20, 2, 0x40, 0xa0, 2, 5, 6, 2, 7, 8 -> 0x20, 2, 0x40, 0xa0, 2, 5, 6, 2, 7, 8
21+
// f(uint256[][]): 0x20, 2, 0x40, 0xa0, 2, 5, 6, 2, 7, 8, 9 -> 0x20, 2, 0x40, 0xa0, 2, 5, 6, 2, 7, 8
22+
// f(uint256[][]): 0x20, 2, 0x40, 0xa0, 2, 5, 6, 3, 7, 8 -> FAILURE
23+
// g(uint256[][][]): 0x20, 2, 0x40, 0x60, 0, 2, 0x40, 0xa0, 2, 5, 6, 2, 7, 8 -> 0x20, 2, 0x40, 0x60, 0, 2, 0x40, 0xa0, 2, 5, 6, 2, 7, 8
24+
// g(uint256[][][]): 0x20, 2, 0x40, 0x60, 0, 2, 0x40, 0xa0, 2, 5, 6, 2, 7 -> FAILURE
25+
// h(uint256[2][][]): 0x20, 2, 0x40, 0x60, 0, 2, 5, 6, 7, 8 -> 0x20, 2, 0x40, 0x60, 0, 2, 5, 6, 7, 8
26+
// h(uint256[2][][]): 0x20, 2, 0x40, 0x60, 0, 2, 5, 6, 7, 8, 9 -> 0x20, 2, 0x40, 0x60, 0, 2, 5, 6, 7, 8
27+
// h(uint256[2][][]): 0x20, 2, 0x40, 0x60, 0, 2, 5, 6, 7 -> FAILURE
Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,37 @@
11
pragma abicoder v2;
22

33
contract C {
4-
function h(uint[][] calldata a) public {
5-
abi.encode(a);
6-
}
7-
struct S { uint[] x; }
8-
function f(S calldata a) public {
9-
abi.encode(a);
10-
}
4+
function f(uint[][] calldata a) public returns (bytes memory) {
5+
return abi.encode(a);
6+
}
7+
function g(uint8[][][] calldata a) public returns (bytes memory) {
8+
return abi.encode(a);
9+
}
10+
function h(uint16[][2][] calldata a) public returns (bytes memory) {
11+
return abi.encode(a);
12+
}
13+
function i(uint16[][][1] calldata a) public returns (bytes memory) {
14+
return abi.encode(a);
15+
}
16+
function j(uint16[2][][] calldata a) public returns (bytes memory) {
17+
return abi.encode(a);
18+
}
1119
}
1220
// ====
1321
// revertStrings: debug
22+
// compileViaYul: also
1423
// ----
15-
// h(uint256[][]): 0x20, 1, 0x20, 0 ->
16-
// h(uint256[][]): 0x20, 1, 0x20, 1 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
17-
// h(uint256[][]): 0x20, 1, 0x20, 2 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
18-
// h(uint256[][]): 0x20, 1, 0x20, 3 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
19-
// f((uint256[])): 0x20, 0x20, 0 ->
20-
// f((uint256[])): 0x20, 0x20, 1 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
21-
// f((uint256[])): 0x20, 0x20, 2 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
22-
// f((uint256[])): 0x20, 0x20, 3 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
24+
// f(uint256[][]): 0x20, 1, 0x20, 0 -> 0x20, 0x80, 0x20, 1, 0x20, 0
25+
// f(uint256[][]): 0x20, 1, 0x20, 1 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
26+
// f(uint256[][]): 0x20, 1, 0x20, 2 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
27+
// f(uint256[][]): 0x20, 1, 0x20, 3 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
28+
// g(uint8[][][]): 0x20, 2, 0x40, 0x0140, 2, 0x40, 0x80, 1, 10, 2, 11, 12, 0 -> 0x20, 0x01a0, 0x20, 2, 0x40, 0x0140, 2, 0x40, 0x80, 1, 10, 2, 11, 12, 0
29+
// g(uint8[][][]): 0x20, 2, 0x40, 0x0140, 2, 0x40, 0x80, 1, 10, 2, 11, 12 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access offset"
30+
// g(uint8[][][]): 0x20, 2, 0x40, 0x0140, 2, 0x40, 0x80, 1, 10, 2, 11, 12, 1, 0x20, 0 -> 0x20, 0x01e0, 0x20, 2, 0x40, 0x0140, 2, 0x40, 0x80, 1, 10, 2, 11, 12, 1, 0x20, 0
31+
// g(uint8[][][]): 0x20, 2, 0x40, 0x0140, 2, 0x40, 0x80, 1, 10, 2, 11, 12, 1, 0x20, 0, 1 -> 0x20, 0x01e0, 0x20, 2, 0x40, 0x0140, 2, 0x40, 0x80, 1, 10, 2, 11, 12, 1, 0x20, 0
32+
// h(uint16[][2][]): 0x20, 2, 0x40, 0x0120, 0x40, 0x80, 1, 10, 2, 11, 12, 0x40, 0x60, 0, 1, 13 -> 0x20, 0x0200, 0x20, 2, 0x40, 288, 0x40, 0x80, 1, 10, 2, 11, 12, 0x40, 0x60, 0, 1, 13
33+
// h(uint16[][2][]): 0x20, 2, 0x40, 0x0120, 0x40, 0x80, 1, 10, 2, 11, 12, 0x40, 0x60, 0, 1 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
34+
// i(uint16[][][1]): 0x20, 0x20, 2, 0x40, 0x80, 1, 10, 2, 11, 12 -> 0x20, 0x0140, 0x20, 0x20, 2, 0x40, 0x80, 1, 10, 2, 11, 12
35+
// i(uint16[][][1]): 0x20, 0x20, 2, 0x40, 0x80, 1, 10, 2, 11 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
36+
// j(uint16[2][][]): 0x20, 2, 0x40, 0xa0, 1, 0x0a, 11, 2, 12, 13, 14, 15 -> 0x20, 0x0180, 0x20, 2, 0x40, 0xa0, 1, 10, 11, 2, 12, 13, 14, 15
37+
// j(uint16[2][][]): 0x20, 2, 0x40, 0xa0, 1, 0x0a, 11, 2, 12, 13, 14 -> FAILURE, hex"08c379a0", 0x20, 0x1e, "Invalid calldata access stride"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
pragma abicoder v2;
2+
3+
contract C {
4+
uint[] s;
5+
uint[2] n;
6+
7+
function f_memory(uint[] calldata a, uint[2] calldata b) public returns (uint[] memory, uint[2] memory) {
8+
return (a, b);
9+
}
10+
11+
function f_encode(uint[] calldata a, uint[2] calldata b) public returns (bytes memory) {
12+
return abi.encode(a, b);
13+
}
14+
15+
function f_which(uint[] calldata a, uint[2] calldata b, uint which) public returns (bytes memory) {
16+
return abi.encode(a[which], b[1]);
17+
}
18+
19+
function f_storage(uint[] calldata a, uint[2] calldata b ) public returns (bytes memory) {
20+
s = a;
21+
n = b;
22+
return abi.encode(s);
23+
}
24+
}
25+
26+
// ====
27+
// compileViaYul: also
28+
// ----
29+
// f_memory(uint256[],uint256[2]): 0x20, 1, 2 -> 0x60, 0x01, 0x02, 1, 2
30+
// f_memory(uint256[],uint256[2]): 0x40, 1, 2, 5, 6 -> 0x60, 1, 2, 2, 5, 6
31+
// f_memory(uint256[],uint256[2]): 0x40, 1, 2, 5 -> FAILURE
32+
// f_encode(uint256[],uint256[2]): 0x20, 1, 2 -> 0x20, 0xa0, 0x60, 1, 2, 1, 2
33+
// f_encode(uint256[],uint256[2]): 0x40, 1, 2, 5, 6 -> 0x20, 0xc0, 0x60, 1, 2, 2, 5, 6
34+
// f_encode(uint256[],uint256[2]): 0x40, 1, 2, 5 -> FAILURE
35+
// f_which(uint256[],uint256[2],uint256): 0x40, 1, 2, 1, 5 -> 0x20, 0x40, 5, 2
36+
// f_which(uint256[],uint256[2],uint256): 0x40, 1, 2, 1, 5, 6 -> 0x20, 0x40, 5, 2
37+
// f_which(uint256[],uint256[2],uint256): 0x40, 1, 2, 1 -> FAILURE
38+
// f_storage(uint256[],uint256[2]): 0x20, 1, 2 -> 0x20, 0x60, 0x20, 1, 2
39+
// gas irOptimized: 111653
40+
// gas legacy: 112987
41+
// gas legacyOptimized: 112104
42+
// f_storage(uint256[],uint256[2]): 0x40, 1, 2, 5, 6 -> 0x20, 0x80, 0x20, 2, 5, 6
43+
// f_storage(uint256[],uint256[2]): 0x40, 1, 2, 5 -> FAILURE
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
pragma abicoder v2;
2+
3+
contract C {
4+
uint[] s;
5+
uint[2] n;
6+
7+
function f_memory(uint[][] calldata a) public returns (uint[][] memory) {
8+
return a;
9+
}
10+
11+
function f_encode(uint[][] calldata a) public returns (bytes memory) {
12+
return abi.encode(a);
13+
}
14+
15+
function f_which(uint[][] calldata a, uint which) public returns (uint[] memory) {
16+
return a[which];
17+
}
18+
}
19+
20+
// ====
21+
// compileViaYul: also
22+
// ----
23+
// f_memory(uint256[][]): 0x20, 2, 0x40, 0x40, 2, 1, 2 -> 0x20, 2, 0x40, 0xa0, 2, 1, 2, 2, 1, 2
24+
// f_memory(uint256[][]): 0x20, 2, 0x40, 0x60, 2, 1, 2 -> 0x20, 2, 0x40, 0xa0, 2, 1, 2, 1, 2
25+
// f_memory(uint256[][]): 0x20, 2, 0, 0x60, 2, 1, 2 -> 0x20, 2, 0x40, 0x60, 0, 1, 2
26+
// f_memory(uint256[][]): 0x20, 2, 0, 0x60, 2, 2, 2 -> FAILURE
27+
// f_encode(uint256[][]): 0x20, 2, 0x40, 0x40, 2, 1, 2 -> 0x20, 0x0140, 0x20, 2, 0x40, 0xa0, 2, 1, 2, 2, 1, 2
28+
// f_encode(uint256[][]): 0x20, 2, 0x40, 0x60, 2, 1, 2 -> 0x20, 0x0120, 0x20, 2, 0x40, 0xa0, 2, 1, 2, 1, 2
29+
// f_encode(uint256[][]): 0x20, 2, 0, 0x60, 2, 1, 2 -> 0x20, 0xe0, 0x20, 2, 0x40, 0x60, 0, 1, 2
30+
// f_encode(uint256[][]): 0x20, 2, 0, 0x60, 2, 2, 2 -> FAILURE
31+
// f_which(uint256[][],uint256): 0x40, 0, 2, 0x40, 0x40, 2, 1, 2 -> 0x20, 2, 1, 2
32+
// f_which(uint256[][],uint256): 0x40, 1, 2, 0x40, 0x40, 2, 1, 2 -> 0x20, 2, 1, 2
33+
// f_which(uint256[][],uint256): 0x40, 0, 2, 0x40, 0x60, 2, 1, 2 -> 0x20, 2, 1, 2
34+
// f_which(uint256[][],uint256): 0x40, 1, 2, 0x40, 0x60, 2, 1, 2 -> 0x20, 1, 2
35+
// f_which(uint256[][],uint256): 0x40, 0, 2, 0, 0x60, 2, 1, 2 -> 0x20, 0
36+
// f_which(uint256[][],uint256): 0x40, 1, 2, 0, 0x60, 2, 1, 2 -> 0x20, 1, 2
37+
// f_which(uint256[][],uint256): 0x40, 1, 2, 0, 0x60, 2, 2, 2 -> FAILURE
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
pragma abicoder v2;
2+
3+
contract C {
4+
struct D { uint[] x; }
5+
struct S { uint x; }
6+
7+
function f(D calldata a) public returns (bytes memory){
8+
return abi.encode(a);
9+
}
10+
11+
function g(D[2] calldata a) public returns (bytes memory) {
12+
return abi.encode(a);
13+
}
14+
15+
function h(D[][] calldata a) public returns (bytes memory) {
16+
return abi.encode(a);
17+
}
18+
19+
function i(D[2][] calldata a) public returns (bytes memory) {
20+
return abi.encode(a);
21+
}
22+
23+
function j(S[] memory a) public returns (bytes memory) {
24+
return abi.encode(a);
25+
}
26+
27+
function k(S[2] memory a) public returns (bytes memory) {
28+
return abi.encode(a);
29+
}
30+
31+
function l(S[][] memory a) public returns (bytes memory) {
32+
return abi.encode(a);
33+
}
34+
35+
}
36+
37+
// ====
38+
// compileViaYul: also
39+
// ----
40+
// f((uint256[])): 0x20, 0x20, 0 -> 0x20, 0x60, 0x20, 0x20, 0
41+
// f((uint256[])): 0x20, 0x20, 1 -> FAILURE
42+
// f((uint256[])): 0x20, 0x20, 2 -> FAILURE
43+
// f((uint256[])): 0x20, 0x20, 3 -> FAILURE
44+
// g((uint256[])[2]): 0x20, 0x40, 0xc0, 0x20, 2, 1, 2, 0x20, 1, 3 -> 0x20, 0x0140, 0x20, 0x40, 0xc0, 0x20, 2, 1, 2, 0x20, 1, 3
45+
// g((uint256[])[2]): 0x20, 0x40, 0xc0, 0x20, 2, 1, 2, 0x20, 1 -> FAILURE
46+
// h((uint256[])[][]): 0x20, 0x02, 0x40, 0x0180, 2, 0x40, 0xc0, 0x20, 2, 1, 2, 0x20, 1, 3, 1, 0x20, 0x20, 1, 1 -> 0x20, 0x0260, 0x20, 2, 0x40, 0x0180, 2, 0x40, 0xc0, 0x20, 2, 1, 2, 0x20, 1, 3, 1, 0x20, 0x20, 1, 1
47+
// h((uint256[])[][]): 0x20, 0x02, 0x40, 0x0180, 2, 0x40, 0xc0, 0x20, 2, 1, 2, 0x20, 1, 3, 1, 0x20, 0x20, 1 -> FAILURE
48+
// i((uint256[])[2][]): 0x20, 1, 0x20, 0x40, 0xc0, 0x20, 2, 1, 2, 0x20, 1, 3 -> 0x20, 0x0180, 0x20, 1, 0x20, 0x40, 0xc0, 0x20, 2, 1, 2, 0x20, 1, 3
49+
// i((uint256[])[2][]): 0x20, 1, 0x20, 0x40, 0xc0, 0x20, 2, 1, 2, 0x20, 1 -> FAILURE
50+
// j((uint256)[]): 0x20, 2, 1, 2 -> 0x20, 0x80, 0x20, 2, 1, 2
51+
// j((uint256)[]): 0x20, 2, 1 -> FAILURE
52+
// k((uint256)[2]): 1, 2 -> 0x20, 0x40, 1, 2
53+
// k((uint256)[2]): 1 -> FAILURE
54+
// l((uint256)[][]): 0x20, 2, 0x40, 0xa0, 2, 5, 6, 3, 7, 8, 9 -> 0x20, 0x0160, 0x20, 2, 0x40, 0xa0, 2, 5, 6, 3, 7, 8, 9
55+
// l((uint256)[][]): 0x20, 2, 0x40, 0xa0, 2, 5, 6, 3, 7, 8, 9, 10 -> 0x20, 0x0160, 0x20, 2, 0x40, 0xa0, 2, 5, 6, 3, 7, 8, 9
56+
// l((uint256)[][]): 0x20, 2, 0x40, 0xa0, 2, 5, 6, 3, 7, 8 -> FAILURE
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
pragma abicoder v2;
2+
3+
contract C {
4+
struct S { uint[] a; }
5+
6+
function f(uint[][] calldata s, uint i, uint j) public pure returns (bytes memory) {
7+
return abi.encode(s[i][j]);
8+
}
9+
10+
function g(uint[][][] calldata s, uint i, uint j, uint k) public pure returns (bytes memory) {
11+
return abi.encode(s[i][j][k]);
12+
}
13+
14+
function h(uint[][][1] calldata s, uint i) public pure returns (bytes memory) {
15+
return abi.encode(s[0][i]);
16+
}
17+
18+
function k(S[][] calldata s, uint i, uint j) public pure returns (bytes memory) {
19+
return abi.encode(s[i][j].a);
20+
}
21+
22+
function l(S[2][2] calldata s, uint i, uint j) public pure returns (bytes memory) {
23+
return abi.encode(s[i][j].a);
24+
}
25+
}
26+
27+
// ====
28+
// compileViaYul: also
29+
// revertStrings: debug
30+
// ----
31+
// f(uint256[][],uint256,uint256): 0x60, 0, 0, 2, 0x40, 0x80, 1, 7, 1, 8 -> 0x20, 0x20, 7
32+
// f(uint256[][],uint256,uint256): 0x60, 1, 0, 2, 0x40, 0x80, 1, 7, 1, 8 -> 0x20, 0x20, 8
33+
// g(uint256[][][],uint256,uint256,uint256): 0x80, 0, 0, 0, 2, 0x40, 0xc0, 1, 0x20, 1, 4, 2, 0x40, 0xa0, 2, 5, 6, 1, 7 -> 0x20, 0x20, 4
34+
// g(uint256[][][],uint256,uint256,uint256): 0x80, 1, 0, 1, 2, 0x40, 0xc0, 1, 0x20, 1, 4, 2, 0x40, 0xa0, 2, 5, 6, 1, 7 -> 0x20, 0x20, 6
35+
// g(uint256[][][],uint256,uint256,uint256): 0x80, 1, 0, 2, 2, 0x40, 0xc0, 1, 0x20, 1, 4, 2, 0x40, 0xa0, 2, 5, 6, 1, 7 -> FAILURE, hex"4e487b71", 0x32
36+
// g(uint256[][][],uint256,uint256,uint256): 0x80, 2, 0, 1, 2, 0x40, 0xc0, 1, 0x20, 1, 4, 2, 0x40, 0xa0, 2, 5, 6, 1, 7 -> FAILURE, hex"4e487b71", 0x32
37+
// h(uint256[][][1],uint256): 0x40, 1, 0x20, 2, 0x40, 0xA0, 2, 5, 6, 3, 7, 8, 9 -> 0x20, 0xa0, 0x20, 3, 7, 8, 9
38+
// h(uint256[][][1],uint256): 0x40, 2, 0x20, 2, 0x40, 0xA0, 2, 5, 6, 3, 7, 8, 9 -> FAILURE, hex"4e487b71", 0x32
39+
// k((uint256[])[][],uint256,uint256): 0x60, 0, 0, 2, 0x40, 0xe0, 1, 0x20, 0x20, 1, 6, 2, 0x40, 0xa0, 0x20, 1, 7, 0x20, 2, 8, 9 -> 0x20, 0x60, 0x20, 1, 6
40+
// k((uint256[])[][],uint256,uint256): 0x60, 0, 1, 2, 0x40, 0xe0, 1, 0x20, 0x20, 1, 6, 2, 0x40, 0xa0, 0x20, 1, 7, 0x20, 2, 8, 9 -> FAILURE, hex"4e487b71", 0x32
41+
// l((uint256[])[2][2],uint256,uint256): 0x60, 1, 1, 0x40, 0x0140, 0x40, 0xa0, 0x20, 1, 5, 0x20, 1, 6, 0x40, 0xa0, 0x20, 1, 7, 0x20, 2, 8, 9 -> 0x20, 0x80, 0x20, 2, 8, 9
42+
// l((uint256[])[2][2],uint256,uint256): 0x60, 1, 2, 0x40, 0x0140, 0x40, 0xa0, 0x20, 1, 5, 0x20, 1, 6, 0x40, 0xa0, 0x20, 1, 7, 0x20, 2, 8, 9 -> FAILURE, hex"4e487b71", 0x32
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
pragma abicoder v2;
2+
3+
contract C {
4+
uint[] aTmp;
5+
uint[2] bTmp;
6+
7+
function f_memory(uint[] calldata a) public returns (uint[] memory) {
8+
return a;
9+
}
10+
11+
function f_encode(uint[] calldata a) public returns (bytes memory) {
12+
return abi.encode(a);
13+
}
14+
15+
function f_storage(uint[] calldata a) public returns (bytes memory) {
16+
aTmp = a;
17+
return abi.encode(aTmp);
18+
}
19+
20+
function f_index(uint[] calldata a, uint which) public returns (uint) {
21+
return a[which];
22+
}
23+
24+
function g_memory(uint[] calldata a, uint[2] calldata b) public returns (uint[] memory, uint[2] memory) {
25+
return (a, b);
26+
}
27+
28+
function g_encode(uint[] calldata a, uint[2] calldata b) public returns (bytes memory) {
29+
return abi.encode(a, b);
30+
}
31+
32+
function g_storage(uint[] calldata a, uint[2] calldata b) public returns (bytes memory) {
33+
aTmp = a;
34+
bTmp = b;
35+
return abi.encode(aTmp, bTmp);
36+
}
37+
38+
function g_index(uint[] calldata a, uint[2] calldata b, uint which) public returns (uint, uint) {
39+
return (a[which], b[0]);
40+
}
41+
}
42+
43+
// ====
44+
// compileViaYul: also
45+
// ----
46+
// f_memory(uint256[]): 0x80, 9, 9, 9, 0 -> 0x20, 0
47+
// f_memory(uint256[]): 0x80, 9, 9, 9, 1, 7 -> 0x20, 1, 7
48+
// f_memory(uint256[]): 0x80, 9, 9, 9, 2, 7 -> FAILURE
49+
// f_encode(uint256[]): 0x80, 9, 9, 9, 0 -> 0x20, 0x40, 0x20, 0
50+
// f_encode(uint256[]): 0x80, 9, 9, 9, 1, 7 -> 0x20, 0x60, 0x20, 1, 7
51+
// f_encode(uint256[]): 0x80, 9, 9, 9, 2, 7 -> FAILURE
52+
// f_storage(uint256[]): 0x80, 9, 9, 9, 0 -> 0x20, 0x40, 0x20, 0
53+
// f_storage(uint256[]): 0x80, 9, 9, 9, 1, 7 -> 0x20, 0x60, 0x20, 1, 7
54+
// f_storage(uint256[]): 0x80, 9, 9, 9, 2, 7 -> FAILURE
55+
// f_index(uint256[],uint256): 0xa0, 0, 9, 9, 9, 2, 7, 8 -> 7
56+
// f_index(uint256[],uint256): 0xa0, 1, 9, 9, 9, 2, 7, 8 -> 8
57+
// f_index(uint256[],uint256): 0xa0, 2, 9, 9, 9, 2, 7, 8 -> FAILURE, hex"4e487b71", 0x32
58+
// g_memory(uint256[],uint256[2]): 0xc0, 1, 2, 9, 9, 9, 0 -> 0x60, 1, 2, 0
59+
// g_memory(uint256[],uint256[2]): 0xc0, 1, 2, 9, 9, 9, 1, 7 -> 0x60, 1, 2, 1, 7
60+
// g_memory(uint256[],uint256[2]): 0xc0, 1, 2, 9, 9, 9, 2, 7 -> FAILURE
61+
// g_encode(uint256[],uint256[2]): 0xc0, 1, 2, 9, 9, 9, 0 -> 0x20, 0x80, 0x60, 1, 2, 0
62+
// g_encode(uint256[],uint256[2]): 0xc0, 1, 2, 9, 9, 9, 1, 7 -> 0x20, 0xa0, 0x60, 1, 2, 1, 7
63+
// g_encode(uint256[],uint256[2]): 0xc0, 1, 2, 9, 9, 9, 2, 7 -> FAILURE
64+
// g_storage(uint256[],uint256[2]): 0xc0, 1, 2, 9, 9, 9, 0 -> 0x20, 0x80, 0x60, 1, 2, 0
65+
// g_storage(uint256[],uint256[2]): 0xc0, 1, 2, 9, 9, 9, 1, 7 -> 0x20, 0xa0, 0x60, 1, 2, 1, 7
66+
// g_storage(uint256[],uint256[2]): 0xc0, 1, 2, 9, 9, 9, 2, 7 -> FAILURE
67+
// g_index(uint256[],uint256[2],uint256): 0xe0, 1, 2, 0, 9, 9, 9, 2, 7, 8 -> 7, 1
68+
// g_index(uint256[],uint256[2],uint256): 0xe0, 1, 2, 1, 9, 9, 9, 2, 7, 8 -> 8, 1
69+
// g_index(uint256[],uint256[2],uint256): 0xe0, 1, 2, 1, 9, 9, 9, 2, 7 -> FAILURE

0 commit comments

Comments
 (0)