solidity/test/libsolidity/semanticTests/modifiers/function_modifier.sol
2020-03-19 14:42:25 +01:00

14 lines
216 B
Solidity

contract C {
function getOne() public payable nonFree returns (uint256 r) {
return 1;
}
modifier nonFree {
if (msg.value > 0) _;
}
}
// ----
// getOne() -> 0
// getOne(), 1 wei -> 1