ETH Price: $2,047.06 (+9.09%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Buy Tokens For E...218907872025-02-20 23:18:2326 days ago1740093503IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000153411.1
Buy Tokens For E...218907782025-02-20 23:16:3526 days ago1740093395IN
0x6D8b29c1...Cfb0A869F
0 ETH0.00019771.26278761
Buy Tokens For E...218498602025-02-15 5:50:4732 days ago1739598647IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000127260.8
Buy Tokens For E...218215602025-02-11 6:42:2336 days ago1739256143IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000219981.38280916
Buy Tokens For E...218079042025-02-09 8:56:4738 days ago1739091407IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000143170.9
Buy Tokens For E...217872942025-02-06 11:54:2341 days ago1738842863IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000176421.10900038
Buy Tokens For E...217509792025-02-01 10:09:3546 days ago1738404575IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000381952.40111626
Buy Tokens For E...217482652025-02-01 1:04:1146 days ago1738371851IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000258641.652021
Claim Tokens215441102025-01-03 12:59:1175 days ago1735909151IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000677210.49590435
Claim Tokens214539552024-12-21 22:47:4787 days ago1734821267IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000229637.89320189
Claim Tokens214539532024-12-21 22:47:2387 days ago1734821243IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000508537.88176823
Claim Tokens213563192024-12-08 7:36:35101 days ago1733643395IN
0x6D8b29c1...Cfb0A869F
0 ETH0.00069579.28522692
Claim Tokens213111552024-12-02 0:09:59107 days ago1733098199IN
0x6D8b29c1...Cfb0A869F
0 ETH0.0010655416.51462837
Claim Tokens212881592024-11-28 19:02:59110 days ago1732820579IN
0x6D8b29c1...Cfb0A869F
0 ETH0.0008604516.2588769
Transfer Ownersh...212441322024-11-22 15:21:11117 days ago1732288871IN
0x6D8b29c1...Cfb0A869F
0 ETH0.0004356418.1
Claim Tokens211783132024-11-13 10:56:11126 days ago1731495371IN
0x6D8b29c1...Cfb0A869F
0 ETH0.002128825.62015242
Buy Tokens For E...211046482024-11-03 4:13:23136 days ago1730607203IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000461352.9
Buy Tokens For E...209831202024-10-17 5:13:23153 days ago1729142003IN
0x6D8b29c1...Cfb0A869F
0 ETH0.001158127.27980462
Claim Tokens209733812024-10-15 20:34:23154 days ago1729024463IN
0x6D8b29c1...Cfb0A869F
0 ETH0.0010037720.04136745
Claim Tokens209649092024-10-14 16:10:47156 days ago1728922247IN
0x6D8b29c1...Cfb0A869F
0 ETH0.0020627331.96993202
Claim Tokens209400592024-10-11 4:41:23159 days ago1728621683IN
0x6D8b29c1...Cfb0A869F
0 ETH0.0008425912.387144
Claim Tokens209217242024-10-08 15:21:47162 days ago1728400907IN
0x6D8b29c1...Cfb0A869F
0 ETH0.0019465230.16887218
Claim Tokens209199682024-10-08 9:29:35162 days ago1728379775IN
0x6D8b29c1...Cfb0A869F
0 ETH0.0008712313.50310518
Claim Tokens209170722024-10-07 23:48:23162 days ago1728344903IN
0x6D8b29c1...Cfb0A869F
0 ETH0.000636189.86017913
Claim Tokens209076092024-10-06 16:09:23164 days ago1728230963IN
0x6D8b29c1...Cfb0A869F
0 ETH0.0015317222.51812527
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UBDNLockerDistributor

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 9 : UBDNLockerDistributor.sol
// SPDX-License-Identifier: MIT
// UBDNDistributor ERC20 Token Distributor
pragma solidity 0.8.19;


import "SafeERC20.sol";
import "Ownable.sol";
import "IERC20Mint.sol";


contract UBDNLockerDistributor is Ownable {
    using SafeERC20 for IERC20Mint;
    
    struct Lock {
        uint256 amount;
        uint256 lockedUntil;
    }

    uint256 constant public START_PRICE = 1;         // 1 stable coin unit, not decimal. 
    uint256 constant public PRICE_INCREASE_STEP = 1; // 1 stable coin unit, not decimal. 
    uint256 constant public INCREASE_FROM_ROUND = 1;
    uint256 constant public ROUND_VOLUME = 1_000_000e18; // in wei
    uint256 constant public ADD_NEW_PAYMENT_TOKEN_TIMELOCK = 48 hours;
    uint256 constant public EMERGENCY_PAYMENT_PAUSE = 1 hours;

    
    uint256 public LOCK_PERIOD = 90 days;
    uint256 public distributedAmount;

    IERC20Mint public distributionToken;
    mapping (address => uint256) public paymentTokens;
    mapping (address => Lock[]) public userLocks;
    mapping (address => bool) public isGuardian;

    event DistributionTokenSet(address indexed Token);
    event PaymentTokenStatus(address indexed Token, bool Status);
    event Purchase(
        address indexed User,
        uint256 indexed PurchaseAmount, 
        address indexed PaymentToken, 
        uint256 PaymentAmount
    );
    event Claimed(address User, uint256 Amount, uint256 Timestamp);
    event PaymentTokenPaused(address indexed Token, uint256 Until);

    constructor (uint256 _lockPeriod) {
        if (_lockPeriod > 0) {
           LOCK_PERIOD = _lockPeriod;
        }
    }

    /// @notice Buy distibuting token with stable coins
    /// @dev _inAmount in wei. Don't forget approve
    /// @param _paymentToken stable coin address
    /// @param _inAmount amount of stable to spent
    /// @param _outNotLess minimal desired amount of distributed tokens (anti slippage)
    function buyTokensForExactStableWithSlippage(
        address _paymentToken, 
        uint256 _inAmount, 
        uint256 _outNotLess
    ) 
        external 
    {
        require(
            _calcTokensForExactStable(_paymentToken,_inAmount) >= _outNotLess, 
            "Slippage occur"
        );
        buyTokensForExactStable(_paymentToken, _inAmount); 

    }     

    /// @notice Buy distibuting token with stable coins
    /// @dev _inAmount in wei. Don't forget approve
    /// @param _paymentToken stable coin address
    /// @param _inAmount amount of stable to spent
    function buyTokensForExactStable(address _paymentToken, uint256 _inAmount) 
        public 
    {
        require(address(distributionToken) != address(0), 'Distribution not Define');

        require(_isValidForPayment(_paymentToken), 'This payment token not supported');
        
        // 1. Calc distribution tokens
        uint256 outAmount = _calcTokensForExactStable(_paymentToken,_inAmount);
        require(outAmount > 0, 'Cant buy zero');
        
        // 2. Save lockInfo
        _newLock(msg.sender, outAmount);
        distributedAmount += outAmount;
        
        // 3. Mint distribution token
        distributionToken.mint(address(this), outAmount);
        emit Purchase(msg.sender, outAmount, _paymentToken, _inAmount);

        // 4. Receive payment
        IERC20Mint(_paymentToken).safeTransferFrom(msg.sender, owner(),_inAmount);
    }

    /// @notice Claim available for now tokens
    function claimTokens() external {
        uint256 claimAmount;
        // calc and mark as claimed
        for (uint256 i = 0; i < userLocks[msg.sender].length; ++i){
            if (block.timestamp >= userLocks[msg.sender][i].lockedUntil){
                claimAmount += userLocks[msg.sender][i].amount;
                userLocks[msg.sender][i].amount = 0;
            }
        }
        require(claimAmount > 0, 'Nothing to claim');
        distributionToken.safeTransfer(msg.sender, claimAmount);
        emit Claimed(msg.sender, claimAmount, block.timestamp);
    }

    /// @notice Temprory disable payments with token
    /// @param _paymentToken stable coin address
    function emergencyPause(address _paymentToken) external {
        require(isGuardian[msg.sender], "Only for approved guardians");
        if (
                paymentTokens[_paymentToken] > 0 // token enabled 
                && paymentTokens[_paymentToken] <= block.timestamp // no timelock 
            ) 
        {
            paymentTokens[_paymentToken] = block.timestamp + EMERGENCY_PAYMENT_PAUSE;
            emit PaymentTokenPaused(_paymentToken, paymentTokens[_paymentToken]);
        }
    }

    ///////////////////////////////////////////////////////////
    ///////    Admin Functions        /////////////////////////
    ///////////////////////////////////////////////////////////
    function setPaymentTokenStatus(address _token, bool _state) 
        external 
        onlyOwner 
    {
        if (_state ) {
            paymentTokens[_token] = block.timestamp + ADD_NEW_PAYMENT_TOKEN_TIMELOCK;    
        } else {
            paymentTokens[_token] = 0;
        }
        
        emit PaymentTokenStatus(_token, _state);
    }

    function setDistributionToken(address _token) 
        external 
        onlyOwner 
    {
        require(address(distributionToken) == address(0), "Can call only once");
        distributionToken = IERC20Mint(_token);
        emit DistributionTokenSet(_token);
    }

    function setGuardianStatus(address _guardian, bool _state)
        external
        onlyOwner
    {
        isGuardian[_guardian] = _state;
    }

    ///////////////////////////////////////////////////////////

    /// @notice Returns amount of distributing tokens that will be
    /// get by user if he(she) pay given stable coin amount
    /// @dev _inAmount must be with given in wei (eg 1 USDT =1000000)
    /// @param _paymentToken stable coin address
    /// @param _inAmount stable coin amount that user want to spend
    function calcTokensForExactStable(address _paymentToken, uint256 _inAmount) 
        external 
        view 
        returns(uint256) 
    {
        return _calcTokensForExactStable(_paymentToken, _inAmount);
    }

    /// @notice Returns amount of stable coins that must be spent
    /// for user get given  amount of distributing token
    /// @dev _outAmount must be with given in wei (eg 1 UBDN =1e18)
    /// @param _paymentToken stable coin address
    /// @param _outAmount distributing token amount that user want to get
    function calcStableForExactTokens(address _paymentToken, uint256 _outAmount) 
        external 
        view 
        returns(uint256) 
    {
        return _calcStableForExactTokens(_paymentToken, _outAmount);
    }

    /// @notice Returns price without decimals and distributing token rest
    /// for given round
    /// @dev returns tuple  (price, rest)
    /// @param _round round number
    function priceInUnitsAndRemainByRound(uint256 _round) 
        external 
        view 
        returns(uint256, uint256) 
    {
        return _priceInUnitsAndRemainByRound(_round);
    }

    /// @notice Returns array of user's locks
    /// @dev returns tuple  array of (amount, unlock timestamp)
    /// @param _user user address 
    function getUserLocks(address _user) 
        public 
        view 
        returns(Lock[] memory)
    {
        return userLocks[_user];
    }

    /// @notice Returns array of user's locks
    /// @dev returns tuple  array of (total locked amount, available now)
    /// @param _user user address 
    function getUserAvailableAmount(address _user)
        public
        view
        returns(uint256 total, uint256 availableNow)
    {
        for (uint256 i = 0; i < userLocks[_user].length; ++i){
            total += userLocks[_user][i].amount;
            if (block.timestamp >= userLocks[_user][i].lockedUntil){
                availableNow += userLocks[_user][i].amount;
            }
        }
    }

    /// @notice Returns current round number
    function getCurrentRound() external view returns(uint256){
        return _currenRound();   
    }

    /////////////////////////////////////////////////////////////////////
    function _newLock(address _user, uint256 _lockAmount) internal {
        userLocks[_user].push(
            Lock(_lockAmount, block.timestamp + LOCK_PERIOD)
        );
    }

    function _calcStableForExactTokens(address _paymentToken, uint256 _outAmount) 
        internal
        virtual 
        view 
        returns(uint256 inAmount) 
    {
        uint256 outA = _outAmount;
        uint256 curR = _currenRound();
        uint256 curPrice; 
        uint256 curRest;
        uint8 payTokenDecimals = IERC20Mint(_paymentToken).decimals();
        uint8 dstTokenDecimals = distributionToken.decimals();
        while (outA > 0) {
            (curPrice, curRest) = _priceInUnitsAndRemainByRound(curR); 
            if (outA > curRest) {
                inAmount += curRest 
                    * curPrice * 10**payTokenDecimals
                    / (10**dstTokenDecimals);
                outA -= curRest;
                ++ curR;
            } else {
                inAmount += outA 
                    * curPrice * 10**payTokenDecimals
                    / (10**dstTokenDecimals);
                return inAmount;
            }
        }
    }

    function _calcTokensForExactStable(address _paymentToken, uint256 _inAmount) 
        internal
        virtual 
        view 
        returns(uint256 outAmount) 
    {
        uint256 inA = _inAmount;
        uint256 curR = _currenRound();
        uint256 curPrice; 
        uint256 curRest;
        uint8 payTokenDecimals = IERC20Mint(_paymentToken).decimals();
        uint8 dstTokenDecimals = distributionToken.decimals();
        while (inA > 0) {
            (curPrice, curRest) = _priceInUnitsAndRemainByRound(curR); 
            if (
                // calc out amount
                inA 
                * (10**dstTokenDecimals)
                / (curPrice * 10**payTokenDecimals)
                   > curRest
                ) 
            {
                // Case when inAmount more then price of all tokens 
                // in current round
                outAmount += curRest;
                inA -= curRest 
                       * curPrice * 10**payTokenDecimals
                       / (10**dstTokenDecimals);
                ++ curR;
            } else {
                // Case when inAmount less or eqal then price of all tokens 
                // in current round
                outAmount += inA 
                  * 10**dstTokenDecimals
                  / (curPrice * 10**payTokenDecimals);
                return outAmount;
            }
        }
    }

    function _priceInUnitsAndRemainByRound(uint256 _round) 
        internal 
        view 
        virtual 
        returns(uint256 price, uint256 rest) 
    {
        if (_round < INCREASE_FROM_ROUND){
            price = START_PRICE;
        } else {
            price = START_PRICE + PRICE_INCREASE_STEP * (_round - INCREASE_FROM_ROUND + 1); 
        }
        
        // in finished rounds rest always zero
        if (_round < _currenRound()){
            rest = 0;
        
        // in current round need calc 
        } else if (_round == _currenRound()){
            if (_round == 1){
                // first round
                rest = ROUND_VOLUME - distributedAmount; 
            } else {
                rest = ROUND_VOLUME - (distributedAmount % ROUND_VOLUME); 
            } 
        
        // in future rounds rest always ROUND_VOLUME
        } else {
            rest = ROUND_VOLUME;
        }
    }

    function _currenRound() internal view virtual returns(uint256){
        return distributedAmount / ROUND_VOLUME + 1;
    }

    function _isValidForPayment(address _paymentToken) internal view returns(bool){
        if (paymentTokens[_paymentToken] == 0) {
            return false;
        }
        require(
            paymentTokens[_paymentToken] < block.timestamp,
            "Token paused or timelocked"
        );
        return true; 
    }
}

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

pragma solidity ^0.8.0;

import "IERC20.sol";
import "draft-IERC20Permit.sol";
import "Address.sol";

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

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

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

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

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

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

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

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

pragma solidity ^0.8.0;

import "Context.sol";

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

File 8 of 9 : IERC20Mint.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import "IERC20Metadata.sol";

interface IERC20Mint is IERC20Metadata {
	function mint(address _for, uint256 _amount) external;
}

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

pragma solidity ^0.8.0;

import "IERC20.sol";

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

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

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"uint256","name":"_lockPeriod","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"User","type":"address"},{"indexed":false,"internalType":"uint256","name":"Amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"Timestamp","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"Token","type":"address"}],"name":"DistributionTokenSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"Token","type":"address"},{"indexed":false,"internalType":"uint256","name":"Until","type":"uint256"}],"name":"PaymentTokenPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"Token","type":"address"},{"indexed":false,"internalType":"bool","name":"Status","type":"bool"}],"name":"PaymentTokenStatus","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"User","type":"address"},{"indexed":true,"internalType":"uint256","name":"PurchaseAmount","type":"uint256"},{"indexed":true,"internalType":"address","name":"PaymentToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"PaymentAmount","type":"uint256"}],"name":"Purchase","type":"event"},{"inputs":[],"name":"ADD_NEW_PAYMENT_TOKEN_TIMELOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EMERGENCY_PAYMENT_PAUSE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INCREASE_FROM_ROUND","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOCK_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_INCREASE_STEP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROUND_VOLUME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"START_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_paymentToken","type":"address"},{"internalType":"uint256","name":"_inAmount","type":"uint256"}],"name":"buyTokensForExactStable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_paymentToken","type":"address"},{"internalType":"uint256","name":"_inAmount","type":"uint256"},{"internalType":"uint256","name":"_outNotLess","type":"uint256"}],"name":"buyTokensForExactStableWithSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_paymentToken","type":"address"},{"internalType":"uint256","name":"_outAmount","type":"uint256"}],"name":"calcStableForExactTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_paymentToken","type":"address"},{"internalType":"uint256","name":"_inAmount","type":"uint256"}],"name":"calcTokensForExactStable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distributedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributionToken","outputs":[{"internalType":"contract IERC20Mint","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_paymentToken","type":"address"}],"name":"emergencyPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCurrentRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserAvailableAmount","outputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"availableNow","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserLocks","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockedUntil","type":"uint256"}],"internalType":"struct UBDNLockerDistributor.Lock[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isGuardian","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"paymentTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_round","type":"uint256"}],"name":"priceInUnitsAndRemainByRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"setDistributionToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_guardian","type":"address"},{"internalType":"bool","name":"_state","type":"bool"}],"name":"setGuardianStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bool","name":"_state","type":"bool"}],"name":"setPaymentTokenStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userLocks","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lockedUntil","type":"uint256"}],"stateMutability":"view","type":"function"}]

