Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xC6e64729931f60D2c8Bc70A27D66D9E0c28D1BF9
Balance 0 ETH
Nonce 1
Code Size 4427 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

4427 bytes
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806378e979251161008c578063a9059cbb11610066578063a9059cbb146102a8578063be26ed7f146102d4578063dd62ed3e146102dc578063eb246b641461030a576100ea565b806378e979251461026c57806395d89b4114610274578063a457c2d71461027c576100ea565b806323b872dd116100c857806323b872dd146101c6578063313ce567146101fc578063395093511461021a57806370a0823114610246576100ea565b806306fdde03146100ef578063095ea7b31461016c57806318160ddd146101ac575b600080fd5b6100f761037c565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610131578181015183820152602001610119565b50505050905090810190601f16801561015e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101986004803603604081101561018257600080fd5b506001600160a01b038135169060200135610412565b604080519115158252519081900360200190f35b6101b4610430565b60408051918252519081900360200190f35b610198600480360360608110156101dc57600080fd5b506001600160a01b0381358116916020810135909116906040013561044f565b6102046104dc565b6040805160ff9092168252519081900360200190f35b6101986004803603604081101561023057600080fd5b506001600160a01b0381351690602001356104e5565b6101b46004803603602081101561025c57600080fd5b50356001600160a01b0316610539565b6101b4610581565b6100f7610587565b6101986004803603604081101561029257600080fd5b506001600160a01b0381351690602001356105e8565b610198600480360360408110156102be57600080fd5b506001600160a01b038135169060200135610656565b6101b461066a565b6101b4600480360360408110156102f257600080fd5b506001600160a01b0381358116916020013516610678565b61037a6004803603604081101561032057600080fd5b81019060208101813564010000000081111561033b57600080fd5b82018360208201111561034d57600080fd5b8035906020019184602083028401116401000000008311171561036f57600080fd5b9193509150356106a3565b005b602f8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104085780601f106103dd57610100808354040283529160200191610408565b820191906000526020600020905b8154815290600101906020018083116103eb57829003601f168201915b5050505050905090565b600061042661041f6106e2565b84846106e6565b5060015b92915050565b600061044a662386f26fc1000061044561066a565b6107d2565b905090565b600061045c848484610888565b6104d2846104686106e2565b6104cd85604051806060016040528060288152602001611080602891396001600160a01b038a166000908152600160205260408120906104a66106e2565b6001600160a01b03168152602081019190915260400160002054919063ffffffff6109f816565b6106e6565b5060019392505050565b60315460ff1690565b60006104266104f26106e2565b846104cd85600160006105036106e2565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff610a8f16565b600061042a61055c662386f26fc100006000195b0619610557610430565b610af0565b6001600160a01b0384166000908152602081905260409020549063ffffffff610b0216565b602e5490565b60308054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104085780601f106103dd57610100808354040283529160200191610408565b60006104266105f56106e2565b846104cd856040518060600160405280602581526020016110f1602591396001600061061f6106e2565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff6109f816565b60006104266106636106e2565b8484610888565b600061044a602e5442610b44565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60005b828110156106dc576106d38484838181106106bd57fe5b905060200201356001600160a01b031683610656565b506001016106a6565b50505050565b3390565b6001600160a01b03831661072b5760405162461bcd60e51b81526004018080602001828103825260248152602001806110cd6024913960400191505060405180910390fd5b6001600160a01b0382166107705760405162461bcd60e51b815260040180806020018281038252602281526020018061103d6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600082815b600b811015610880576107e8610fee565b600282600b81106107f557fe5b6040805160808101825260049290920292909201805482526001810154602083018190526002820154600f90810b810b900b93830193909352600301546060820152915085111561084c5780606001519250610877565b6040810151815161086f91859161086a90899063ffffffff610b7d16565b610bbf565b925050610880565b506001016107d7565b509392505050565b6001600160a01b0383166108cd5760405162461bcd60e51b81526004018080602001828103825260258152602001806110a86025913960400191505060405180910390fd5b6001600160a01b0382166109125760405162461bcd60e51b815260040180806020018281038252602381526020018061101a6023913960400191505060405180910390fd5b6000610927662386f26fc1000060001961054d565b9050600061093b838363ffffffff610beb16565b6001600160a01b038616600090815260208190526040902054909150610967908263ffffffff610b7d16565b6001600160a01b03808716600090815260208190526040808220939093559086168152205461099c908263ffffffff610a8f16565b6001600160a01b038086166000818152602081815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35050505050565b60008184841115610a875760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a4c578181015183820152602001610a34565b50505050905090810190601f168015610a795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610ae9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000610ae9838363ffffffff610b0216565b6000610ae983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610c44565b600080610b518484610ca9565b905060016201518080830683030401610e7f8110610b7557610e7f9250505061042a565b949350505050565b6000610ae983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506109f8565b600080610be2610bdc610bd6600160401b87610cbb565b85610cf8565b86610d88565b95945050505050565b600082610bfa5750600061042a565b82820282848281610c0757fe5b0414610ae95760405162461bcd60e51b815260040180806020018281038252602181526020018061105f6021913960400191505060405180910390fd5b60008183610c935760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610a4c578181015183820152602001610a34565b506000838581610c9f57fe5b0495945050505050565b6000610ae9828463ffffffff610b7d16565b6000600f83810b9083900b016f7fffffffffffffffffffffffffffffff198112801590610cef575060016001607f1b038113155b610ae957600080fd5b60008080600f85900b8113610d1f57610d18603f86600f0b901b85610df0565b9150610d43565b610d39603f866000036001600160801b0316901b85610df0565b9150506001831615155b603f82901c91508015610d6c576001607f1b821115610d6157600080fd5b50600003905061042a565b60016001607f1b03821115610d8057600080fd5b50905061042a565b600081610d975750600061042a565b600083600f0b1215610da857600080fd5b600f83900b6001600160801b038316810260401c90608084901c026001600160c01b03811115610dd757600080fd5b60401b8119811115610de857600080fd5b019392505050565b600081610e0257506001607f1b61042a565b82610e0f5750600061042a565b600083600160801b8110610e25576080918201911c5b600160401b8110610e38576040918201911c5b6401000000008110610e4c576020918201911c5b620100008110610e5e576010918201911c5b6101008110610e6f576008918201911c5b60108110610e7f576004918201911c5b60048110610e8f576002918201911c5b60028110610e9e576001820191505b607e1982016000811315610ec25780866000821215610eb957fe5b901c9550610ed7565b80600003866000821215610ed257fe5b901b95505b6001607f1b60005b8615610fa5576001871615610f475760001990960195908702908201600160ff1b8210610f155760809190911c90600101610f1d565b607f82901c91505b607e19811215610f355760009550505050505061042a565b60808112610f4257600080fd5b610fa0565b96800296600196871c969290921b91600160ff1b8810610f7357608088901c9750600183019250610f7b565b607f88901c97505b607e19831215610f935760009550505050505061042a565b60808312610fa057600080fd5b610edf565b6000811315610fc45780826000821215610fbb57fe5b901b9150610fe2565b6000811215610fe25780600003826000821215610fdd57fe5b901c91505b50935061042a92505050565b604051806080016040528060008152602001600081526020016000600f0b815260200160008152509056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220fd1feee2443660dcf06f9c88a2a78dd5fa53d2869e8f6d40070dd42563a8029a64736f6c63430006020033

