ETH Price: $3,382.75 (+0.66%)

Contract

0x2bEe80d06383A28AFc630Eb3cd8B9C74eBfad7F7
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Become147807352022-05-15 15:29:54958 days ago1652628594IN
0x2bEe80d0...4eBfad7F7
0 ETH0.0030072955

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
VeToken

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : VeToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./VeTokenProxy.sol";
import "./VeTokenStorage.sol";

// # Interface for checking whether address belongs to a whitelisted
// # type of a smart wallet.
interface SmartWalletChecker {
    function isAllowed(address addr) external returns (bool);
}

contract VeToken is AccessControl, VeTokenStorage {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;
    
    function initialize(
        address tokenAddr_,
        string memory name_,
        string memory symbol_,
        string memory version_,
        uint256 scorePerBlk_,
        uint256 startBlk_
    ) external onlyOwner 
    {
        token = tokenAddr_;
        
        name = name_;
        symbol = symbol_;
        version = version_;

        scorePerBlk = scorePerBlk_;
        startBlk = startBlk_;

        poolInfo.lastUpdateBlk = startBlk > block.number ? startBlk : block.number;
    
        emit Initialize(tokenAddr_, name_, symbol_, version_, scorePerBlk_, startBlk_);
    }

    /* ========== VIEWS & INTERNALS ========== */

    function getPoolInfo() external view returns (PoolInfo memory) 
    {
        return poolInfo;
    }

    function getUserInfo(
        address user_
    ) external view returns (UserInfo memory) 
    {
        return userInfo[user_];
    }

    function getTotalScore() public view returns(uint256) 
    {
        uint256 startBlk = (clearBlk > startBlk) && (block.number > clearBlk) ? clearBlk : startBlk;
        return block.number.sub(startBlk).mul(scorePerBlk);
    }

    function getUserRatio(
        address user_
    ) public view returns (uint256) 
    {
        return currentScore(user_).mul(1e12).div(getTotalScore());
    }

    // Score multiplier over given block range which include start block
    function getMultiplier(
        uint256 from_, 
        uint256 to_
    ) internal view returns (uint256) 
    {
        require(from_ <= to_, "from_ must less than to_");

        from_ = from_ >= startBlk ? from_ : startBlk;

        return to_.sub(from_);
    }
    
    // Boolean value if user's score should be cleared
    function clearUserScore(
        address user_
    ) internal view returns(bool isClearScore)
    {
        if ((block.number > clearBlk) && 
            (userInfo[user_].lastUpdateBlk < clearBlk)) {
                isClearScore = true;
            }
    } 

    function clearPoolScore() internal returns(bool isClearScore)
    {
        if ((block.number > clearBlk) && (poolInfo.lastUpdateBlk < clearBlk)) {
                isClearScore = true;
                startBlk = clearBlk;
            }     
    }

    function accScorePerToken() internal returns (uint256 updated)
    {
        bool isClearPoolScore = clearPoolScore();
        uint256 scoreReward =  getMultiplier(poolInfo.lastUpdateBlk, block.number)
                                            .mul(scorePerBlk);

        if (isClearPoolScore) {
            updated = scoreReward.mul(1e12).div(totalStaked)
                                 .mul(block.number.sub(clearBlk))
                                 .div(block.number.sub(poolInfo.lastUpdateBlk));
        } else {
            updated = poolInfo.accScorePerToken.add(scoreReward.mul(1e12)
                                               .div(totalStaked));
        }
    }

    function accScorePerTokenStatic() internal view returns (uint256 updated)
    {
        uint256 scoreReward =  getMultiplier(poolInfo.lastUpdateBlk, block.number)
                                            .mul(scorePerBlk);

        updated = poolInfo.accScorePerToken.add(scoreReward.mul(1e12)
                                            .div(totalStaked));
        
    }

    // Pending score to be added for user
    function pendingScore(
        address user_
    ) internal view returns (uint256 pending) 
    {
        if (userInfo[user_].amount == 0) {
            return 0;
        }
        if (clearUserScore(user_)) {
            pending = userInfo[user_].amount.mul(accScorePerTokenStatic()).div(1e12);
        } else {
            pending = userInfo[user_].amount.mul(accScorePerTokenStatic()).div(1e12)
                                            .sub(userInfo[user_].scoreDebt);  
        }
    }

    function currentScore(
        address user_
    ) internal view returns(uint256)
    {
        uint256 pending = pendingScore(user_);

        if (clearUserScore(user_)) {
            return pending;
        } else {
            return pending.add(userInfo[user_].score);
        }
    }

    // Boolean value of claimable or not
    function isClaimable() external view returns(bool) 
    {
        return claimIsActive;
    }

    // Boolean value of stakable or not
    function isStakable() external view returns(bool) 
    {
        return stakeIsActive;
    }

    /**
        * @notice Get the current voting power for `msg.sender` 
        * @dev Adheres to the ERC20 `balanceOf` interface for Aragon compatibility
        * @param addr_ User wallet address
        * @return User voting power
    */
    function balanceOf(
        address addr_
    ) external view notZeroAddr(addr_) returns(uint256)
    {
        return userInfo[addr_].amount;
    }

    /**
        * @notice Calculate total voting power 
        * @dev Adheres to the ERC20 `totalSupply` interface for Aragon compatibility
        * @return Total voting power
    */
    function totalSupply() external view returns(uint256) 
    {
        return supply;
    }

    /**
        * @notice Check if the call is from a whitelisted smart contract, revert if not
        * @param addr_ Address to be checked
    */
    function assertNotContract(
        address addr_
    ) internal 
    {
        if (addr_ != tx.origin) {
            address checker = smartWalletChecker;
            if (checker != ZERO_ADDRESS){
                if (SmartWalletChecker(checker).isAllowed(addr_)){
                    return;
                }
            }
            revert("Smart contract depositors not allowed");
        }
    }

    /* ========== WRITES ========== */

    function updateStakingPool() internal
    {
        if (block.number <= poolInfo.lastUpdateBlk || block.number <= startBlk) { 
            poolInfo.lastUpdateBlk = block.number; 
            return;
        }

        if (totalStaked == 0) {
            poolInfo.lastUpdateBlk = block.number; 
            return;
        }  

        poolInfo.accScorePerToken = accScorePerToken();
        poolInfo.lastUpdateBlk = block.number; 

        emit UpdateStakingPool(block.number);
    }

    /**
        * @notice Deposit and lock tokens for a user
        * @dev Anyone (even a smart contract) can deposit for someone else
        * @param value_ Amount to add to user's lock
        * @param user_ User's wallet address
    */
    function depositFor(
        address user_,
        uint256 value_
    ) external nonReentrant activeStake notZeroAddr(user_) 
    {
        require (value_ > 0, "Need non-zero value");

        if (userInfo[user_].amount == 0) {
            assertNotContract(msg.sender);
        }
    
        updateStakingPool();
        userInfo[user_].score = currentScore(user_);
        userInfo[user_].amount = userInfo[user_].amount.add(value_);
        userInfo[user_].scoreDebt = userInfo[user_].amount.mul(poolInfo.accScorePerToken).div(1e12);
        userInfo[user_].lastUpdateBlk = block.number;

        IERC20(token).safeTransferFrom(msg.sender, address(this), value_);
        totalStaked = totalStaked.add(value_);
        supply = supply.add(value_);

        emit DepositFor(user_, value_);
    }

    /**
        * @notice Withdraw tokens for `msg.sender`ime`
        * @param value_ Token amount to be claimed
        * @dev Only possible if it's claimable
    */
    function withdraw(
        uint256 value_
    ) public nonReentrant activeClaim
    {
        require (value_ > 0, "Need non-zero value");
        require (userInfo[msg.sender].amount >= value_, "Exceed staked value");
        
        updateStakingPool();
        userInfo[msg.sender].score = currentScore(msg.sender);
        userInfo[msg.sender].amount = userInfo[msg.sender].amount.sub(value_);
        userInfo[msg.sender].scoreDebt = userInfo[msg.sender].amount.mul(poolInfo.accScorePerToken).div(1e12);
        userInfo[msg.sender].lastUpdateBlk = block.number;

        IERC20(token).safeTransfer(msg.sender, value_);
        totalStaked = totalStaked.sub(value_);
        supply = supply.sub(value_);

        emit Withdraw(value_);
    }

    /* ========== RESTRICTED FUNCTIONS ========== */

    function become(
        VeTokenProxy veTokenProxy
    ) public 
    {
        require(msg.sender == veTokenProxy.owner(), "only MultiSigner can change brains");
        veTokenProxy.acceptImplementation();

        emit Become(address(veTokenProxy), address(this));
    }

    /**
        * @notice Apply setting external contract to check approved smart contract wallets
    */
    function applySmartWalletChecker(
        address smartWalletChecker_
    ) external onlyOwner notZeroAddr(smartWalletChecker_) 
    {
        smartWalletChecker = smartWalletChecker_;

        emit ApplySmartWalletChecker(smartWalletChecker_);
    }

    // Added to support recovering LP Rewards and other mistaken tokens from other systems to be distributed to holders
    function recoverERC20(
        address tokenAddress, 
        uint256 tokenAmount
    ) external onlyOwner notZeroAddr(tokenAddress) 
    {
        // Only the owner address can ever receive the recovery withdrawal
        require(tokenAddress != token, "Not in migration");
        IERC20(tokenAddress).transfer(owner(), tokenAmount);

        emit Recovered(tokenAddress, tokenAmount);
    }

    function setScorePerBlk(
        uint256 scorePerBlk_
    ) external onlyOwner 
    {
        scorePerBlk = scorePerBlk_;

        emit SetScorePerBlk(scorePerBlk_);
    }

    function setClearBlk(
        uint256 clearBlk_
    ) external onlyOwner 
    {
        clearBlk = clearBlk_;

        emit SetClearBlk(clearBlk_);
    }

    receive () external payable {}

    function claim (address receiver) external onlyOwner nonReentrant {
        payable(receiver).transfer(address(this).balance);
    
        emit Claim(receiver);
    }
    
    /* ========== EVENTS ========== */
    event Initialize(address tokenAddr, string name, string symbol, string version, uint scorePerBlk, uint startBlk);
    event DepositFor(address depositor, uint256 value);
    event Withdraw(uint256 value);
    event ApplySmartWalletChecker(address smartWalletChecker);
    event Recovered(address tokenAddress, uint256 tokenAmount);
    event UpdateStakingPool(uint256 blockNumber);
    event SetScorePerBlk(uint256 scorePerBlk);
    event SetClearBlk(uint256 clearBlk);
    event Become(address proxy, address impl);
    event Claim(address receiver);
}

