solidity/test/libsolidity/semanticTests/payable/no_nonpayable_circumvention_by_modifier.sol
2022-05-19 20:23:28 +02:00

17 lines
380 B
Solidity

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;
}
}
// ====
// compileToEwasm: also
// ----
// f(), 27 wei -> FAILURE
// balance -> 0