ETH Price: $3,415.99 (-0.64%)
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Token Holdings

Sponsored

Transaction Hash
Method
Block
From
To
0x6080604054217572023-10-18 12:41:01273 days ago1697632861IN
 Create: GenesisRewardPool
0 ETH0.00000040.00021396

Parent Transaction Hash Block From To
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GenesisRewardPool

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 13 : GenesisRewardPool.sol
// SPDX-License-Identifier: UNLICENSED









pragma solidity ^0.8.15;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "contracts/libraries/Operator.sol";

interface IRewarder {
  function onJoeReward(address user, uint256 newLpAmount) external;

  function pendingTokens(address user) external view returns (uint256 pending);

  function rewardToken() external view returns (address);
}

interface IERC20Burnable is IERC20 {
  function burn(uint256 amount) external;
}

contract GenesisRewardPool is Initializable, ReentrancyGuard {
  using SafeMath for uint256;
  using SafeERC20 for IERC20;

  // governance
  address public operator;
  address public feeAddress;

  // Info of each user.
  struct UserInfo {
    uint256 amount; // How many tokens the user has provided.
    uint256 rewardDebt; // Reward debt. See explanation below.
  }

  // Info of each pool.
  struct PoolInfo {
    IERC20 token; // Address of LP token contract.
    uint256 allocPoint; // How many allocation points assigned to this pool. TOKEN to distribute.
    uint256 lastRewardTime; // Last time that TOKEN distribution occurs.
    uint16 depositFeeBP; //depositfee
    uint256 accTokenPerShare; // Accumulated TOKEN per share, times 1e18. See below.
    bool isStarted; // if lastRewardBlock has passed
    IRewarder rewarder;
  }

  IERC20 public token;

  // Info of each pool.
  PoolInfo[] public poolInfo;

  // Info of each user that stakes LP tokens.
  mapping(uint256 => mapping(address => UserInfo)) public userInfo;

  // Total allocation points. Must be the sum of all allocation points in all pools.
  uint256 public totalAllocPoint = 0;

  // The time when TOKEN mining starts.
  uint256 public poolStartTime;

  // The time when TOKEN mining ends.
  uint256 public poolEndTime;

  uint256 public tokenPerSecond = 0.77159722222 ether; // 33333 TOKEN / (12h * 60min * 60s)
  uint256 public runningTime = 12 hours; // 2 days
  uint256 public constant TOTAL_REWARDS = 33333 ether;

  event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
  event SetFeeAddress(address indexed user, address indexed newAddress);
  event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
  event EmergencyWithdraw(
    address indexed user,
    uint256 indexed pid,
    uint256 amount
  );
  event RewardPaid(address indexed user, uint256 amount);

  function init(address _token, uint256 _poolStartTime, address _feeAddress) public initializer {
    require(block.timestamp < _poolStartTime, "late");
    if (_token != address(0)) token = IERC20(_token);

    // ensure source of rewards is present
    uint256 tokeBal = token.balanceOf(address(this));
    uint256 rewards = runningTime * tokenPerSecond;
    require(tokeBal >= TOTAL_REWARDS, "rewards missing1");
    require(rewards <= TOTAL_REWARDS, "rewards missing");

    poolStartTime = _poolStartTime;
    poolEndTime = poolStartTime + runningTime;
    operator = msg.sender;
    if (_feeAddress != address(0)) feeAddress = _feeAddress;
  }

  modifier onlyOperator() {
    require(operator == msg.sender, "GenesisPool: caller is not the operator");
    _;
  }

  function checkPoolDuplicate(IERC20 _token) internal view {
    uint256 length = poolInfo.length;
    for (uint256 pid = 0; pid < length; ++pid) {
      require(poolInfo[pid].token != _token, "GenesisPool: existing pool?");
    }
  }

  // Add a new token to the pool. Can only be called by the owner.
  function add(
    uint256 _allocPoint,
    IERC20 _token,
    bool _withUpdate,
    uint256 _lastRewardTime,
    uint16 _depositFeeBP,
    IRewarder _rewarder
  ) public onlyOperator {
    require(_depositFeeBP <= 300, "add: invalid deposit fee basis points");
    require(
      Address.isContract(address(_rewarder)) ||
        address(_rewarder) == address(0),
      "add: rewarder must be contract or zero"
    );
    checkPoolDuplicate(_token);
    if (_withUpdate) {
      massUpdatePools();
    }
    if (block.timestamp < poolStartTime) {
      // chef is sleeping
      if (_lastRewardTime == 0) {
        _lastRewardTime = poolStartTime;
      } else {
        if (_lastRewardTime < poolStartTime) {
          _lastRewardTime = poolStartTime;
        }
      }
    } else {
      // chef is cooking
      if (_lastRewardTime == 0 || _lastRewardTime < block.timestamp) {
        _lastRewardTime = block.timestamp;
      }
    }
    bool _isStarted = (_lastRewardTime <= poolStartTime) ||
      (_lastRewardTime <= block.timestamp);
    poolInfo.push(
      PoolInfo({
        token: _token,
        allocPoint: _allocPoint,
        lastRewardTime: _lastRewardTime,
        accTokenPerShare: 0,
        isStarted: _isStarted,
        depositFeeBP: _depositFeeBP,
        rewarder: _rewarder
      })
    );
    if (_isStarted) {
      totalAllocPoint = totalAllocPoint.add(_allocPoint);
    }
  }

  // Update the given pool's TOKEN allocation point. Can only be called by the owner.
  function set(
    uint256 _pid,
    uint256 _allocPoint,
    uint16 _depositFeeBP
  ) public onlyOperator {
    require(_depositFeeBP <= 300, "set: invalid deposit fee basis points");
    massUpdatePools();
    PoolInfo storage pool = poolInfo[_pid];
    if (pool.isStarted) {
      totalAllocPoint = totalAllocPoint.sub(pool.allocPoint).add(_allocPoint);
    }
    pool.allocPoint = _allocPoint;
    poolInfo[_pid].depositFeeBP = _depositFeeBP;
  }

  // Return accumulate rewards over the given _from to _to block.
  function getGeneratedReward(
    uint256 _fromTime,
    uint256 _toTime
  ) public view returns (uint256) {
    if (_fromTime >= _toTime) return 0;
    if (_toTime >= poolEndTime) {
      if (_fromTime >= poolEndTime) return 0;
      if (_fromTime <= poolStartTime)
        return poolEndTime.sub(poolStartTime).mul(tokenPerSecond);
      return poolEndTime.sub(_fromTime).mul(tokenPerSecond);
    } else {
      if (_toTime <= poolStartTime) return 0;
      if (_fromTime <= poolStartTime)
        return _toTime.sub(poolStartTime).mul(tokenPerSecond);
      return _toTime.sub(_fromTime).mul(tokenPerSecond);
    }
  }

  // View function to see pending TOKEN on frontend.
  function pending(
    uint256 _pid,
    address _user
  ) external view returns (uint256 pendingToken, uint256 pendingBonusToken) {
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][_user];
    uint256 accTokenPerShare = pool.accTokenPerShare;
    uint256 tokenSupply = pool.token.balanceOf(address(this));
    if (block.timestamp > pool.lastRewardTime && tokenSupply != 0) {
      uint256 _generatedReward = getGeneratedReward(
        pool.lastRewardTime,
        block.timestamp
      );
      uint256 _reward = _generatedReward.mul(pool.allocPoint).div(
        totalAllocPoint
      );
      accTokenPerShare = accTokenPerShare.add(
        _reward.mul(1e18).div(tokenSupply)
      );
    }
    pendingToken = user.amount.mul(accTokenPerShare).div(1e18).sub(
      user.rewardDebt
    );
    // If it's a double reward farm, we return info about the bonus token
    if (address(pool.rewarder) != address(0)) {
      pendingBonusToken = pool.rewarder.pendingTokens(_user);
    }
  }

  // Get bonus token info from the rewarder contract for a given pool, if it is a double reward farm

  // Update reward variables for all pools. Be careful of gas spending!
  function massUpdatePools() public {
    uint256 length = poolInfo.length;
    for (uint256 pid = 0; pid < length; ++pid) {
      updatePool(pid);
    }
  }

  // Update reward variables of the given pool to be up-to-date.
  function updatePool(uint256 _pid) public {
    PoolInfo storage pool = poolInfo[_pid];
    if (block.timestamp <= pool.lastRewardTime) {
      return;
    }
    uint256 tokenSupply = pool.token.balanceOf(address(this));
    if (tokenSupply == 0) {
      pool.lastRewardTime = block.timestamp;
      return;
    }
    if (!pool.isStarted) {
      pool.isStarted = true;
      totalAllocPoint = totalAllocPoint.add(pool.allocPoint);
    }
    if (totalAllocPoint > 0) {
      uint256 _generatedReward = getGeneratedReward(
        pool.lastRewardTime,
        block.timestamp
      );
      uint256 _reward = _generatedReward.mul(pool.allocPoint).div(
        totalAllocPoint
      );
      pool.accTokenPerShare = pool.accTokenPerShare.add(
        _reward.mul(1e18).div(tokenSupply)
      );
    }
    pool.lastRewardTime = block.timestamp;
  }

  // Deposit LP tokens.
  function deposit(uint256 _pid, uint256 _amount) public nonReentrant {
    address _sender = msg.sender;
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][_sender];
    updatePool(_pid);
    if (user.amount > 0) {
      uint256 _pending = user.amount.mul(pool.accTokenPerShare).div(1e18).sub(
        user.rewardDebt
      );
      if (_pending > 0) {
        safeTransfer(_sender, _pending);
        emit RewardPaid(_sender, _pending);
      }
    }
    if (_amount > 0) {
      pool.token.safeTransferFrom(_sender, address(this), _amount);
      if (pool.depositFeeBP > 0) {
        uint256 depositFee = _amount.mul(pool.depositFeeBP).div(10000);
        pool.token.safeTransfer(feeAddress, depositFee);
        // pool.lpToken.safeTransfer(vaultAddress, depositFee);
        user.amount = user.amount.add(_amount).sub(depositFee);
      } else {
        user.amount = user.amount.add(_amount);
      }
    }
    IRewarder rewarder = poolInfo[_pid].rewarder;
    if (address(rewarder) != address(0)) {
      rewarder.onJoeReward(msg.sender, user.amount);
    }
    user.rewardDebt = user.amount.mul(pool.accTokenPerShare).div(1e18);
    emit Deposit(_sender, _pid, _amount);
  }

  // Withdraw LP tokens.
  function withdraw(uint256 _pid, uint256 _amount) public {
    address _sender = msg.sender;
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][_sender];
    require(user.amount >= _amount, "withdraw: not good");
    updatePool(_pid);
    uint256 _pending = user.amount.mul(pool.accTokenPerShare).div(1e18).sub(
      user.rewardDebt
    );
    if (_pending > 0) {
      safeTransfer(_sender, _pending);
      emit RewardPaid(_sender, _pending);
    }
    if (_amount > 0) {
      user.amount = user.amount.sub(_amount);
      pool.token.safeTransfer(_sender, _amount);
    }
    IRewarder rewarder = poolInfo[_pid].rewarder;
    if (address(rewarder) != address(0)) {
      rewarder.onJoeReward(msg.sender, user.amount);
    }

    user.rewardDebt = user.amount.mul(pool.accTokenPerShare).div(1e18);
    emit Withdraw(_sender, _pid, _amount);
  }

  // Withdraw without caring about rewards. EMERGENCY ONLY.
  function emergencyWithdraw(uint256 _pid) public {
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][msg.sender];
    uint256 _amount = user.amount;
    user.amount = 0;
    user.rewardDebt = 0;
    pool.token.safeTransfer(msg.sender, _amount);
    emit EmergencyWithdraw(msg.sender, _pid, _amount);
  }

  // Safe TOKEN transfer function, just in case a rounding error causes pool to not have enough TOKENs.
  function safeTransfer(address _to, uint256 _amount) internal {
    uint256 _tokenBalance = token.balanceOf(address(this));
    if (_tokenBalance > 0) {
      if (_amount > _tokenBalance) {
        token.safeTransfer(_to, _tokenBalance);
      } else {
        token.safeTransfer(_to, _amount);
      }
    }
  }

  function setFeeAddress(address _feeAddress) external onlyOperator {
    require(
      _feeAddress != address(0),
      "feeAddress address cannot be 0 address"
    );
    feeAddress = _feeAddress;
    emit SetFeeAddress(msg.sender, _feeAddress);
  }

  function setOperator(address _operator) external onlyOperator {
    operator = _operator;
  }

  function burnRemainingTokens() external {
    require(block.timestamp > poolEndTime, "Farm is not over yet");
    IERC20Burnable(address(token)).burn(token.balanceOf(address(this)));
  }
}

