ETH Price: $3,424.85 (-0.45%)
Gas: 2 Gwei

Contract

0x32c0Fc9Edbae6B81514103991b39d1C2958d4af1
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Initialize121067402021-03-25 7:21:261195 days ago1616656886IN
0x32c0Fc9E...2958d4af1
0 ETH0.01798065150
0x60806040121067332021-03-25 7:20:471195 days ago1616656847IN
 Create: PerpRewardVesting
0 ETH0.2007201150

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PerpRewardVesting

Compiler Version
v0.6.9+commit.3e3065ac

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv3 license
File 1 of 12 : PerpRewardVesting.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;

import { IERC20 } from "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol";
import { SafeMath } from "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import { MerkleRedeemUpgradeSafe } from "./Balancer/MerkleRedeemUpgradeSafe.sol";
import { Decimal } from "../utils/Decimal.sol";
import { DecimalERC20 } from "../utils/DecimalERC20.sol";
import { BlockContext } from "../utils/BlockContext.sol";

contract PerpRewardVesting is MerkleRedeemUpgradeSafe, BlockContext {
    using Decimal for Decimal.decimal;
    using SafeMath for uint256;

    //**********************************************************//
    //    The below state variables can not change the order    //
    //**********************************************************//
    // {weekMerkleRootsIndex: timestamp}
    mapping(uint256 => uint256) public merkleRootTimestampMap;

    // array of weekMerkleRootsIndex
    uint256[] public merkleRootIndexes;

    uint256 public vestingPeriod;

    //**********************************************************//
    //    The above state variables can not change the order    //
    //**********************************************************//

    //◥◤◥◤◥◤◥◤◥◤◥◤◥◤◥◤ add state variables below ◥◤◥◤◥◤◥◤◥◤◥◤◥◤◥◤//

    //◢◣◢◣◢◣◢◣◢◣◢◣◢◣◢◣ add state variable, ables above ◢◣◢◣◢◣◢◣◢◣◢◣◢◣◢◣//
    uint256[50] private __gap;

    function initialize(IERC20 _token, uint256 _vestingPeriod) external initializer {
        require(address(_token) != address(0), "Invalid input");
        __MerkleRedeem_init(_token);
        vestingPeriod = _vestingPeriod;
    }

    function claimWeeks(address _account, Claim[] memory _claims) public virtual override {
        for (uint256 i; i < _claims.length; i++) {
            claimWeek(_account, _claims[i].week, _claims[i].balance, _claims[i].merkleProof);
        }
    }

    function claimWeek(
        address _account,
        uint256 _week,
        uint256 _claimedBalance,
        bytes32[] memory _merkleProof
    ) public virtual override {
        //
        //                      +----------------+
        //                      | vesting period |
        //           +----------------+----------+
        //           | vesting period |          |
        //  ---------+------+---+-----+------+---+
        //           |          |     |     now  |
        //           |        week2   |          merkleRootTimestampMap[week1]
        //           |                |
        //         week1              merkleRootTimestampMap[week1]
        //
        //  week1 -> claimable
        //  week2 -> non-claimable
        //
        require(
            _blockTimestamp() >= merkleRootTimestampMap[_week] && merkleRootTimestampMap[_week] > 0,
            "Invalid claim"
        );
        super.claimWeek(_account, _week, _claimedBalance, _merkleProof);
    }

    function seedAllocations(
        uint256 _week,
        bytes32 _merkleRoot,
        uint256 _totalAllocation
    ) public override onlyOwner {
        super.seedAllocations(_week, _merkleRoot, _totalAllocation);
        merkleRootTimestampMap[_week] = _blockTimestamp().add(vestingPeriod);
        merkleRootIndexes.push(_week);
    }

    //
    // INTERNAL
    //

    function getLengthOfMerkleRoots() external view returns (uint256) {
        return merkleRootIndexes.length;
    }
}

File 2 of 12 : MerkleRedeemUpgradeSafe.sol
// source: https://github.com/balancer-labs/erc20-redeemable/blob/master/merkle/contracts/MerkleRedeem.sol
// changes:
// 1. add license and update solidity version to 0.6.9
// 2. make it upgradeable
// 3. add virtual modifier in claim functions

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;

import { MerkleProof } from "@openzeppelin/contracts-ethereum-package/contracts/cryptography/MerkleProof.sol";
import { IERC20 } from "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol";
import { PerpFiOwnableUpgrade } from "../../utils/PerpFiOwnableUpgrade.sol";

