ETH Price: $2,256.73 (-7.88%)

Contract

0x332D6DaCd25aF65A5eDa55ADae60a7398Eb9535D

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Emergency Withdr...4081260132025-12-07 12:41:2956 days ago1765111289IN
0x332D6DaC...98Eb9535D
0 ETH0.000000490.01
Harvest Dividend...3566684432025-07-11 19:12:13205 days ago1752261133IN
0x332D6DaC...98Eb9535D
0 ETH0.000001060.01
Harvest Dividend...3542581012025-07-04 19:26:10212 days ago1751657170IN
0x332D6DaC...98Eb9535D
0 ETH0.000000940.01
Harvest Dividend...3515120542025-06-26 20:21:40220 days ago1750969300IN
0x332D6DaC...98Eb9535D
0 ETH0.000001030.01
Harvest Dividend...3447732452025-06-07 6:59:58239 days ago1749279598IN
0x332D6DaC...98Eb9535D
0 ETH0.000002670.026748
Harvest Dividend...3441641662025-06-05 12:31:43241 days ago1749126703IN
0x332D6DaC...98Eb9535D
0 ETH0.000001050.01
Harvest Dividend...3438480632025-06-04 14:29:11242 days ago1749047351IN
0x332D6DaC...98Eb9535D
0 ETH0.000001420.01
Harvest Dividend...3438125132025-06-04 12:00:30242 days ago1749038430IN
0x332D6DaC...98Eb9535D
0 ETH0.000001030.01
Harvest Dividend...3394584752025-05-22 20:26:51255 days ago1747945611IN
0x332D6DaC...98Eb9535D
0 ETH0.000001130.01
Harvest Dividend...3393660142025-05-22 13:59:51255 days ago1747922391IN
0x332D6DaC...98Eb9535D
0 ETH0.000003090.028996
Harvest Dividend...3393616492025-05-22 13:41:39255 days ago1747921299IN
0x332D6DaC...98Eb9535D
0 ETH0.000005810.07732
Harvest Dividend...3389294552025-05-21 7:38:05256 days ago1747813085IN
0x332D6DaC...98Eb9535D
0 ETH0.000002870.032367
Harvest Dividend...3389293282025-05-21 7:37:33256 days ago1747813053IN
0x332D6DaC...98Eb9535D
0 ETH0.000002560.028725
Harvest Dividend...3389292022025-05-21 7:37:01256 days ago1747813021IN
0x332D6DaC...98Eb9535D
0 ETH0.000002610.029314
Harvest Dividend...3387105372025-05-20 16:22:26257 days ago1747758146IN
0x332D6DaC...98Eb9535D
0 ETH0.000001150.01
Harvest Dividend...3366954172025-05-14 19:30:47263 days ago1747251047IN
0x332D6DaC...98Eb9535D
0 ETH0.000000910.01
Harvest Dividend...3366953472025-05-14 19:30:29263 days ago1747251029IN
0x332D6DaC...98Eb9535D
0 ETH0.000001130.01
Harvest Dividend...3366952992025-05-14 19:30:17263 days ago1747251017IN
0x332D6DaC...98Eb9535D
0 ETH0.000001130.01
Harvest Dividend...3366952502025-05-14 19:30:03263 days ago1747251003IN
0x332D6DaC...98Eb9535D
0 ETH0.000001130.01
Harvest Dividend...3366951552025-05-14 19:29:40263 days ago1747250980IN
0x332D6DaC...98Eb9535D
0 ETH0.000001130.01
Harvest Dividend...3366950672025-05-14 19:29:17263 days ago1747250957IN
0x332D6DaC...98Eb9535D
0 ETH0.000001130.01
Harvest Dividend...3366949842025-05-14 19:28:56263 days ago1747250936IN
0x332D6DaC...98Eb9535D
0 ETH0.000001130.01
Harvest Dividend...3366948992025-05-14 19:28:36263 days ago1747250916IN
0x332D6DaC...98Eb9535D
0 ETH0.000001090.01
Harvest Dividend...3366945812025-05-14 19:27:16263 days ago1747250836IN
0x332D6DaC...98Eb9535D
0 ETH0.000001090.01
Harvest Dividend...3363960722025-05-13 22:32:50264 days ago1747175570IN
0x332D6DaC...98Eb9535D
0 ETH0.000001040.01
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
3566684432025-07-11 19:12:13205 days ago1752261133
0x332D6DaC...98Eb9535D
0.00058541 ETH
3566684432025-07-11 19:12:13205 days ago1752261133
0x332D6DaC...98Eb9535D
0.00058541 ETH
3542581012025-07-04 19:26:10212 days ago1751657170
0x332D6DaC...98Eb9535D
0.00819055 ETH
3542581012025-07-04 19:26:10212 days ago1751657170
0x332D6DaC...98Eb9535D
0.00819055 ETH
3515120542025-06-26 20:21:40220 days ago1750969300
0x332D6DaC...98Eb9535D
0.00035869 ETH
3515120542025-06-26 20:21:40220 days ago1750969300
0x332D6DaC...98Eb9535D
0.00035869 ETH
3441641662025-06-05 12:31:43241 days ago1749126703
0x332D6DaC...98Eb9535D
0.0015908 ETH
3441641662025-06-05 12:31:43241 days ago1749126703
0x332D6DaC...98Eb9535D
0.0015908 ETH
3438480632025-06-04 14:29:11242 days ago1749047351
0x332D6DaC...98Eb9535D
0.00043302 ETH
3438480632025-06-04 14:29:11242 days ago1749047351
0x332D6DaC...98Eb9535D
0.00043302 ETH
3438125132025-06-04 12:00:30242 days ago1749038430
0x332D6DaC...98Eb9535D
0.00002091 ETH
3438125132025-06-04 12:00:30242 days ago1749038430
0x332D6DaC...98Eb9535D
0.00002091 ETH
3394584752025-05-22 20:26:51255 days ago1747945611
0x332D6DaC...98Eb9535D
0.00219999 ETH
3394584752025-05-22 20:26:51255 days ago1747945611
0x332D6DaC...98Eb9535D
0.00219999 ETH
3393660142025-05-22 13:59:51255 days ago1747922391
0x332D6DaC...98Eb9535D
0.00846824 ETH
3393660142025-05-22 13:59:51255 days ago1747922391
0x332D6DaC...98Eb9535D
0.00846824 ETH
3387105372025-05-20 16:22:26257 days ago1747758146
0x332D6DaC...98Eb9535D
0.00711729 ETH
3387105372025-05-20 16:22:26257 days ago1747758146
0x332D6DaC...98Eb9535D
0.00711729 ETH
3366953472025-05-14 19:30:29263 days ago1747251029
0x332D6DaC...98Eb9535D
0.00048618 ETH
3366953472025-05-14 19:30:29263 days ago1747251029
0x332D6DaC...98Eb9535D
0.00048618 ETH
3366952992025-05-14 19:30:17263 days ago1747251017
0x332D6DaC...98Eb9535D
0.00042348 ETH
3366952992025-05-14 19:30:17263 days ago1747251017
0x332D6DaC...98Eb9535D
0.00042348 ETH
3366952502025-05-14 19:30:03263 days ago1747251003
0x332D6DaC...98Eb9535D
0.00068713 ETH
3366952502025-05-14 19:30:03263 days ago1747251003
0x332D6DaC...98Eb9535D
0.00068713 ETH
3366951552025-05-14 19:29:40263 days ago1747250980
0x332D6DaC...98Eb9535D
0.00044449 ETH
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Dividends

Compiler Version
v0.7.5+commit.eb77ed08

Optimization Enabled:
Yes with 1 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.5;

import "./lib/Ownable.sol";
import "./lib/SafeERC20.sol";
import "./lib/ReentrancyGuard.sol";
import "./lib/SafeMath.sol";
import "./lib/EnumerableSet.sol";

import "./interfaces/IDividends.sol";
import "./interfaces/IGMVDTokenUsage.sol";
import "./interfaces/IWETH.sol";


/*
 * This contract is used to distribute dividends to users that allocated gMVD here
 *
 * Dividends can be distributed in the form of one or more tokens
 * They are mainly managed to be received from the FeeManager contract, but other sources can be added (dev wallet for instance)
 *
 * The freshly received dividends are stored in a pending slot
 *
 * The content of this pending slot will be progressively transferred over time into a distribution slot
 * This distribution slot is the source of the dividends distribution to gMVD allocators during the current cycle
 *
 * This transfer from the pending slot to the distribution slot is based on cycleDividendsPercent and CYCLE_PERIOD_SECONDS
 *
 */
