solidity/test/libsolidity/semanticTests/arithmetics/checked_modifier_called_by_unchecked.sol

14 lines
356 B
Solidity
Raw Normal View History

2020-09-30 22:13:03 +00:00
contract C {
modifier add(uint16 a, uint16 b) {
unchecked { a + b; }
_;
}
function f(uint16 a, uint16 b, uint16 c) public add(a, b) returns (uint16) {
return b + c;
}
}
// ----
// f(uint16,uint16,uint16): 0xe000, 0xe500, 2 -> 58626
2020-10-13 11:28:39 +00:00
// f(uint16,uint16,uint16): 0x1000, 0xe500, 0xe000 -> FAILURE, hex"4e487b71", 0x11