ETH Price: $3,313.39 (-3.94%)

Contract

0x465A790B428268196865a3AE2648481ad7e0d3b1
 
Transaction Hash
Method
Block
From
To
Update Pool144394662022-03-23 0:56:30980 days ago1647996990IN
LooksRare: Token Distributor
0 ETH0.0015213633.04587759
Deposit144394572022-03-23 0:53:34980 days ago1647996814IN
LooksRare: Token Distributor
0 ETH0.0031881624.07783056
Harvest And Comp...144365382022-03-22 14:08:02980 days ago1647958082IN
LooksRare: Token Distributor
0 ETH0.0011656935.94172565
Harvest And Comp...143097472022-03-02 20:24:521000 days ago1646252692IN
LooksRare: Token Distributor
0 ETH0.0020460963.08681709
Harvest And Comp...140720512022-01-25 2:17:011036 days ago1643077021IN
LooksRare: Token Distributor
0 ETH0.00837899112.15960615
Harvest And Comp...140720432022-01-25 2:15:151036 days ago1643076915IN
LooksRare: Token Distributor
0 ETH0.005026589.53997301
0x61010060139750512022-01-10 2:12:591051 days ago1641780779IN
 Create: TokenDistributor
0 ETH0.27059685150

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenDistributor

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 888888 runs

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

import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import {ILooksRareToken} from "../interfaces/ILooksRareToken.sol";

/**
 * @title TokenDistributor
 * @notice It handles the distribution of LOOKS token.
 * It auto-adjusts block rewards over a set number of periods.
 */