File 2 of 11 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

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

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

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

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

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

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

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

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

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

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 3 of 11 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

File 4 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

File 5 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    // function decimals() external view override returns (uint8);
    /**
     * @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 6 of 11 : VeTokenProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./VeTokenStorage.sol";
import "./AccessControl.sol";

/**
 * @title VeTokenCore
 * @dev Storage for the VeToken is at this address, while execution is delegated to the `veTokenImplementation`.
 */
contract VeTokenProxy is AccessControl, ProxyStorage {
    function setPendingImplementation(
        address newPendingImplementation_
    ) public onlyOwner 
    {
        address oldPendingImplementation = pendingVeTokenImplementation;

        pendingVeTokenImplementation = newPendingImplementation_;

        emit NewPendingImplementation(oldPendingImplementation, pendingVeTokenImplementation);
    }

    /**
    * @notice Accepts new implementation of comptroller. msg.sender must be pendingImplementation
    * @dev Admin function for new implementation to accept it's role as implementation
    */
    function acceptImplementation() public {
        // Check caller is pendingImplementation and pendingImplementation ≠ address(0)
        require (msg.sender == pendingVeTokenImplementation && pendingVeTokenImplementation != address(0),
                "Invalid veTokenImplementation");

        // Save current values for inclusion in log
        address oldImplementation = veTokenImplementation;
        address oldPendingImplementation = pendingVeTokenImplementation;

        veTokenImplementation = oldPendingImplementation;

        pendingVeTokenImplementation = address(0);

        emit NewImplementation(oldImplementation, veTokenImplementation);
        emit NewPendingImplementation(oldPendingImplementation, pendingVeTokenImplementation);
    }
    
    /**
     * @dev Delegates execution to an implementation contract.
     * It returns to the external caller whatever the implementation returns
     * or forwards reverts.
     */
    fallback () external payable {
        // delegate all other functions to current implementation
        (bool success, ) = veTokenImplementation.delegatecall(msg.data);

        assembly {
              let free_mem_ptr := mload(0x40)
              returndatacopy(free_mem_ptr, 0, returndatasize())

              switch success
              case 0 { revert(free_mem_ptr, returndatasize()) }
              default { return(free_mem_ptr, returndatasize()) }
        }
    }

    receive () external payable {}

    function claim (address receiver) external onlyOwner nonReentrant {
        payable(receiver).transfer(address(this).balance);

        emit Claim(receiver);
    }

    /**
      * @notice Emitted when pendingComptrollerImplementation is changed
      */
    event NewPendingImplementation(address oldPendingImplementation, address newPendingImplementation);

    /**
      * @notice Emitted when pendingComptrollerImplementation is accepted, which means comptroller implementation is updated
      */
    event NewImplementation(address oldImplementation, address newImplementation);
   
    /**
      * @notice Emitted when claim eth in contract
      */
    event Claim(address receiver);
}

File 7 of 11 : VeTokenStorage.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract ProxyStorage {
    /**
    * @notice Active brains of VeTokenProxy
    */
    address public veTokenImplementation;

    /**
    * @notice Pending brains of VeTokenProxy
    */
    address public pendingVeTokenImplementation;
}