File 2 of 13 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 13 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/Address.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 4 of 13 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 5 of 13 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        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);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 6 of 13 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 7 of 13 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 8 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 9 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 10 of 13 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @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");

        (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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 11 of 13 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.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 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) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 12 of 13 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // 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 (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @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) {
        return a + b;
    }

    /**
     * @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 a - b;
    }

    /**
     * @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) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting 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 a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting 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) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * 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) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 13 of 13 : Operator.sol
// SPDX-License-Identifier: UNLICENSED





pragma solidity ^0.8.15;

import "@openzeppelin/contracts/access/Ownable.sol";


abstract contract Operator is Context, Ownable {
    address private _operator;

    event OperatorTransferred(address indexed previousOperator, address indexed newOperator);

    constructor() {
        _operator = _msgSender();
        emit OperatorTransferred(address(0), _operator);
    }

    function operator() public view returns (address) {
        return _operator;
    }

    modifier onlyOperator() {
        require(_operator == msg.sender, "operator: caller is not the operator");
        _;
    }

    function isOperator() public view returns (bool) {
        return _msgSender() == _operator;
    }

    function transferOperator(address newOperator_) public onlyOwner {
        _transferOperator(newOperator_);
    }

    function _transferOperator(address newOperator_) internal {
        require(newOperator_ != address(0), "operator: zero address given for new operator");
        emit OperatorTransferred(address(0), newOperator_);
        _operator = newOperator_;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetFeeAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"TOTAL_REWARDS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"},{"internalType":"uint256","name":"_lastRewardTime","type":"uint256"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"contract IRewarder","name":"_rewarder","type":"address"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burnRemainingTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromTime","type":"uint256"},{"internalType":"uint256","name":"_toTime","type":"uint256"}],"name":"getGeneratedReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_poolStartTime","type":"uint256"},{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pending","outputs":[{"internalType":"uint256","name":"pendingToken","type":"uint256"},{"internalType":"uint256","name":"pendingBonusToken","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardTime","type":"uint256"},{"internalType":"uint16","name":"depositFeeBP","type":"uint16"},{"internalType":"uint256","name":"accTokenPerShare","type":"uint256"},{"internalType":"bool","name":"isStarted","type":"bool"},{"internalType":"contract IRewarder","name":"rewarder","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"runningTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526000600755670ab54395e419eb00600a5561a8c0600b5534801561002757600080fd5b5060018055611f9e8061003b6000396000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c80635fa7b83f116100c3578063943f013d1161007c578063943f013d1461031b578063b3ab15fb14610324578063e2bbb15814610337578063e4c75c271461034a578063e53b48621461035d578063fc0c546a1461037057600080fd5b80635fa7b83f1461029f578063630b5ba1146102a85780636e271dd5146102b057806383408d73146102b95780638705fcd4146102c157806393f1a40b146102d457600080fd5b806343fc00b81161011557806343fc00b814610237578063441a3e701461024a57806351eb05a61461025d5780635312ea8e14610270578063570ca735146102835780635f96dc111461029657600080fd5b806309cf60911461015d5780631526fe271461018157806317caf6f1146101db578063231f0c6a146101e457806324bcb38c146101f7578063412753581461020c575b600080fd5b61016e69070efc4d0e326fb4000081565b6040519081526020015b60405180910390f35b61019461018f366004611c2a565b610383565b604080516001600160a01b039889168152602081019790975286019490945261ffff90921660608501526080840152151560a08301529190911660c082015260e001610178565b61016e60075481565b61016e6101f2366004611c43565b6103e6565b61020a610205366004611c7c565b6104ab565b005b60035461021f906001600160a01b031681565b6040516001600160a01b039091168152602001610178565b61020a610245366004611cc9565b6105f4565b61020a610258366004611c43565b6108d8565b61020a61026b366004611c2a565b610b40565b61020a61027e366004611c2a565b610c98565b60025461021f906001600160a01b031681565b61016e60085481565b61016e600a5481565b61020a610d37565b61016e60095481565b61020a610d62565b61020a6102cf366004611d0b565b610e6b565b6103066102e2366004611d28565b60066020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610178565b61016e600b5481565b61020a610332366004611d0b565b610f46565b61020a610345366004611c43565b610f92565b610306610358366004611d28565b611223565b61020a61036b366004611d66565b61141a565b60045461021f906001600160a01b031681565b6005818154811061039357600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160a01b0394851696509294919361ffff9091169260ff8116916101009091041687565b60008183106103f7575060006104a5565b600954821061045f576009548310610411575060006104a5565b60085483116104445761043d600a5461043760085460095461174a90919063ffffffff16565b9061175d565b90506104a5565b61043d600a546104378560095461174a90919063ffffffff16565b6008548211610470575060006104a5565b60085483116104945761043d600a546104376008548561174a90919063ffffffff16565b600a5461043d90610437848661174a565b92915050565b6002546001600160a01b031633146104de5760405162461bcd60e51b81526004016104d590611dd4565b60405180910390fd5b61012c8161ffff1611156105425760405162461bcd60e51b815260206004820152602560248201527f7365743a20696e76616c6964206465706f7369742066656520626173697320706044820152646f696e747360d81b60648201526084016104d5565b61054a610d37565b60006005848154811061055f5761055f611e1b565b60009182526020909120600690910201600581015490915060ff16156105a6576105a28361059c836001015460075461174a90919063ffffffff16565b90611769565b6007555b82816001018190555081600585815481106105c3576105c3611e1b565b906000526020600020906006020160030160006101000a81548161ffff021916908361ffff16021790555050505050565b600054610100900460ff16158080156106145750600054600160ff909116105b8061062e5750303b15801561062e575060005460ff166001145b6106915760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104d5565b6000805460ff1916600117905580156106b4576000805461ff0019166101001790555b8242106106ec5760405162461bcd60e51b81526004016104d5906020808252600490820152636c61746560e01b604082015260600190565b6001600160a01b0384161561071757600480546001600160a01b0319166001600160a01b0386161790555b600480546040516370a0823160e01b815230928101929092526000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610765573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107899190611e31565b90506000600a54600b5461079d9190611e60565b905069070efc4d0e326fb400008210156107ec5760405162461bcd60e51b815260206004820152601060248201526f72657761726473206d697373696e673160801b60448201526064016104d5565b69070efc4d0e326fb400008111156108385760405162461bcd60e51b815260206004820152600f60248201526e72657761726473206d697373696e6760881b60448201526064016104d5565b6008859055600b5461084a9086611e77565b600955600280546001600160a01b031916331790556001600160a01b0384161561088a57600380546001600160a01b0319166001600160a01b0386161790555b505080156108d2576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60003390506000600584815481106108f2576108f2611e1b565b60009182526020808320878452600680835260408086206001600160a01b038916875290935291909320805492909102909201925084111561096b5760405162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b60448201526064016104d5565b61097485610b40565b60006109b182600101546109ab670de0b6b3a76400006109a58760040154876000015461175d90919063ffffffff16565b90611775565b9061174a565b90508015610a07576109c38482611781565b836001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486826040516109fe91815260200190565b60405180910390a25b8415610a31578154610a19908661174a565b82558254610a31906001600160a01b03168587611832565b600060058781548110610a4657610a46611e1b565b600091825260209091206006909102016005015461010090046001600160a01b031690508015610ad45782546040516301a7af8b60e41b815233600482015260248101919091526001600160a01b03821690631a7af8b090604401600060405180830381600087803b158015610abb57600080fd5b505af1158015610acf573d6000803e3d6000fd5b505050505b60048401548354610af291670de0b6b3a7640000916109a59161175d565b600184015560405186815287906001600160a01b038716907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a350505050505050565b600060058281548110610b5557610b55611e1b565b9060005260206000209060060201905080600201544211610b74575050565b80546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610bbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be09190611e31565b905080600003610bf557504260029091015550565b600582015460ff16610c265760058201805460ff19166001908117909155820154600754610c2291611769565b6007555b60075415610c8d576000610c3e8360020154426103e6565b90506000610c5f6007546109a586600101548561175d90919063ffffffff16565b9050610c85610c7a846109a584670de0b6b3a764000061175d565b600486015490611769565b600485015550505b504260029091015550565b600060058281548110610cad57610cad611e1b565b60009182526020808320858452600680835260408086203380885294528520805486825560018201969096559302018054909450919291610cfa916001600160a01b039091169083611832565b604051818152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a350505050565b60055460005b81811015610d5e57610d4e81610b40565b610d5781611e8a565b9050610d3d565b5050565b6009544211610daa5760405162461bcd60e51b815260206004820152601460248201527311985c9b481a5cc81b9bdd081bdd995c881e595d60621b60448201526064016104d5565b600480546040516370a0823160e01b815230928101929092526001600160a01b0316906342966c689082906370a0823190602401602060405180830381865afa158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1f9190611e31565b6040518263ffffffff1660e01b8152600401610e3d91815260200190565b600060405180830381600087803b158015610e5757600080fd5b505af11580156108d2573d6000803e3d6000fd5b6002546001600160a01b03163314610e955760405162461bcd60e51b81526004016104d590611dd4565b6001600160a01b038116610efa5760405162461bcd60e51b815260206004820152602660248201527f6665654164647265737320616464726573732063616e6e6f742062652030206160448201526564647265737360d01b60648201526084016104d5565b600380546001600160a01b0319166001600160a01b03831690811790915560405133907fd44190acf9d04bdb5d3a1aafff7e6dee8b40b93dfb8c5d3f0eea4b9f4539c3f790600090a350565b6002546001600160a01b03163314610f705760405162461bcd60e51b81526004016104d590611dd4565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b610f9a611895565b6000339050600060058481548110610fb457610fb4611e1b565b60009182526020808320878452600680835260408086206001600160a01b03891687529093529190932091029091019150610fee85610b40565b80541561107e57600061102682600101546109ab670de0b6b3a76400006109a58760040154876000015461175d90919063ffffffff16565b9050801561107c576110388482611781565b836001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04868260405161107391815260200190565b60405180910390a25b505b831561111057815461109b906001600160a01b03168430876118ee565b600382015461ffff16156111015760038201546000906110c890612710906109a590889061ffff1661175d565b60035484549192506110e7916001600160a01b03908116911683611832565b81546110f99082906109ab9088611769565b825550611110565b805461110d9085611769565b81555b60006005868154811061112557611125611e1b565b600091825260209091206006909102016005015461010090046001600160a01b0316905080156111b35781546040516301a7af8b60e41b815233600482015260248101919091526001600160a01b03821690631a7af8b090604401600060405180830381600087803b15801561119a57600080fd5b505af11580156111ae573d6000803e3d6000fd5b505050505b600483015482546111d191670de0b6b3a7640000916109a59161175d565b600183015560405185815286906001600160a01b038616907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159060200160405180910390a350505050610d5e60018055565b60008060006005858154811061123b5761123b611e1b565b60009182526020808320888452600680835260408086206001600160a01b038b81168852945280862094909102909101600481810154825493516370a0823160e01b8152309281019290925291965093949093909291909116906370a0823190602401602060405180830381865afa1580156112bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112df9190611e31565b90508360020154421180156112f357508015155b156113505760006113088560020154426103e6565b905060006113296007546109a588600101548561175d90919063ffffffff16565b905061134b611344846109a584670de0b6b3a764000061175d565b8590611769565b935050505b61137b83600101546109ab670de0b6b3a76400006109a586886000015461175d90919063ffffffff16565b600585015490965061010090046001600160a01b03161561140f57600584015460405163c031a66f60e01b81526001600160a01b0389811660048301526101009092049091169063c031a66f90602401602060405180830381865afa1580156113e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140c9190611e31565b94505b505050509250929050565b6002546001600160a01b031633146114445760405162461bcd60e51b81526004016104d590611dd4565b61012c8261ffff1611156114a85760405162461bcd60e51b815260206004820152602560248201527f6164643a20696e76616c6964206465706f7369742066656520626173697320706044820152646f696e747360d81b60648201526084016104d5565b6001600160a01b0381163b1515806114c757506001600160a01b038116155b6115225760405162461bcd60e51b815260206004820152602660248201527f6164643a207265776172646572206d75737420626520636f6e7472616374206f60448201526572207a65726f60d01b60648201526084016104d5565b61152b85611926565b831561153957611539610d37565b60085442101561156a578260000361155557600854925061157f565b6008548310156115655760085492505b61157f565b82158061157657504283105b1561157f574292505b6000600854841115806115925750428411155b6040805160e0810182526001600160a01b038981168252602082018b815292820188815261ffff888116606085019081526000608086018181528815801560a089019081528c881660c08a0190815260058054600181018255955298517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0600690950294850180546001600160a01b031916918a1691909117905598517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db184015594517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db283015591517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db38201805461ffff19169190941617909255517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db482015593517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db5909401805493516001600160a81b0319909416941515610100600160a81b031916949094176101009390921692909202179091559091506117415760075461173d9088611769565b6007555b50505050505050565b60006117568284611ea3565b9392505050565b60006117568284611e60565b60006117568284611e77565b60006117568284611eb6565b600480546040516370a0823160e01b815230928101929092526000916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156117cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f39190611e31565b9050801561181a578082111561181f5760045461181a906001600160a01b03168483611832565b505050565b60045461181a906001600160a01b031684845b6040516001600160a01b03831660248201526044810182905261181a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526119c8565b6002600154036118e75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104d5565b6002600155565b6040516001600160a01b03808516602483015283166044820152606481018290526108d29085906323b872dd60e01b9060840161185e565b60055460005b8181101561181a57826001600160a01b03166005828154811061195157611951611e1b565b60009182526020909120600690910201546001600160a01b0316036119b85760405162461bcd60e51b815260206004820152601b60248201527f47656e65736973506f6f6c3a206578697374696e6720706f6f6c3f000000000060448201526064016104d5565b6119c181611e8a565b905061192c565b6000611a1d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a9a9092919063ffffffff16565b80519091501561181a5780806020019051810190611a3b9190611ed8565b61181a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104d5565b6060611aa98484600085611ab1565b949350505050565b606082471015611b125760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104d5565b600080866001600160a01b03168587604051611b2e9190611f19565b60006040518083038185875af1925050503d8060008114611b6b576040519150601f19603f3d011682016040523d82523d6000602084013e611b70565b606091505b5091509150611b8187838387611b8c565b979650505050505050565b60608315611bfb578251600003611bf4576001600160a01b0385163b611bf45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104d5565b5081611aa9565b611aa98383815115611c105781518083602001fd5b8060405162461bcd60e51b81526004016104d59190611f35565b600060208284031215611c3c57600080fd5b5035919050565b60008060408385031215611c5657600080fd5b50508035926020909101359150565b803561ffff81168114611c7757600080fd5b919050565b600080600060608486031215611c9157600080fd5b8335925060208401359150611ca860408501611c65565b90509250925092565b6001600160a01b0381168114611cc657600080fd5b50565b600080600060608486031215611cde57600080fd5b8335611ce981611cb1565b9250602084013591506040840135611d0081611cb1565b809150509250925092565b600060208284031215611d1d57600080fd5b813561175681611cb1565b60008060408385031215611d3b57600080fd5b823591506020830135611d4d81611cb1565b809150509250929050565b8015158114611cc657600080fd5b60008060008060008060c08789031215611d7f57600080fd5b863595506020870135611d9181611cb1565b94506040870135611da181611d58565b935060608701359250611db660808801611c65565b915060a0870135611dc681611cb1565b809150509295509295509295565b60208082526027908201527f47656e65736973506f6f6c3a2063616c6c6572206973206e6f7420746865206f6040820152663832b930ba37b960c91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611e4357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176104a5576104a5611e4a565b808201808211156104a5576104a5611e4a565b600060018201611e9c57611e9c611e4a565b5060010190565b818103818111156104a5576104a5611e4a565b600082611ed357634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611eea57600080fd5b815161175681611d58565b60005b83811015611f10578181015183820152602001611ef8565b50506000910152565b60008251611f2b818460208701611ef5565b9190910192915050565b6020815260008251806020840152611f54816040850160208701611ef5565b601f01601f1916919091016040019291505056fea2646970667358221220ce3a103101d2cd018abd42ffda285b859cdcf51511904f085509af1a2528ba6664736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101585760003560e01c80635fa7b83f116100c3578063943f013d1161007c578063943f013d1461031b578063b3ab15fb14610324578063e2bbb15814610337578063e4c75c271461034a578063e53b48621461035d578063fc0c546a1461037057600080fd5b80635fa7b83f1461029f578063630b5ba1146102a85780636e271dd5146102b057806383408d73146102b95780638705fcd4146102c157806393f1a40b146102d457600080fd5b806343fc00b81161011557806343fc00b814610237578063441a3e701461024a57806351eb05a61461025d5780635312ea8e14610270578063570ca735146102835780635f96dc111461029657600080fd5b806309cf60911461015d5780631526fe271461018157806317caf6f1146101db578063231f0c6a146101e457806324bcb38c146101f7578063412753581461020c575b600080fd5b61016e69070efc4d0e326fb4000081565b6040519081526020015b60405180910390f35b61019461018f366004611c2a565b610383565b604080516001600160a01b039889168152602081019790975286019490945261ffff90921660608501526080840152151560a08301529190911660c082015260e001610178565b61016e60075481565b61016e6101f2366004611c43565b6103e6565b61020a610205366004611c7c565b6104ab565b005b60035461021f906001600160a01b031681565b6040516001600160a01b039091168152602001610178565b61020a610245366004611cc9565b6105f4565b61020a610258366004611c43565b6108d8565b61020a61026b366004611c2a565b610b40565b61020a61027e366004611c2a565b610c98565b60025461021f906001600160a01b031681565b61016e60085481565b61016e600a5481565b61020a610d37565b61016e60095481565b61020a610d62565b61020a6102cf366004611d0b565b610e6b565b6103066102e2366004611d28565b60066020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610178565b61016e600b5481565b61020a610332366004611d0b565b610f46565b61020a610345366004611c43565b610f92565b610306610358366004611d28565b611223565b61020a61036b366004611d66565b61141a565b60045461021f906001600160a01b031681565b6005818154811061039357600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160a01b0394851696509294919361ffff9091169260ff8116916101009091041687565b60008183106103f7575060006104a5565b600954821061045f576009548310610411575060006104a5565b60085483116104445761043d600a5461043760085460095461174a90919063ffffffff16565b9061175d565b90506104a5565b61043d600a546104378560095461174a90919063ffffffff16565b6008548211610470575060006104a5565b60085483116104945761043d600a546104376008548561174a90919063ffffffff16565b600a5461043d90610437848661174a565b92915050565b6002546001600160a01b031633146104de5760405162461bcd60e51b81526004016104d590611dd4565b60405180910390fd5b61012c8161ffff1611156105425760405162461bcd60e51b815260206004820152602560248201527f7365743a20696e76616c6964206465706f7369742066656520626173697320706044820152646f696e747360d81b60648201526084016104d5565b61054a610d37565b60006005848154811061055f5761055f611e1b565b60009182526020909120600690910201600581015490915060ff16156105a6576105a28361059c836001015460075461174a90919063ffffffff16565b90611769565b6007555b82816001018190555081600585815481106105c3576105c3611e1b565b906000526020600020906006020160030160006101000a81548161ffff021916908361ffff16021790555050505050565b600054610100900460ff16158080156106145750600054600160ff909116105b8061062e5750303b15801561062e575060005460ff166001145b6106915760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104d5565b6000805460ff1916600117905580156106b4576000805461ff0019166101001790555b8242106106ec5760405162461bcd60e51b81526004016104d5906020808252600490820152636c61746560e01b604082015260600190565b6001600160a01b0384161561071757600480546001600160a01b0319166001600160a01b0386161790555b600480546040516370a0823160e01b815230928101929092526000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610765573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107899190611e31565b90506000600a54600b5461079d9190611e60565b905069070efc4d0e326fb400008210156107ec5760405162461bcd60e51b815260206004820152601060248201526f72657761726473206d697373696e673160801b60448201526064016104d5565b69070efc4d0e326fb400008111156108385760405162461bcd60e51b815260206004820152600f60248201526e72657761726473206d697373696e6760881b60448201526064016104d5565b6008859055600b5461084a9086611e77565b600955600280546001600160a01b031916331790556001600160a01b0384161561088a57600380546001600160a01b0319166001600160a01b0386161790555b505080156108d2576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60003390506000600584815481106108f2576108f2611e1b565b60009182526020808320878452600680835260408086206001600160a01b038916875290935291909320805492909102909201925084111561096b5760405162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b60448201526064016104d5565b61097485610b40565b60006109b182600101546109ab670de0b6b3a76400006109a58760040154876000015461175d90919063ffffffff16565b90611775565b9061174a565b90508015610a07576109c38482611781565b836001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486826040516109fe91815260200190565b60405180910390a25b8415610a31578154610a19908661174a565b82558254610a31906001600160a01b03168587611832565b600060058781548110610a4657610a46611e1b565b600091825260209091206006909102016005015461010090046001600160a01b031690508015610ad45782546040516301a7af8b60e41b815233600482015260248101919091526001600160a01b03821690631a7af8b090604401600060405180830381600087803b158015610abb57600080fd5b505af1158015610acf573d6000803e3d6000fd5b505050505b60048401548354610af291670de0b6b3a7640000916109a59161175d565b600184015560405186815287906001600160a01b038716907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a350505050505050565b600060058281548110610b5557610b55611e1b565b9060005260206000209060060201905080600201544211610b74575050565b80546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610bbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be09190611e31565b905080600003610bf557504260029091015550565b600582015460ff16610c265760058201805460ff19166001908117909155820154600754610c2291611769565b6007555b60075415610c8d576000610c3e8360020154426103e6565b90506000610c5f6007546109a586600101548561175d90919063ffffffff16565b9050610c85610c7a846109a584670de0b6b3a764000061175d565b600486015490611769565b600485015550505b504260029091015550565b600060058281548110610cad57610cad611e1b565b60009182526020808320858452600680835260408086203380885294528520805486825560018201969096559302018054909450919291610cfa916001600160a01b039091169083611832565b604051818152849033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a350505050565b60055460005b81811015610d5e57610d4e81610b40565b610d5781611e8a565b9050610d3d565b5050565b6009544211610daa5760405162461bcd60e51b815260206004820152601460248201527311985c9b481a5cc81b9bdd081bdd995c881e595d60621b60448201526064016104d5565b600480546040516370a0823160e01b815230928101929092526001600160a01b0316906342966c689082906370a0823190602401602060405180830381865afa158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1f9190611e31565b6040518263ffffffff1660e01b8152600401610e3d91815260200190565b600060405180830381600087803b158015610e5757600080fd5b505af11580156108d2573d6000803e3d6000fd5b6002546001600160a01b03163314610e955760405162461bcd60e51b81526004016104d590611dd4565b6001600160a01b038116610efa5760405162461bcd60e51b815260206004820152602660248201527f6665654164647265737320616464726573732063616e6e6f742062652030206160448201526564647265737360d01b60648201526084016104d5565b600380546001600160a01b0319166001600160a01b03831690811790915560405133907fd44190acf9d04bdb5d3a1aafff7e6dee8b40b93dfb8c5d3f0eea4b9f4539c3f790600090a350565b6002546001600160a01b03163314610f705760405162461bcd60e51b81526004016104d590611dd4565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b610f9a611895565b6000339050600060058481548110610fb457610fb4611e1b565b60009182526020808320878452600680835260408086206001600160a01b03891687529093529190932091029091019150610fee85610b40565b80541561107e57600061102682600101546109ab670de0b6b3a76400006109a58760040154876000015461175d90919063ffffffff16565b9050801561107c576110388482611781565b836001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04868260405161107391815260200190565b60405180910390a25b505b831561111057815461109b906001600160a01b03168430876118ee565b600382015461ffff16156111015760038201546000906110c890612710906109a590889061ffff1661175d565b60035484549192506110e7916001600160a01b03908116911683611832565b81546110f99082906109ab9088611769565b825550611110565b805461110d9085611769565b81555b60006005868154811061112557611125611e1b565b600091825260209091206006909102016005015461010090046001600160a01b0316905080156111b35781546040516301a7af8b60e41b815233600482015260248101919091526001600160a01b03821690631a7af8b090604401600060405180830381600087803b15801561119a57600080fd5b505af11580156111ae573d6000803e3d6000fd5b505050505b600483015482546111d191670de0b6b3a7640000916109a59161175d565b600183015560405185815286906001600160a01b038616907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159060200160405180910390a350505050610d5e60018055565b60008060006005858154811061123b5761123b611e1b565b60009182526020808320888452600680835260408086206001600160a01b038b81168852945280862094909102909101600481810154825493516370a0823160e01b8152309281019290925291965093949093909291909116906370a0823190602401602060405180830381865afa1580156112bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112df9190611e31565b90508360020154421180156112f357508015155b156113505760006113088560020154426103e6565b905060006113296007546109a588600101548561175d90919063ffffffff16565b905061134b611344846109a584670de0b6b3a764000061175d565b8590611769565b935050505b61137b83600101546109ab670de0b6b3a76400006109a586886000015461175d90919063ffffffff16565b600585015490965061010090046001600160a01b03161561140f57600584015460405163c031a66f60e01b81526001600160a01b0389811660048301526101009092049091169063c031a66f90602401602060405180830381865afa1580156113e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140c9190611e31565b94505b505050509250929050565b6002546001600160a01b031633146114445760405162461bcd60e51b81526004016104d590611dd4565b61012c8261ffff1611156114a85760405162461bcd60e51b815260206004820152602560248201527f6164643a20696e76616c6964206465706f7369742066656520626173697320706044820152646f696e747360d81b60648201526084016104d5565b6001600160a01b0381163b1515806114c757506001600160a01b038116155b6115225760405162461bcd60e51b815260206004820152602660248201527f6164643a207265776172646572206d75737420626520636f6e7472616374206f60448201526572207a65726f60d01b60648201526084016104d5565b61152b85611926565b831561153957611539610d37565b60085442101561156a578260000361155557600854925061157f565b6008548310156115655760085492505b61157f565b82158061157657504283105b1561157f574292505b6000600854841115806115925750428411155b6040805160e0810182526001600160a01b038981168252602082018b815292820188815261ffff888116606085019081526000608086018181528815801560a089019081528c881660c08a0190815260058054600181018255955298517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0600690950294850180546001600160a01b031916918a1691909117905598517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db184015594517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db283015591517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db38201805461ffff19169190941617909255517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db482015593517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db5909401805493516001600160a81b0319909416941515610100600160a81b031916949094176101009390921692909202179091559091506117415760075461173d9088611769565b6007555b50505050505050565b60006117568284611ea3565b9392505050565b60006117568284611e60565b60006117568284611e77565b60006117568284611eb6565b600480546040516370a0823160e01b815230928101929092526000916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156117cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f39190611e31565b9050801561181a578082111561181f5760045461181a906001600160a01b03168483611832565b505050565b60045461181a906001600160a01b031684845b6040516001600160a01b03831660248201526044810182905261181a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526119c8565b6002600154036118e75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104d5565b6002600155565b6040516001600160a01b03808516602483015283166044820152606481018290526108d29085906323b872dd60e01b9060840161185e565b60055460005b8181101561181a57826001600160a01b03166005828154811061195157611951611e1b565b60009182526020909120600690910201546001600160a01b0316036119b85760405162461bcd60e51b815260206004820152601b60248201527f47656e65736973506f6f6c3a206578697374696e6720706f6f6c3f000000000060448201526064016104d5565b6119c181611e8a565b905061192c565b6000611a1d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a9a9092919063ffffffff16565b80519091501561181a5780806020019051810190611a3b9190611ed8565b61181a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104d5565b6060611aa98484600085611ab1565b949350505050565b606082471015611b125760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104d5565b600080866001600160a01b03168587604051611b2e9190611f19565b60006040518083038185875af1925050503d8060008114611b6b576040519150601f19603f3d011682016040523d82523d6000602084013e611b70565b606091505b5091509150611b8187838387611b8c565b979650505050505050565b60608315611bfb578251600003611bf4576001600160a01b0385163b611bf45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104d5565b5081611aa9565b611aa98383815115611c105781518083602001fd5b8060405162461bcd60e51b81526004016104d59190611f35565b600060208284031215611c3c57600080fd5b5035919050565b60008060408385031215611c5657600080fd5b50508035926020909101359150565b803561ffff81168114611c7757600080fd5b919050565b600080600060608486031215611c9157600080fd5b8335925060208401359150611ca860408501611c65565b90509250925092565b6001600160a01b0381168114611cc657600080fd5b50565b600080600060608486031215611cde57600080fd5b8335611ce981611cb1565b9250602084013591506040840135611d0081611cb1565b809150509250925092565b600060208284031215611d1d57600080fd5b813561175681611cb1565b60008060408385031215611d3b57600080fd5b823591506020830135611d4d81611cb1565b809150509250929050565b8015158114611cc657600080fd5b60008060008060008060c08789031215611d7f57600080fd5b863595506020870135611d9181611cb1565b94506040870135611da181611d58565b935060608701359250611db660808801611c65565b915060a0870135611dc681611cb1565b809150509295509295509295565b60208082526027908201527f47656e65736973506f6f6c3a2063616c6c6572206973206e6f7420746865206f6040820152663832b930ba37b960c91b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611e4357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176104a5576104a5611e4a565b808201808211156104a5576104a5611e4a565b600060018201611e9c57611e9c611e4a565b5060010190565b818103818111156104a5576104a5611e4a565b600082611ed357634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215611eea57600080fd5b815161175681611d58565b60005b83811015611f10578181015183820152602001611ef8565b50506000910152565b60008251611f2b818460208701611ef5565b9190910192915050565b6020815260008251806020840152611f54816040850160208701611ef5565b601f01601f1916919091016040019291505056fea2646970667358221220ce3a103101d2cd018abd42ffda285b859cdcf51511904f085509af1a2528ba6664736f6c63430008110033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.