60806040526276a70060015534801561001757600080fd5b5060405162001aa138038062001aa1833981016040819052610038916100a3565b61004133610053565b801561004d5760018190555b506100bc565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100b557600080fd5b5051919050565b6119d580620000cc6000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80637041b48a116100f9578063abf93ca411610097578063db576d6d11610071578063db576d6d1461038e578063f2fde38b1461039f578063fb7bc67d146103b2578063fdae1ec3146103c557600080fd5b8063abf93ca414610352578063b786896214610365578063c3b88b421461036e57600080fd5b80638da5cb5b116100d35780638da5cb5b146102ff5780639d13906214610324578063a32bf59714610337578063aa33fedb1461033f57600080fd5b80637041b48a146102d1578063715018a6146102e457806376cce75e146102ec57600080fd5b80632d198d931161016657806348c54b9d1161014057806348c54b9d146102a35780634ca86ecf146102ab57806359f75d22146102695780635c493347146102be57600080fd5b80632d198d93146102865780632ee7a6a8146102995780633609ac8f1461026957600080fd5b80631820cabb116101a25780631820cabb1461024057806323a35de91461024957806325b9e20a1461026957806329dba3901461027157600080fd5b806305817f4f146101c95780630c68ba21146101f65780630d25320c14610229575b600080fd5b6101dc6101d73660046115f1565b6103d8565b604080519283526020830191909152015b60405180910390f35b610219610204366004611626565b60066020526000908152604090205460ff1681565b60405190151581526020016101ed565b61023260025481565b6040519081526020016101ed565b61023260015481565b61025c610257366004611626565b6103ed565b6040516101ed9190611641565b610232600181565b61028461027f366004611626565b610476565b005b610284610294366004611690565b61051b565b6102326202a30081565b610284610574565b6102846102b93660046116c3565b6106eb565b6102846102cc3660046116fb565b6108e1565b6102846102df366004611626565b61097d565b610284610a86565b6102846102fa3660046116fb565b610a9a565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016101ed565b60035461030c906001600160a01b031681565b610232610acd565b6101dc61034d3660046116c3565b610adc565b6102326103603660046116c3565b610b18565b610232610e1081565b61023261037c366004611626565b60046020526000908152604090205481565b61023269d3c21bcecceda100000081565b6102846103ad366004611626565b610b2d565b6102326103c03660046116c3565b610ba3565b6101dc6103d3366004611626565b610baf565b6000806103e483610cc2565b91509150915091565b6001600160a01b0381166000908152600560209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561046b57838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190610425565b505050509050919050565b61047e610d8e565b6003546001600160a01b0316156104d15760405162461bcd60e51b815260206004820152601260248201527143616e2063616c6c206f6e6c79206f6e636560701b60448201526064015b60405180910390fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040517fdd5b8d8ddd59853bffc84ce621109ce2f4f16fe887cbd2528e3d83cdb39f4ff390600090a250565b806105268484610de8565b10156105655760405162461bcd60e51b815260206004820152600e60248201526d29b634b83830b3b29037b1b1bab960911b60448201526064016104c8565b61056f83836106eb565b505050565b6000805b3360009081526005602052604090205481101561064e573360009081526005602052604090208054829081106105b0576105b0611732565b906000526020600020906002020160010154421061063e573360009081526005602052604090208054829081106105e9576105e9611732565b90600052602060002090600202016000015482610606919061175e565b336000908152600560205260408120805492945090918390811061062c5761062c611732565b60009182526020909120600290910201555b61064781611771565b9050610578565b50600081116106925760405162461bcd60e51b815260206004820152601060248201526f4e6f7468696e6720746f20636c61696d60801b60448201526064016104c8565b6003546106a9906001600160a01b03163383610fdd565b6040805133815260208101839052428183015290517f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a9181900360600190a150565b6003546001600160a01b03166107435760405162461bcd60e51b815260206004820152601760248201527f446973747269627574696f6e206e6f7420446566696e6500000000000000000060448201526064016104c8565b61074c82611040565b6107985760405162461bcd60e51b815260206004820181905260248201527f54686973207061796d656e7420746f6b656e206e6f7420737570706f7274656460448201526064016104c8565b60006107a48383610de8565b9050600081116107e65760405162461bcd60e51b815260206004820152600d60248201526c43616e7420627579207a65726f60981b60448201526064016104c8565b6107f033826110d6565b8060026000828254610802919061175e565b90915550506003546040516340c10f1960e01b8152306004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561085357600080fd5b505af1158015610867573d6000803e3d6000fd5b50505050826001600160a01b031681336001600160a01b03167f3c0aac7ff88f2e47ddbaf56d3cfc506dff643228e74c58f6ef3e8a2322c6b22a856040516108b191815260200190565b60405180910390a461056f336108cf6000546001600160a01b031690565b6001600160a01b038616919085611147565b6108e9610d8e565b801561091a576108fc6202a3004261175e565b6001600160a01b038316600090815260046020526040902055610934565b6001600160a01b0382166000908152600460205260408120555b816001600160a01b03167fe97bec0d76fb14291e89489d44998cc9770a9788b11c1c69ad369094540b7d0682604051610971911515815260200190565b60405180910390a25050565b3360009081526006602052604090205460ff166109dc5760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c7920666f7220617070726f76656420677561726469616e73000000000060448201526064016104c8565b6001600160a01b03811660009081526004602052604090205415801590610a1b57506001600160a01b0381166000908152600460205260409020544210155b15610a8357610a2c610e104261175e565b6001600160a01b038216600081815260046020526040908190208390555190917f54eab57be6a72992bf271e2d488afa40cc41d14ae46c1fe9a7419aa03798374491610a7a91815260200190565b60405180910390a25b50565b610a8e610d8e565b610a986000611185565b565b610aa2610d8e565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000610ad76111d5565b905090565b60056020528160005260406000208181548110610af857600080fd5b600091825260209091206002909102018054600190910154909250905082565b6000610b2483836111fa565b90505b92915050565b610b35610d8e565b6001600160a01b038116610b9a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c8565b610a8381611185565b6000610b248383610de8565b60008060005b6001600160a01b038416600090815260056020526040902054811015610cbc576001600160a01b0384166000908152600560205260409020805482908110610bff57610bff611732565b90600052602060002090600202016000015483610c1c919061175e565b6001600160a01b038516600090815260056020526040902080549194509082908110610c4a57610c4a611732565b9060005260206000209060020201600101544210610cac576001600160a01b0384166000908152600560205260409020805482908110610c8c57610c8c611732565b90600052602060002090600202016000015482610ca9919061175e565b91505b610cb581611771565b9050610bb5565b50915091565b6000806001831015610cd75760019150610d06565b610ce260018461178a565b610ced90600161175e565b610cf890600161179d565b610d0390600161175e565b91505b610d0e6111d5565b831015610d1d57506000915091565b610d256111d5565b8303610d7d5782600103610d5157600254610d4a9069d3c21bcecceda100000061178a565b9050915091565b69d3c21bcecceda1000000600254610d6991906117ca565b610d4a9069d3c21bcecceda100000061178a565b5069d3c21bcecceda1000000915091565b6000546001600160a01b03163314610a985760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c8565b60008181610df46111d5565b90506000806000876001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5d91906117de565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed891906117de565b90505b8515610fd157610eea85610cc2565b909450925082610efb83600a6118ec565b610f05908661179d565b610f1083600a6118ec565b610f1a908961179d565b610f2491906118fb565b1115610f8657610f34838861175e565b9650610f4181600a6118ec565b610f4c83600a6118ec565b610f56868661179d565b610f60919061179d565b610f6a91906118fb565b610f74908761178a565b9550610f7f85611771565b9450610edb565b610f9182600a6118ec565b610f9b908561179d565b610fa682600a6118ec565b610fb0908861179d565b610fba91906118fb565b610fc4908861175e565b9650505050505050610b27565b50505050505092915050565b6040516001600160a01b03831660248201526044810182905261056f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261138f565b6001600160a01b038116600090815260046020526040812054810361106757506000919050565b6001600160a01b03821660009081526004602052604090205442116110ce5760405162461bcd60e51b815260206004820152601a60248201527f546f6b656e20706175736564206f722074696d656c6f636b656400000000000060448201526064016104c8565b506001919050565b60056000836001600160a01b03166001600160a01b0316815260200190815260200160002060405180604001604052808381526020016001544261111a919061175e565b90528154600181810184556000938452602093849020835160029093020191825592909101519101555050565b6040516001600160a01b038085166024830152831660448201526064810182905261117f9085906323b872dd60e01b90608401611009565b50505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600069d3c21bcecceda10000006002546111ef91906118fb565b610ad790600161175e565b600081816112066111d5565b90506000806000876001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561124b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126f91906117de565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ea91906117de565b90505b8515610fd1576112fc85610cc2565b9094509250828611156113655761131481600a6118ec565b61131f83600a6118ec565b611329868661179d565b611333919061179d565b61133d91906118fb565b611347908861175e565b9650611353838761178a565b955061135e85611771565b94506112ed565b61137081600a6118ec565b61137b83600a6118ec565b611385868961179d565b610fb0919061179d565b60006113e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114619092919063ffffffff16565b80519091501561056f5780806020019051810190611402919061190f565b61056f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104c8565b60606114708484600085611478565b949350505050565b6060824710156114d95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104c8565b600080866001600160a01b031685876040516114f59190611950565b60006040518083038185875af1925050503d8060008114611532576040519150601f19603f3d011682016040523d82523d6000602084013e611537565b606091505b509150915061154887838387611553565b979650505050505050565b606083156115c25782516000036115bb576001600160a01b0385163b6115bb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104c8565b5081611470565b61147083838151156115d75781518083602001fd5b8060405162461bcd60e51b81526004016104c8919061196c565b60006020828403121561160357600080fd5b5035919050565b80356001600160a01b038116811461162157600080fd5b919050565b60006020828403121561163857600080fd5b610b248261160a565b602080825282518282018190526000919060409081850190868401855b828110156116835781518051855286015186850152928401929085019060010161165e565b5091979650505050505050565b6000806000606084860312156116a557600080fd5b6116ae8461160a565b95602085013595506040909401359392505050565b600080604083850312156116d657600080fd5b6116df8361160a565b946020939093013593505050565b8015158114610a8357600080fd5b6000806040838503121561170e57600080fd5b6117178361160a565b91506020830135611727816116ed565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610b2757610b27611748565b60006001820161178357611783611748565b5060010190565b81810381811115610b2757610b27611748565b8082028115828204841417610b2757610b27611748565b634e487b7160e01b600052601260045260246000fd5b6000826117d9576117d96117b4565b500690565b6000602082840312156117f057600080fd5b815160ff8116811461180157600080fd5b9392505050565b600181815b8085111561184357816000190482111561182957611829611748565b8085161561183657918102915b93841c939080029061180d565b509250929050565b60008261185a57506001610b27565b8161186757506000610b27565b816001811461187d5760028114611887576118a3565b6001915050610b27565b60ff84111561189857611898611748565b50506001821b610b27565b5060208310610133831016604e8410600b84101617156118c6575081810a610b27565b6118d08383611808565b80600019048211156118e4576118e4611748565b029392505050565b6000610b2460ff84168361184b565b60008261190a5761190a6117b4565b500490565b60006020828403121561192157600080fd5b8151611801816116ed565b60005b8381101561194757818101518382015260200161192f565b50506000910152565b6000825161196281846020870161192c565b9190910192915050565b602081526000825180602084015261198b81604085016020870161192c565b601f01601f1916919091016040019291505056fea264697066735822122004a9a424a1e6d0876f30bbbffb3f2ef8ee78d8081e2ce73031cc93942da1ca7964736f6c634300081300330000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80637041b48a116100f9578063abf93ca411610097578063db576d6d11610071578063db576d6d1461038e578063f2fde38b1461039f578063fb7bc67d146103b2578063fdae1ec3146103c557600080fd5b8063abf93ca414610352578063b786896214610365578063c3b88b421461036e57600080fd5b80638da5cb5b116100d35780638da5cb5b146102ff5780639d13906214610324578063a32bf59714610337578063aa33fedb1461033f57600080fd5b80637041b48a146102d1578063715018a6146102e457806376cce75e146102ec57600080fd5b80632d198d931161016657806348c54b9d1161014057806348c54b9d146102a35780634ca86ecf146102ab57806359f75d22146102695780635c493347146102be57600080fd5b80632d198d93146102865780632ee7a6a8146102995780633609ac8f1461026957600080fd5b80631820cabb116101a25780631820cabb1461024057806323a35de91461024957806325b9e20a1461026957806329dba3901461027157600080fd5b806305817f4f146101c95780630c68ba21146101f65780630d25320c14610229575b600080fd5b6101dc6101d73660046115f1565b6103d8565b604080519283526020830191909152015b60405180910390f35b610219610204366004611626565b60066020526000908152604090205460ff1681565b60405190151581526020016101ed565b61023260025481565b6040519081526020016101ed565b61023260015481565b61025c610257366004611626565b6103ed565b6040516101ed9190611641565b610232600181565b61028461027f366004611626565b610476565b005b610284610294366004611690565b61051b565b6102326202a30081565b610284610574565b6102846102b93660046116c3565b6106eb565b6102846102cc3660046116fb565b6108e1565b6102846102df366004611626565b61097d565b610284610a86565b6102846102fa3660046116fb565b610a9a565b6000546001600160a01b03165b6040516001600160a01b0390911681526020016101ed565b60035461030c906001600160a01b031681565b610232610acd565b6101dc61034d3660046116c3565b610adc565b6102326103603660046116c3565b610b18565b610232610e1081565b61023261037c366004611626565b60046020526000908152604090205481565b61023269d3c21bcecceda100000081565b6102846103ad366004611626565b610b2d565b6102326103c03660046116c3565b610ba3565b6101dc6103d3366004611626565b610baf565b6000806103e483610cc2565b91509150915091565b6001600160a01b0381166000908152600560209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561046b57838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190610425565b505050509050919050565b61047e610d8e565b6003546001600160a01b0316156104d15760405162461bcd60e51b815260206004820152601260248201527143616e2063616c6c206f6e6c79206f6e636560701b60448201526064015b60405180910390fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040517fdd5b8d8ddd59853bffc84ce621109ce2f4f16fe887cbd2528e3d83cdb39f4ff390600090a250565b806105268484610de8565b10156105655760405162461bcd60e51b815260206004820152600e60248201526d29b634b83830b3b29037b1b1bab960911b60448201526064016104c8565b61056f83836106eb565b505050565b6000805b3360009081526005602052604090205481101561064e573360009081526005602052604090208054829081106105b0576105b0611732565b906000526020600020906002020160010154421061063e573360009081526005602052604090208054829081106105e9576105e9611732565b90600052602060002090600202016000015482610606919061175e565b336000908152600560205260408120805492945090918390811061062c5761062c611732565b60009182526020909120600290910201555b61064781611771565b9050610578565b50600081116106925760405162461bcd60e51b815260206004820152601060248201526f4e6f7468696e6720746f20636c61696d60801b60448201526064016104c8565b6003546106a9906001600160a01b03163383610fdd565b6040805133815260208101839052428183015290517f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a9181900360600190a150565b6003546001600160a01b03166107435760405162461bcd60e51b815260206004820152601760248201527f446973747269627574696f6e206e6f7420446566696e6500000000000000000060448201526064016104c8565b61074c82611040565b6107985760405162461bcd60e51b815260206004820181905260248201527f54686973207061796d656e7420746f6b656e206e6f7420737570706f7274656460448201526064016104c8565b60006107a48383610de8565b9050600081116107e65760405162461bcd60e51b815260206004820152600d60248201526c43616e7420627579207a65726f60981b60448201526064016104c8565b6107f033826110d6565b8060026000828254610802919061175e565b90915550506003546040516340c10f1960e01b8152306004820152602481018390526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561085357600080fd5b505af1158015610867573d6000803e3d6000fd5b50505050826001600160a01b031681336001600160a01b03167f3c0aac7ff88f2e47ddbaf56d3cfc506dff643228e74c58f6ef3e8a2322c6b22a856040516108b191815260200190565b60405180910390a461056f336108cf6000546001600160a01b031690565b6001600160a01b038616919085611147565b6108e9610d8e565b801561091a576108fc6202a3004261175e565b6001600160a01b038316600090815260046020526040902055610934565b6001600160a01b0382166000908152600460205260408120555b816001600160a01b03167fe97bec0d76fb14291e89489d44998cc9770a9788b11c1c69ad369094540b7d0682604051610971911515815260200190565b60405180910390a25050565b3360009081526006602052604090205460ff166109dc5760405162461bcd60e51b815260206004820152601b60248201527f4f6e6c7920666f7220617070726f76656420677561726469616e73000000000060448201526064016104c8565b6001600160a01b03811660009081526004602052604090205415801590610a1b57506001600160a01b0381166000908152600460205260409020544210155b15610a8357610a2c610e104261175e565b6001600160a01b038216600081815260046020526040908190208390555190917f54eab57be6a72992bf271e2d488afa40cc41d14ae46c1fe9a7419aa03798374491610a7a91815260200190565b60405180910390a25b50565b610a8e610d8e565b610a986000611185565b565b610aa2610d8e565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000610ad76111d5565b905090565b60056020528160005260406000208181548110610af857600080fd5b600091825260209091206002909102018054600190910154909250905082565b6000610b2483836111fa565b90505b92915050565b610b35610d8e565b6001600160a01b038116610b9a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c8565b610a8381611185565b6000610b248383610de8565b60008060005b6001600160a01b038416600090815260056020526040902054811015610cbc576001600160a01b0384166000908152600560205260409020805482908110610bff57610bff611732565b90600052602060002090600202016000015483610c1c919061175e565b6001600160a01b038516600090815260056020526040902080549194509082908110610c4a57610c4a611732565b9060005260206000209060020201600101544210610cac576001600160a01b0384166000908152600560205260409020805482908110610c8c57610c8c611732565b90600052602060002090600202016000015482610ca9919061175e565b91505b610cb581611771565b9050610bb5565b50915091565b6000806001831015610cd75760019150610d06565b610ce260018461178a565b610ced90600161175e565b610cf890600161179d565b610d0390600161175e565b91505b610d0e6111d5565b831015610d1d57506000915091565b610d256111d5565b8303610d7d5782600103610d5157600254610d4a9069d3c21bcecceda100000061178a565b9050915091565b69d3c21bcecceda1000000600254610d6991906117ca565b610d4a9069d3c21bcecceda100000061178a565b5069d3c21bcecceda1000000915091565b6000546001600160a01b03163314610a985760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c8565b60008181610df46111d5565b90506000806000876001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5d91906117de565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed891906117de565b90505b8515610fd157610eea85610cc2565b909450925082610efb83600a6118ec565b610f05908661179d565b610f1083600a6118ec565b610f1a908961179d565b610f2491906118fb565b1115610f8657610f34838861175e565b9650610f4181600a6118ec565b610f4c83600a6118ec565b610f56868661179d565b610f60919061179d565b610f6a91906118fb565b610f74908761178a565b9550610f7f85611771565b9450610edb565b610f9182600a6118ec565b610f9b908561179d565b610fa682600a6118ec565b610fb0908861179d565b610fba91906118fb565b610fc4908861175e565b9650505050505050610b27565b50505050505092915050565b6040516001600160a01b03831660248201526044810182905261056f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261138f565b6001600160a01b038116600090815260046020526040812054810361106757506000919050565b6001600160a01b03821660009081526004602052604090205442116110ce5760405162461bcd60e51b815260206004820152601a60248201527f546f6b656e20706175736564206f722074696d656c6f636b656400000000000060448201526064016104c8565b506001919050565b60056000836001600160a01b03166001600160a01b0316815260200190815260200160002060405180604001604052808381526020016001544261111a919061175e565b90528154600181810184556000938452602093849020835160029093020191825592909101519101555050565b6040516001600160a01b038085166024830152831660448201526064810182905261117f9085906323b872dd60e01b90608401611009565b50505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600069d3c21bcecceda10000006002546111ef91906118fb565b610ad790600161175e565b600081816112066111d5565b90506000806000876001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561124b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126f91906117de565b90506000600360009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ea91906117de565b90505b8515610fd1576112fc85610cc2565b9094509250828611156113655761131481600a6118ec565b61131f83600a6118ec565b611329868661179d565b611333919061179d565b61133d91906118fb565b611347908861175e565b9650611353838761178a565b955061135e85611771565b94506112ed565b61137081600a6118ec565b61137b83600a6118ec565b611385868961179d565b610fb0919061179d565b60006113e4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166114619092919063ffffffff16565b80519091501561056f5780806020019051810190611402919061190f565b61056f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104c8565b60606114708484600085611478565b949350505050565b6060824710156114d95760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104c8565b600080866001600160a01b031685876040516114f59190611950565b60006040518083038185875af1925050503d8060008114611532576040519150601f19603f3d011682016040523d82523d6000602084013e611537565b606091505b509150915061154887838387611553565b979650505050505050565b606083156115c25782516000036115bb576001600160a01b0385163b6115bb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104c8565b5081611470565b61147083838151156115d75781518083602001fd5b8060405162461bcd60e51b81526004016104c8919061196c565b60006020828403121561160357600080fd5b5035919050565b80356001600160a01b038116811461162157600080fd5b919050565b60006020828403121561163857600080fd5b610b248261160a565b602080825282518282018190526000919060409081850190868401855b828110156116835781518051855286015186850152928401929085019060010161165e565b5091979650505050505050565b6000806000606084860312156116a557600080fd5b6116ae8461160a565b95602085013595506040909401359392505050565b600080604083850312156116d657600080fd5b6116df8361160a565b946020939093013593505050565b8015158114610a8357600080fd5b6000806040838503121561170e57600080fd5b6117178361160a565b91506020830135611727816116ed565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610b2757610b27611748565b60006001820161178357611783611748565b5060010190565b81810381811115610b2757610b27611748565b8082028115828204841417610b2757610b27611748565b634e487b7160e01b600052601260045260246000fd5b6000826117d9576117d96117b4565b500690565b6000602082840312156117f057600080fd5b815160ff8116811461180157600080fd5b9392505050565b600181815b8085111561184357816000190482111561182957611829611748565b8085161561183657918102915b93841c939080029061180d565b509250929050565b60008261185a57506001610b27565b8161186757506000610b27565b816001811461187d5760028114611887576118a3565b6001915050610b27565b60ff84111561189857611898611748565b50506001821b610b27565b5060208310610133831016604e8410600b84101617156118c6575081810a610b27565b6118d08383611808565b80600019048211156118e4576118e4611748565b029392505050565b6000610b2460ff84168361184b565b60008261190a5761190a6117b4565b500490565b60006020828403121561192157600080fd5b8151611801816116ed565b60005b8381101561194757818101518382015260200161192f565b50506000910152565b6000825161196281846020870161192c565b9190910192915050565b602081526000825180602084015261198b81604085016020870161192c565b601f01601f1916919091016040019291505056fea264697066735822122004a9a424a1e6d0876f30bbbffb3f2ef8ee78d8081e2ce73031cc93942da1ca7964736f6c63430008130033

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

0000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _lockPeriod (uint256): 0

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000


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.