contract MerkleRedeemUpgradeSafe is PerpFiOwnableUpgrade {
    event Claimed(address _claimant, uint256 _balance);

    //**********************************************************//
    //    The below state variables can not change the order    //
    //**********************************************************//
    // Recorded weeks
    mapping(uint256 => bytes32) public weekMerkleRoots;
    mapping(uint256 => mapping(address => bool)) public claimed;

    IERC20 public token;

    //**********************************************************//
    //    The above state variables can not change the order    //
    //**********************************************************//

    //◥◤◥◤◥◤◥◤◥◤◥◤◥◤◥◤ add state variables below ◥◤◥◤◥◤◥◤◥◤◥◤◥◤◥◤//

    //◢◣◢◣◢◣◢◣◢◣◢◣◢◣◢◣ add state variables above ◢◣◢◣◢◣◢◣◢◣◢◣◢◣◢◣//
    uint256[50] private __gap;

    //
    // FUNCTIONS
    //

    function __MerkleRedeem_init(IERC20 _token) internal initializer {
        __Ownable_init();
        __MerkleRedeem_init_unchained(_token);
    }

    function __MerkleRedeem_init_unchained(IERC20 _token) internal initializer {
        token = _token;
    }

    function disburse(address _liquidityProvider, uint256 _balance) private {
        if (_balance > 0) {
            emit Claimed(_liquidityProvider, _balance);
            require(token.transfer(_liquidityProvider, _balance), "ERR_TRANSFER_FAILED");
        }
    }

    function claimWeek(
        address _liquidityProvider,
        uint256 _week,
        uint256 _claimedBalance,
        bytes32[] memory _merkleProof
    ) public virtual {
        require(!claimed[_week][_liquidityProvider], "Claimed already");
        require(verifyClaim(_liquidityProvider, _week, _claimedBalance, _merkleProof), "Incorrect merkle proof");

        claimed[_week][_liquidityProvider] = true;
        disburse(_liquidityProvider, _claimedBalance);
    }

    struct Claim {
        uint256 week;
        uint256 balance;
        bytes32[] merkleProof;
    }

    function claimWeeks(address _liquidityProvider, Claim[] memory claims) public virtual {
        uint256 totalBalance = 0;
        Claim memory claim;
        for (uint256 i = 0; i < claims.length; i++) {
            claim = claims[i];

            require(!claimed[claim.week][_liquidityProvider], "Claimed already");
            require(
                verifyClaim(_liquidityProvider, claim.week, claim.balance, claim.merkleProof),
                "Incorrect merkle proof"
            );

            totalBalance += claim.balance;
            claimed[claim.week][_liquidityProvider] = true;
        }
        disburse(_liquidityProvider, totalBalance);
    }

    function claimStatus(
        address _liquidityProvider,
        uint256 _begin,
        uint256 _end
    ) external view returns (bool[] memory) {
        uint256 size = 1 + _end - _begin;
        bool[] memory arr = new bool[](size);
        for (uint256 i = 0; i < size; i++) {
            arr[i] = claimed[_begin + i][_liquidityProvider];
        }
        return arr;
    }

    function merkleRoots(uint256 _begin, uint256 _end) external view returns (bytes32[] memory) {
        uint256 size = 1 + _end - _begin;
        bytes32[] memory arr = new bytes32[](size);
        for (uint256 i = 0; i < size; i++) {
            arr[i] = weekMerkleRoots[_begin + i];
        }
        return arr;
    }

    function verifyClaim(
        address _liquidityProvider,
        uint256 _week,
        uint256 _claimedBalance,
        bytes32[] memory _merkleProof
    ) public view virtual returns (bool valid) {
        bytes32 leaf = keccak256(abi.encodePacked(_liquidityProvider, _claimedBalance));
        return MerkleProof.verify(_merkleProof, weekMerkleRoots[_week], leaf);
    }

    function seedAllocations(
        uint256 _week,
        bytes32 _merkleRoot,
        uint256 _totalAllocation
    ) public virtual {
        require(weekMerkleRoots[_week] == bytes32(0), "cannot rewrite merkle root");
        weekMerkleRoots[_week] = _merkleRoot;

        require(token.transferFrom(msg.sender, address(this), _totalAllocation), "ERR_TRANSFER_FAILED");
    }
}

File 3 of 12 : PerpFiOwnableUpgrade.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.9;

import { ContextUpgradeSafe } from "@openzeppelin/contracts-ethereum-package/contracts/GSN/Context.sol";

// copy from openzeppelin Ownable, only modify how the owner transfer
/**
 * @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.
 */
