solidity/test/libsolidity/semanticTests/modifiers/function_modifier.sol

16 lines
247 B
Solidity
Raw Normal View History

contract C {
function getOne() public payable nonFree returns (uint256 r) {
return 1;
}
modifier nonFree {
if (msg.value > 0) _;
}
}
2020-11-30 17:59:49 +00:00
// ====
// compileViaYul: also
// ----
// getOne() -> 0
// getOne(), 1 wei -> 1