1 2 3 4
contract C { modifier costs(uint _amount) { require(msg.value >= _amount); _; } function f() costs(1 ether) public payable {} }