contract PerpFiOwnableUpgrade is ContextUpgradeSafe {
    address private _owner;
    address private _candidate;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */

    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    function candidate() public view returns (address) {
        return _candidate;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(_owner == _msgSender(), "PerpFiOwnableUpgrade: 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 Set ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function setOwner(address newOwner) public onlyOwner {
        require(newOwner != address(0), "PerpFiOwnableUpgrade: zero address");
        require(newOwner != _owner, "PerpFiOwnableUpgrade: same as original");
        require(newOwner != _candidate, "PerpFiOwnableUpgrade: same as candidate");
        _candidate = newOwner;
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`_candidate`).
     * Can only be called by the new owner.
     */
    function updateOwner() public {
        require(_candidate != address(0), "PerpFiOwnableUpgrade: candidate is zero address");
        require(_candidate == _msgSender(), "PerpFiOwnableUpgrade: not the new owner");

        emit OwnershipTransferred(_owner, _candidate);
        _owner = _candidate;
        _candidate = address(0);
    }

    uint256[50] private __gap;
}

File 4 of 12 : Decimal.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.9;

import { SafeMath } from "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import { DecimalMath } from "./DecimalMath.sol";

library Decimal {
    using DecimalMath for uint256;
    using SafeMath for uint256;

    struct decimal {
        uint256 d;
    }

    function zero() internal pure returns (decimal memory) {
        return decimal(0);
    }

    function one() internal pure returns (decimal memory) {
        return decimal(DecimalMath.unit(18));
    }

    function toUint(decimal memory x) internal pure returns (uint256) {
        return x.d;
    }

    function modD(decimal memory x, decimal memory y) internal pure returns (decimal memory) {
        return decimal(x.d.mul(DecimalMath.unit(18)) % y.d);
    }

    function cmp(decimal memory x, decimal memory y) internal pure returns (int8) {
        if (x.d > y.d) {
            return 1;
        } else if (x.d < y.d) {
            return -1;
        }
        return 0;
    }

    /// @dev add two decimals
    function addD(decimal memory x, decimal memory y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.add(y.d);
        return t;
    }

    /// @dev subtract two decimals
    function subD(decimal memory x, decimal memory y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.sub(y.d);
        return t;
    }

    /// @dev multiple two decimals
    function mulD(decimal memory x, decimal memory y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.muld(y.d);
        return t;
    }

    /// @dev multiple a decimal by a uint256
    function mulScalar(decimal memory x, uint256 y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.mul(y);
        return t;
    }

    /// @dev divide two decimals
    function divD(decimal memory x, decimal memory y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.divd(y.d);
        return t;
    }

    /// @dev divide a decimal by a uint256
    function divScalar(decimal memory x, uint256 y) internal pure returns (decimal memory) {
        decimal memory t;
        t.d = x.d.div(y);
        return t;
    }
}

File 5 of 12 : DecimalMath.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.9;

import { SafeMath } from "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";

/// @dev Implements simple fixed point math add, sub, mul and div operations.
/// @author Alberto Cuesta Cañada
library DecimalMath {
    using SafeMath for uint256;

    /// @dev Returns 1 in the fixed point representation, with `decimals` decimals.
    function unit(uint8 decimals) internal pure returns (uint256) {
        return 10**uint256(decimals);
    }

    /// @dev Adds x and y, assuming they are both fixed point with 18 decimals.
    function addd(uint256 x, uint256 y) internal pure returns (uint256) {
        return x.add(y);
    }

    /// @dev Subtracts y from x, assuming they are both fixed point with 18 decimals.
    function subd(uint256 x, uint256 y) internal pure returns (uint256) {
        return x.sub(y);
    }

    /// @dev Multiplies x and y, assuming they are both fixed point with 18 digits.
    function muld(uint256 x, uint256 y) internal pure returns (uint256) {
        return muld(x, y, 18);
    }

    /// @dev Multiplies x and y, assuming they are both fixed point with `decimals` digits.
    function muld(
        uint256 x,
        uint256 y,
        uint8 decimals
    ) internal pure returns (uint256) {
        return x.mul(y).div(unit(decimals));
    }

    /// @dev Divides x between y, assuming they are both fixed point with 18 digits.
    function divd(uint256 x, uint256 y) internal pure returns (uint256) {
        return divd(x, y, 18);
    }

    /// @dev Divides x between y, assuming they are both fixed point with `decimals` digits.
    function divd(
        uint256 x,
        uint256 y,
        uint8 decimals
    ) internal pure returns (uint256) {
        return x.mul(unit(decimals)).div(y);
    }
}

File 6 of 12 : DecimalERC20.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.9;

import { IERC20 } from "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol";
import { SafeMath } from "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol";
import { Decimal } from "./Decimal.sol";

abstract contract DecimalERC20 {
    using SafeMath for uint256;
    using Decimal for Decimal.decimal;

    mapping(address => uint256) private decimalMap;

    //◥◤◥◤◥◤◥◤◥◤◥◤◥◤◥◤ add state variables below ◥◤◥◤◥◤◥◤◥◤◥◤◥◤◥◤//

    //◢◣◢◣◢◣◢◣◢◣◢◣◢◣◢◣ add state variables above ◢◣◢◣◢◣◢◣◢◣◢◣◢◣◢◣//
    uint256[50] private __gap;

    //
    // INTERNAL functions
    //

    // CAUTION: do not input _from == _to s.t. this function will always fail
    function _transfer(
        IERC20 _token,
        address _to,
        Decimal.decimal memory _value
    ) internal {
        _updateDecimal(address(_token));
        Decimal.decimal memory balanceBefore = _balanceOf(_token, _to);
        uint256 roundedDownValue = _toUint(_token, _value);

        // solhint-disable avoid-low-level-calls
        (bool success, bytes memory data) =
            address(_token).call(abi.encodeWithSelector(_token.transfer.selector, _to, roundedDownValue));

        require(success && (data.length == 0 || abi.decode(data, (bool))), "DecimalERC20: transfer failed");
        _validateBalance(_token, _to, roundedDownValue, balanceBefore);
    }

    function _transferFrom(
        IERC20 _token,
        address _from,
        address _to,
        Decimal.decimal memory _value
    ) internal {
        _updateDecimal(address(_token));
        Decimal.decimal memory balanceBefore = _balanceOf(_token, _to);
        uint256 roundedDownValue = _toUint(_token, _value);

        // solhint-disable avoid-low-level-calls
        (bool success, bytes memory data) =
            address(_token).call(abi.encodeWithSelector(_token.transferFrom.selector, _from, _to, roundedDownValue));

        require(success && (data.length == 0 || abi.decode(data, (bool))), "DecimalERC20: transferFrom failed");
        _validateBalance(_token, _to, roundedDownValue, balanceBefore);
    }

    function _approve(
        IERC20 _token,
        address _spender,
        Decimal.decimal memory _value
    ) internal {
        _updateDecimal(address(_token));
        // to be compatible with some erc20 tokens like USDT
        __approve(_token, _spender, Decimal.zero());
        __approve(_token, _spender, _value);
    }

    //
    // VIEW
    //
    function _allowance(
        IERC20 _token,
        address _owner,
        address _spender
    ) internal view returns (Decimal.decimal memory) {
        return _toDecimal(_token, _token.allowance(_owner, _spender));
    }

    function _balanceOf(IERC20 _token, address _owner) internal view returns (Decimal.decimal memory) {
        return _toDecimal(_token, _token.balanceOf(_owner));
    }

    function _totalSupply(IERC20 _token) internal view returns (Decimal.decimal memory) {
        return _toDecimal(_token, _token.totalSupply());
    }

    function _toDecimal(IERC20 _token, uint256 _number) internal view returns (Decimal.decimal memory) {
        uint256 tokenDecimals = _getTokenDecimals(address(_token));
        if (tokenDecimals >= 18) {
            return Decimal.decimal(_number.div(10**(tokenDecimals.sub(18))));
        }

        return Decimal.decimal(_number.mul(10**(uint256(18).sub(tokenDecimals))));
    }

    function _toUint(IERC20 _token, Decimal.decimal memory _decimal) internal view returns (uint256) {
        uint256 tokenDecimals = _getTokenDecimals(address(_token));
        if (tokenDecimals >= 18) {
            return _decimal.toUint().mul(10**(tokenDecimals.sub(18)));
        }
        return _decimal.toUint().div(10**(uint256(18).sub(tokenDecimals)));
    }

    function _getTokenDecimals(address _token) internal view returns (uint256) {
        uint256 tokenDecimals = decimalMap[_token];
        if (tokenDecimals == 0) {
            (bool success, bytes memory data) = _token.staticcall(abi.encodeWithSignature("decimals()"));
            require(success && data.length != 0, "DecimalERC20: get decimals failed");
            tokenDecimals = abi.decode(data, (uint256));
        }
        return tokenDecimals;
    }

    //
    // PRIVATE
    //
    function _updateDecimal(address _token) private {
        uint256 tokenDecimals = _getTokenDecimals(_token);
        if (decimalMap[_token] != tokenDecimals) {
            decimalMap[_token] = tokenDecimals;
        }
    }

    function __approve(
        IERC20 _token,
        address _spender,
        Decimal.decimal memory _value
    ) private {
        // solhint-disable avoid-low-level-calls
        (bool success, bytes memory data) =
            address(_token).call(abi.encodeWithSelector(_token.approve.selector, _spender, _toUint(_token, _value)));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "DecimalERC20: approve failed");
    }

    // To prevent from deflationary token, check receiver's balance is as expectation.
    function _validateBalance(
        IERC20 _token,
        address _to,
        uint256 _roundedDownValue,
        Decimal.decimal memory _balanceBefore
    ) private view {
        require(
            _balanceOf(_token, _to).cmp(_balanceBefore.addD(_toDecimal(_token, _roundedDownValue))) == 0,
            "DecimalERC20: balance inconsistent"
        );
    }
}

