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

     1  // SPDX-License-Identifier: GPL-3.0
     2  
     3  pragma solidity ^0.8.14;
     4  
     5  contract MyContract {
     6      bool locked = false;
     7  
     8      modifier validAddress(address account) {
     9          if (account == address(0x0)) {
    10              revert();
    11          }
    12          _;
    13      }
    14  
    15      modifier greaterThan(uint256 value, uint256 limit) {
    16          if (value <= limit) {
    17              revert();
    18          }
    19          _;
    20      }
    21  
    22      modifier lock() {
    23          if (locked) {
    24              locked = true;
    25              _;
    26              locked = false;
    27          }
    28      }
    29  
    30      function f(address account) public validAddress(account) {}
    31  
    32      function g(uint256 a) public greaterThan(a, 10) {}
    33  
    34      function refund() public payable {
    35          payable(msg.sender).transfer(0);
    36      }
    37  }