Skip to content

Commit 27da206

Browse files
committed
Adding explanation
Update Update
1 parent a227118 commit 27da206

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/contracts/fail/bytes1-packed.sol

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ contract C {
2323
mstore(0x40, add(dataPtr, dataLen))
2424

2525
// Perform the low-level call
26+
// this should call the inc() function, which has selector:
27+
//```
28+
//cast keccak "inc()"
29+
//0x371303c051bff726100ad13871cababf50c20dd920fca137e519f98f089a74b4
30+
//```
31+
// which happens to have the first 4 bytes as
32+
// 0x37, 0x13 0x03, 0xc0
33+
// This will increment `state` by 1, thereby violating the property
34+
2635
success := call(gas(), target, 0, dataPtr, dataLen, 0, 0)
2736
}
2837

0 commit comments

Comments
 (0)