File 7 of 12 : BlockContext.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.9;

// wrap block.xxx functions for testing
// only support timestamp and number so far
abstract contract BlockContext {
    //◥◤◥◤◥◤◥◤◥◤◥◤◥◤◥◤ add state variables below ◥◤◥◤◥◤◥◤◥◤◥◤◥◤◥◤//

    //◢◣◢◣◢◣◢◣◢◣◢◣◢◣◢◣ add state variables above ◢◣◢◣◢◣◢◣◢◣◢◣◢◣◢◣//
    uint256[50] private __gap;

    function _blockTimestamp() internal view virtual returns (uint256) {
        return block.timestamp;
    }

    function _blockNumber() internal view virtual returns (uint256) {
        return block.number;
    }
}

File 8 of 12 : IERC20.sol
pragma solidity ^0.6.0;

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

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

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

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

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

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

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

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

File 9 of 12 : SafeMath.sol
pragma solidity ^0.6.0;

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

        return c;
    }

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

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

File 10 of 12 : MerkleProof.sol
pragma solidity ^0.6.0;

/**
 * @dev These functions deal with verification of Merkle trees (hash trees),
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        bytes32 computedHash = leaf;

        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];

            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }

        // Check if the computed hash (root) is equal to the provided root
        return computedHash == root;
    }
}

File 11 of 12 : Context.sol
pragma solidity ^0.6.0;
import "../Initializable.sol";

/*
 * @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.
 */
contract ContextUpgradeSafe is Initializable {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.

    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {


    }


    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;
    }

    uint256[50] private __gap;
}

File 12 of 12 : Initializable.sol
pragma solidity >=0.4.24 <0.7.0;


/**
 * @title Initializable
 *
 * @dev Helper contract to support initializer functions. To use it, replace
 * the constructor with a function that has the `initializer` modifier.
 * WARNING: Unlike constructors, initializer functions must be manually
 * invoked. This applies both to deploying an Initializable contract, as well
 * as extending an Initializable contract via inheritance.
 * WARNING: When used with inheritance, manual care must be taken to not invoke
 * a parent initializer twice, or ensure that all initializers are idempotent,
 * because this is not dealt with automatically as with constructors.
 */
