2020-11-26 22:08:06 +00:00
|
|
|
contract C {
|
|
|
|
modifier tryCircumvent {
|
|
|
|
if (false) _; // avoid the function, we should still not accept ether
|
|
|
|
}
|
|
|
|
function f() tryCircumvent public returns (uint) {
|
|
|
|
return msgvalue();
|
|
|
|
}
|
|
|
|
function msgvalue() internal returns (uint) {
|
|
|
|
return msg.value;
|
|
|
|
}
|
|
|
|
// TODO: remove this helper function once isoltest supports balance checking
|
|
|
|
function balance() external returns (uint) {
|
|
|
|
return address(this).balance;
|
|
|
|
}
|
|
|
|
}
|
2020-11-30 17:59:49 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2021-04-23 15:59:01 +00:00
|
|
|
// compileToEwasm: also
|
2020-11-26 22:08:06 +00:00
|
|
|
// ----
|
|
|
|
// f(), 27 wei -> FAILURE
|
|
|
|
// balance() -> 0
|