Skip to content

Commit 28aad7e

Browse files
committed
Add test with event where indexed parameters are not the first.
1 parent c09dc61 commit 28aad7e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
contract C {
2+
// Indexed parameters are always listed first in the output.
3+
// The data is the ABI encoding of just the non-indexed parameters,
4+
// so putting the indexed parameters "in between" would mess
5+
// up the offsets for the reader.
6+
event E(uint a, uint indexed r, uint b, bytes c);
7+
function deposit() public {
8+
emit E(1, 2, 3, "def");
9+
}
10+
}
11+
// ====
12+
// compileViaYul: also
13+
// ----
14+
// deposit() ->
15+
// ~ emit E(uint256,uint256,uint256,bytes): #0x02, 0x01, 0x03, 0x60, 0x03, "def"
16+
// gas irOptimized: 23685
17+
// gas legacy: 24170
18+
// gas legacyOptimized: 23753

0 commit comments

Comments
 (0)