Verified Source Code Full Match

Compiler: v0.6.2+commit.bacdbe57 EVM: istanbul Optimization: Yes (200 runs)
FLOW-flattened.sol 756 lines
// File: contracts\math\ABDKMath.sol

/*
 * ABDK Math 64.64 Smart Contract Library.  Copyright © 2019 by ABDK Consulting.
 * Author: Mikhail Vladimirov <[email protected]>
 */
pragma solidity ^0.6.0;

/**
 * Smart contract library of mathematical functions operating with signed
 * 64.64-bit fixed point numbers.  Signed 64.64-bit fixed point number is
 * basically a simple fraction whose numerator is signed 128-bit integer and
 * denominator is 2^64.  As long as denominator is always the same, there is no
 * need to store it, thus in Solidity signed 64.64-bit fixed point numbers are
 * represented by int128 type holding only the numerator.
 */
library ABDKMath64x64 {
  /**
   * Minimum value signed 64.64-bit fixed point number may have.
   */
  int128 private constant MIN_64x64 = -0x80000000000000000000000000000000;

  /**
   * Maximum value signed 64.64-bit fixed point number may have.
   */
  int128 private constant MAX_64x64 = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

  /**
   * Calculate x + y.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y signed 64.64-bit fixed point number
   * @return signed 64.64-bit fixed point number
   */
  function add (int128 x, int128 y) internal pure returns (int128) {
    int256 result = int256(x) + y;
    require (result >= MIN_64x64 && result <= MAX_64x64);
    return int128 (result);
  }

  /**
   * Calculate x * y rounding down, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64 fixed point number
   * @param y unsigned 256-bit integer number
   * @return unsigned 256-bit integer number
   */
  function mulu (int128 x, uint256 y) internal pure returns (uint256) {
    if (y == 0) return 0;

    require (x >= 0);

    uint256 lo = (uint256 (x) * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) >> 64;
    uint256 hi = uint256 (x) * (y >> 128);

    require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
    hi <<= 64;

    require (hi <=
      0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF - lo);
    return hi + lo;
  }

  /**
   * Calculate x^y assuming 0^0 is 1, where x is signed 64.64 fixed point number
   * and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x signed 64.64-bit fixed point number
   * @param y uint256 value
   * @return signed 64.64-bit fixed point number
   */
  function pow (int128 x, uint256 y) internal pure returns (int128) {
    uint256 absoluteResult;
    bool negativeResult = false;
    if (x >= 0) {
      absoluteResult = powu (uint256 (x) << 63, y);
    } else {
      // We rely on overflow behavior here
      absoluteResult = powu (uint256 (uint128 (-x)) << 63, y);
      negativeResult = y & 1 > 0;
    }

    absoluteResult >>= 63;

    if (negativeResult) {
      require (absoluteResult <= 0x80000000000000000000000000000000);
      return -int128 (absoluteResult); // We rely on overflow behavior here
    } else {
      require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
      return int128 (absoluteResult); // We rely on overflow behavior here
    }
  }

  /**
   * Calculate x^y assuming 0^0 is 1, where x is unsigned 129.127 fixed point
   * number and y is unsigned 256-bit integer number.  Revert on overflow.
   *
   * @param x unsigned 129.127-bit fixed point number
   * @param y uint256 value
   * @return unsigned 129.127-bit fixed point number
   */
  function powu (uint256 x, uint256 y) private pure returns (uint256) {
    if (y == 0) return 0x80000000000000000000000000000000;
    else if (x == 0) return 0;
    else {
      int256 msb = 0;
      uint256 xc = x;
      if (xc >= 0x100000000000000000000000000000000) { xc >>= 128; msb += 128; }
      if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; }
      if (xc >= 0x100000000) { xc >>= 32; msb += 32; }
      if (xc >= 0x10000) { xc >>= 16; msb += 16; }
      if (xc >= 0x100) { xc >>= 8; msb += 8; }
      if (xc >= 0x10) { xc >>= 4; msb += 4; }
      if (xc >= 0x4) { xc >>= 2; msb += 2; }
      if (xc >= 0x2) msb += 1;  // No need to shift xc anymore

      int256 xe = msb - 127;
      if (xe > 0) x >>= xe;
      else x <<= -xe;

      uint256 result = 0x80000000000000000000000000000000;
      int256 re = 0;

      while (y > 0) {
        if (y & 1 > 0) {
          result = result * x;
          y -= 1;
          re += xe;
          if (result >=
            0x8000000000000000000000000000000000000000000000000000000000000000) {
            result >>= 128;
            re += 1;
          } else result >>= 127;
          if (re < -127) return 0; // Underflow
          require (re < 128); // Overflow
        } else {
          x = x * x;
          y >>= 1;
          xe <<= 1;
          if (x >=
            0x8000000000000000000000000000000000000000000000000000000000000000) {
            x >>= 128;
            xe += 1;
          } else x >>= 127;
          if (xe < -127) return 0; // Underflow
          require (xe < 128); // Overflow
        }
      }

      if (re > 0) result <<= re;
      else if (re < 0) result >>= -re;

      return result;
    }
  }
}