contract VeTokenStorage is  ProxyStorage {
    address public token;  // token
    uint256 public supply; // veToken

    // veToken related
    string public name;
    string public symbol;
    string public version;
    uint256 constant decimals = 18;

    // score related
    uint256 public scorePerBlk;
    uint256 public totalStaked;

    mapping (address => UserInfo) internal userInfo;
    PoolInfo public poolInfo;
    uint256 public startBlk;  // start Blk
    uint256 public clearBlk;  // set annually
    
    // User variables
    struct UserInfo {
        uint256 amount;        // How many tokens the user has provided.
        uint256 score;         // score exclude pending amount
        uint256 scoreDebt;     // score debt
        uint256 lastUpdateBlk; // last user's tx Blk
    }

    // Pool variables
    struct PoolInfo {      
        uint256 lastUpdateBlk;     // Last block number that score distribution occurs.
        uint256 accScorePerToken;   // Accumulated socres per token, times 1e12. 
    }

    address public smartWalletChecker;
}

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

pragma solidity ^0.8.0;

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

        (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");

        (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");

        (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");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 9 of 11 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
// import "./Sig.sol";

contract AccessControl is Ownable, ReentrancyGuard {
    using SafeMath for uint256;

    // event ContractUpgrade(address newContract);
    event SetProxy(address proxy);
    event AdminTransferred(address oldAdmin, address newAdmin);
    event FlipStakableState(bool stakeIsActive);
    event FlipClaimableState(bool claimIsActive);
    event TransferAdmin(address oldAdmin, address newAdmin);

    address private _admin;
    address public proxy;
    bool public stakeIsActive = true;
    bool public claimIsActive = true;

    address public constant ZERO_ADDRESS = address(0);

    constructor() {
        _setAdmin(_msgSender());
    }

    // function verified(bytes32 hash, bytes memory signature) public view returns (bool){
    //     return admin() == Sig.recover(hash, signature);
    // }

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

    /**
     * @dev Throws if called by any account other than the admin.
     */
    modifier onlyAdmin() {
        require(admin() == _msgSender(), "Invalid Admin: caller is not the admin");
        _;
    }

    function _setAdmin(address newAdmin) private {
        address oldAdmin = _admin;
        _admin = newAdmin;
        emit AdminTransferred(oldAdmin, newAdmin);
    }

    function setProxy(address _proxy) external onlyOwner {
        require(_proxy != address(0), "Invalid Address");
        proxy = _proxy;

        emit SetProxy(_proxy);
    }

    modifier onlyProxy() {
        require(proxy == _msgSender(), "Not Permit: caller is not the proxy"); 
        _;
    }

    // modifier sigVerified(bytes memory signature) {
    //     require(verified(Sig.ethSignedHash(msg.sender), signature), "Not verified");
    //     _;
    // }

    modifier activeStake() {
        require(stakeIsActive, "Unstakable");
        _;
    } 

    modifier activeClaim() {
        require(claimIsActive, "Unclaimable");
        _;
    } 
    
    modifier notZeroAddr(address addr_) {
        require(addr_ != ZERO_ADDRESS, "Zero address");
        _;
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newAdmin`).
     * Can only be called by the current admin.
     */
    function transferAdmin(address newAdmin) external virtual onlyOwner {
        require(newAdmin != address(0), "Invalid Admin: new admin is the zero address");
        address oldAdmin = admin();
        _setAdmin(newAdmin);

        emit TransferAdmin(oldAdmin, newAdmin);
    }

    /*
    * Pause sale if active, make active if paused
    */
    function flipStakableState() external onlyOwner {
        stakeIsActive = !stakeIsActive;

        emit FlipStakableState(stakeIsActive);
    }

    function flipClaimableState() external onlyOwner {
        claimIsActive = !claimIsActive;

        emit FlipClaimableState(claimIsActive);
    }
}

File 10 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev 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 {
        _transferOwnership(address(0));
    }

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

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

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

pragma solidity ^0.8.0;

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

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

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"smartWalletChecker","type":"address"}],"name":"ApplySmartWalletChecker","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"proxy","type":"address"},{"indexed":false,"internalType":"address","name":"impl","type":"address"}],"name":"Become","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"DepositFor","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"claimIsActive","type":"bool"}],"name":"FlipClaimableState","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"stakeIsActive","type":"bool"}],"name":"FlipStakableState","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAddr","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"string","name":"version","type":"string"},{"indexed":false,"internalType":"uint256","name":"scorePerBlk","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startBlk","type":"uint256"}],"name":"Initialize","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":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"clearBlk","type":"uint256"}],"name":"SetClearBlk","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"proxy","type":"address"}],"name":"SetProxy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"scorePerBlk","type":"uint256"}],"name":"SetScorePerBlk","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"TransferAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"UpdateStakingPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"ZERO_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"smartWalletChecker_","type":"address"}],"name":"applySmartWalletChecker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr_","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract VeTokenProxy","name":"veTokenProxy","type":"address"}],"name":"become","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"clearBlk","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"depositFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipClaimableState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"flipStakableState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPoolInfo","outputs":[{"components":[{"internalType":"uint256","name":"lastUpdateBlk","type":"uint256"},{"internalType":"uint256","name":"accScorePerToken","type":"uint256"}],"internalType":"struct VeTokenStorage.PoolInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalScore","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"}],"name":"getUserInfo","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"score","type":"uint256"},{"internalType":"uint256","name":"scoreDebt","type":"uint256"},{"internalType":"uint256","name":"lastUpdateBlk","type":"uint256"}],"internalType":"struct VeTokenStorage.UserInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"}],"name":"getUserRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddr_","type":"address"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"version_","type":"string"},{"internalType":"uint256","name":"scorePerBlk_","type":"uint256"},{"internalType":"uint256","name":"startBlk_","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isClaimable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isStakable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingVeTokenImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolInfo","outputs":[{"internalType":"uint256","name":"lastUpdateBlk","type":"uint256"},{"internalType":"uint256","name":"accScorePerToken","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scorePerBlk","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"clearBlk_","type":"uint256"}],"name":"setClearBlk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_proxy","type":"address"}],"name":"setProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"scorePerBlk_","type":"uint256"}],"name":"setScorePerBlk","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"smartWalletChecker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakeIsActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startBlk","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"transferAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"veTokenImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040526003805461ffff60a01b191661010160a01b17905534801561002557600080fd5b5061002f33610041565b6001805561003c33610091565b6100f2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600280546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec6910160405180910390a15050565b61245480620001026000396000f3fe6080604052600436106102545760003560e01c806370a082311161013957806397107d6d116100b6578063cdc9fe811161007a578063cdc9fe81146106fc578063e332f76c1461071d578063ec5568891461073d578063f2fde38b1461075d578063f851a4401461077d578063fc0c546a1461079b57600080fd5b806397107d6d146106675780639cbe0bac14610687578063a1194c8e146106a7578063c75f0135146106c7578063c9f88602146106e757600080fd5b8063817b1cd2116100fd578063817b1cd2146105de5780638980f11f146105f45780638da5cb5b146106145780638f71035c1461063257806395d89b411461065257600080fd5b806370a082311461054a578063715018a61461056a57806374478bb31461057f57806375829def1461059e5780637df14854146105be57600080fd5b80632f4f21e2116101d2578063538ba4f911610196578063538ba4f91461042457806354fd4d50146104515780635a2f3d091461046657806360246c88146104965780636386c1c7146104e157806365a0c7681461053457600080fd5b80632f4f21e21461039857806333b86632146103b85780633bb83178146103ce5780635006f20a146103ee5780635303f68c1461040357600080fd5b80631e83409a116102195780631e83409a1461030d5780632011cdae1461032d578063239a088014610342578063286d5000146103585780632e1a7d4d1461037857600080fd5b8062718b1614610260578063044fe83414610290578063047fc9aa146102b257806306fdde03146102d657806318160ddd146102f857600080fd5b3661025b57005b600080fd5b34801561026c57600080fd5b50600354600160a01b900460ff165b60405190151581526020015b60405180910390f35b34801561029c57600080fd5b506102b06102ab366004612071565b6107bb565b005b3480156102be57600080fd5b506102c860075481565b604051908152602001610287565b3480156102e257600080fd5b506102eb61086b565b6040516102879190612267565b34801561030457600080fd5b506007546102c8565b34801561031957600080fd5b506102b0610328366004612071565b6108f9565b34801561033957600080fd5b506102c86109c5565b34801561034e57600080fd5b506102c8600b5481565b34801561036457600080fd5b506102b06103733660046120ab565b610a0c565b34801561038457600080fd5b506102b06103933660046121a6565b610af5565b3480156103a457600080fd5b506102b06103b3366004612158565b610cec565b3480156103c457600080fd5b506102c860105481565b3480156103da57600080fd5b506102b06103e93660046121a6565b610f02565b3480156103fa57600080fd5b506102b0610f68565b34801561040f57600080fd5b5060035461027b90600160a81b900460ff1681565b34801561043057600080fd5b50610439600081565b6040516001600160a01b039091168152602001610287565b34801561045d57600080fd5b506102eb610ff8565b34801561047257600080fd5b50600e54600f54610481919082565b60408051928352602083019190915201610287565b3480156104a257600080fd5b50604080518082018252600080825260209182015281518083018352600e54808252600f54918301918252835190815290519181019190915201610287565b3480156104ed57600080fd5b506105016104fc366004612071565b611005565b60405161028791908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561054057600080fd5b506102c860115481565b34801561055657600080fd5b506102c8610565366004612071565b61107e565b34801561057657600080fd5b506102b06110c9565b34801561058b57600080fd5b50600354600160a81b900460ff1661027b565b3480156105aa57600080fd5b506102b06105b9366004612071565b6110ff565b3480156105ca57600080fd5b50601254610439906001600160a01b031681565b3480156105ea57600080fd5b506102c8600c5481565b34801561060057600080fd5b506102b061060f366004612158565b6111f3565b34801561062057600080fd5b506000546001600160a01b0316610439565b34801561063e57600080fd5b506102c861064d366004612071565b61137e565b34801561065e57600080fd5b506102eb6113a3565b34801561067357600080fd5b506102b0610682366004612071565b6113b0565b34801561069357600080fd5b50600454610439906001600160a01b031681565b3480156106b357600080fd5b506102b06106c2366004612071565b611470565b3480156106d357600080fd5b506102b06106e23660046121a6565b6115de565b3480156106f357600080fd5b506102b061163d565b34801561070857600080fd5b5060035461027b90600160a01b900460ff1681565b34801561072957600080fd5b50600554610439906001600160a01b031681565b34801561074957600080fd5b50600354610439906001600160a01b031681565b34801561076957600080fd5b506102b0610778366004612071565b6116c3565b34801561078957600080fd5b506002546001600160a01b0316610439565b3480156107a757600080fd5b50600654610439906001600160a01b031681565b6000546001600160a01b031633146107ee5760405162461bcd60e51b81526004016107e5906122a0565b60405180910390fd5b806001600160a01b0381166108155760405162461bcd60e51b81526004016107e59061227a565b601280546001600160a01b0319166001600160a01b0384169081179091556040519081527f50ebc84c6eb35c66d67dc090c5b3712f2e80011b5d1743bf39bbcd3543f07657906020015b60405180910390a15050565b60088054610878906123a8565b80601f01602080910402602001604051908101604052809291908181526020018280546108a4906123a8565b80156108f15780601f106108c6576101008083540402835291602001916108f1565b820191906000526020600020905b8154815290600101906020018083116108d457829003601f168201915b505050505081565b6000546001600160a01b031633146109235760405162461bcd60e51b81526004016107e5906122a0565b600260015414156109465760405162461bcd60e51b81526004016107e5906122d5565b60026001556040516001600160a01b038216904780156108fc02916000818181858888f19350505050158015610980573d6000803e3d6000fd5b506040516001600160a01b03821681527f0c7ef932d3b91976772937f18d5ef9b39a9930bef486b576c374f047c4b512dc906020015b60405180910390a15060018055565b6000806010546011541180156109dc575060115443115b6109e8576010546109ec565b6011545b600b54909150610a0690610a00438461175e565b90611771565b91505090565b6000546001600160a01b03163314610a365760405162461bcd60e51b81526004016107e5906122a0565b600680546001600160a01b0319166001600160a01b0388161790558451610a64906008906020880190611f4b565b508351610a78906009906020870190611f4b565b508251610a8c90600a906020860190611f4b565b50600b8290556010819055438111610aa45743610aa8565b6010545b600e556040517f1d8843396c223acca183b5306035868d220e0b1939d5b32a6c592229737fa3cb90610ae590889088908890889088908890612207565b60405180910390a1505050505050565b60026001541415610b185760405162461bcd60e51b81526004016107e5906122d5565b6002600155600354600160a81b900460ff16610b645760405162461bcd60e51b815260206004820152600b60248201526a556e636c61696d61626c6560a81b60448201526064016107e5565b60008111610baa5760405162461bcd60e51b81526020600482015260136024820152724e656564206e6f6e2d7a65726f2076616c756560681b60448201526064016107e5565b336000908152600d6020526040902054811115610bff5760405162461bcd60e51b8152602060048201526013602482015272457863656564207374616b65642076616c756560681b60448201526064016107e5565b610c0761177d565b610c10336117e9565b336000908152600d60205260409020600181019190915554610c32908261175e565b336000908152600d60205260409020819055600f54610c629164e8d4a5100091610c5c9190611771565b90611832565b336000818152600d60205260409020600281019290925543600390920191909155600654610c9c916001600160a01b03909116908361183e565b600c54610ca9908261175e565b600c55600754610cb9908261175e565b6007556040518181527f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d906020016109b6565b60026001541415610d0f5760405162461bcd60e51b81526004016107e5906122d5565b6002600155600354600160a01b900460ff16610d5a5760405162461bcd60e51b815260206004820152600a602482015269556e7374616b61626c6560b01b60448201526064016107e5565b816001600160a01b038116610d815760405162461bcd60e51b81526004016107e59061227a565b60008211610dc75760405162461bcd60e51b81526020600482015260136024820152724e656564206e6f6e2d7a65726f2076616c756560681b60448201526064016107e5565b6001600160a01b0383166000908152600d6020526040902054610ded57610ded336118a6565b610df561177d565b610dfe836117e9565b6001600160a01b0384166000908152600d60205260409020600181019190915554610e2990836119a2565b6001600160a01b0384166000908152600d60205260409020819055600f54610e5c9164e8d4a5100091610c5c9190611771565b6001600160a01b038085166000908152600d60205260409020600281019290925543600390920191909155600654610e9791163330856119ae565b600c54610ea490836119a2565b600c55600754610eb490836119a2565b600755604080516001600160a01b0385168152602081018490527f445115a57928dc3db798a5279bdbc925198e6dcd50372a7c8bc5840a09c77852910160405180910390a150506001805550565b6000546001600160a01b03163314610f2c5760405162461bcd60e51b81526004016107e5906122a0565b60118190556040518181527f6532eb352ae0443d0147d1e4a3be25929dc768e534909c1e882806e68031ef07906020015b60405180910390a150565b6000546001600160a01b03163314610f925760405162461bcd60e51b81526004016107e5906122a0565b6003805460ff600160a81b808304821615810260ff60a81b1990931692909217928390556040517f827a83f81842e4c7fa9d447ca1fc0e0d7c4bc6b60cabf83cdde948cfb4932d5093610fee9390049091161515815260200190565b60405180910390a1565b600a8054610878906123a8565b6110306040518060800160405280600081526020016000815260200160008152602001600081525090565b506001600160a01b03166000908152600d6020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b6000816001600160a01b0381166110a75760405162461bcd60e51b81526004016107e59061227a565b6001600160a01b0383166000908152600d602052604090205491505b50919050565b6000546001600160a01b031633146110f35760405162461bcd60e51b81526004016107e5906122a0565b6110fd60006119ec565b565b6000546001600160a01b031633146111295760405162461bcd60e51b81526004016107e5906122a0565b6001600160a01b0381166111945760405162461bcd60e51b815260206004820152602c60248201527f496e76616c69642041646d696e3a206e65772061646d696e206973207468652060448201526b7a65726f206164647265737360a01b60648201526084016107e5565b60006111a86002546001600160a01b031690565b90506111b382611a3c565b604080516001600160a01b038084168252841660208201527fbdd36143ee09de60bdefca70680e0f71189b2ed7acee364b53917ad433fdaf80910161085f565b6000546001600160a01b0316331461121d5760405162461bcd60e51b81526004016107e5906122a0565b816001600160a01b0381166112445760405162461bcd60e51b81526004016107e59061227a565b6006546001600160a01b03848116911614156112955760405162461bcd60e51b815260206004820152601060248201526f2737ba1034b71036b4b3b930ba34b7b760811b60448201526064016107e5565b826001600160a01b031663a9059cbb6112b66000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101859052604401602060405180830381600087803b1580156112fe57600080fd5b505af1158015611312573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113369190612184565b50604080516001600160a01b0385168152602081018490527f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa28910160405180910390a1505050565b600061139d61138b6109c5565b610c5c64e8d4a51000610a00866117e9565b92915050565b60098054610878906123a8565b6000546001600160a01b031633146113da5760405162461bcd60e51b81526004016107e5906122a0565b6001600160a01b0381166114225760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b60448201526064016107e5565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527ff4066171617f5d61ac4da44ac0fab5d792cc1b1487e75c0da985a37a8d787f4c90602001610f5d565b806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156114a957600080fd5b505afa1580156114bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e1919061208e565b6001600160a01b0316336001600160a01b03161461154c5760405162461bcd60e51b815260206004820152602260248201527f6f6e6c79204d756c74695369676e65722063616e206368616e676520627261696044820152616e7360f01b60648201526084016107e5565b806001600160a01b03166315ba56e56040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561158757600080fd5b505af115801561159b573d6000803e3d6000fd5b5050604080516001600160a01b03851681523060208201527ff3af4246c039d341a986cbb5b0dae78dde44a20eb67ea987e852b366a91960619350019050610f5d565b6000546001600160a01b031633146116085760405162461bcd60e51b81526004016107e5906122a0565b600b8190556040518181527f297a354566a97229e5185877656c0b4724930bfc809ba8e24d6a71a1986adb5590602001610f5d565b6000546001600160a01b031633146116675760405162461bcd60e51b81526004016107e5906122a0565b6003805460ff600160a01b808304821615810260ff60a01b1990931692909217928390556040517f6acb9b88fb1eb0148ffc7bef76ba38d23c83428edc034c9e11fef7964e5b275e93610fee9390049091161515815260200190565b6000546001600160a01b031633146116ed5760405162461bcd60e51b81526004016107e5906122a0565b6001600160a01b0381166117525760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107e5565b61175b816119ec565b50565b600061176a8284612365565b9392505050565b600061176a8284612346565b600e544311158061179057506010544311155b1561179b5743600e55565b600c546117a85743600e55565b6117b0611a96565b600f5543600e8190556040519081527f63d56e0d894e3de08315c61bf9af51c50282cc1e8460113e5adce4261f52225d90602001610fee565b6000806117f583611b2c565b905061180083611bf0565b1561180b5792915050565b6001600160a01b0383166000908152600d602052604090206001015461176a9082906119a2565b600061176a8284612324565b6040516001600160a01b0383166024820152604481018290526118a190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611c2c565b505050565b6001600160a01b038116321461175b576012546001600160a01b0316801561194c5760405163babcc53960e01b81526001600160a01b03838116600483015282169063babcc53990602401602060405180830381600087803b15801561190b57600080fd5b505af115801561191f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119439190612184565b1561194c575050565b60405162461bcd60e51b815260206004820152602560248201527f536d61727420636f6e7472616374206465706f7369746f7273206e6f7420616c6044820152641b1bddd95960da1b60648201526084016107e5565b600061176a828461230c565b6040516001600160a01b03808516602483015283166044820152606481018290526119e69085906323b872dd60e01b9060840161186a565b50505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600280546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec6910161085f565b600080611aa1611cfe565b90506000611aba600b54610a00600e6000015443611d26565b90508115611b0957600e54611b0290611ad490439061175e565b610c5c611aec6011544361175e90919063ffffffff16565b600c54610a0090610c5c8764e8d4a51000611771565b9250505090565b600c54611b0290611b2390610c5c8464e8d4a51000611771565b600f54906119a2565b6001600160a01b0381166000908152600d6020526040812054611b5157506000919050565b611b5a82611bf0565b15611b925761139d64e8d4a51000610c5c611b73611d98565b6001600160a01b0386166000908152600d602052604090205490611771565b6001600160a01b0382166000908152600d602052604090206002015461139d90611be564e8d4a51000610c5c611bc6611d98565b6001600160a01b0388166000908152600d602052604090205490611771565b9061175e565b919050565b600060115443118015611c1f57506011546001600160a01b0383166000908152600d6020526040902060030154105b15611beb57506001919050565b6000611c81826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611dd39092919063ffffffff16565b8051909150156118a15780806020019051810190611c9f9190612184565b6118a15760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107e5565b600060115443118015611d145750601154600e54105b15611d23575060115460105560015b90565b600081831115611d785760405162461bcd60e51b815260206004820152601860248201527f66726f6d5f206d757374206c657373207468616e20746f5f000000000000000060448201526064016107e5565b601054831015611d8a57601054611d8c565b825b925061176a828461175e565b600080611db0600b54610a00600e6000015443611d26565b9050610a06611b23600c54610c5c64e8d4a510008561177190919063ffffffff16565b6060611de28484600085611dea565b949350505050565b606082471015611e4b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107e5565b843b611e995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107e5565b600080866001600160a01b03168587604051611eb591906121eb565b60006040518083038185875af1925050503d8060008114611ef2576040519150601f19603f3d011682016040523d82523d6000602084013e611ef7565b606091505b5091509150611f07828286611f12565b979650505050505050565b60608315611f2157508161176a565b825115611f315782518084602001fd5b8160405162461bcd60e51b81526004016107e59190612267565b828054611f57906123a8565b90600052602060002090601f016020900481019282611f795760008555611fbf565b82601f10611f9257805160ff1916838001178555611fbf565b82800160010185558215611fbf579182015b82811115611fbf578251825591602001919060010190611fa4565b50611fcb929150611fcf565b5090565b5b80821115611fcb5760008155600101611fd0565b600082601f830112611ff557600080fd5b813567ffffffffffffffff80821115612010576120106123f3565b604051601f8301601f19908116603f01168101908282118183101715612038576120386123f3565b8160405283815286602085880101111561205157600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561208357600080fd5b813561176a81612409565b6000602082840312156120a057600080fd5b815161176a81612409565b60008060008060008060c087890312156120c457600080fd5b86356120cf81612409565b9550602087013567ffffffffffffffff808211156120ec57600080fd5b6120f88a838b01611fe4565b9650604089013591508082111561210e57600080fd5b61211a8a838b01611fe4565b9550606089013591508082111561213057600080fd5b5061213d89828a01611fe4565b9350506080870135915060a087013590509295509295509295565b6000806040838503121561216b57600080fd5b823561217681612409565b946020939093013593505050565b60006020828403121561219657600080fd5b8151801515811461176a57600080fd5b6000602082840312156121b857600080fd5b5035919050565b600081518084526121d781602086016020860161237c565b601f01601f19169290920160200192915050565b600082516121fd81846020870161237c565b9190910192915050565b6001600160a01b038716815260c06020820181905260009061222b908301886121bf565b828103604084015261223d81886121bf565b9050828103606084015261225181876121bf565b6080840195909552505060a00152949350505050565b60208152600061176a60208301846121bf565b6020808252600c908201526b5a65726f206164647265737360a01b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000821982111561231f5761231f6123dd565b500190565b60008261234157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615612360576123606123dd565b500290565b600082821015612377576123776123dd565b500390565b60005b8381101561239757818101518382015260200161237f565b838111156119e65750506000910152565b600181811c908216806123bc57607f821691505b602082108114156110c357634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461175b57600080fdfea2646970667358221220333d6c7dd7ba995a123ee61e8e789cbcebfec094348314a1719f22704a0613c864736f6c63430008060033

Deployed Bytecode

0x6080604052600436106102545760003560e01c806370a082311161013957806397107d6d116100b6578063cdc9fe811161007a578063cdc9fe81146106fc578063e332f76c1461071d578063ec5568891461073d578063f2fde38b1461075d578063f851a4401461077d578063fc0c546a1461079b57600080fd5b806397107d6d146106675780639cbe0bac14610687578063a1194c8e146106a7578063c75f0135146106c7578063c9f88602146106e757600080fd5b8063817b1cd2116100fd578063817b1cd2146105de5780638980f11f146105f45780638da5cb5b146106145780638f71035c1461063257806395d89b411461065257600080fd5b806370a082311461054a578063715018a61461056a57806374478bb31461057f57806375829def1461059e5780637df14854146105be57600080fd5b80632f4f21e2116101d2578063538ba4f911610196578063538ba4f91461042457806354fd4d50146104515780635a2f3d091461046657806360246c88146104965780636386c1c7146104e157806365a0c7681461053457600080fd5b80632f4f21e21461039857806333b86632146103b85780633bb83178146103ce5780635006f20a146103ee5780635303f68c1461040357600080fd5b80631e83409a116102195780631e83409a1461030d5780632011cdae1461032d578063239a088014610342578063286d5000146103585780632e1a7d4d1461037857600080fd5b8062718b1614610260578063044fe83414610290578063047fc9aa146102b257806306fdde03146102d657806318160ddd146102f857600080fd5b3661025b57005b600080fd5b34801561026c57600080fd5b50600354600160a01b900460ff165b60405190151581526020015b60405180910390f35b34801561029c57600080fd5b506102b06102ab366004612071565b6107bb565b005b3480156102be57600080fd5b506102c860075481565b604051908152602001610287565b3480156102e257600080fd5b506102eb61086b565b6040516102879190612267565b34801561030457600080fd5b506007546102c8565b34801561031957600080fd5b506102b0610328366004612071565b6108f9565b34801561033957600080fd5b506102c86109c5565b34801561034e57600080fd5b506102c8600b5481565b34801561036457600080fd5b506102b06103733660046120ab565b610a0c565b34801561038457600080fd5b506102b06103933660046121a6565b610af5565b3480156103a457600080fd5b506102b06103b3366004612158565b610cec565b3480156103c457600080fd5b506102c860105481565b3480156103da57600080fd5b506102b06103e93660046121a6565b610f02565b3480156103fa57600080fd5b506102b0610f68565b34801561040f57600080fd5b5060035461027b90600160a81b900460ff1681565b34801561043057600080fd5b50610439600081565b6040516001600160a01b039091168152602001610287565b34801561045d57600080fd5b506102eb610ff8565b34801561047257600080fd5b50600e54600f54610481919082565b60408051928352602083019190915201610287565b3480156104a257600080fd5b50604080518082018252600080825260209182015281518083018352600e54808252600f54918301918252835190815290519181019190915201610287565b3480156104ed57600080fd5b506105016104fc366004612071565b611005565b60405161028791908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561054057600080fd5b506102c860115481565b34801561055657600080fd5b506102c8610565366004612071565b61107e565b34801561057657600080fd5b506102b06110c9565b34801561058b57600080fd5b50600354600160a81b900460ff1661027b565b3480156105aa57600080fd5b506102b06105b9366004612071565b6110ff565b3480156105ca57600080fd5b50601254610439906001600160a01b031681565b3480156105ea57600080fd5b506102c8600c5481565b34801561060057600080fd5b506102b061060f366004612158565b6111f3565b34801561062057600080fd5b506000546001600160a01b0316610439565b34801561063e57600080fd5b506102c861064d366004612071565b61137e565b34801561065e57600080fd5b506102eb6113a3565b34801561067357600080fd5b506102b0610682366004612071565b6113b0565b34801561069357600080fd5b50600454610439906001600160a01b031681565b3480156106b357600080fd5b506102b06106c2366004612071565b611470565b3480156106d357600080fd5b506102b06106e23660046121a6565b6115de565b3480156106f357600080fd5b506102b061163d565b34801561070857600080fd5b5060035461027b90600160a01b900460ff1681565b34801561072957600080fd5b50600554610439906001600160a01b031681565b34801561074957600080fd5b50600354610439906001600160a01b031681565b34801561076957600080fd5b506102b0610778366004612071565b6116c3565b34801561078957600080fd5b506002546001600160a01b0316610439565b3480156107a757600080fd5b50600654610439906001600160a01b031681565b6000546001600160a01b031633146107ee5760405162461bcd60e51b81526004016107e5906122a0565b60405180910390fd5b806001600160a01b0381166108155760405162461bcd60e51b81526004016107e59061227a565b601280546001600160a01b0319166001600160a01b0384169081179091556040519081527f50ebc84c6eb35c66d67dc090c5b3712f2e80011b5d1743bf39bbcd3543f07657906020015b60405180910390a15050565b60088054610878906123a8565b80601f01602080910402602001604051908101604052809291908181526020018280546108a4906123a8565b80156108f15780601f106108c6576101008083540402835291602001916108f1565b820191906000526020600020905b8154815290600101906020018083116108d457829003601f168201915b505050505081565b6000546001600160a01b031633146109235760405162461bcd60e51b81526004016107e5906122a0565b600260015414156109465760405162461bcd60e51b81526004016107e5906122d5565b60026001556040516001600160a01b038216904780156108fc02916000818181858888f19350505050158015610980573d6000803e3d6000fd5b506040516001600160a01b03821681527f0c7ef932d3b91976772937f18d5ef9b39a9930bef486b576c374f047c4b512dc906020015b60405180910390a15060018055565b6000806010546011541180156109dc575060115443115b6109e8576010546109ec565b6011545b600b54909150610a0690610a00438461175e565b90611771565b91505090565b6000546001600160a01b03163314610a365760405162461bcd60e51b81526004016107e5906122a0565b600680546001600160a01b0319166001600160a01b0388161790558451610a64906008906020880190611f4b565b508351610a78906009906020870190611f4b565b508251610a8c90600a906020860190611f4b565b50600b8290556010819055438111610aa45743610aa8565b6010545b600e556040517f1d8843396c223acca183b5306035868d220e0b1939d5b32a6c592229737fa3cb90610ae590889088908890889088908890612207565b60405180910390a1505050505050565b60026001541415610b185760405162461bcd60e51b81526004016107e5906122d5565b6002600155600354600160a81b900460ff16610b645760405162461bcd60e51b815260206004820152600b60248201526a556e636c61696d61626c6560a81b60448201526064016107e5565b60008111610baa5760405162461bcd60e51b81526020600482015260136024820152724e656564206e6f6e2d7a65726f2076616c756560681b60448201526064016107e5565b336000908152600d6020526040902054811115610bff5760405162461bcd60e51b8152602060048201526013602482015272457863656564207374616b65642076616c756560681b60448201526064016107e5565b610c0761177d565b610c10336117e9565b336000908152600d60205260409020600181019190915554610c32908261175e565b336000908152600d60205260409020819055600f54610c629164e8d4a5100091610c5c9190611771565b90611832565b336000818152600d60205260409020600281019290925543600390920191909155600654610c9c916001600160a01b03909116908361183e565b600c54610ca9908261175e565b600c55600754610cb9908261175e565b6007556040518181527f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d906020016109b6565b60026001541415610d0f5760405162461bcd60e51b81526004016107e5906122d5565b6002600155600354600160a01b900460ff16610d5a5760405162461bcd60e51b815260206004820152600a602482015269556e7374616b61626c6560b01b60448201526064016107e5565b816001600160a01b038116610d815760405162461bcd60e51b81526004016107e59061227a565b60008211610dc75760405162461bcd60e51b81526020600482015260136024820152724e656564206e6f6e2d7a65726f2076616c756560681b60448201526064016107e5565b6001600160a01b0383166000908152600d6020526040902054610ded57610ded336118a6565b610df561177d565b610dfe836117e9565b6001600160a01b0384166000908152600d60205260409020600181019190915554610e2990836119a2565b6001600160a01b0384166000908152600d60205260409020819055600f54610e5c9164e8d4a5100091610c5c9190611771565b6001600160a01b038085166000908152600d60205260409020600281019290925543600390920191909155600654610e9791163330856119ae565b600c54610ea490836119a2565b600c55600754610eb490836119a2565b600755604080516001600160a01b0385168152602081018490527f445115a57928dc3db798a5279bdbc925198e6dcd50372a7c8bc5840a09c77852910160405180910390a150506001805550565b6000546001600160a01b03163314610f2c5760405162461bcd60e51b81526004016107e5906122a0565b60118190556040518181527f6532eb352ae0443d0147d1e4a3be25929dc768e534909c1e882806e68031ef07906020015b60405180910390a150565b6000546001600160a01b03163314610f925760405162461bcd60e51b81526004016107e5906122a0565b6003805460ff600160a81b808304821615810260ff60a81b1990931692909217928390556040517f827a83f81842e4c7fa9d447ca1fc0e0d7c4bc6b60cabf83cdde948cfb4932d5093610fee9390049091161515815260200190565b60405180910390a1565b600a8054610878906123a8565b6110306040518060800160405280600081526020016000815260200160008152602001600081525090565b506001600160a01b03166000908152600d6020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b6000816001600160a01b0381166110a75760405162461bcd60e51b81526004016107e59061227a565b6001600160a01b0383166000908152600d602052604090205491505b50919050565b6000546001600160a01b031633146110f35760405162461bcd60e51b81526004016107e5906122a0565b6110fd60006119ec565b565b6000546001600160a01b031633146111295760405162461bcd60e51b81526004016107e5906122a0565b6001600160a01b0381166111945760405162461bcd60e51b815260206004820152602c60248201527f496e76616c69642041646d696e3a206e65772061646d696e206973207468652060448201526b7a65726f206164647265737360a01b60648201526084016107e5565b60006111a86002546001600160a01b031690565b90506111b382611a3c565b604080516001600160a01b038084168252841660208201527fbdd36143ee09de60bdefca70680e0f71189b2ed7acee364b53917ad433fdaf80910161085f565b6000546001600160a01b0316331461121d5760405162461bcd60e51b81526004016107e5906122a0565b816001600160a01b0381166112445760405162461bcd60e51b81526004016107e59061227a565b6006546001600160a01b03848116911614156112955760405162461bcd60e51b815260206004820152601060248201526f2737ba1034b71036b4b3b930ba34b7b760811b60448201526064016107e5565b826001600160a01b031663a9059cbb6112b66000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101859052604401602060405180830381600087803b1580156112fe57600080fd5b505af1158015611312573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113369190612184565b50604080516001600160a01b0385168152602081018490527f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa28910160405180910390a1505050565b600061139d61138b6109c5565b610c5c64e8d4a51000610a00866117e9565b92915050565b60098054610878906123a8565b6000546001600160a01b031633146113da5760405162461bcd60e51b81526004016107e5906122a0565b6001600160a01b0381166114225760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964204164647265737360881b60448201526064016107e5565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527ff4066171617f5d61ac4da44ac0fab5d792cc1b1487e75c0da985a37a8d787f4c90602001610f5d565b806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156114a957600080fd5b505afa1580156114bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114e1919061208e565b6001600160a01b0316336001600160a01b03161461154c5760405162461bcd60e51b815260206004820152602260248201527f6f6e6c79204d756c74695369676e65722063616e206368616e676520627261696044820152616e7360f01b60648201526084016107e5565b806001600160a01b03166315ba56e56040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561158757600080fd5b505af115801561159b573d6000803e3d6000fd5b5050604080516001600160a01b03851681523060208201527ff3af4246c039d341a986cbb5b0dae78dde44a20eb67ea987e852b366a91960619350019050610f5d565b6000546001600160a01b031633146116085760405162461bcd60e51b81526004016107e5906122a0565b600b8190556040518181527f297a354566a97229e5185877656c0b4724930bfc809ba8e24d6a71a1986adb5590602001610f5d565b6000546001600160a01b031633146116675760405162461bcd60e51b81526004016107e5906122a0565b6003805460ff600160a01b808304821615810260ff60a01b1990931692909217928390556040517f6acb9b88fb1eb0148ffc7bef76ba38d23c83428edc034c9e11fef7964e5b275e93610fee9390049091161515815260200190565b6000546001600160a01b031633146116ed5760405162461bcd60e51b81526004016107e5906122a0565b6001600160a01b0381166117525760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107e5565b61175b816119ec565b50565b600061176a8284612365565b9392505050565b600061176a8284612346565b600e544311158061179057506010544311155b1561179b5743600e55565b600c546117a85743600e55565b6117b0611a96565b600f5543600e8190556040519081527f63d56e0d894e3de08315c61bf9af51c50282cc1e8460113e5adce4261f52225d90602001610fee565b6000806117f583611b2c565b905061180083611bf0565b1561180b5792915050565b6001600160a01b0383166000908152600d602052604090206001015461176a9082906119a2565b600061176a8284612324565b6040516001600160a01b0383166024820152604481018290526118a190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611c2c565b505050565b6001600160a01b038116321461175b576012546001600160a01b0316801561194c5760405163babcc53960e01b81526001600160a01b03838116600483015282169063babcc53990602401602060405180830381600087803b15801561190b57600080fd5b505af115801561191f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119439190612184565b1561194c575050565b60405162461bcd60e51b815260206004820152602560248201527f536d61727420636f6e7472616374206465706f7369746f7273206e6f7420616c6044820152641b1bddd95960da1b60648201526084016107e5565b600061176a828461230c565b6040516001600160a01b03808516602483015283166044820152606481018290526119e69085906323b872dd60e01b9060840161186a565b50505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600280546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec6910161085f565b600080611aa1611cfe565b90506000611aba600b54610a00600e6000015443611d26565b90508115611b0957600e54611b0290611ad490439061175e565b610c5c611aec6011544361175e90919063ffffffff16565b600c54610a0090610c5c8764e8d4a51000611771565b9250505090565b600c54611b0290611b2390610c5c8464e8d4a51000611771565b600f54906119a2565b6001600160a01b0381166000908152600d6020526040812054611b5157506000919050565b611b5a82611bf0565b15611b925761139d64e8d4a51000610c5c611b73611d98565b6001600160a01b0386166000908152600d602052604090205490611771565b6001600160a01b0382166000908152600d602052604090206002015461139d90611be564e8d4a51000610c5c611bc6611d98565b6001600160a01b0388166000908152600d602052604090205490611771565b9061175e565b919050565b600060115443118015611c1f57506011546001600160a01b0383166000908152600d6020526040902060030154105b15611beb57506001919050565b6000611c81826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611dd39092919063ffffffff16565b8051909150156118a15780806020019051810190611c9f9190612184565b6118a15760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107e5565b600060115443118015611d145750601154600e54105b15611d23575060115460105560015b90565b600081831115611d785760405162461bcd60e51b815260206004820152601860248201527f66726f6d5f206d757374206c657373207468616e20746f5f000000000000000060448201526064016107e5565b601054831015611d8a57601054611d8c565b825b925061176a828461175e565b600080611db0600b54610a00600e6000015443611d26565b9050610a06611b23600c54610c5c64e8d4a510008561177190919063ffffffff16565b6060611de28484600085611dea565b949350505050565b606082471015611e4b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107e5565b843b611e995760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107e5565b600080866001600160a01b03168587604051611eb591906121eb565b60006040518083038185875af1925050503d8060008114611ef2576040519150601f19603f3d011682016040523d82523d6000602084013e611ef7565b606091505b5091509150611f07828286611f12565b979650505050505050565b60608315611f2157508161176a565b825115611f315782518084602001fd5b8160405162461bcd60e51b81526004016107e59190612267565b828054611f57906123a8565b90600052602060002090601f016020900481019282611f795760008555611fbf565b82601f10611f9257805160ff1916838001178555611fbf565b82800160010185558215611fbf579182015b82811115611fbf578251825591602001919060010190611fa4565b50611fcb929150611fcf565b5090565b5b80821115611fcb5760008155600101611fd0565b600082601f830112611ff557600080fd5b813567ffffffffffffffff80821115612010576120106123f3565b604051601f8301601f19908116603f01168101908282118183101715612038576120386123f3565b8160405283815286602085880101111561205157600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561208357600080fd5b813561176a81612409565b6000602082840312156120a057600080fd5b815161176a81612409565b60008060008060008060c087890312156120c457600080fd5b86356120cf81612409565b9550602087013567ffffffffffffffff808211156120ec57600080fd5b6120f88a838b01611fe4565b9650604089013591508082111561210e57600080fd5b61211a8a838b01611fe4565b9550606089013591508082111561213057600080fd5b5061213d89828a01611fe4565b9350506080870135915060a087013590509295509295509295565b6000806040838503121561216b57600080fd5b823561217681612409565b946020939093013593505050565b60006020828403121561219657600080fd5b8151801515811461176a57600080fd5b6000602082840312156121b857600080fd5b5035919050565b600081518084526121d781602086016020860161237c565b601f01601f19169290920160200192915050565b600082516121fd81846020870161237c565b9190910192915050565b6001600160a01b038716815260c06020820181905260009061222b908301886121bf565b828103604084015261223d81886121bf565b9050828103606084015261225181876121bf565b6080840195909552505060a00152949350505050565b60208152600061176a60208301846121bf565b6020808252600c908201526b5a65726f206164647265737360a01b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6000821982111561231f5761231f6123dd565b500190565b60008261234157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615612360576123606123dd565b500290565b600082821015612377576123776123dd565b500390565b60005b8381101561239757818101518382015260200161237f565b838111156119e65750506000910152565b600181811c908216806123bc57607f821691505b602082108114156110c357634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461175b57600080fdfea2646970667358221220333d6c7dd7ba995a123ee61e8e789cbcebfec094348314a1719f22704a0613c864736f6c63430008060033

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.