contract TokenDistributor is ReentrancyGuard {
    using SafeERC20 for IERC20;
    using SafeERC20 for ILooksRareToken;

    struct StakingPeriod {
        uint256 rewardPerBlockForStaking;
        uint256 rewardPerBlockForOthers;
        uint256 periodLengthInBlock;
    }

    struct UserInfo {
        uint256 amount; // Amount of staked tokens provided by user
        uint256 rewardDebt; // Reward debt
    }

    // Precision factor for calculating rewards
    uint256 public constant PRECISION_FACTOR = 10**12;

    ILooksRareToken public immutable looksRareToken;

    address public immutable tokenSplitter;

    // Number of reward periods
    uint256 public immutable NUMBER_PERIODS;

    // Block number when rewards start
    uint256 public immutable START_BLOCK;

    // Accumulated tokens per share
    uint256 public accTokenPerShare;

    // Current phase for rewards
    uint256 public currentPhase;

    // Block number when rewards end
    uint256 public endBlock;

    // Block number of the last update
    uint256 public lastRewardBlock;

    // Tokens distributed per block for other purposes (team + treasury + trading rewards)
    uint256 public rewardPerBlockForOthers;

    // Tokens distributed per block for staking
    uint256 public rewardPerBlockForStaking;

    // Total amount staked
    uint256 public totalAmountStaked;

    mapping(uint256 => StakingPeriod) public stakingPeriod;

    mapping(address => UserInfo) public userInfo;

    event Compound(address indexed user, uint256 harvestedAmount);
    event Deposit(address indexed user, uint256 amount, uint256 harvestedAmount);
    event NewRewardsPerBlock(
        uint256 indexed currentPhase,
        uint256 startBlock,
        uint256 rewardPerBlockForStaking,
        uint256 rewardPerBlockForOthers
    );
    event Withdraw(address indexed user, uint256 amount, uint256 harvestedAmount);

    /**
     * @notice Constructor
     * @param _looksRareToken LOOKS token address
     * @param _tokenSplitter token splitter contract address (for team and trading rewards)
     * @param _startBlock start block for reward program
     * @param _rewardsPerBlockForStaking array of rewards per block for staking
     * @param _rewardsPerBlockForOthers array of rewards per block for other purposes (team + treasury + trading rewards)
     * @param _periodLengthesInBlocks array of period lengthes
     * @param _numberPeriods number of periods with different rewards/lengthes (e.g., if 3 changes --> 4 periods)
     */
    constructor(
        address _looksRareToken,
        address _tokenSplitter,
        uint256 _startBlock,
        uint256[] memory _rewardsPerBlockForStaking,
        uint256[] memory _rewardsPerBlockForOthers,
        uint256[] memory _periodLengthesInBlocks,
        uint256 _numberPeriods
    ) {
        require(
            (_periodLengthesInBlocks.length == _numberPeriods) &&
                (_rewardsPerBlockForStaking.length == _numberPeriods) &&
                (_rewardsPerBlockForStaking.length == _numberPeriods),
            "Distributor: Lengthes must match numberPeriods"
        );

        // 1. Operational checks for supply
        uint256 nonCirculatingSupply = ILooksRareToken(_looksRareToken).SUPPLY_CAP() -
            ILooksRareToken(_looksRareToken).totalSupply();

        uint256 amountTokensToBeMinted;

        for (uint256 i = 0; i < _numberPeriods; i++) {
            amountTokensToBeMinted +=
                (_rewardsPerBlockForStaking[i] * _periodLengthesInBlocks[i]) +
                (_rewardsPerBlockForOthers[i] * _periodLengthesInBlocks[i]);

            stakingPeriod[i] = StakingPeriod({
                rewardPerBlockForStaking: _rewardsPerBlockForStaking[i],
                rewardPerBlockForOthers: _rewardsPerBlockForOthers[i],
                periodLengthInBlock: _periodLengthesInBlocks[i]
            });
        }

        require(amountTokensToBeMinted == nonCirculatingSupply, "Distributor: Wrong reward parameters");

        // 2. Store values
        looksRareToken = ILooksRareToken(_looksRareToken);
        tokenSplitter = _tokenSplitter;
        rewardPerBlockForStaking = _rewardsPerBlockForStaking[0];
        rewardPerBlockForOthers = _rewardsPerBlockForOthers[0];

        START_BLOCK = _startBlock;
        endBlock = _startBlock + _periodLengthesInBlocks[0];

        NUMBER_PERIODS = _numberPeriods;

        // Set the lastRewardBlock as the startBlock
        lastRewardBlock = _startBlock;
    }

    /**
     * @notice Deposit staked tokens and compounds pending rewards
     * @param amount amount to deposit (in LOOKS)
     */
    function deposit(uint256 amount) external nonReentrant {
        require(amount > 0, "Deposit: Amount must be > 0");

        // Update pool information
        _updatePool();

        // Transfer LOOKS tokens to this contract
        looksRareToken.safeTransferFrom(msg.sender, address(this), amount);

        uint256 pendingRewards;

        // If not new deposit, calculate pending rewards (for auto-compounding)
        if (userInfo[msg.sender].amount > 0) {
            pendingRewards =
                ((userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR) -
                userInfo[msg.sender].rewardDebt;
        }

        // Adjust user information
        userInfo[msg.sender].amount += (amount + pendingRewards);
        userInfo[msg.sender].rewardDebt = (userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR;

        // Increase totalAmountStaked
        totalAmountStaked += (amount + pendingRewards);

        emit Deposit(msg.sender, amount, pendingRewards);
    }

    /**
     * @notice Compound based on pending rewards
     */
    function harvestAndCompound() external nonReentrant {
        // Update pool information
        _updatePool();

        // Calculate pending rewards
        uint256 pendingRewards = ((userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR) -
            userInfo[msg.sender].rewardDebt;

        // Return if no pending rewards
        if (pendingRewards == 0) {
            // It doesn't throw revertion (to help with the fee-sharing auto-compounding contract)
            return;
        }

        // Adjust user amount for pending rewards
        userInfo[msg.sender].amount += pendingRewards;

        // Adjust totalAmountStaked
        totalAmountStaked += pendingRewards;

        // Recalculate reward debt based on new user amount
        userInfo[msg.sender].rewardDebt = (userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR;

        emit Compound(msg.sender, pendingRewards);
    }

    /**
     * @notice Update pool rewards
     */
    function updatePool() external nonReentrant {
        _updatePool();
    }

    /**
     * @notice Withdraw staked tokens and compound pending rewards
     * @param amount amount to withdraw
     */
    function withdraw(uint256 amount) external nonReentrant {
        require(
            (userInfo[msg.sender].amount >= amount) && (amount > 0),
            "Withdraw: Amount must be > 0 or lower than user balance"
        );

        // Update pool
        _updatePool();

        // Calculate pending rewards
        uint256 pendingRewards = ((userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR) -
            userInfo[msg.sender].rewardDebt;

        // Adjust user information
        userInfo[msg.sender].amount = userInfo[msg.sender].amount + pendingRewards - amount;
        userInfo[msg.sender].rewardDebt = (userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR;

        // Adjust total amount staked
        totalAmountStaked = totalAmountStaked + pendingRewards - amount;

        // Transfer LOOKS tokens to the sender
        looksRareToken.safeTransfer(msg.sender, amount);

        emit Withdraw(msg.sender, amount, pendingRewards);
    }

    /**
     * @notice Withdraw all staked tokens and collect tokens
     */
    function withdrawAll() external nonReentrant {
        require(userInfo[msg.sender].amount > 0, "Withdraw: Amount must be > 0");

        // Update pool
        _updatePool();

        // Calculate pending rewards and amount to transfer (to the sender)
        uint256 pendingRewards = ((userInfo[msg.sender].amount * accTokenPerShare) / PRECISION_FACTOR) -
            userInfo[msg.sender].rewardDebt;

        uint256 amountToTransfer = userInfo[msg.sender].amount + pendingRewards;

        // Adjust total amount staked
        totalAmountStaked = totalAmountStaked - userInfo[msg.sender].amount;

        // Adjust user information
        userInfo[msg.sender].amount = 0;
        userInfo[msg.sender].rewardDebt = 0;

        // Transfer LOOKS tokens to the sender
        looksRareToken.safeTransfer(msg.sender, amountToTransfer);

        emit Withdraw(msg.sender, amountToTransfer, pendingRewards);
    }

    /**
     * @notice Calculate pending rewards for a user
     * @param user address of the user
     * @return Pending rewards
     */
    function calculatePendingRewards(address user) external view returns (uint256) {
        if ((block.number > lastRewardBlock) && (totalAmountStaked != 0)) {
            uint256 multiplier = _getMultiplier(lastRewardBlock, block.number);

            uint256 tokenRewardForStaking = multiplier * rewardPerBlockForStaking;

            uint256 adjustedEndBlock = endBlock;
            uint256 adjustedCurrentPhase = currentPhase;

            // Check whether to adjust multipliers and reward per block
            while ((block.number > adjustedEndBlock) && (adjustedCurrentPhase < (NUMBER_PERIODS - 1))) {
                // Update current phase
                adjustedCurrentPhase++;

                // Update rewards per block
                uint256 adjustedRewardPerBlockForStaking = stakingPeriod[adjustedCurrentPhase].rewardPerBlockForStaking;

                // Calculate adjusted block number
                uint256 previousEndBlock = adjustedEndBlock;

                // Update end block
                adjustedEndBlock = previousEndBlock + stakingPeriod[adjustedCurrentPhase].periodLengthInBlock;

                // Calculate new multiplier
                uint256 newMultiplier = (block.number <= adjustedEndBlock)
                    ? (block.number - previousEndBlock)
                    : stakingPeriod[adjustedCurrentPhase].periodLengthInBlock;

                // Adjust token rewards for staking
                tokenRewardForStaking += (newMultiplier * adjustedRewardPerBlockForStaking);
            }

            uint256 adjustedTokenPerShare = accTokenPerShare +
                (tokenRewardForStaking * PRECISION_FACTOR) /
                totalAmountStaked;

            return (userInfo[user].amount * adjustedTokenPerShare) / PRECISION_FACTOR - userInfo[user].rewardDebt;
        } else {
            return (userInfo[user].amount * accTokenPerShare) / PRECISION_FACTOR - userInfo[user].rewardDebt;
        }
    }

    /**
     * @notice Update reward variables of the pool
     */
    function _updatePool() internal {
        if (block.number <= lastRewardBlock) {
            return;
        }

        if (totalAmountStaked == 0) {
            lastRewardBlock = block.number;
            return;
        }

        // Calculate multiplier
        uint256 multiplier = _getMultiplier(lastRewardBlock, block.number);

        // Calculate rewards for staking and others
        uint256 tokenRewardForStaking = multiplier * rewardPerBlockForStaking;
        uint256 tokenRewardForOthers = multiplier * rewardPerBlockForOthers;

        // Check whether to adjust multipliers and reward per block
        while ((block.number > endBlock) && (currentPhase < (NUMBER_PERIODS - 1))) {
            // Update rewards per block
            _updateRewardsPerBlock(endBlock);

            uint256 previousEndBlock = endBlock;

            // Adjust the end block
            endBlock += stakingPeriod[currentPhase].periodLengthInBlock;

            // Adjust multiplier to cover the missing periods with other lower inflation schedule
            uint256 newMultiplier = _getMultiplier(previousEndBlock, block.number);

            // Adjust token rewards
            tokenRewardForStaking += (newMultiplier * rewardPerBlockForStaking);
            tokenRewardForOthers += (newMultiplier * rewardPerBlockForOthers);
        }

        // Mint tokens only if token rewards for staking are not null
        if (tokenRewardForStaking > 0) {
            // It allows protection against potential issues to prevent funds from being locked
            bool mintStatus = looksRareToken.mint(address(this), tokenRewardForStaking);
            if (mintStatus) {
                accTokenPerShare = accTokenPerShare + ((tokenRewardForStaking * PRECISION_FACTOR) / totalAmountStaked);
            }

            looksRareToken.mint(tokenSplitter, tokenRewardForOthers);
        }

        // Update last reward block only if it wasn't updated after or at the end block
        if (lastRewardBlock <= endBlock) {
            lastRewardBlock = block.number;
        }
    }

    /**
     * @notice Update rewards per block
     * @dev Rewards are halved by 2 (for staking + others)
     */
    function _updateRewardsPerBlock(uint256 _newStartBlock) internal {
        // Update current phase
        currentPhase++;

        // Update rewards per block
        rewardPerBlockForStaking = stakingPeriod[currentPhase].rewardPerBlockForStaking;
        rewardPerBlockForOthers = stakingPeriod[currentPhase].rewardPerBlockForOthers;

        emit NewRewardsPerBlock(currentPhase, _newStartBlock, rewardPerBlockForStaking, rewardPerBlockForOthers);
    }

    /**
     * @notice Return reward multiplier over the given "from" to "to" block.
     * @param from block to start calculating reward
     * @param to block to finish calculating reward
     * @return the multiplier for the period
     */
    function _getMultiplier(uint256 from, uint256 to) internal view returns (uint256) {
        if (to <= endBlock) {
            return to - from;
        } else if (from >= endBlock) {
            return 0;
        } else {
            return endBlock - from;
        }
    }
}

File 2 of 6 : 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 3 of 6 : 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 4 of 6 : ILooksRareToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface ILooksRareToken is IERC20 {
    function SUPPLY_CAP() external view returns (uint256);

    function mint(address account, uint256 amount) external returns (bool);
}

File 5 of 6 : 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 {
    /**
     * @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 6 : 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);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_looksRareToken","type":"address"},{"internalType":"address","name":"_tokenSplitter","type":"address"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256[]","name":"_rewardsPerBlockForStaking","type":"uint256[]"},{"internalType":"uint256[]","name":"_rewardsPerBlockForOthers","type":"uint256[]"},{"internalType":"uint256[]","name":"_periodLengthesInBlocks","type":"uint256[]"},{"internalType":"uint256","name":"_numberPeriods","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"harvestedAmount","type":"uint256"}],"name":"Compound","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"harvestedAmount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"currentPhase","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardPerBlockForStaking","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardPerBlockForOthers","type":"uint256"}],"name":"NewRewardsPerBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"harvestedAmount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"NUMBER_PERIODS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRECISION_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"START_BLOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accTokenPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"calculatePendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPhase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvestAndCompound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastRewardBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"looksRareToken","outputs":[{"internalType":"contract ILooksRareToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerBlockForOthers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerBlockForStaking","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakingPeriod","outputs":[{"internalType":"uint256","name":"rewardPerBlockForStaking","type":"uint256"},{"internalType":"uint256","name":"rewardPerBlockForOthers","type":"uint256"},{"internalType":"uint256","name":"periodLengthInBlock","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenSplitter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAmountStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101006040523480156200001257600080fd5b5060405162001f4a38038062001f4a8339810160408190526200003591620004ee565b60016000558151811480156200004b5750808451145b8015620000585750808451145b620000c15760405162461bcd60e51b815260206004820152602e60248201527f4469737472696275746f723a204c656e6774686573206d757374206d6174636860448201526d206e756d626572506572696f647360901b60648201526084015b60405180910390fd5b6000876001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015620000fd57600080fd5b505afa15801562000112573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001389190620005b9565b886001600160a01b0316630cfccc836040518163ffffffff1660e01b815260040160206040518083038186803b1580156200017257600080fd5b505afa15801562000187573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001ad9190620005b9565b620001b9919062000610565b90506000805b838110156200031d57848181518110620001dd57620001dd6200065e565b6020026020010151868281518110620001fa57620001fa6200065e565b60200260200101516200020e9190620005ee565b8582815181106200022357620002236200065e565b60200260200101518883815181106200024057620002406200065e565b6020026020010151620002549190620005ee565b620002609190620005d3565b6200026c9083620005d3565b915060405180606001604052808883815181106200028e576200028e6200065e565b60200260200101518152602001878381518110620002b057620002b06200065e565b60200260200101518152602001868381518110620002d257620002d26200065e565b6020908102919091018101519091526000838152600882526040908190208351815591830151600183015591909101516002909101558062000314816200062a565b915050620001bf565b508181146200037b5760405162461bcd60e51b8152602060048201526024808201527f4469737472696275746f723a2057726f6e672072657761726420706172616d656044820152637465727360e01b6064820152608401620000b8565b6001600160601b031960608a811b821660805289901b1660a05285518690600090620003ab57620003ab6200065e565b602002602001015160068190555084600081518110620003cf57620003cf6200065e565b60200260200101516005819055508660e0818152505083600081518110620003fb57620003fb6200065e565b602002602001015187620004109190620005d3565b600355505060c052505050600455506200068a9050565b80516001600160a01b03811681146200043f57600080fd5b919050565b600082601f8301126200045657600080fd5b815160206001600160401b038083111562000475576200047562000674565b8260051b604051601f19603f830116810181811084821117156200049d576200049d62000674565b60405284815283810192508684018288018501891015620004bd57600080fd5b600092505b85831015620004e2578051845292840192600192909201918401620004c2565b50979650505050505050565b600080600080600080600060e0888a0312156200050a57600080fd5b620005158862000427565b9650620005256020890162000427565b604089015160608a015191975095506001600160401b03808211156200054a57600080fd5b620005588b838c0162000444565b955060808a01519150808211156200056f57600080fd5b6200057d8b838c0162000444565b945060a08a01519150808211156200059457600080fd5b50620005a38a828b0162000444565b92505060c0880151905092959891949750929550565b600060208284031215620005cc57600080fd5b5051919050565b60008219821115620005e957620005e962000648565b500190565b60008160001904831182151516156200060b576200060b62000648565b500290565b60008282101562000625576200062562000648565b500390565b600060001982141562000641576200064162000648565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60805160601c60a05160601c60c05160e05161184862000702600039600061025301526000818161027a015281816103be0152610eab0152600081816102bb015261109b015260008181610207015281816108e901528181610ae101528181610c5001528181610f9801526110ca01526118486000f3fe608060405234801561001057600080fd5b506004361061016c5760003560e01c8063853828b6116100cd578063c1027c9811610081578063e3161ddd11610066578063e3161ddd1461034f578063e683d96f14610357578063fe961f611461036057600080fd5b8063c1027c98146102f9578063ccd34cd51461034357600080fd5b8063a46074c3116100b2578063a46074c3146102b6578063a9f8d181146102dd578063b6b55f25146102e657600080fd5b8063853828b6146102a55780638f662915146102ad57600080fd5b80632e1a7d4d1161012457806339b3e8261161010957806339b3e8261461024e57806352bf348c146102755780635a9477e91461029c57600080fd5b80632e1a7d4d146101ef57806336db9fb21461020257600080fd5b8063097aad1011610155578063097aad10146101965780631959a002146101a95780632a4e051b146101e557600080fd5b8063055ad42e14610171578063083c63231461018d575b600080fd5b61017a60025481565b6040519081526020015b60405180910390f35b61017a60035481565b61017a6101a43660046115f9565b610369565b6101d06101b73660046115f9565b6009602052600090815260409020805460019091015482565b60408051928352602083019190915201610184565b6101ed610551565b005b6101ed6101fd366004611651565b6106e1565b6102297f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610184565b61017a7f000000000000000000000000000000000000000000000000000000000000000081565b61017a7f000000000000000000000000000000000000000000000000000000000000000081565b61017a60065481565b6101ed610955565b61017a60015481565b6102297f000000000000000000000000000000000000000000000000000000000000000081565b61017a60045481565b6101ed6102f4366004611651565b610b55565b610328610307366004611651565b60086020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610184565b61017a64e8d4a5100081565b6101ed610d96565b61017a60055481565b61017a60075481565b60006004544311801561037d575060075415155b156104f557600061039060045443610e10565b90506000600654826103a2919061172a565b600354600254919250905b81431180156103e557506103e260017f0000000000000000000000000000000000000000000000000000000000000000611767565b81105b1561046857806103f4816117aa565b600081815260086020526040902080546002909101549193509150839061041b90826116d7565b935060008443111561043e57600084815260086020526040902060020154610448565b6104488243611767565b9050610454838261172a565b61045e90876116d7565b95505050506103ad565b60075460009061047d64e8d4a510008661172a565b61048791906116ef565b60015461049491906116d7565b73ffffffffffffffffffffffffffffffffffffffff88166000908152600960205260409020600181015490549192509064e8d4a51000906104d690849061172a565b6104e091906116ef565b6104ea9190611767565b979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260096020526040902060018082015490549154909164e8d4a5100091610537919061172a565b61054191906116ef565b61054b9190611767565b92915050565b600260005414156105c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026000556105d0610e4b565b33600090815260096020526040812060018082015490549154909164e8d4a51000916105fc919061172a565b61060691906116ef565b6106109190611767565b90508061061d57506106da565b336000908152600960205260408120805483929061063c9084906116d7565b92505081905550806007600082825461065591906116d7565b90915550506001543360009081526009602052604090205464e8d4a510009161067d9161172a565b61068791906116ef565b33600081815260096020526040908190206001019290925590517f169f1815ebdea059aac3bb00ec9a9594c7a5ffcb64a17e8392b5d84909a14556906106d09084815260200190565b60405180910390a2505b6001600055565b6002600054141561074e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ba565b600260009081553381526009602052604090205481118015906107715750600081115b6107fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f57697468647261773a20416d6f756e74206d757374206265203e2030206f722060448201527f6c6f776572207468616e20757365722062616c616e636500000000000000000060648201526084016105ba565b610805610e4b565b33600090815260096020526040812060018082015490549154909164e8d4a5100091610831919061172a565b61083b91906116ef565b6108459190611767565b3360009081526009602052604090205490915082906108659083906116d7565b61086f9190611767565b33600090815260096020526040902081905560015464e8d4a5100091610895919061172a565b61089f91906116ef565b3360009081526009602052604090206001015560075482906108c29083906116d7565b6108cc9190611767565b60075561091073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016338461115e565b604080518381526020810183905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56891015b60405180910390a250506001600055565b600260005414156109c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ba565b6002600090815533815260096020526040902054610a3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f57697468647261773a20416d6f756e74206d757374206265203e20300000000060448201526064016105ba565b610a44610e4b565b33600090815260096020526040812060018082015490549154909164e8d4a5100091610a70919061172a565b610a7a91906116ef565b610a849190611767565b3360009081526009602052604081205491925090610aa39083906116d7565b33600090815260096020526040902054600754919250610ac291611767565b60075533600081815260096020526040812081815560010155610b1d907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16908361115e565b604080518281526020810184905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689101610944565b60026000541415610bc2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ba565b600260005580610c2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4465706f7369743a20416d6f756e74206d757374206265203e2030000000000060448201526064016105ba565b610c36610e4b565b610c7873ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016333084611232565b3360009081526009602052604081205415610cd05733600090815260096020526040902060018082015490549154909164e8d4a5100091610cb9919061172a565b610cc391906116ef565b610ccd9190611767565b90505b610cda81836116d7565b3360009081526009602052604081208054909190610cf99084906116d7565b90915550506001543360009081526009602052604090205464e8d4a5100091610d219161172a565b610d2b91906116ef565b33600090815260096020526040902060010155610d4881836116d7565b60076000828254610d5991906116d7565b9091555050604080518381526020810183905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159101610944565b60026000541415610e03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ba565b60026000556106da610e4b565b60006003548211610e2c57610e258383611767565b905061054b565b6003548310610e3d5750600061054b565b82600354610e259190611767565b6004544311610e5657565b600754610e635743600455565b6000610e7160045443610e10565b9050600060065482610e83919061172a565b9050600060055483610e95919061172a565b90505b60035443118015610ed45750610ecf60017f0000000000000000000000000000000000000000000000000000000000000000611767565b600254105b15610f5a57610ee4600354611296565b6003805460028054600090815260086020526040812090910154919290610f0b83856116d7565b9091555060009050610f1d8243610e10565b905060065481610f2d919061172a565b610f3790856116d7565b935060055481610f47919061172a565b610f5190846116d7565b92505050610e98565b8115611149576040517f40c10f19000000000000000000000000000000000000000000000000000000008152306004820152602481018390526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906340c10f1990604401602060405180830381600087803b158015610ff157600080fd5b505af1158015611005573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611029919061162f565b9050801561105e5760075461104364e8d4a510008561172a565b61104d91906116ef565b60015461105a91906116d7565b6001555b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018490527f000000000000000000000000000000000000000000000000000000000000000016906340c10f1990604401602060405180830381600087803b15801561110e57600080fd5b505af1158015611122573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611146919061162f565b50505b6003546004541161115957436004555b505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526111599084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611311565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526112909085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016111b0565b50505050565b600280549060006112a6836117aa565b90915550506002546000818152600860209081526040918290208054600681905560019091015460058190558351868152928301919091528183015290517f40181eb77bccfdef1a73b669bb4290d98e2fbec678c7cf4578ae256210420e179181900360600190a250565b6000611373826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661141d9092919063ffffffff16565b8051909150156111595780806020019051810190611391919061162f565b611159576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016105ba565b606061142c8484600085611436565b90505b9392505050565b6060824710156114c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016105ba565b843b611530576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105ba565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611559919061166a565b60006040518083038185875af1925050503d8060008114611596576040519150601f19603f3d011682016040523d82523d6000602084013e61159b565b606091505b50915091506104ea828286606083156115b557508161142f565b8251156115c55782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ba9190611686565b60006020828403121561160b57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461142f57600080fd5b60006020828403121561164157600080fd5b8151801515811461142f57600080fd5b60006020828403121561166357600080fd5b5035919050565b6000825161167c81846020870161177e565b9190910192915050565b60208152600082518060208401526116a581604085016020870161177e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600082198211156116ea576116ea6117e3565b500190565b600082611725577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611762576117626117e3565b500290565b600082821015611779576117796117e3565b500390565b60005b83811015611799578181015183820152602001611781565b838111156112905750506000910152565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156117dc576117dc6117e3565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea2646970667358221220cf7d961c27f41e20b5eaa8e8c6c65c46053085763b73a84c3bd14bc7a11b761764736f6c63430008070033000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e000000000000000000000000fec3069df398faaf689c559151e41fa8036c82030000000000000000000000000000000000000000000000000000000000d545b400000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000a3ee6e2a294d40000000000000000000000000000000000000000000000000004dde0deda06b18000000000000000000000000000000000000000000000000001ebcb4a7e7be7c000000000000000000000000000000000000000000000000001064a49dd0ee2000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000211f540ec883ac000000000000000000000000000000000000000000000000000fbbae53d271be800000000000000000000000000000000000000000000000000635dfc2c598b040000000000000000000000000000000000000000000000000034feece47405e00000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000002f9b8000000000000000000000000000000000000000000000000000000000008ed28000000000000000000000000000000000000000000000000000000000017cdc0000000000000000000000000000000000000000000000000000000000023cd0a

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061016c5760003560e01c8063853828b6116100cd578063c1027c9811610081578063e3161ddd11610066578063e3161ddd1461034f578063e683d96f14610357578063fe961f611461036057600080fd5b8063c1027c98146102f9578063ccd34cd51461034357600080fd5b8063a46074c3116100b2578063a46074c3146102b6578063a9f8d181146102dd578063b6b55f25146102e657600080fd5b8063853828b6146102a55780638f662915146102ad57600080fd5b80632e1a7d4d1161012457806339b3e8261161010957806339b3e8261461024e57806352bf348c146102755780635a9477e91461029c57600080fd5b80632e1a7d4d146101ef57806336db9fb21461020257600080fd5b8063097aad1011610155578063097aad10146101965780631959a002146101a95780632a4e051b146101e557600080fd5b8063055ad42e14610171578063083c63231461018d575b600080fd5b61017a60025481565b6040519081526020015b60405180910390f35b61017a60035481565b61017a6101a43660046115f9565b610369565b6101d06101b73660046115f9565b6009602052600090815260409020805460019091015482565b60408051928352602083019190915201610184565b6101ed610551565b005b6101ed6101fd366004611651565b6106e1565b6102297f000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e81565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610184565b61017a7f0000000000000000000000000000000000000000000000000000000000d545b481565b61017a7f000000000000000000000000000000000000000000000000000000000000000481565b61017a60065481565b6101ed610955565b61017a60015481565b6102297f000000000000000000000000fec3069df398faaf689c559151e41fa8036c820381565b61017a60045481565b6101ed6102f4366004611651565b610b55565b610328610307366004611651565b60086020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610184565b61017a64e8d4a5100081565b6101ed610d96565b61017a60055481565b61017a60075481565b60006004544311801561037d575060075415155b156104f557600061039060045443610e10565b90506000600654826103a2919061172a565b600354600254919250905b81431180156103e557506103e260017f0000000000000000000000000000000000000000000000000000000000000004611767565b81105b1561046857806103f4816117aa565b600081815260086020526040902080546002909101549193509150839061041b90826116d7565b935060008443111561043e57600084815260086020526040902060020154610448565b6104488243611767565b9050610454838261172a565b61045e90876116d7565b95505050506103ad565b60075460009061047d64e8d4a510008661172a565b61048791906116ef565b60015461049491906116d7565b73ffffffffffffffffffffffffffffffffffffffff88166000908152600960205260409020600181015490549192509064e8d4a51000906104d690849061172a565b6104e091906116ef565b6104ea9190611767565b979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260096020526040902060018082015490549154909164e8d4a5100091610537919061172a565b61054191906116ef565b61054b9190611767565b92915050565b600260005414156105c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60026000556105d0610e4b565b33600090815260096020526040812060018082015490549154909164e8d4a51000916105fc919061172a565b61060691906116ef565b6106109190611767565b90508061061d57506106da565b336000908152600960205260408120805483929061063c9084906116d7565b92505081905550806007600082825461065591906116d7565b90915550506001543360009081526009602052604090205464e8d4a510009161067d9161172a565b61068791906116ef565b33600081815260096020526040908190206001019290925590517f169f1815ebdea059aac3bb00ec9a9594c7a5ffcb64a17e8392b5d84909a14556906106d09084815260200190565b60405180910390a2505b6001600055565b6002600054141561074e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ba565b600260009081553381526009602052604090205481118015906107715750600081115b6107fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f57697468647261773a20416d6f756e74206d757374206265203e2030206f722060448201527f6c6f776572207468616e20757365722062616c616e636500000000000000000060648201526084016105ba565b610805610e4b565b33600090815260096020526040812060018082015490549154909164e8d4a5100091610831919061172a565b61083b91906116ef565b6108459190611767565b3360009081526009602052604090205490915082906108659083906116d7565b61086f9190611767565b33600090815260096020526040902081905560015464e8d4a5100091610895919061172a565b61089f91906116ef565b3360009081526009602052604090206001015560075482906108c29083906116d7565b6108cc9190611767565b60075561091073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e16338461115e565b604080518381526020810183905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56891015b60405180910390a250506001600055565b600260005414156109c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ba565b6002600090815533815260096020526040902054610a3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f57697468647261773a20416d6f756e74206d757374206265203e20300000000060448201526064016105ba565b610a44610e4b565b33600090815260096020526040812060018082015490549154909164e8d4a5100091610a70919061172a565b610a7a91906116ef565b610a849190611767565b3360009081526009602052604081205491925090610aa39083906116d7565b33600090815260096020526040902054600754919250610ac291611767565b60075533600081815260096020526040812081815560010155610b1d907f000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e73ffffffffffffffffffffffffffffffffffffffff16908361115e565b604080518281526020810184905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689101610944565b60026000541415610bc2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ba565b600260005580610c2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4465706f7369743a20416d6f756e74206d757374206265203e2030000000000060448201526064016105ba565b610c36610e4b565b610c7873ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e16333084611232565b3360009081526009602052604081205415610cd05733600090815260096020526040902060018082015490549154909164e8d4a5100091610cb9919061172a565b610cc391906116ef565b610ccd9190611767565b90505b610cda81836116d7565b3360009081526009602052604081208054909190610cf99084906116d7565b90915550506001543360009081526009602052604090205464e8d4a5100091610d219161172a565b610d2b91906116ef565b33600090815260096020526040902060010155610d4881836116d7565b60076000828254610d5991906116d7565b9091555050604080518381526020810183905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159101610944565b60026000541415610e03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ba565b60026000556106da610e4b565b60006003548211610e2c57610e258383611767565b905061054b565b6003548310610e3d5750600061054b565b82600354610e259190611767565b6004544311610e5657565b600754610e635743600455565b6000610e7160045443610e10565b9050600060065482610e83919061172a565b9050600060055483610e95919061172a565b90505b60035443118015610ed45750610ecf60017f0000000000000000000000000000000000000000000000000000000000000004611767565b600254105b15610f5a57610ee4600354611296565b6003805460028054600090815260086020526040812090910154919290610f0b83856116d7565b9091555060009050610f1d8243610e10565b905060065481610f2d919061172a565b610f3790856116d7565b935060055481610f47919061172a565b610f5190846116d7565b92505050610e98565b8115611149576040517f40c10f19000000000000000000000000000000000000000000000000000000008152306004820152602481018390526000907f000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e73ffffffffffffffffffffffffffffffffffffffff16906340c10f1990604401602060405180830381600087803b158015610ff157600080fd5b505af1158015611005573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611029919061162f565b9050801561105e5760075461104364e8d4a510008561172a565b61104d91906116ef565b60015461105a91906116d7565b6001555b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000fec3069df398faaf689c559151e41fa8036c820381166004830152602482018490527f000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e16906340c10f1990604401602060405180830381600087803b15801561110e57600080fd5b505af1158015611122573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611146919061162f565b50505b6003546004541161115957436004555b505050565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526111599084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611311565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526112909085907f23b872dd00000000000000000000000000000000000000000000000000000000906084016111b0565b50505050565b600280549060006112a6836117aa565b90915550506002546000818152600860209081526040918290208054600681905560019091015460058190558351868152928301919091528183015290517f40181eb77bccfdef1a73b669bb4290d98e2fbec678c7cf4578ae256210420e179181900360600190a250565b6000611373826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661141d9092919063ffffffff16565b8051909150156111595780806020019051810190611391919061162f565b611159576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016105ba565b606061142c8484600085611436565b90505b9392505050565b6060824710156114c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016105ba565b843b611530576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105ba565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611559919061166a565b60006040518083038185875af1925050503d8060008114611596576040519150601f19603f3d011682016040523d82523d6000602084013e61159b565b606091505b50915091506104ea828286606083156115b557508161142f565b8251156115c55782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ba9190611686565b60006020828403121561160b57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461142f57600080fd5b60006020828403121561164157600080fd5b8151801515811461142f57600080fd5b60006020828403121561166357600080fd5b5035919050565b6000825161167c81846020870161177e565b9190910192915050565b60208152600082518060208401526116a581604085016020870161177e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600082198211156116ea576116ea6117e3565b500190565b600082611725577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611762576117626117e3565b500290565b600082821015611779576117796117e3565b500390565b60005b83811015611799578181015183820152602001611781565b838111156112905750506000910152565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156117dc576117dc6117e3565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea2646970667358221220cf7d961c27f41e20b5eaa8e8c6c65c46053085763b73a84c3bd14bc7a11b761764736f6c63430008070033

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

000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e000000000000000000000000fec3069df398faaf689c559151e41fa8036c82030000000000000000000000000000000000000000000000000000000000d545b400000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000a3ee6e2a294d40000000000000000000000000000000000000000000000000004dde0deda06b18000000000000000000000000000000000000000000000000001ebcb4a7e7be7c000000000000000000000000000000000000000000000000001064a49dd0ee2000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000211f540ec883ac000000000000000000000000000000000000000000000000000fbbae53d271be800000000000000000000000000000000000000000000000000635dfc2c598b040000000000000000000000000000000000000000000000000034feece47405e00000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000002f9b8000000000000000000000000000000000000000000000000000000000008ed28000000000000000000000000000000000000000000000000000000000017cdc0000000000000000000000000000000000000000000000000000000000023cd0a

-----Decoded View---------------
Arg [0] : _looksRareToken (address): 0xf4d2888d29D722226FafA5d9B24F9164c092421E
Arg [1] : _tokenSplitter (address): 0xfec3069dF398FaAf689c559151E41fa8036c8203
Arg [2] : _startBlock (uint256): 13977012
Arg [3] : _rewardsPerBlockForStaking (uint256[]): 189000000000000000000,89775000000000000000,35437500000000000000,18900000000000000000
Arg [4] : _rewardsPerBlockForOthers (uint256[]): 611000000000000000000,290225000000000000000,114562500000000000000,61100000000000000000
Arg [5] : _periodLengthesInBlocks (uint256[]): 195000,585000,1560000,2346250
Arg [6] : _numberPeriods (uint256): 4

-----Encoded View---------------
22 Constructor Arguments found :
Arg [0] : 000000000000000000000000f4d2888d29d722226fafa5d9b24f9164c092421e
Arg [1] : 000000000000000000000000fec3069df398faaf689c559151e41fa8036c8203
Arg [2] : 0000000000000000000000000000000000000000000000000000000000d545b4
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000220
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [8] : 00000000000000000000000000000000000000000000000a3ee6e2a294d40000
Arg [9] : 000000000000000000000000000000000000000000000004dde0deda06b18000
Arg [10] : 000000000000000000000000000000000000000000000001ebcb4a7e7be7c000
Arg [11] : 000000000000000000000000000000000000000000000001064a49dd0ee20000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [13] : 0000000000000000000000000000000000000000000000211f540ec883ac0000
Arg [14] : 00000000000000000000000000000000000000000000000fbbae53d271be8000
Arg [15] : 00000000000000000000000000000000000000000000000635dfc2c598b04000
Arg [16] : 0000000000000000000000000000000000000000000000034feece47405e0000
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [18] : 000000000000000000000000000000000000000000000000000000000002f9b8
Arg [19] : 000000000000000000000000000000000000000000000000000000000008ed28
Arg [20] : 000000000000000000000000000000000000000000000000000000000017cdc0
Arg [21] : 000000000000000000000000000000000000000000000000000000000023cd0a


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.