github.com/iotexproject/iotex-core@v1.14.1-rc1/action/protocol/execution/testdata-istanbul/modifiers.sol (about)

     1  pragma solidity ^0.8.4;
     2  contract MyContract {
     3  
     4    bool locked = false;
     5  
     6    modifier validAddress(address account) {
     7      if (account == address(0x0)) { revert(); }
     8      _;
     9    }
    10  
    11    modifier greaterThan(uint value, uint limit) {
    12        if(value <= limit) { revert(); }
    13        _;
    14    }
    15  
    16    modifier lock() {
    17      if(locked) {
    18          locked = true;
    19          _;
    20          locked = false;
    21      }
    22    }
    23  
    24    function f(address account) public validAddress(account) {}
    25    function g(uint a) public greaterThan(a, 10) {}
    26    function refund() public payable {
    27        payable(msg.sender).transfer(0);
    28    }
    29  }