-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Expand file tree
/
Copy pathstatic_array_v2.sol
More file actions
23 lines (22 loc) · 917 Bytes
/
static_array_v2.sol
File metadata and controls
23 lines (22 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
pragma abicoder v2;
contract C {
function gggggggg(uint8[2] calldata s) external pure returns (bytes memory) {
s[0]; // only this will validate.
return msg.data;
}
function f(uint256 a, uint256 b) public returns (bytes memory) {
uint8[2] memory m = [0,0];
assembly {
mstore(m, a)
mstore(add(m, 0x20), b)
}
return this.gggggggg(m);
}
}
// ====
// EVMVersion: >homestead
// ----
// f(uint256,uint256): 1, 1 -> 0x20, 0x44, hex"78b86ac6", 1, 1, hex"00000000000000000000000000000000000000000000000000000000"
// gggggggg(uint8[2]): 1, 1 -> 0x20, 0x44, hex"78b86ac6", 1, 1, hex"00000000000000000000000000000000000000000000000000000000"
// f(uint256,uint256): 0x0101, 0x0101 -> 0x20, 0x44, hex"78b86ac6", 1, 1, hex"00000000000000000000000000000000000000000000000000000000"
// gggggggg(uint8[2]): 0x0101, 0x0101 -> FAILURE