contract Dividends is Ownable, ReentrancyGuard, IGMVDTokenUsage, IDividends {
  using SafeMath for uint256;
  using SafeERC20 for IERC20;
  using EnumerableSet for EnumerableSet.AddressSet;

  struct UserInfo {
    uint256 pendingDividends;
    uint256 rewardDebt;
  }

  struct DividendsInfo {
    uint256 currentDistributionAmount; // total amount to distribute during the current cycle
    uint256 currentCycleDistributedAmount; // amount already distributed for the current cycle (times 1e2)
    uint256 pendingAmount; // total amount in the pending slot, not distributed yet
    uint256 distributedAmount; // total amount that has been distributed since initialization
    uint256 accDividendsPerShare; // accumulated dividends per share (times 1e9)
    uint256 lastUpdateTime; // last time the dividends distribution occurred
    uint256 cycleDividendsPercent; // fixed part of the pending dividends to assign to currentDistributionAmount on every cycle
    bool distributionDisabled; // deactivate a token distribution (for temporary dividends)
  }

  // actively distributed tokens
  EnumerableSet.AddressSet private _distributedTokens;
  uint256 public constant MAX_DISTRIBUTED_TOKENS = 10;
  address public immutable weth;
  // dividends info for every dividends token
  mapping(address => DividendsInfo) public dividendsInfo;
  mapping(address => mapping(address => UserInfo)) public users;

  address public immutable gMVDToken; // gMVDToken contract

  mapping(address => uint256) public usersAllocation; // User's gMVD allocation
  uint256 public totalAllocation; // Contract's total gMVD allocation

  uint256 public constant MIN_CYCLE_DIVIDENDS_PERCENT = 1; // 0.01%
  uint256 public constant DEFAULT_CYCLE_DIVIDENDS_PERCENT = 100; // 1%
  uint256 public constant MAX_CYCLE_DIVIDENDS_PERCENT = 10000; // 100%
  // dividends will be added to the currentDistributionAmount on each new cycle
  uint256 internal _cycleDurationSeconds = 7 days;
  uint256 public currentCycleStartTime;

  constructor(address gMVDToken_, uint256 startTime_, address weth_) {
    require(gMVDToken_ != address(0), "zero address");
    gMVDToken = gMVDToken_;
    currentCycleStartTime = startTime_;
    weth = weth_;
  }

  /********************************************/
  /****************** EVENTS ******************/
  /********************************************/

  event UserUpdated(address indexed user, uint256 previousBalance, uint256 newBalance);
  event DividendsCollected(address indexed user, address indexed token, uint256 amount);
  event CycleDividendsPercentUpdated(address indexed token, uint256 previousValue, uint256 newValue);
  event DividendsAddedToPending(address indexed token, uint256 amount);
  event DistributedTokenDisabled(address indexed token);
  event DistributedTokenRemoved(address indexed token);
  event DistributedTokenEnabled(address indexed token);

  /***********************************************/
  /****************** MODIFIERS ******************/
  /***********************************************/

  /**
   * @dev Checks if an index exists
   */
  modifier validateDistributedTokensIndex(uint256 index) {
    require(index < _distributedTokens.length(), "validateDistributedTokensIndex: index exists?");
    _;
  }

  /**
   * @dev Checks if token exists
   */
  modifier validateDistributedToken(address token) {
    require(_distributedTokens.contains(token), "validateDistributedTokens: token does not exists");
    _;
  }

  /**
   * @dev Checks if caller is the gMVDToken contract
   */
  modifier gMVDTokenOnly() {
    require(msg.sender == gMVDToken, "gMVDTokenOnly: caller should be gMVDToken");
    _;
  }

  /*******************************************/
  /****************** VIEWS ******************/
  /*******************************************/

  function cycleDurationSeconds() external view returns (uint256) {
    return _cycleDurationSeconds;
  }

  /**
   * @dev Returns the number of dividends tokens
   */
  function distributedTokensLength() external view override returns (uint256) {
    return _distributedTokens.length();
  }

  /**
   * @dev Returns dividends token address from given index
   */
  function distributedToken(uint256 index) external view override validateDistributedTokensIndex(index) returns (address){
    return address(_distributedTokens.at(index));
  }

  /**
   * @dev Returns true if given token is a dividends token
   */
  function isDistributedToken(address token) external view override returns (bool) {
    return _distributedTokens.contains(token);
  }

  /**
   * @dev Returns time at which the next cycle will start
   */
  function nextCycleStartTime() public view returns (uint256) {
    return currentCycleStartTime.add(_cycleDurationSeconds);
  }

  /**
   * @dev Returns user's dividends pending amount for a given token
   */
  function pendingDividendsAmount(address token, address userAddress) external view returns (uint256) {
    if (totalAllocation == 0) {
      return 0;
    }

    DividendsInfo storage dividendsInfo_ = dividendsInfo[token];

    uint256 accDividendsPerShare = dividendsInfo_.accDividendsPerShare;
    uint256 lastUpdateTime = dividendsInfo_.lastUpdateTime;
    uint256 dividendAmountPerSecond_ = _dividendsAmountPerSecond(token);

    // check if the current cycle has changed since last update
    if (_currentBlockTimestamp() > nextCycleStartTime()) {
      // get remaining rewards from last cycle
      accDividendsPerShare = accDividendsPerShare.add(
        (nextCycleStartTime().sub(lastUpdateTime)).mul(dividendAmountPerSecond_).mul(1e7).div(totalAllocation)
      );
      lastUpdateTime = nextCycleStartTime();
      dividendAmountPerSecond_ = dividendsInfo_.pendingAmount.mul(dividendsInfo_.cycleDividendsPercent).div(100).div(
        _cycleDurationSeconds
      );
    }

    // get pending rewards from current cycle
    accDividendsPerShare = accDividendsPerShare.add(
      (_currentBlockTimestamp().sub(lastUpdateTime)).mul(dividendAmountPerSecond_).mul(1e7).div(totalAllocation)
    );

    return usersAllocation[userAddress]
        .mul(accDividendsPerShare)
        .div(1e9)
        .sub(users[token][userAddress].rewardDebt)
        .add(users[token][userAddress].pendingDividends);
  }

  /**************************************************/
  /****************** PUBLIC FUNCTIONS **************/
  /**************************************************/

  /**
   * @dev Updates the current cycle start time if previous cycle has ended
   */
  function updateCurrentCycleStartTime() public {
    uint256 nextCycleStartTime_ = nextCycleStartTime();

    if (_currentBlockTimestamp() >= nextCycleStartTime_) {
      currentCycleStartTime = nextCycleStartTime_;
    }
  }

  /**
   * @dev Updates dividends info for a given token
   */
  function updateDividendsInfo(address token) external validateDistributedToken(token) {
    _updateDividendsInfo(token);
  }

  /****************************************************************/
  /****************** EXTERNAL PUBLIC FUNCTIONS  ******************/
  /****************************************************************/

  /**
   * @dev Updates all dividendsInfo
   */
  function massUpdateDividendsInfo() external {
    uint256 length = _distributedTokens.length();
    for (uint256 index = 0; index < length; ++index) {
      _updateDividendsInfo(_distributedTokens.at(index));
    }
  }

  /**
   * @dev Harvests caller's pending dividends of a given token
   */
  function harvestDividends(address token, bool withdrawEth) external nonReentrant {
    if (!_distributedTokens.contains(token)) {
      require(dividendsInfo[token].distributedAmount > 0, "harvestDividends: invalid token");
    }

    _harvestDividends(token, withdrawEth);
  }

  /**
   * @dev Harvests all caller's pending dividends
   */
  function harvestAllDividends(bool withdrawEth) external nonReentrant {
    uint256 length = _distributedTokens.length();
    for (uint256 index = 0; index < length; ++index) {
      _harvestDividends(_distributedTokens.at(index), withdrawEth);
    }
  }

  /**
   * @dev Transfers the given amount of token from caller to pendingAmount
   *
   * Must only be called by a trustable address
   */
  function addDividendsToPending(address token, uint256 amount) external override nonReentrant {
    uint256 prevTokenBalance = IERC20(token).balanceOf(address(this));
    DividendsInfo storage dividendsInfo_ = dividendsInfo[token];

    IERC20(token).safeTransferFrom(msg.sender, address(this), amount);

    // handle tokens with transfer tax
    uint256 receivedAmount = IERC20(token).balanceOf(address(this)).sub(prevTokenBalance);
    dividendsInfo_.pendingAmount = dividendsInfo_.pendingAmount.add(receivedAmount);

    emit DividendsAddedToPending(token, receivedAmount);
  }

  /**
   * @dev Emergency withdraw token's balance on the contract
   */
  function emergencyWithdraw(IERC20 token) public nonReentrant onlyOwner {
    uint256 balance = token.balanceOf(address(this));
    require(balance > 0, "emergencyWithdraw: token balance is null");
    _safeTokenTransfer(token, msg.sender, balance);
  }

  /**
   * @dev Emergency withdraw all dividend tokens' balances on the contract
   */
  function emergencyWithdrawAll() external nonReentrant onlyOwner {
    for (uint256 index = 0; index < _distributedTokens.length(); ++index) {
      emergencyWithdraw(IERC20(_distributedTokens.at(index)));
    }
  }

  /*****************************************************************/
  /****************** OWNABLE FUNCTIONS  ******************/
  /*****************************************************************/

  /**
   * Allocates "userAddress" user's "amount" of gMVD to this dividends contract
   *
   * Can only be called by gMVDToken contract, which is trusted to verify amounts
   * "data" is only here for compatibility reasons (IGMVDTokenUsage)
   */
  function allocate(address userAddress, uint256 amount, bytes calldata /*data*/) external override nonReentrant gMVDTokenOnly {
    uint256 newUserAllocation = usersAllocation[userAddress].add(amount);
    uint256 newTotalAllocation = totalAllocation.add(amount);
    _updateUser(userAddress, newUserAllocation, newTotalAllocation);
  }

  /**
   * Deallocates "userAddress" user's "amount" of gMVD allocation from this dividends contract
   *
   * Can only be called by gMVDToken contract, which is trusted to verify amounts
   * "data" is only here for compatibility reasons (IGMVDTokenUsage)
   */
  function deallocate(address userAddress, uint256 amount, bytes calldata /*data*/) external override nonReentrant gMVDTokenOnly {
    uint256 newUserAllocation = usersAllocation[userAddress].sub(amount);
    uint256 newTotalAllocation = totalAllocation.sub(amount);
    _updateUser(userAddress, newUserAllocation, newTotalAllocation);
  }

  /**
   * @dev Enables a given token to be distributed as dividends
   *
   * Effective from the next cycle
   */
  function enableDistributedToken(address token) external onlyOwner {
    DividendsInfo storage dividendsInfo_ = dividendsInfo[token];
    require(
      dividendsInfo_.lastUpdateTime == 0 || dividendsInfo_.distributionDisabled,
      "enableDistributedToken: Already enabled dividends token"
    );
    require(_distributedTokens.length() < MAX_DISTRIBUTED_TOKENS, "enableDistributedToken: too many distributedTokens");
    // initialize lastUpdateTime if never set before
    if (dividendsInfo_.lastUpdateTime == 0) {
      dividendsInfo_.lastUpdateTime = _currentBlockTimestamp();
    }
    // initialize cycleDividendsPercent to the minimum if never set before
    if (dividendsInfo_.cycleDividendsPercent == 0) {
      dividendsInfo_.cycleDividendsPercent = DEFAULT_CYCLE_DIVIDENDS_PERCENT;
    }
    dividendsInfo_.distributionDisabled = false;
    _distributedTokens.add(token);
    emit DistributedTokenEnabled(token);
  }

  /**
   * @dev Disables distribution of a given token as dividends
   *
   * Effective from the next cycle
   */
  function disableDistributedToken(address token) external onlyOwner {
    DividendsInfo storage dividendsInfo_ = dividendsInfo[token];
    require(
      dividendsInfo_.lastUpdateTime > 0 && !dividendsInfo_.distributionDisabled,
      "disableDistributedToken: Already disabled dividends token"
    );
    dividendsInfo_.distributionDisabled = true;
    emit DistributedTokenDisabled(token);
  }

  /**
   * @dev Updates the percentage of pending dividends that will be distributed during the next cycle
   *
   * Must be a value between MIN_CYCLE_DIVIDENDS_PERCENT and MAX_CYCLE_DIVIDENDS_PERCENT
   */
  function updateCycleDividendsPercent(address token, uint256 percent) external onlyOwner {
    require(percent <= MAX_CYCLE_DIVIDENDS_PERCENT, "updateCycleDividendsPercent: percent mustn't exceed maximum");
    require(percent >= MIN_CYCLE_DIVIDENDS_PERCENT, "updateCycleDividendsPercent: percent mustn't exceed minimum");
    DividendsInfo storage dividendsInfo_ = dividendsInfo[token];
    uint256 previousPercent = dividendsInfo_.cycleDividendsPercent;
    dividendsInfo_.cycleDividendsPercent = percent;
    emit CycleDividendsPercentUpdated(token, previousPercent, dividendsInfo_.cycleDividendsPercent);
  }

  /**
  * @dev remove an address from _distributedTokens
  *
  * Can only be valid for a disabled dividends token and if the distribution has ended
  */
  function removeTokenFromDistributedTokens(address tokenToRemove) external onlyOwner {
    DividendsInfo storage _dividendsInfo = dividendsInfo[tokenToRemove];
    require(_dividendsInfo.distributionDisabled && _dividendsInfo.currentDistributionAmount == 0, "removeTokenFromDistributedTokens: cannot be removed");
    _distributedTokens.remove(tokenToRemove);
    emit DistributedTokenRemoved(tokenToRemove);
  }

  function updateCycleDurationSeconds(uint256 cycleDurationSeconds_) external onlyOwner {
    require(cycleDurationSeconds_ >= 7 days, "Dividends: Min cycle duration");
    require(cycleDurationSeconds_ <= 60 days, "Dividends: Max cycle duration");
    _cycleDurationSeconds = cycleDurationSeconds_;
  }

  /********************************************************/
  /****************** INTERNAL FUNCTIONS ******************/
  /********************************************************/

  /**
   * @dev Returns the amount of dividends token distributed every second (times 1e2)
   */
  function _dividendsAmountPerSecond(address token) internal view returns (uint256) {
    if (!_distributedTokens.contains(token)) return 0;
    return dividendsInfo[token].currentDistributionAmount.mul(1e2).div(_cycleDurationSeconds);
  }

  /**
   * @dev Updates every user's rewards allocation for each distributed token
   */
  function _updateDividendsInfo(address token) internal {
    uint256 currentBlockTimestamp = _currentBlockTimestamp();
    DividendsInfo storage dividendsInfo_ = dividendsInfo[token];

    updateCurrentCycleStartTime();

    uint256 lastUpdateTime = dividendsInfo_.lastUpdateTime;
    uint256 accDividendsPerShare = dividendsInfo_.accDividendsPerShare;
    if (currentBlockTimestamp <= lastUpdateTime) {
      return;
    }

    // if no gMVD is allocated or initial distribution has not started yet
    if (totalAllocation == 0 || currentBlockTimestamp < currentCycleStartTime) {
      dividendsInfo_.lastUpdateTime = currentBlockTimestamp;
      return;
    }

    uint256 currentDistributionAmount = dividendsInfo_.currentDistributionAmount; // gas saving
    uint256 currentCycleDistributedAmount = dividendsInfo_.currentCycleDistributedAmount; // gas saving

    // check if the current cycle has changed since last update
    if (lastUpdateTime < currentCycleStartTime) {
      // update accDividendPerShare for the end of the previous cycle
      accDividendsPerShare = accDividendsPerShare.add(
        (currentDistributionAmount.mul(1e2).sub(currentCycleDistributedAmount))
          .mul(1e7)
          .div(totalAllocation)
      );

      // check if distribution is enabled
      if (!dividendsInfo_.distributionDisabled) {
        // transfer the token's cycleDividendsPercent part from the pending slot to the distribution slot
        dividendsInfo_.distributedAmount = dividendsInfo_.distributedAmount.add(currentDistributionAmount);

        uint256 pendingAmount = dividendsInfo_.pendingAmount;
        currentDistributionAmount = pendingAmount.mul(dividendsInfo_.cycleDividendsPercent).div(
          10000
        );
        dividendsInfo_.currentDistributionAmount = currentDistributionAmount;
        dividendsInfo_.pendingAmount = pendingAmount.sub(currentDistributionAmount);
      } else {
        // stop the token's distribution on next cycle
        dividendsInfo_.distributedAmount = dividendsInfo_.distributedAmount.add(currentDistributionAmount);
        currentDistributionAmount = 0;
        dividendsInfo_.currentDistributionAmount = 0;
      }

      currentCycleDistributedAmount = 0;
      lastUpdateTime = currentCycleStartTime;
    }

    uint256 toDistribute = (currentBlockTimestamp.sub(lastUpdateTime)).mul(_dividendsAmountPerSecond(token));
    // ensure that we can't distribute more than currentDistributionAmount (for instance w/ a > 24h service interruption)
    if (currentCycleDistributedAmount.add(toDistribute) > currentDistributionAmount.mul(1e2)) {
      toDistribute = currentDistributionAmount.mul(1e2).sub(currentCycleDistributedAmount);
    }

    dividendsInfo_.currentCycleDistributedAmount = currentCycleDistributedAmount.add(toDistribute);
    dividendsInfo_.accDividendsPerShare = accDividendsPerShare.add(toDistribute.mul(1e7).div(totalAllocation));
    dividendsInfo_.lastUpdateTime = currentBlockTimestamp;
  }

  /**
   * Updates "userAddress" user's and total allocations for each distributed token
   */
  function _updateUser(address userAddress, uint256 newUserAllocation, uint256 newTotalAllocation) internal {
    uint256 previousUserAllocation = usersAllocation[userAddress];

    // for each distributedToken
    uint256 length = _distributedTokens.length();
    for (uint256 index = 0; index < length; ++index) {
      address token = _distributedTokens.at(index);
      _updateDividendsInfo(token);

      UserInfo storage user = users[token][userAddress];
      uint256 accDividendsPerShare = dividendsInfo[token].accDividendsPerShare;

      uint256 pending = previousUserAllocation.mul(accDividendsPerShare).div(1e9).sub(user.rewardDebt);
      user.pendingDividends = user.pendingDividends.add(pending);
      user.rewardDebt = newUserAllocation.mul(accDividendsPerShare).div(1e9);
    }

    usersAllocation[userAddress] = newUserAllocation;
    totalAllocation = newTotalAllocation;

    emit UserUpdated(userAddress, previousUserAllocation, newUserAllocation);
  }

  /**
   * @dev Harvests msg.sender's pending dividends of a given token
   */
  function _harvestDividends(address token, bool withdrawEth) internal {
    _updateDividendsInfo(token);

    UserInfo storage user = users[token][msg.sender];
    uint256 accDividendsPerShare = dividendsInfo[token].accDividendsPerShare;

    uint256 userGMVDAllocation = usersAllocation[msg.sender];
    uint256 pending = user.pendingDividends.add(
      userGMVDAllocation.mul(accDividendsPerShare).div(1e9).sub(user.rewardDebt)
    );

    user.pendingDividends = 0;
    user.rewardDebt = userGMVDAllocation.mul(accDividendsPerShare).div(1e9);

    if(withdrawEth && token == weth ){
      _transferOutETH(pending, payable(msg.sender));
    } else {
      _safeTokenTransfer(IERC20(token), msg.sender, pending);
    }
    emit DividendsCollected(msg.sender, token, pending);
  }

  function _transferOutETH(uint256 _amountOut, address payable _receiver) internal {
    IWETH _weth = IWETH(weth);
    _weth.withdraw(_amountOut);

    (bool success, /* bytes memory data */) = _receiver.call{ value: _amountOut }("");

    if (success) { return; }

    // if the transfer failed, re-wrap the token and send it to the receiver
    _weth.deposit{ value: _amountOut }();
    _weth.transfer(address(_receiver), _amountOut);
  }

  receive() external payable {
      require(msg.sender == weth, "Dividends: invalid sender");
  }

  /**
   * @dev Safe token transfer function, in case rounding error causes pool to not have enough tokens
   */
  function _safeTokenTransfer(
    IERC20 token,
    address to,
    uint256 amount
  ) internal {
    if (amount > 0) {
      uint256 tokenBal = token.balanceOf(address(this));
      if (amount > tokenBal) {
        token.safeTransfer(to, tokenBal);
      } else {
        token.safeTransfer(to, amount);
      }
    }
  }

  /**
   * @dev Utility function to get the current block timestamp
   */
  function _currentBlockTimestamp() internal view virtual returns (uint256) {
    /* solhint-disable not-rely-on-time */
    return block.timestamp;
  }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.7.5;

interface IDividends {
  function distributedTokensLength() external view returns (uint256);

  function distributedToken(uint256 index) external view returns (address);

  function isDistributedToken(address token) external view returns (bool);

  function addDividendsToPending(address token, uint256 amount) external;
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.7.5;

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
pragma solidity ^0.7.5;

interface IGMVDTokenUsage {
    function allocate(address userAddress, uint256 amount, bytes calldata data) external;
    function deallocate(address userAddress, uint256 amount, bytes calldata data) external;
}

//SPDX-License-Identifier: MIT

pragma solidity ^0.7.5;

interface IWETH {
    function deposit() external payable;
    function transfer(address to, uint value) external returns (bool);
    function withdraw(uint) external;
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.7.5;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 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");

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

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.7.5;

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

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.7.5;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.7.5;

import "./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 () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 10 of 12 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.5;

/**
 * @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 make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.7.5;

import "../interfaces/IERC20.sol";
import "./SafeMath.sol";
import "./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 SafeMath for uint256;
    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'
        // solhint-disable-next-line max-line-length
        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).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

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

    /**
     * @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
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.7.5;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        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) {
        // 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) {
        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) {
        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) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        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) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        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) {
        require(b > 0, "SafeMath: modulo by zero");
        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) {
        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.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        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) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"gMVDToken_","type":"address"},{"internalType":"uint256","name":"startTime_","type":"uint256"},{"internalType":"address","name":"weth_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"CycleDividendsPercentUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"DistributedTokenDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"DistributedTokenEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"DistributedTokenRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DividendsAddedToPending","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DividendsCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"UserUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_CYCLE_DIVIDENDS_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_CYCLE_DIVIDENDS_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_DISTRIBUTED_TOKENS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_CYCLE_DIVIDENDS_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addDividendsToPending","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"allocate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentCycleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cycleDurationSeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"userAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"deallocate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"disableDistributedToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"distributedToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributedTokensLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"dividendsInfo","outputs":[{"internalType":"uint256","name":"currentDistributionAmount","type":"uint256"},{"internalType":"uint256","name":"currentCycleDistributedAmount","type":"uint256"},{"internalType":"uint256","name":"pendingAmount","type":"uint256"},{"internalType":"uint256","name":"distributedAmount","type":"uint256"},{"internalType":"uint256","name":"accDividendsPerShare","type":"uint256"},{"internalType":"uint256","name":"lastUpdateTime","type":"uint256"},{"internalType":"uint256","name":"cycleDividendsPercent","type":"uint256"},{"internalType":"bool","name":"distributionDisabled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"enableDistributedToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gMVDToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"withdrawEth","type":"bool"}],"name":"harvestAllDividends","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"withdrawEth","type":"bool"}],"name":"harvestDividends","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"isDistributedToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdateDividendsInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nextCycleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"userAddress","type":"address"}],"name":"pendingDividendsAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenToRemove","type":"address"}],"name":"removeTokenFromDistributedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateCurrentCycleStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"}],"name":"updateCycleDividendsPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"cycleDurationSeconds_","type":"uint256"}],"name":"updateCycleDurationSeconds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"updateDividendsInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"users","outputs":[{"internalType":"uint256","name":"pendingDividends","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"usersAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c060405262093a806008553480156200001857600080fd5b5060405162002d7838038062002d78833981810160405260608110156200003e57600080fd5b508051602082015160409092015190919060006200005b6200011a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180556001600160a01b038316620000f4576040805162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b604482015290519081900360640190fd5b6001600160601b0319606093841b811660a05260099290925590911b166080526200011e565b3390565b60805160601c60a05160601c612c1762000161600039806109045280610e695280610f035250806101a85280610dbd5280611d9b528061230b5250612c176000f3fe6080604052600436106101985760003560e01c8063034d7fcb1461021d5780631c75e3691461026457806328ea7ee1146102f45780632d9c97a41461032057806335d2506d1461036d5780633999a4e5146103a05780633fc8cef3146103d957806347b32f281461040a578063549230c91461041f57806354e34fa1146104af5780635726d26e146104c45780635b2acf17146104d95780635d9b436a1461054f5780635e80536a146105795780636d319d27146105cd5780636e34b818146106085780636ff1c9bc1461061d578063715018a61461065057806379203dc414610665578063799fb9651461067a5780638da5cb5b1461068f578063911c935c146106a457806393c563af146106b9578063bd394a8d146106ec578063c4d3e08314610701578063d2af0b9414610734578063d637ff8314610749578063dd1917191461075e578063ddd48f4714610773578063de9d477e14610788578063e895cca3146107bb578063eb141dcf146107ee578063f2fde38b14610803578063f494ec5a14610836578063f72477891461086f57610218565b3661021857336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610216576040805162461bcd60e51b81526020600482015260196024820152782234bb34b232b732399d1034b73b30b634b21039b2b73232b960391b604482015290519081900360640190fd5b005b600080fd5b34801561022957600080fd5b506102506004803603602081101561024057600080fd5b50356001600160a01b0316610899565b604080519115158252519081900360200190f35b34801561027057600080fd5b506102166004803603606081101561028757600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156102b657600080fd5b8201836020820111156102c857600080fd5b803590602001918460018302840111600160201b831117156102e957600080fd5b5090925090506108ae565b34801561030057600080fd5b506102166004803603602081101561031757600080fd5b503515156109b5565b34801561032c57600080fd5b5061035b6004803603604081101561034357600080fd5b506001600160a01b0381358116916020013516610a41565b60408051918252519081900360200190f35b34801561037957600080fd5b506102166004803603602081101561039057600080fd5b50356001600160a01b0316610b99565b3480156103ac57600080fd5b50610216600480360360408110156103c357600080fd5b506001600160a01b038135169060200135610bed565b3480156103e557600080fd5b506103ee610dbb565b604080516001600160a01b039092168252519081900360200190f35b34801561041657600080fd5b50610216610ddf565b34801561042b57600080fd5b506102166004803603606081101561044257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561047157600080fd5b82018360208201111561048357600080fd5b803590602001918460018302840111600160201b831117156104a457600080fd5b509092509050610e13565b3480156104bb57600080fd5b506103ee610f01565b3480156104d057600080fd5b50610216610f25565b3480156104e557600080fd5b5061050c600480360360208110156104fc57600080fd5b50356001600160a01b0316610f48565b604080519889526020890197909752878701959095526060870193909352608086019190915260a085015260c0840152151560e083015251908190036101000190f35b34801561055b57600080fd5b506103ee6004803603602081101561057257600080fd5b5035610f8e565b34801561058557600080fd5b506105b46004803603604081101561059c57600080fd5b506001600160a01b0381358116916020013516610fea565b6040805192835260208301919091528051918290030190f35b3480156105d957600080fd5b50610216600480360360408110156105f057600080fd5b506001600160a01b038135169060200135151561100e565b34801561061457600080fd5b5061035b6110e8565b34801561062957600080fd5b506102166004803603602081101561064057600080fd5b50356001600160a01b03166110ee565b34801561065c57600080fd5b5061021661125f565b34801561067157600080fd5b5061035b6112f9565b34801561068657600080fd5b5061035b6112ff565b34801561069b57600080fd5b506103ee611305565b3480156106b057600080fd5b5061035b611314565b3480156106c557600080fd5b50610216600480360360208110156106dc57600080fd5b50356001600160a01b0316611319565b3480156106f857600080fd5b5061035b6114a3565b34801561070d57600080fd5b5061035b6004803603602081101561072457600080fd5b50356001600160a01b03166114b4565b34801561074057600080fd5b5061035b6114c6565b34801561075557600080fd5b5061035b6114cb565b34801561076a57600080fd5b506102166114e4565b34801561077f57600080fd5b5061035b6115c7565b34801561079457600080fd5b50610216600480360360208110156107ab57600080fd5b50356001600160a01b03166115cd565b3480156107c757600080fd5b50610216600480360360208110156107de57600080fd5b50356001600160a01b03166116d9565b3480156107fa57600080fd5b5061035b6117ed565b34801561080f57600080fd5b506102166004803603602081101561082657600080fd5b50356001600160a01b03166117f2565b34801561084257600080fd5b506102166004803603604081101561085957600080fd5b506001600160a01b0381351690602001356118e2565b34801561087b57600080fd5b506102166004803603602081101561089257600080fd5b5035611a2f565b60006108a6600283611b46565b90505b919050565b600260015414156108f4576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b6002600155336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109605760405162461bcd60e51b8152600401808060200182810382526029815260200180612b7f6029913960400191505060405180910390fd5b6001600160a01b0384166000908152600660205260408120546109839085611b5b565b9050600061099c85600754611b5b90919063ffffffff16565b90506109a9868383611bb3565b50506001805550505050565b600260015414156109fb576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b60026001819055506000610a0f6002611cec565b905060005b81811015610a3857610a30610a2a600283611cf7565b84611d03565b600101610a14565b50506001805550565b600060075460001415610a5657506000610b93565b6001600160a01b038316600090815260046020819052604082209081015460058201549192909190610a8787611e36565b9050610a916114cb565b610a99611e7b565b1115610b0d57610ad8610ad1600754610acb62989680610ac586610ac589610abf6114cb565b90611e7f565b90611edc565b90611f35565b8490611b5b565b9250610ae26114cb565b9150610b0a600854610acb6064610acb88600601548960020154611edc90919063ffffffff16565b90505b610b2d610ad1600754610acb62989680610ac586610ac589610abf611e7b565b6001600160a01b038881166000908152600560209081526040808320938b168352928152828220805460019091015460069092529290912054929550610b8c92610b869190610abf90633b9aca0090610acb908a611edc565b90611b5b565b9450505050505b92915050565b80610ba5600282611b46565b610be05760405162461bcd60e51b815260040180806020018281038252603081526020018061296d6030913960400191505060405180910390fd5b610be982611f99565b5050565b60026001541415610c33576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b6002600155604080516370a0823160e01b815230600482015290516000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b158015610c8257600080fd5b505afa158015610c96573d6000803e3d6000fd5b505050506040513d6020811015610cac57600080fd5b50516001600160a01b0384166000818152600460205260409020919250610cd59033308661213c565b6000610d5a83866001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610d2857600080fd5b505afa158015610d3c573d6000803e3d6000fd5b505050506040513d6020811015610d5257600080fd5b505190611e7f565b6002830154909150610d6c9082611b5b565b60028301556040805182815290516001600160a01b038716917f28fd761b1b374f526d6eba05c1081e7547a7a6b978161fac6bded2f1dc7a9952919081900360200190a2505060018055505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000610deb6002611cec565b905060005b81811015610be957610e0b610e06600283611cf7565b611f99565b600101610df0565b60026001541415610e59576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b6002600155336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610ec55760405162461bcd60e51b8152600401808060200182810382526029815260200180612b7f6029913960400191505060405180910390fd5b6001600160a01b038416600090815260066020526040812054610ee89085611e7f565b9050600061099c85600754611e7f90919063ffffffff16565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000610f2f6114cb565b905080610f3a611e7b565b10610f455760098190555b50565b6004602081905260009182526040909120805460018201546002830154600384015494840154600585015460068601546007909601549496939592949192909160ff1688565b600081610f9b6002611cec565b8110610fd85760405162461bcd60e51b815260040180806020018281038252602d815260200180612a35602d913960400191505060405180910390fd5b610fe3600284611cf7565b9392505050565b60056020908152600092835260408084209091529082529020805460019091015482565b60026001541415611054576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b600260018190556110659083611b46565b6110d6576001600160a01b0382166000908152600460205260409020600301546110d6576040805162461bcd60e51b815260206004820152601f60248201527f686172766573744469766964656e64733a20696e76616c696420746f6b656e00604482015290519081900360640190fd5b6110e08282611d03565b505060018055565b61271081565b60026001541415611134576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b600260015561114161219c565b6001600160a01b0316611152611305565b6001600160a01b03161461119b576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156111ea57600080fd5b505afa1580156111fe573d6000803e3d6000fd5b505050506040513d602081101561121457600080fd5b50519050806112545760405162461bcd60e51b8152600401808060200182810382526028815260200180612b576028913960400191505060405180910390fd5b6110e08233836121a0565b61126761219c565b6001600160a01b0316611278611305565b6001600160a01b0316146112c1576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b600080546040516001600160a01b0390911690600080516020612ac9833981519152908390a3600080546001600160a01b0319169055565b60075481565b60095481565b6000546001600160a01b031690565b606481565b61132161219c565b6001600160a01b0316611332611305565b6001600160a01b03161461137b576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6001600160a01b0381166000908152600460205260409020600581015415806113a85750600781015460ff165b6113e35760405162461bcd60e51b81526004018080602001828103825260378152602001806129fe6037913960400191505060405180910390fd5b600a6113ef6002611cec565b1061142b5760405162461bcd60e51b815260040180806020018281038252603281526020018061293b6032913960400191505060405180910390fd5b60058101546114425761143c611e7b565b60058201555b600681015461145357606460068201555b60078101805460ff1916905561146a60028361225d565b506040516001600160a01b038316907fefa645a0ab6703d2f2e7f177f50d16c90ce1c71e317bb91cbbdab430e0a3968290600090a25050565b60006114af6002611cec565b905090565b60066020526000908152604090205481565b600a81565b60006114af600854600954611b5b90919063ffffffff16565b6002600154141561152a576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b600260015561153761219c565b6001600160a01b0316611548611305565b6001600160a01b031614611591576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b60005b61159e6002611cec565b8110156115c0576115b86115b3600283611cf7565b6110ee565b600101611594565b5060018055565b60085490565b6115d561219c565b6001600160a01b03166115e6611305565b6001600160a01b03161461162f576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6001600160a01b0381166000908152600460205260409020600781015460ff16801561165a57508054155b6116955760405162461bcd60e51b8152600401808060200182810382526033815260200180612ae96033913960400191505060405180910390fd5b6116a0600283612272565b506040516001600160a01b038316907f17cd3cc84c669de8c5c4218fd1d9814e647b547d1e7f59287ea6989aa4e032c290600090a25050565b6116e161219c565b6001600160a01b03166116f2611305565b6001600160a01b03161461173b576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6001600160a01b038116600090815260046020526040902060058101541580159061176b5750600781015460ff16155b6117a65760405162461bcd60e51b8152600401808060200182810382526039815260200180612bd26039913960400191505060405180910390fd5b60078101805460ff191660011790556040516001600160a01b038316907f961f10509197d967c55f8720c2b6a80d48433ef36db1b12cf3bf6bcf66da434690600090a25050565b600181565b6117fa61219c565b6001600160a01b031661180b611305565b6001600160a01b031614611854576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6001600160a01b0381166118995760405162461bcd60e51b81526004018080602001828103825260268152602001806129d86026913960400191505060405180910390fd5b600080546040516001600160a01b0380851693921691600080516020612ac983398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6118ea61219c565b6001600160a01b03166118fb611305565b6001600160a01b031614611944576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6127108111156119855760405162461bcd60e51b815260040180806020018281038252603b815260200180612b1c603b913960400191505060405180910390fd5b60018110156119c55760405162461bcd60e51b815260040180806020018281038252603b81526020018061299d603b913960400191505060405180910390fd5b6001600160a01b03821660008181526004602090815260409182902060068101805490869055835181815292830186905283519194909390927f82ebda75a31dc518c1b711aab73005a4dddecaf297cee2cf545e72b6a799eb51929081900390910190a250505050565b611a3761219c565b6001600160a01b0316611a48611305565b6001600160a01b031614611a91576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b62093a80811015611ae9576040805162461bcd60e51b815260206004820152601d60248201527f4469766964656e64733a204d696e206379636c65206475726174696f6e000000604482015290519081900360640190fd5b624f1a00811115611b41576040805162461bcd60e51b815260206004820152601d60248201527f4469766964656e64733a204d6178206379636c65206475726174696f6e000000604482015290519081900360640190fd5b600855565b6000610fe3836001600160a01b038416612287565b600082820183811015610fe3576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b6001600160a01b03831660009081526006602052604081205490611bd76002611cec565b905060005b81811015611c88576000611bf1600283611cf7565b9050611bfc81611f99565b6001600160a01b038082166000818152600560209081526040808320948c16835293815283822092825260049081905292812090920154600182015491929091611c5290610abf633b9aca00610acb8b87611edc565b8354909150611c619082611b5b565b8355611c75633b9aca00610acb8b85611edc565b6001938401555050919091019050611bdc565b506001600160a01b0385166000818152600660209081526040918290208790556007869055815185815290810187905281517f97ce9d7086176d6da45e4e7999788176e2629a7591ffe505b0c1b13fe8052cc6929181900390910190a25050505050565b60006108a68261229f565b6000610fe383836122a3565b611d0c82611f99565b6001600160a01b038216600081815260056020908152604080832033808552908352818420948452600480845282852001549084526006909252822054600184015491929091611d7490611d6c90610abf633b9aca00610acb8789611edc565b855490611b5b565b600085559050611d8c633b9aca00610acb8486611edc565b6001850155848015611dcf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316866001600160a01b0316145b15611de357611dde8133612307565b611dee565b611dee8633836121a0565b6040805182815290516001600160a01b0388169133917f45a4759e6c135135eaba72e35bf196d59fd6fe17e1772d731f05dc25ec5a96a29181900360200190a3505050505050565b6000611e43600283611b46565b611e4f575060006108a9565b6008546001600160a01b0383166000908152600460205260409020546108a69190610acb906064611edc565b4290565b600082821115611ed6576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082611eeb57506000610b93565b82820282848281611ef857fe5b0414610fe35760405162461bcd60e51b8152600401808060200182810382526021815260200180612a886021913960400191505060405180910390fd5b6000808211611f88576040805162461bcd60e51b815260206004820152601a602482015279536166654d6174683a206469766973696f6e206279207a65726f60301b604482015290519081900360640190fd5b818381611f9157fe5b049392505050565b6000611fa3611e7b565b6001600160a01b0383166000908152600460205260409020909150611fc6610f25565b60058101546004820154818411611fe05750505050610f45565b6007541580611ff0575060095484105b1561200057505060050155610f45565b825460018401546009548410156120b15760075461203290610ad190610acb62989680610ac586610abf896064611edc565b600786015490935060ff1661208c5760038501546120509083611b5b565b6003860155600285015460068601546120729061271090610acb908490611edc565b80875592506120818184611e7f565b6002870155506120a8565b600385015461209b9083611b5b565b6003860155600080865591505b50600954925060005b60006120c96120bf89611e36565b610ac58988611e7f565b90506120d6836064611edc565b6120e08383611b5b565b11156120f8576120f582610abf856064611edc565b90505b6121028282611b5b565b60018701556007546121269061211f90610acb8462989680611edc565b8590611b5b565b6004870155505050506005909101919091555050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526121969085906124c8565b50505050565b3390565b8015612258576000836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156121f557600080fd5b505afa158015612209573d6000803e3d6000fd5b505050506040513d602081101561221f57600080fd5b50519050808211156122445761223f6001600160a01b0385168483612579565b612196565b6121966001600160a01b0385168484612579565b505050565b6000610fe3836001600160a01b0384166125cb565b6000610fe3836001600160a01b038416612615565b60009081526001919091016020526040902054151590565b5490565b815460009082106122e55760405162461bcd60e51b81526004018080602001828103825260228152602001806128f96022913960400191505060405180910390fd5b8260000182815481106122f457fe5b9060005260206000200154905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000009050806001600160a01b0316632e1a7d4d846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561237257600080fd5b505af1158015612386573d6000803e3d6000fd5b5050604051600092506001600160a01b038516915085908381818185875af1925050503d80600081146123d5576040519150601f19603f3d011682016040523d82523d6000602084013e6123da565b606091505b5050905080156123eb575050610be9565b816001600160a01b031663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b15801561242657600080fd5b505af115801561243a573d6000803e3d6000fd5b5050505050816001600160a01b031663a9059cbb84866040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561249657600080fd5b505af11580156124aa573d6000803e3d6000fd5b505050506040513d60208110156124c057600080fd5b505050505050565b606061251d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126db9092919063ffffffff16565b8051909150156122585780806020019051602081101561253c57600080fd5b50516122585760405162461bcd60e51b815260040180806020018281038252602a815260200180612ba8602a913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526122589084906124c8565b60006125d78383612287565b61260d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610b93565b506000610b93565b600081815260018301602052604081205480156126d1578354600019808301919081019060009087908390811061264857fe5b906000526020600020015490508087600001848154811061266557fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061269557fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610b93565b6000915050610b93565b60606126ea84846000856126f2565b949350505050565b6060824710156127335760405162461bcd60e51b8152600401808060200182810382526026815260200180612a626026913960400191505060405180910390fd5b61273c8561284e565b61278d576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106127cc5780518252601f1990920191602091820191016127ad565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461282e576040519150601f19603f3d011682016040523d82523d6000602084013e612833565b606091505b5091509150612843828286612854565b979650505050505050565b3b151590565b60608315612863575081610fe3565b8251156128735782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156128bd5781810151838201526020016128a5565b50505050905090810190601f1680156128ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64735265656e7472616e637947756172643a207265656e7472616e742063616c6c00656e61626c654469737472696275746564546f6b656e3a20746f6f206d616e79206469737472696275746564546f6b656e7376616c69646174654469737472696275746564546f6b656e733a20746f6b656e20646f6573206e6f74206578697374737570646174654379636c654469766964656e647350657263656e743a2070657263656e74206d7573746e277420657863656564206d696e696d756d4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373656e61626c654469737472696275746564546f6b656e3a20416c726561647920656e61626c6564206469766964656e647320746f6b656e76616c69646174654469737472696275746564546f6b656e73496e6465783a20696e646578206578697374733f416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65728be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e072656d6f7665546f6b656e46726f6d4469737472696275746564546f6b656e733a2063616e6e6f742062652072656d6f7665647570646174654379636c654469766964656e647350657263656e743a2070657263656e74206d7573746e277420657863656564206d6178696d756d656d657267656e637957697468647261773a20746f6b656e2062616c616e6365206973206e756c6c674d5644546f6b656e4f6e6c793a2063616c6c65722073686f756c6420626520674d5644546f6b656e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656464697361626c654469737472696275746564546f6b656e3a20416c72656164792064697361626c6564206469766964656e647320746f6b656ea164736f6c6343000705000a000000000000000000000000fa69292726a53d62111c9485c03ac551ba05679b000000000000000000000000000000000000000000000000000000006433518000000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1

Deployed Bytecode

0x6080604052600436106101985760003560e01c8063034d7fcb1461021d5780631c75e3691461026457806328ea7ee1146102f45780632d9c97a41461032057806335d2506d1461036d5780633999a4e5146103a05780633fc8cef3146103d957806347b32f281461040a578063549230c91461041f57806354e34fa1146104af5780635726d26e146104c45780635b2acf17146104d95780635d9b436a1461054f5780635e80536a146105795780636d319d27146105cd5780636e34b818146106085780636ff1c9bc1461061d578063715018a61461065057806379203dc414610665578063799fb9651461067a5780638da5cb5b1461068f578063911c935c146106a457806393c563af146106b9578063bd394a8d146106ec578063c4d3e08314610701578063d2af0b9414610734578063d637ff8314610749578063dd1917191461075e578063ddd48f4714610773578063de9d477e14610788578063e895cca3146107bb578063eb141dcf146107ee578063f2fde38b14610803578063f494ec5a14610836578063f72477891461086f57610218565b3661021857336001600160a01b037f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab11614610216576040805162461bcd60e51b81526020600482015260196024820152782234bb34b232b732399d1034b73b30b634b21039b2b73232b960391b604482015290519081900360640190fd5b005b600080fd5b34801561022957600080fd5b506102506004803603602081101561024057600080fd5b50356001600160a01b0316610899565b604080519115158252519081900360200190f35b34801561027057600080fd5b506102166004803603606081101561028757600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156102b657600080fd5b8201836020820111156102c857600080fd5b803590602001918460018302840111600160201b831117156102e957600080fd5b5090925090506108ae565b34801561030057600080fd5b506102166004803603602081101561031757600080fd5b503515156109b5565b34801561032c57600080fd5b5061035b6004803603604081101561034357600080fd5b506001600160a01b0381358116916020013516610a41565b60408051918252519081900360200190f35b34801561037957600080fd5b506102166004803603602081101561039057600080fd5b50356001600160a01b0316610b99565b3480156103ac57600080fd5b50610216600480360360408110156103c357600080fd5b506001600160a01b038135169060200135610bed565b3480156103e557600080fd5b506103ee610dbb565b604080516001600160a01b039092168252519081900360200190f35b34801561041657600080fd5b50610216610ddf565b34801561042b57600080fd5b506102166004803603606081101561044257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561047157600080fd5b82018360208201111561048357600080fd5b803590602001918460018302840111600160201b831117156104a457600080fd5b509092509050610e13565b3480156104bb57600080fd5b506103ee610f01565b3480156104d057600080fd5b50610216610f25565b3480156104e557600080fd5b5061050c600480360360208110156104fc57600080fd5b50356001600160a01b0316610f48565b604080519889526020890197909752878701959095526060870193909352608086019190915260a085015260c0840152151560e083015251908190036101000190f35b34801561055b57600080fd5b506103ee6004803603602081101561057257600080fd5b5035610f8e565b34801561058557600080fd5b506105b46004803603604081101561059c57600080fd5b506001600160a01b0381358116916020013516610fea565b6040805192835260208301919091528051918290030190f35b3480156105d957600080fd5b50610216600480360360408110156105f057600080fd5b506001600160a01b038135169060200135151561100e565b34801561061457600080fd5b5061035b6110e8565b34801561062957600080fd5b506102166004803603602081101561064057600080fd5b50356001600160a01b03166110ee565b34801561065c57600080fd5b5061021661125f565b34801561067157600080fd5b5061035b6112f9565b34801561068657600080fd5b5061035b6112ff565b34801561069b57600080fd5b506103ee611305565b3480156106b057600080fd5b5061035b611314565b3480156106c557600080fd5b50610216600480360360208110156106dc57600080fd5b50356001600160a01b0316611319565b3480156106f857600080fd5b5061035b6114a3565b34801561070d57600080fd5b5061035b6004803603602081101561072457600080fd5b50356001600160a01b03166114b4565b34801561074057600080fd5b5061035b6114c6565b34801561075557600080fd5b5061035b6114cb565b34801561076a57600080fd5b506102166114e4565b34801561077f57600080fd5b5061035b6115c7565b34801561079457600080fd5b50610216600480360360208110156107ab57600080fd5b50356001600160a01b03166115cd565b3480156107c757600080fd5b50610216600480360360208110156107de57600080fd5b50356001600160a01b03166116d9565b3480156107fa57600080fd5b5061035b6117ed565b34801561080f57600080fd5b506102166004803603602081101561082657600080fd5b50356001600160a01b03166117f2565b34801561084257600080fd5b506102166004803603604081101561085957600080fd5b506001600160a01b0381351690602001356118e2565b34801561087b57600080fd5b506102166004803603602081101561089257600080fd5b5035611a2f565b60006108a6600283611b46565b90505b919050565b600260015414156108f4576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b6002600155336001600160a01b037f000000000000000000000000fa69292726a53d62111c9485c03ac551ba05679b16146109605760405162461bcd60e51b8152600401808060200182810382526029815260200180612b7f6029913960400191505060405180910390fd5b6001600160a01b0384166000908152600660205260408120546109839085611b5b565b9050600061099c85600754611b5b90919063ffffffff16565b90506109a9868383611bb3565b50506001805550505050565b600260015414156109fb576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b60026001819055506000610a0f6002611cec565b905060005b81811015610a3857610a30610a2a600283611cf7565b84611d03565b600101610a14565b50506001805550565b600060075460001415610a5657506000610b93565b6001600160a01b038316600090815260046020819052604082209081015460058201549192909190610a8787611e36565b9050610a916114cb565b610a99611e7b565b1115610b0d57610ad8610ad1600754610acb62989680610ac586610ac589610abf6114cb565b90611e7f565b90611edc565b90611f35565b8490611b5b565b9250610ae26114cb565b9150610b0a600854610acb6064610acb88600601548960020154611edc90919063ffffffff16565b90505b610b2d610ad1600754610acb62989680610ac586610ac589610abf611e7b565b6001600160a01b038881166000908152600560209081526040808320938b168352928152828220805460019091015460069092529290912054929550610b8c92610b869190610abf90633b9aca0090610acb908a611edc565b90611b5b565b9450505050505b92915050565b80610ba5600282611b46565b610be05760405162461bcd60e51b815260040180806020018281038252603081526020018061296d6030913960400191505060405180910390fd5b610be982611f99565b5050565b60026001541415610c33576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b6002600155604080516370a0823160e01b815230600482015290516000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b158015610c8257600080fd5b505afa158015610c96573d6000803e3d6000fd5b505050506040513d6020811015610cac57600080fd5b50516001600160a01b0384166000818152600460205260409020919250610cd59033308661213c565b6000610d5a83866001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610d2857600080fd5b505afa158015610d3c573d6000803e3d6000fd5b505050506040513d6020811015610d5257600080fd5b505190611e7f565b6002830154909150610d6c9082611b5b565b60028301556040805182815290516001600160a01b038716917f28fd761b1b374f526d6eba05c1081e7547a7a6b978161fac6bded2f1dc7a9952919081900360200190a2505060018055505050565b7f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab181565b6000610deb6002611cec565b905060005b81811015610be957610e0b610e06600283611cf7565b611f99565b600101610df0565b60026001541415610e59576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b6002600155336001600160a01b037f000000000000000000000000fa69292726a53d62111c9485c03ac551ba05679b1614610ec55760405162461bcd60e51b8152600401808060200182810382526029815260200180612b7f6029913960400191505060405180910390fd5b6001600160a01b038416600090815260066020526040812054610ee89085611e7f565b9050600061099c85600754611e7f90919063ffffffff16565b7f000000000000000000000000fa69292726a53d62111c9485c03ac551ba05679b81565b6000610f2f6114cb565b905080610f3a611e7b565b10610f455760098190555b50565b6004602081905260009182526040909120805460018201546002830154600384015494840154600585015460068601546007909601549496939592949192909160ff1688565b600081610f9b6002611cec565b8110610fd85760405162461bcd60e51b815260040180806020018281038252602d815260200180612a35602d913960400191505060405180910390fd5b610fe3600284611cf7565b9392505050565b60056020908152600092835260408084209091529082529020805460019091015482565b60026001541415611054576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b600260018190556110659083611b46565b6110d6576001600160a01b0382166000908152600460205260409020600301546110d6576040805162461bcd60e51b815260206004820152601f60248201527f686172766573744469766964656e64733a20696e76616c696420746f6b656e00604482015290519081900360640190fd5b6110e08282611d03565b505060018055565b61271081565b60026001541415611134576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b600260015561114161219c565b6001600160a01b0316611152611305565b6001600160a01b03161461119b576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156111ea57600080fd5b505afa1580156111fe573d6000803e3d6000fd5b505050506040513d602081101561121457600080fd5b50519050806112545760405162461bcd60e51b8152600401808060200182810382526028815260200180612b576028913960400191505060405180910390fd5b6110e08233836121a0565b61126761219c565b6001600160a01b0316611278611305565b6001600160a01b0316146112c1576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b600080546040516001600160a01b0390911690600080516020612ac9833981519152908390a3600080546001600160a01b0319169055565b60075481565b60095481565b6000546001600160a01b031690565b606481565b61132161219c565b6001600160a01b0316611332611305565b6001600160a01b03161461137b576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6001600160a01b0381166000908152600460205260409020600581015415806113a85750600781015460ff165b6113e35760405162461bcd60e51b81526004018080602001828103825260378152602001806129fe6037913960400191505060405180910390fd5b600a6113ef6002611cec565b1061142b5760405162461bcd60e51b815260040180806020018281038252603281526020018061293b6032913960400191505060405180910390fd5b60058101546114425761143c611e7b565b60058201555b600681015461145357606460068201555b60078101805460ff1916905561146a60028361225d565b506040516001600160a01b038316907fefa645a0ab6703d2f2e7f177f50d16c90ce1c71e317bb91cbbdab430e0a3968290600090a25050565b60006114af6002611cec565b905090565b60066020526000908152604090205481565b600a81565b60006114af600854600954611b5b90919063ffffffff16565b6002600154141561152a576040805162461bcd60e51b815260206004820152601f602482015260008051602061291b833981519152604482015290519081900360640190fd5b600260015561153761219c565b6001600160a01b0316611548611305565b6001600160a01b031614611591576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b60005b61159e6002611cec565b8110156115c0576115b86115b3600283611cf7565b6110ee565b600101611594565b5060018055565b60085490565b6115d561219c565b6001600160a01b03166115e6611305565b6001600160a01b03161461162f576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6001600160a01b0381166000908152600460205260409020600781015460ff16801561165a57508054155b6116955760405162461bcd60e51b8152600401808060200182810382526033815260200180612ae96033913960400191505060405180910390fd5b6116a0600283612272565b506040516001600160a01b038316907f17cd3cc84c669de8c5c4218fd1d9814e647b547d1e7f59287ea6989aa4e032c290600090a25050565b6116e161219c565b6001600160a01b03166116f2611305565b6001600160a01b03161461173b576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6001600160a01b038116600090815260046020526040902060058101541580159061176b5750600781015460ff16155b6117a65760405162461bcd60e51b8152600401808060200182810382526039815260200180612bd26039913960400191505060405180910390fd5b60078101805460ff191660011790556040516001600160a01b038316907f961f10509197d967c55f8720c2b6a80d48433ef36db1b12cf3bf6bcf66da434690600090a25050565b600181565b6117fa61219c565b6001600160a01b031661180b611305565b6001600160a01b031614611854576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6001600160a01b0381166118995760405162461bcd60e51b81526004018080602001828103825260268152602001806129d86026913960400191505060405180910390fd5b600080546040516001600160a01b0380851693921691600080516020612ac983398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6118ea61219c565b6001600160a01b03166118fb611305565b6001600160a01b031614611944576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b6127108111156119855760405162461bcd60e51b815260040180806020018281038252603b815260200180612b1c603b913960400191505060405180910390fd5b60018110156119c55760405162461bcd60e51b815260040180806020018281038252603b81526020018061299d603b913960400191505060405180910390fd5b6001600160a01b03821660008181526004602090815260409182902060068101805490869055835181815292830186905283519194909390927f82ebda75a31dc518c1b711aab73005a4dddecaf297cee2cf545e72b6a799eb51929081900390910190a250505050565b611a3761219c565b6001600160a01b0316611a48611305565b6001600160a01b031614611a91576040805162461bcd60e51b81526020600482018190526024820152600080516020612aa9833981519152604482015290519081900360640190fd5b62093a80811015611ae9576040805162461bcd60e51b815260206004820152601d60248201527f4469766964656e64733a204d696e206379636c65206475726174696f6e000000604482015290519081900360640190fd5b624f1a00811115611b41576040805162461bcd60e51b815260206004820152601d60248201527f4469766964656e64733a204d6178206379636c65206475726174696f6e000000604482015290519081900360640190fd5b600855565b6000610fe3836001600160a01b038416612287565b600082820183811015610fe3576040805162461bcd60e51b815260206004820152601b60248201527a536166654d6174683a206164646974696f6e206f766572666c6f7760281b604482015290519081900360640190fd5b6001600160a01b03831660009081526006602052604081205490611bd76002611cec565b905060005b81811015611c88576000611bf1600283611cf7565b9050611bfc81611f99565b6001600160a01b038082166000818152600560209081526040808320948c16835293815283822092825260049081905292812090920154600182015491929091611c5290610abf633b9aca00610acb8b87611edc565b8354909150611c619082611b5b565b8355611c75633b9aca00610acb8b85611edc565b6001938401555050919091019050611bdc565b506001600160a01b0385166000818152600660209081526040918290208790556007869055815185815290810187905281517f97ce9d7086176d6da45e4e7999788176e2629a7591ffe505b0c1b13fe8052cc6929181900390910190a25050505050565b60006108a68261229f565b6000610fe383836122a3565b611d0c82611f99565b6001600160a01b038216600081815260056020908152604080832033808552908352818420948452600480845282852001549084526006909252822054600184015491929091611d7490611d6c90610abf633b9aca00610acb8789611edc565b855490611b5b565b600085559050611d8c633b9aca00610acb8486611edc565b6001850155848015611dcf57507f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab16001600160a01b0316866001600160a01b0316145b15611de357611dde8133612307565b611dee565b611dee8633836121a0565b6040805182815290516001600160a01b0388169133917f45a4759e6c135135eaba72e35bf196d59fd6fe17e1772d731f05dc25ec5a96a29181900360200190a3505050505050565b6000611e43600283611b46565b611e4f575060006108a9565b6008546001600160a01b0383166000908152600460205260409020546108a69190610acb906064611edc565b4290565b600082821115611ed6576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082611eeb57506000610b93565b82820282848281611ef857fe5b0414610fe35760405162461bcd60e51b8152600401808060200182810382526021815260200180612a886021913960400191505060405180910390fd5b6000808211611f88576040805162461bcd60e51b815260206004820152601a602482015279536166654d6174683a206469766973696f6e206279207a65726f60301b604482015290519081900360640190fd5b818381611f9157fe5b049392505050565b6000611fa3611e7b565b6001600160a01b0383166000908152600460205260409020909150611fc6610f25565b60058101546004820154818411611fe05750505050610f45565b6007541580611ff0575060095484105b1561200057505060050155610f45565b825460018401546009548410156120b15760075461203290610ad190610acb62989680610ac586610abf896064611edc565b600786015490935060ff1661208c5760038501546120509083611b5b565b6003860155600285015460068601546120729061271090610acb908490611edc565b80875592506120818184611e7f565b6002870155506120a8565b600385015461209b9083611b5b565b6003860155600080865591505b50600954925060005b60006120c96120bf89611e36565b610ac58988611e7f565b90506120d6836064611edc565b6120e08383611b5b565b11156120f8576120f582610abf856064611edc565b90505b6121028282611b5b565b60018701556007546121269061211f90610acb8462989680611edc565b8590611b5b565b6004870155505050506005909101919091555050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526121969085906124c8565b50505050565b3390565b8015612258576000836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156121f557600080fd5b505afa158015612209573d6000803e3d6000fd5b505050506040513d602081101561221f57600080fd5b50519050808211156122445761223f6001600160a01b0385168483612579565b612196565b6121966001600160a01b0385168484612579565b505050565b6000610fe3836001600160a01b0384166125cb565b6000610fe3836001600160a01b038416612615565b60009081526001919091016020526040902054151590565b5490565b815460009082106122e55760405162461bcd60e51b81526004018080602001828103825260228152602001806128f96022913960400191505060405180910390fd5b8260000182815481106122f457fe5b9060005260206000200154905092915050565b60007f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab19050806001600160a01b0316632e1a7d4d846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561237257600080fd5b505af1158015612386573d6000803e3d6000fd5b5050604051600092506001600160a01b038516915085908381818185875af1925050503d80600081146123d5576040519150601f19603f3d011682016040523d82523d6000602084013e6123da565b606091505b5050905080156123eb575050610be9565b816001600160a01b031663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b15801561242657600080fd5b505af115801561243a573d6000803e3d6000fd5b5050505050816001600160a01b031663a9059cbb84866040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561249657600080fd5b505af11580156124aa573d6000803e3d6000fd5b505050506040513d60208110156124c057600080fd5b505050505050565b606061251d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166126db9092919063ffffffff16565b8051909150156122585780806020019051602081101561253c57600080fd5b50516122585760405162461bcd60e51b815260040180806020018281038252602a815260200180612ba8602a913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526122589084906124c8565b60006125d78383612287565b61260d57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610b93565b506000610b93565b600081815260018301602052604081205480156126d1578354600019808301919081019060009087908390811061264857fe5b906000526020600020015490508087600001848154811061266557fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061269557fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610b93565b6000915050610b93565b60606126ea84846000856126f2565b949350505050565b6060824710156127335760405162461bcd60e51b8152600401808060200182810382526026815260200180612a626026913960400191505060405180910390fd5b61273c8561284e565b61278d576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106127cc5780518252601f1990920191602091820191016127ad565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461282e576040519150601f19603f3d011682016040523d82523d6000602084013e612833565b606091505b5091509150612843828286612854565b979650505050505050565b3b151590565b60608315612863575081610fe3565b8251156128735782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156128bd5781810151838201526020016128a5565b50505050905090810190601f1680156128ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64735265656e7472616e637947756172643a207265656e7472616e742063616c6c00656e61626c654469737472696275746564546f6b656e3a20746f6f206d616e79206469737472696275746564546f6b656e7376616c69646174654469737472696275746564546f6b656e733a20746f6b656e20646f6573206e6f74206578697374737570646174654379636c654469766964656e647350657263656e743a2070657263656e74206d7573746e277420657863656564206d696e696d756d4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373656e61626c654469737472696275746564546f6b656e3a20416c726561647920656e61626c6564206469766964656e647320746f6b656e76616c69646174654469737472696275746564546f6b656e73496e6465783a20696e646578206578697374733f416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65728be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e072656d6f7665546f6b656e46726f6d4469737472696275746564546f6b656e733a2063616e6e6f742062652072656d6f7665647570646174654379636c654469766964656e647350657263656e743a2070657263656e74206d7573746e277420657863656564206d6178696d756d656d657267656e637957697468647261773a20746f6b656e2062616c616e6365206973206e756c6c674d5644546f6b656e4f6e6c793a2063616c6c65722073686f756c6420626520674d5644546f6b656e5361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656464697361626c654469737472696275746564546f6b656e3a20416c72656164792064697361626c6564206469766964656e647320746f6b656ea164736f6c6343000705000a

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000fa69292726a53d62111c9485c03ac551ba05679b000000000000000000000000000000000000000000000000000000006433518000000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1

-----Decoded View---------------
Arg [0] : gMVDToken_ (address): 0xFA69292726A53d62111c9485C03ac551Ba05679b
Arg [1] : startTime_ (uint256): 1681084800
Arg [2] : weth_ (address): 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000fa69292726a53d62111c9485c03ac551ba05679b
Arg [1] : 0000000000000000000000000000000000000000000000000000000064335180
Arg [2] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.