// File: node_modules\openzeppelin-solidity\contracts\GSN\Context.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

// File: node_modules\openzeppelin-solidity\contracts\token\ERC20\IERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

// File: node_modules\openzeppelin-solidity\contracts\math\SafeMath.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

// File: node_modules\openzeppelin-solidity\contracts\utils\Address.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.2;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return _functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        return _functionCallWithValue(target, data, value, errorMessage);
    }

    function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File: contracts\FLOW.sol

pragma solidity ^0.6.2;






contract FLOW is Context, IERC20 {
    using SafeMath for uint256;
    using ABDKMath64x64 for int128;
    using Address for address;

    mapping (address => uint256) private _partsOwned;
    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private constant INITIAL_SUPPLY = 10 * 10**6 * 10**9;
    uint256 private constant MAX_UINT = ~uint256(0);
    uint256 private constant TOTAL_PARTS = MAX_UINT - (MAX_UINT % INITIAL_SUPPLY);

    uint256 private constant CYCLE_SECONDS = 86400;
    uint256 private constant FINAL_CYCLE = 3711;

    struct Era {
        uint256 startCycle;
        uint256 endCycle;
        int128 cycleInflation;
        uint256 finalSupply;
    }

    Era[11] private _eras;
    uint256 private _startTime;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    constructor () public {
        _name = 'Flow Protocol';
        _symbol = 'FLOW';
        _decimals = 9;

        _partsOwned[_msgSender()] = TOTAL_PARTS;
        _initEras();
        _startTime = now;
    }

    function _initEras() private {
        _eras[0] = Era(1, 60, 184467440737095516, 18166966985640902);
        _eras[1] = Era(61, 425, 92233720368547758, 112174713264391144);
        _eras[2] = Era(426, 790, 46116860184273879, 279057783081840914);
        _eras[3] = Era(791, 1155, 23058430092136939, 440268139544969912);
        _eras[4] = Era(1156, 1520, 11529215046068469, 553044069474490613);
        _eras[5] = Era(1521, 1885, 5764607523034234, 619853011328525904);
        _eras[6] = Era(1886, 2250, 2882303761517117, 656228575376038043);
        _eras[7] = Era(2251, 2615, 1441151880758558, 675209948612919169);
        _eras[8] = Era(2616, 2980, 720575940379279, 684905732173838476);
        _eras[9] = Era(2981, 3345, 360287970189639, 689805758238227141);
        _eras[10] = Era(3346, 3710, 180143985094819, 692268913795056564);
    }

    function name() public view returns (string memory) {
        return _name;
    }

    function symbol() public view returns (string memory) {
        return _symbol;
    }

    function decimals() public view returns (uint8) {
        return _decimals;
    }

    function startTime() external view returns(uint256) {
        return _startTime;
    }

    function sendAirdrop(address[] calldata recipients, uint256 airdropAmt) external {
        for (uint256 i = 0; i < recipients.length; i++) {
            transfer(recipients[i], airdropAmt);
        }
    }

    function totalSupply() public view override returns (uint256) {
        return _getSupply(INITIAL_SUPPLY, getCurrentCycle());
    }

    function balanceOf(address account) public view override returns (uint256) {
        return _partsOwned[account].div(_getRate(TOTAL_PARTS, totalSupply()));
    }

    function transfer(address recipient, uint256 amount) public override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    function allowance(address owner, address spender) public view override returns (uint256) {
        return _allowances[owner][spender];
    }

    function approve(address spender, uint256 amount) public override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    function getCurrentCycle() public view returns (uint256) {
        return _getCycle(_startTime, now);
    }

    function _approve(address owner, address spender, uint256 amount) private {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    function _transfer(address sender, address recipient, uint256 amount) private {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        uint256 currentRate = _getRate(TOTAL_PARTS, totalSupply());
        uint256 partsToTransfer = amount.mul(currentRate);
        _partsOwned[sender] = _partsOwned[sender].sub(partsToTransfer);
        _partsOwned[recipient] = _partsOwned[recipient].add(partsToTransfer);
        emit Transfer(sender, recipient, amount);
    }

    function _getCycle(uint256 startTime, uint256 currentTime) private pure returns(uint256) {
        uint256 secondsElapsed = _getElapsedSeconds(startTime, currentTime);
        uint256 cycle = (secondsElapsed - (secondsElapsed % CYCLE_SECONDS)) / CYCLE_SECONDS + 1;
        if (cycle >= FINAL_CYCLE) return FINAL_CYCLE;
        return cycle;
    }

    function _getElapsedSeconds(uint256 startTime, uint256 currentTime) private pure returns(uint256) {
        return currentTime.sub(startTime);
    }

    function _getSupply(uint256 initialSupply, uint256 currentCycle) private view returns(uint256) {
        uint256 currentSupply = initialSupply;
        for (uint256 i = 0; i < _eras.length; i++) {
            Era memory era = _eras[i];
            if (currentCycle > era.endCycle) {
                currentSupply = era.finalSupply;
            } else {
                currentSupply = _compound(currentSupply, era.cycleInflation, currentCycle.sub(era.startCycle));
                break;
            }
        }
        return currentSupply;
    }

    function _compound(uint256 principle, int128 rate, uint256 periods) private pure returns(uint256){
        uint256 result = ABDKMath64x64.mulu(
                            ABDKMath64x64.pow (
                                ABDKMath64x64.add (
                                0x10000000000000000,
                                rate),
                                periods), principle);
        return result;
    }

    function _getRate(uint256 totalParts, uint256 supply) private pure returns(uint256) {
        return totalParts.div(supply);
    }
}

Read Contract

allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
getCurrentCycle 0xbe26ed7f → uint256
name 0x06fdde03 → string
startTime 0x78e97925 → uint256
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256

Write Contract 6 functions

These functions modify contract state and require a wallet transaction to execute.

approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
sendAirdrop 0xeb246b64
address[] recipients
uint256 airdropAmt
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool

Token Balances (1)

View Transfers →
USDT 5900

Recent Transactions

No transactions found for this address