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

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