contract Initializable {

  /**
   * @dev Indicates that the contract has been initialized.
   */
  bool private initialized;

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

  /**
   * @dev Modifier to use in the initializer function of a contract.
   */
  modifier initializer() {
    require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");

    bool isTopLevelCall = !initializing;
    if (isTopLevelCall) {
      initializing = true;
      initialized = true;
    }

    _;

    if (isTopLevelCall) {
      initializing = false;
    }
  }

  /// @dev Returns true if and only if the function is running in the constructor
  function isConstructor() private view returns (bool) {
    // extcodesize checks the size of the code stored in an address, and
    // address returns the current address. Since the code is still not
    // deployed when running a constructor, any checks on its code size will
    // yield zero, making it an effective way to detect if a contract is
    // under construction or not.
    address self = address(this);
    uint256 cs;
    assembly { cs := extcodesize(self) }
    return cs == 0;
  }

  // Reserved storage space to allow for layout changes in the future.
  uint256[50] private ______gap;
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_claimant","type":"address"},{"indexed":false,"internalType":"uint256","name":"_balance","type":"uint256"}],"name":"Claimed","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"},{"inputs":[],"name":"candidate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_liquidityProvider","type":"address"},{"internalType":"uint256","name":"_begin","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"claimStatus","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_week","type":"uint256"},{"internalType":"uint256","name":"_claimedBalance","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"claimWeek","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"components":[{"internalType":"uint256","name":"week","type":"uint256"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"internalType":"struct MerkleRedeemUpgradeSafe.Claim[]","name":"_claims","type":"tuple[]"}],"name":"claimWeeks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"claimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLengthOfMerkleRoots","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_vestingPeriod","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"merkleRootIndexes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"merkleRootTimestampMap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_begin","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"merkleRoots","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_week","type":"uint256"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"_totalAllocation","type":"uint256"}],"name":"seedAllocations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"updateOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_liquidityProvider","type":"address"},{"internalType":"uint256","name":"_week","type":"uint256"},{"internalType":"uint256","name":"_claimedBalance","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"verifyClaim","outputs":[{"internalType":"bool","name":"valid","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vestingPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"weekMerkleRoots","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5061173e806100206000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80637313ee5a116100ad578063dd8c9c9d11610071578063dd8c9c9d1461023a578063e2bd3e351461024d578063eb0d07f514610260578063f373579f14610273578063fc0c546a1461028657610121565b80637313ee5a146101fc5780638da5cb5b14610204578063bc5920ba1461020c578063c804c39a14610214578063cd6dc6871461022757610121565b806347fb23c1116100f457806347fb23c1146101995780634cd488ab146101b957806358b4e4b4146101cc5780636c8381f8146101df578063715018a6146101f457610121565b8063120aa8771461012657806313af40351461014f57806339144f501461016457806339436b0014610179575b600080fd5b6101396101343660046111dc565b61028e565b6040516101469190611356565b60405180910390f35b61016261015d366004610fe0565b6102ae565b005b61016c610390565b6040516101469190611361565b61018c610187366004611236565b610397565b604051610146919061131e565b6101ac6101a73660046110e4565b61042b565b60405161014691906112d8565b6101626101c736600461120b565b6104df565b6101626101da366004611118565b610584565b6101e76105e6565b6040516101469190611287565b6101626105f5565b61016c610674565b6101e761067b565b61016261068a565b610162610222366004610ffc565b61074d565b610162610235366004611199565b6107b7565b61016c6102483660046111c4565b610870565b61016c61025b3660046111c4565b610882565b61013961026e366004611118565b610895565b61016c6102813660046111c4565b6108eb565b6101e761090a565b609a60209081526000928352604080842090915290825290205460ff1681565b6102b6610919565b6065546001600160a01b039081169116146102ec5760405162461bcd60e51b81526004016102e390611619565b60405180910390fd5b6001600160a01b0381166103125760405162461bcd60e51b81526004016102e3906114af565b6065546001600160a01b03828116911614156103405760405162461bcd60e51b81526004016102e390611666565b6066546001600160a01b038281169116141561036e5760405162461bcd60e51b81526004016102e3906113d1565b606680546001600160a01b0319166001600160a01b0392909216919091179055565b6101015490565b6060828203600101818167ffffffffffffffff811180156103b757600080fd5b506040519080825280602002602001820160405280156103e1578160200160208202803683370190505b50905060005b8281101561042257858101600090815260996020526040902054825183908390811061040f57fe5b60209081029190910101526001016103e7565b50949350505050565b6060828203600101818167ffffffffffffffff8111801561044b57600080fd5b50604051908082528060200260200182016040528015610475578160200160208202803683370190505b50905060005b828110156104d5578581016000908152609a602090815260408083206001600160a01b038b168452909152902054825160ff909116908390839081106104bd57fe5b9115156020928302919091019091015260010161047b565b5095945050505050565b6104e7610919565b6065546001600160a01b039081169116146105145760405162461bcd60e51b81526004016102e390611619565b61051f83838361091d565b61053a6101025461052e6109fd565b9063ffffffff610a0116565b60008481526101006020526040812091909155610101805460018101825591527f109ea3cebb188b9c1b9fc5bb3920be60dfdc8699098dff92f3d80daaca74768901929092555050565b6000838152610100602052604090205461059c6109fd565b101580156105b857506000838152610100602052604090205415155b6105d45760405162461bcd60e51b81526004016102e39061145f565b6105e084848484610a2d565b50505050565b6066546001600160a01b031690565b6105fd610919565b6065546001600160a01b0390811691161461062a5760405162461bcd60e51b81526004016102e390611619565b6065546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3606580546001600160a01b0319169055565b6101025481565b6065546001600160a01b031690565b6066546001600160a01b03166106b25760405162461bcd60e51b81526004016102e3906115ca565b6106ba610919565b6066546001600160a01b039081169116146106e75760405162461bcd60e51b81526004016102e390611418565b6066546065546040516001600160a01b0392831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360668054606580546001600160a01b03199081166001600160a01b03841617909155169055565b60005b81518110156107b2576107aa8383838151811061076957fe5b60200260200101516000015184848151811061078157fe5b60200260200101516020015185858151811061079957fe5b602002602001015160400151610584565b600101610750565b505050565b600054610100900460ff16806107d057506107d0610acf565b806107de575060005460ff16155b6107fa5760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610825576000805460ff1961ff0019909116610100171660011790555b6001600160a01b03831661084b5760405162461bcd60e51b81526004016102e39061153f565b61085483610ad5565b61010282905580156107b2576000805461ff0019169055505050565b60996020526000908152604090205481565b6101006020526000908152604090205481565b60008085846040516020016108ab929190611257565b6040516020818303038152906040528051906020012090506108e183609960008881526020019081526020016000205483610b6a565b9695505050505050565b61010181815481106108f957fe5b600091825260209091200154905081565b609b546001600160a01b031681565b3390565b600083815260996020526040902054156109495760405162461bcd60e51b81526004016102e390611593565b60008381526099602052604090819020839055609b5490516323b872dd60e01b81526001600160a01b03909116906323b872dd9061098f9033903090869060040161129b565b602060405180830381600087803b1580156109a957600080fd5b505af11580156109bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e19190611179565b6107b25760405162461bcd60e51b81526004016102e390611566565b4290565b600082820183811015610a265760405162461bcd60e51b81526004016102e39061139a565b9392505050565b6000838152609a602090815260408083206001600160a01b038816845290915290205460ff1615610a705760405162461bcd60e51b81526004016102e390611486565b610a7c84848484610895565b610a985760405162461bcd60e51b81526004016102e39061136a565b6000838152609a602090815260408083206001600160a01b03881684529091529020805460ff191660011790556105e08483610c07565b303b1590565b600054610100900460ff1680610aee5750610aee610acf565b80610afc575060005460ff16155b610b185760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610b43576000805460ff1961ff0019909116610100171660011790555b610b4b610ce6565b610b5482610d79565b8015610b66576000805461ff00191690555b5050565b600081815b8551811015610bfc576000868281518110610b8657fe5b60200260200101519050808311610bc7578281604051602001610baa929190611279565b604051602081830303815290604052805190602001209250610bf3565b8083604051602001610bda929190611279565b6040516020818303038152906040528051906020012092505b50600101610b6f565b509092149392505050565b8015610b66577fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a8282604051610c3e9291906112bf565b60405180910390a1609b5460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90610c7890859085906004016112bf565b602060405180830381600087803b158015610c9257600080fd5b505af1158015610ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cca9190611179565b610b665760405162461bcd60e51b81526004016102e390611566565b600054610100900460ff1680610cff5750610cff610acf565b80610d0d575060005460ff16155b610d295760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610d54576000805460ff1961ff0019909116610100171660011790555b610d5c610e17565b610d64610e98565b8015610d76576000805461ff00191690555b50565b600054610100900460ff1680610d925750610d92610acf565b80610da0575060005460ff16155b610dbc5760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610de7576000805460ff1961ff0019909116610100171660011790555b609b80546001600160a01b0319166001600160a01b0384161790558015610b66576000805461ff00191690555050565b600054610100900460ff1680610e305750610e30610acf565b80610e3e575060005460ff16155b610e5a5760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610d64576000805460ff1961ff0019909116610100171660011790558015610d76576000805461ff001916905550565b600054610100900460ff1680610eb15750610eb1610acf565b80610ebf575060005460ff16155b610edb5760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610f06576000805460ff1961ff0019909116610100171660011790555b6000610f10610919565b606580546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015610d76576000805461ff001916905550565b600082601f830112610f82578081fd5b8135610f95610f90826116d3565b6116ac565b818152915060208083019084810181840286018201871015610fb657600080fd5b60005b84811015610fd557813584529282019290820190600101610fb9565b505050505092915050565b600060208284031215610ff1578081fd5b8135610a26816116f3565b6000806040838503121561100e578081fd5b8235611019816116f3565b915060208381013567ffffffffffffffff80821115611036578384fd5b81860187601f820112611047578485fd5b80359250611057610f90846116d3565b83815284810190828601875b868110156110d357813585016060818e03601f1901121561108257898afd5b61108c60606116ac565b89820135815260408201358a8201526060820135888111156110ac578b8cfd5b6110ba8f8c83860101610f72565b6040830152508552509287019290870190600101611063565b50979a909950975050505050505050565b6000806000606084860312156110f8578081fd5b8335611103816116f3565b95602085013595506040909401359392505050565b6000806000806080858703121561112d578081fd5b8435611138816116f3565b93506020850135925060408501359150606085013567ffffffffffffffff811115611161578182fd5b61116d87828801610f72565b91505092959194509250565b60006020828403121561118a578081fd5b81518015158114610a26578182fd5b600080604083850312156111ab578182fd5b82356111b6816116f3565b946020939093013593505050565b6000602082840312156111d5578081fd5b5035919050565b600080604083850312156111ee578182fd5b823591506020830135611200816116f3565b809150509250929050565b60008060006060848603121561121f578283fd5b505081359360208301359350604090920135919050565b60008060408385031215611248578182fd5b50508035926020909101359150565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b918252602082015260400190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156113125783511515835292840192918401916001016112f4565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156113125783518352928401929184019160010161133a565b901515815260200190565b90815260200190565b60208082526016908201527524b731b7b93932b1ba1036b2b935b63290383937b7b360511b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526027908201527f5065727046694f776e61626c65557067726164653a2073616d652061732063616040820152666e64696461746560c81b606082015260800190565b60208082526027908201527f5065727046694f776e61626c65557067726164653a206e6f7420746865206e656040820152663b9037bbb732b960c91b606082015260800190565b6020808252600d908201526c496e76616c696420636c61696d60981b604082015260600190565b6020808252600f908201526e436c61696d656420616c726561647960881b604082015260600190565b60208082526022908201527f5065727046694f776e61626c65557067726164653a207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252602e908201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560408201526d195b881a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252600d908201526c125b9d985b1a59081a5b9c1d5d609a1b604082015260600190565b60208082526013908201527211549497d514905394d1915497d19052531151606a1b604082015260600190565b6020808252601a908201527f63616e6e6f742072657772697465206d65726b6c6520726f6f74000000000000604082015260600190565b6020808252602f908201527f5065727046694f776e61626c65557067726164653a2063616e6469646174652060408201526e6973207a65726f206164647265737360881b606082015260800190565b6020808252602d908201527f5065727046694f776e61626c65557067726164653a2063616c6c65722069732060408201526c3737ba103a34329037bbb732b960991b606082015260800190565b60208082526026908201527f5065727046694f776e61626c65557067726164653a2073616d65206173206f726040820152651a59da5b985b60d21b606082015260800190565b60405181810167ffffffffffffffff811182821017156116cb57600080fd5b604052919050565b600067ffffffffffffffff8211156116e9578081fd5b5060209081020190565b6001600160a01b0381168114610d7657600080fdfea26469706673582212209e357462c4d9ccdba700907e54b4ed305562564745dc2973f7e438acd7237a5064736f6c63430006090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101215760003560e01c80637313ee5a116100ad578063dd8c9c9d11610071578063dd8c9c9d1461023a578063e2bd3e351461024d578063eb0d07f514610260578063f373579f14610273578063fc0c546a1461028657610121565b80637313ee5a146101fc5780638da5cb5b14610204578063bc5920ba1461020c578063c804c39a14610214578063cd6dc6871461022757610121565b806347fb23c1116100f457806347fb23c1146101995780634cd488ab146101b957806358b4e4b4146101cc5780636c8381f8146101df578063715018a6146101f457610121565b8063120aa8771461012657806313af40351461014f57806339144f501461016457806339436b0014610179575b600080fd5b6101396101343660046111dc565b61028e565b6040516101469190611356565b60405180910390f35b61016261015d366004610fe0565b6102ae565b005b61016c610390565b6040516101469190611361565b61018c610187366004611236565b610397565b604051610146919061131e565b6101ac6101a73660046110e4565b61042b565b60405161014691906112d8565b6101626101c736600461120b565b6104df565b6101626101da366004611118565b610584565b6101e76105e6565b6040516101469190611287565b6101626105f5565b61016c610674565b6101e761067b565b61016261068a565b610162610222366004610ffc565b61074d565b610162610235366004611199565b6107b7565b61016c6102483660046111c4565b610870565b61016c61025b3660046111c4565b610882565b61013961026e366004611118565b610895565b61016c6102813660046111c4565b6108eb565b6101e761090a565b609a60209081526000928352604080842090915290825290205460ff1681565b6102b6610919565b6065546001600160a01b039081169116146102ec5760405162461bcd60e51b81526004016102e390611619565b60405180910390fd5b6001600160a01b0381166103125760405162461bcd60e51b81526004016102e3906114af565b6065546001600160a01b03828116911614156103405760405162461bcd60e51b81526004016102e390611666565b6066546001600160a01b038281169116141561036e5760405162461bcd60e51b81526004016102e3906113d1565b606680546001600160a01b0319166001600160a01b0392909216919091179055565b6101015490565b6060828203600101818167ffffffffffffffff811180156103b757600080fd5b506040519080825280602002602001820160405280156103e1578160200160208202803683370190505b50905060005b8281101561042257858101600090815260996020526040902054825183908390811061040f57fe5b60209081029190910101526001016103e7565b50949350505050565b6060828203600101818167ffffffffffffffff8111801561044b57600080fd5b50604051908082528060200260200182016040528015610475578160200160208202803683370190505b50905060005b828110156104d5578581016000908152609a602090815260408083206001600160a01b038b168452909152902054825160ff909116908390839081106104bd57fe5b9115156020928302919091019091015260010161047b565b5095945050505050565b6104e7610919565b6065546001600160a01b039081169116146105145760405162461bcd60e51b81526004016102e390611619565b61051f83838361091d565b61053a6101025461052e6109fd565b9063ffffffff610a0116565b60008481526101006020526040812091909155610101805460018101825591527f109ea3cebb188b9c1b9fc5bb3920be60dfdc8699098dff92f3d80daaca74768901929092555050565b6000838152610100602052604090205461059c6109fd565b101580156105b857506000838152610100602052604090205415155b6105d45760405162461bcd60e51b81526004016102e39061145f565b6105e084848484610a2d565b50505050565b6066546001600160a01b031690565b6105fd610919565b6065546001600160a01b0390811691161461062a5760405162461bcd60e51b81526004016102e390611619565b6065546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3606580546001600160a01b0319169055565b6101025481565b6065546001600160a01b031690565b6066546001600160a01b03166106b25760405162461bcd60e51b81526004016102e3906115ca565b6106ba610919565b6066546001600160a01b039081169116146106e75760405162461bcd60e51b81526004016102e390611418565b6066546065546040516001600160a01b0392831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360668054606580546001600160a01b03199081166001600160a01b03841617909155169055565b60005b81518110156107b2576107aa8383838151811061076957fe5b60200260200101516000015184848151811061078157fe5b60200260200101516020015185858151811061079957fe5b602002602001015160400151610584565b600101610750565b505050565b600054610100900460ff16806107d057506107d0610acf565b806107de575060005460ff16155b6107fa5760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610825576000805460ff1961ff0019909116610100171660011790555b6001600160a01b03831661084b5760405162461bcd60e51b81526004016102e39061153f565b61085483610ad5565b61010282905580156107b2576000805461ff0019169055505050565b60996020526000908152604090205481565b6101006020526000908152604090205481565b60008085846040516020016108ab929190611257565b6040516020818303038152906040528051906020012090506108e183609960008881526020019081526020016000205483610b6a565b9695505050505050565b61010181815481106108f957fe5b600091825260209091200154905081565b609b546001600160a01b031681565b3390565b600083815260996020526040902054156109495760405162461bcd60e51b81526004016102e390611593565b60008381526099602052604090819020839055609b5490516323b872dd60e01b81526001600160a01b03909116906323b872dd9061098f9033903090869060040161129b565b602060405180830381600087803b1580156109a957600080fd5b505af11580156109bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e19190611179565b6107b25760405162461bcd60e51b81526004016102e390611566565b4290565b600082820183811015610a265760405162461bcd60e51b81526004016102e39061139a565b9392505050565b6000838152609a602090815260408083206001600160a01b038816845290915290205460ff1615610a705760405162461bcd60e51b81526004016102e390611486565b610a7c84848484610895565b610a985760405162461bcd60e51b81526004016102e39061136a565b6000838152609a602090815260408083206001600160a01b03881684529091529020805460ff191660011790556105e08483610c07565b303b1590565b600054610100900460ff1680610aee5750610aee610acf565b80610afc575060005460ff16155b610b185760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610b43576000805460ff1961ff0019909116610100171660011790555b610b4b610ce6565b610b5482610d79565b8015610b66576000805461ff00191690555b5050565b600081815b8551811015610bfc576000868281518110610b8657fe5b60200260200101519050808311610bc7578281604051602001610baa929190611279565b604051602081830303815290604052805190602001209250610bf3565b8083604051602001610bda929190611279565b6040516020818303038152906040528051906020012092505b50600101610b6f565b509092149392505050565b8015610b66577fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a8282604051610c3e9291906112bf565b60405180910390a1609b5460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb90610c7890859085906004016112bf565b602060405180830381600087803b158015610c9257600080fd5b505af1158015610ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cca9190611179565b610b665760405162461bcd60e51b81526004016102e390611566565b600054610100900460ff1680610cff5750610cff610acf565b80610d0d575060005460ff16155b610d295760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610d54576000805460ff1961ff0019909116610100171660011790555b610d5c610e17565b610d64610e98565b8015610d76576000805461ff00191690555b50565b600054610100900460ff1680610d925750610d92610acf565b80610da0575060005460ff16155b610dbc5760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610de7576000805460ff1961ff0019909116610100171660011790555b609b80546001600160a01b0319166001600160a01b0384161790558015610b66576000805461ff00191690555050565b600054610100900460ff1680610e305750610e30610acf565b80610e3e575060005460ff16155b610e5a5760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610d64576000805460ff1961ff0019909116610100171660011790558015610d76576000805461ff001916905550565b600054610100900460ff1680610eb15750610eb1610acf565b80610ebf575060005460ff16155b610edb5760405162461bcd60e51b81526004016102e3906114f1565b600054610100900460ff16158015610f06576000805460ff1961ff0019909116610100171660011790555b6000610f10610919565b606580546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015610d76576000805461ff001916905550565b600082601f830112610f82578081fd5b8135610f95610f90826116d3565b6116ac565b818152915060208083019084810181840286018201871015610fb657600080fd5b60005b84811015610fd557813584529282019290820190600101610fb9565b505050505092915050565b600060208284031215610ff1578081fd5b8135610a26816116f3565b6000806040838503121561100e578081fd5b8235611019816116f3565b915060208381013567ffffffffffffffff80821115611036578384fd5b81860187601f820112611047578485fd5b80359250611057610f90846116d3565b83815284810190828601875b868110156110d357813585016060818e03601f1901121561108257898afd5b61108c60606116ac565b89820135815260408201358a8201526060820135888111156110ac578b8cfd5b6110ba8f8c83860101610f72565b6040830152508552509287019290870190600101611063565b50979a909950975050505050505050565b6000806000606084860312156110f8578081fd5b8335611103816116f3565b95602085013595506040909401359392505050565b6000806000806080858703121561112d578081fd5b8435611138816116f3565b93506020850135925060408501359150606085013567ffffffffffffffff811115611161578182fd5b61116d87828801610f72565b91505092959194509250565b60006020828403121561118a578081fd5b81518015158114610a26578182fd5b600080604083850312156111ab578182fd5b82356111b6816116f3565b946020939093013593505050565b6000602082840312156111d5578081fd5b5035919050565b600080604083850312156111ee578182fd5b823591506020830135611200816116f3565b809150509250929050565b60008060006060848603121561121f578283fd5b505081359360208301359350604090920135919050565b60008060408385031215611248578182fd5b50508035926020909101359150565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b918252602082015260400190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156113125783511515835292840192918401916001016112f4565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156113125783518352928401929184019160010161133a565b901515815260200190565b90815260200190565b60208082526016908201527524b731b7b93932b1ba1036b2b935b63290383937b7b360511b604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526027908201527f5065727046694f776e61626c65557067726164653a2073616d652061732063616040820152666e64696461746560c81b606082015260800190565b60208082526027908201527f5065727046694f776e61626c65557067726164653a206e6f7420746865206e656040820152663b9037bbb732b960c91b606082015260800190565b6020808252600d908201526c496e76616c696420636c61696d60981b604082015260600190565b6020808252600f908201526e436c61696d656420616c726561647960881b604082015260600190565b60208082526022908201527f5065727046694f776e61626c65557067726164653a207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252602e908201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560408201526d195b881a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252600d908201526c125b9d985b1a59081a5b9c1d5d609a1b604082015260600190565b60208082526013908201527211549497d514905394d1915497d19052531151606a1b604082015260600190565b6020808252601a908201527f63616e6e6f742072657772697465206d65726b6c6520726f6f74000000000000604082015260600190565b6020808252602f908201527f5065727046694f776e61626c65557067726164653a2063616e6469646174652060408201526e6973207a65726f206164647265737360881b606082015260800190565b6020808252602d908201527f5065727046694f776e61626c65557067726164653a2063616c6c65722069732060408201526c3737ba103a34329037bbb732b960991b606082015260800190565b60208082526026908201527f5065727046694f776e61626c65557067726164653a2073616d65206173206f726040820152651a59da5b985b60d21b606082015260800190565b60405181810167ffffffffffffffff811182821017156116cb57600080fd5b604052919050565b600067ffffffffffffffff8211156116e9578081fd5b5060209081020190565b6001600160a01b0381168114610d7657600080fdfea26469706673582212209e357462c4d9ccdba700907e54b4ed305562564745dc2973f7e438acd7237a5064736f6c63430006090033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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