ETH Price: $3,621.91 (+6.49%)

Contract

0xa659e66E116D354e779D8dbb35319AF67171ffb4
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Exit159747112022-11-15 10:02:231091 days ago1668506543IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0018437815.0202728
Exit148885872022-06-02 3:09:071257 days ago1654139347IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0065597952.58228329
Exit146156452022-04-19 12:58:401300 days ago1650373120IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.003888231.16725013
Exit145151632022-04-03 19:59:541316 days ago1649015994IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0056586845.35907734
Exit144884662022-03-30 15:54:581320 days ago1648655698IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0070335656.37991735
Exit143252642022-03-05 6:26:201346 days ago1646461580IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0034473727.63363424
Exit142692112022-02-24 14:03:391354 days ago1645711419IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0084789167.96561905
Exit142317952022-02-18 18:48:241360 days ago1645210104IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.01401855112.37046877
Exit142059252022-02-14 18:38:591364 days ago1644863939IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0090767784.31506999
Exit141858912022-02-11 16:42:541367 days ago1644597774IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0120948485.26321273
Exit140222772022-01-17 9:38:101393 days ago1642412290IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0087642881.41235467
Exit140036302022-01-14 12:32:211395 days ago1642163541IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.02003953141.26973625
Exit140029872022-01-14 10:03:191396 days ago1642154599IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0107108399.49411188
Exit139617562022-01-08 1:13:261402 days ago1641604406IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0111624178.68999679
Exit139438052022-01-05 6:24:191405 days ago1641363859IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0134571194.86663572
Exit139314792022-01-03 8:37:281407 days ago1641199048IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0112806679.52365784
Exit139053672021-12-30 7:34:341411 days ago1640849674IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0125381188.38808227
Exit138758242021-12-25 17:53:141415 days ago1640454794IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.01288906105
Exit138728622021-12-25 7:11:361416 days ago1640416296IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0106795187
Exit138700372021-12-24 20:25:271416 days ago1640377527IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0060309948.34346809
Exit138660532021-12-24 5:38:181417 days ago1640324298IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0063833845
Exit138530412021-12-22 5:13:201419 days ago1640150000IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0059645842.04761904
Exit138379182021-12-19 21:14:211421 days ago1639948461IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0049369448
Withdraw138379182021-12-19 21:14:211421 days ago1639948461IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0038881448
Withdraw138376722021-12-19 20:11:411421 days ago1639944701IN
Armor.fi: ARMOR/DAI Uni LP
0 ETH0.0069564555
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Method Block
From
To
-117133112021-01-23 18:01:061751 days ago1611424866  Contract Creation0 ETH
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x24aE7bdf...94E2C8a12
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
LPFarm

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2021-01-23
*/

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

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 * 
 * @dev We've added a second owner to share control of the timelocked owner contract.
 */
contract Ownable {
    address private _owner;
    address private _pendingOwner;
    
    // Second allows a DAO to share control.
    address private _secondOwner;
    address private _pendingSecond;

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

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    function initializeOwnable() internal {
        require(_owner == address(0), "already initialized");
        _owner = msg.sender;
        _secondOwner = msg.sender;
        emit OwnershipTransferred(address(0), msg.sender);
        emit SecondOwnershipTransferred(address(0), msg.sender);
    }


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

    /**
     * @return the address of the owner.
     */
    function secondOwner() public view returns (address) {
        return _secondOwner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner(), "msg.sender is not owner");
        _;
    }
    
    modifier onlyFirstOwner() {
        require(msg.sender == _owner, "msg.sender is not owner");
        _;
    }
    
    modifier onlySecondOwner() {
        require(msg.sender == _secondOwner, "msg.sender is not owner");
        _;
    }

    /**
     * @return true if `msg.sender` is the owner of the contract.
     */
    function isOwner() public view returns (bool) {
        return msg.sender == _owner || msg.sender == _secondOwner;

    }

    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function transferOwnership(address newOwner) public onlyFirstOwner {
        _pendingOwner = newOwner;
    }

    function receiveOwnership() public {
        require(msg.sender == _pendingOwner, "only pending owner can call this function");
        _transferOwnership(_pendingOwner);
        _pendingOwner = address(0);
    }

    /**
     * @dev Transfers control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0));
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }

    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function transferSecondOwnership(address newOwner) public onlySecondOwner {
        _pendingSecond = newOwner;
    }

    function receiveSecondOwnership() public {
        require(msg.sender == _pendingSecond, "only pending owner can call this function");
        _transferSecondOwnership(_pendingSecond);
        _pendingSecond = address(0);
    }

    /**
     * @dev Transfers control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function _transferSecondOwnership(address newOwner) internal {
        require(newOwner != address(0));
        emit SecondOwnershipTransferred(_secondOwner, newOwner);
        _secondOwner = newOwner;
    }

    uint256[50] private __gap;
}

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

interface IRewardDistributionRecipientTokenOnly {
    function rewardToken() external view returns(IERC20);
    function notifyRewardAmount(uint256 reward) external;
    function setRewardDistribution(address rewardDistribution) external;
}

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * This test is non-exhaustive, and there may be false-negatives: during the
     * execution of a contract's constructor, its address will be reported as
     * not containing 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.
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != 0x0 && codehash != accountHash);
    }

    /**
     * @dev Converts an `address` into `address payable`. Note that this is
     * simply a type cast: the actual underlying value is not changed.
     *
     * _Available since v2.4.0._
     */
    function toPayable(address account) internal pure returns (address payable) {
        return address(uint160(account));
    }

    /**
     * @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].
     *
     * _Available since v2.4.0._
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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


/**
 * @title SafeMath
 * @dev Unsigned math operations with safety checks that revert on error
 * 
 * @dev Default OpenZeppelin
 */
library SafeMath {
    /**
     * @dev Multiplies two unsigned integers, reverts on overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b);

        return c;
    }

    /**
     * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Adds two unsigned integers, reverts on overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a);

        return c;
    }

    /**
     * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
     * reverts when dividing by zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0);
        return a % b;
    }
}


/**
 * @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 ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

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

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

    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

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

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value);
        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.

        // A Solidity high level call has three parts:
        //  1. The target address is checked to verify it contains contract code
        //  2. The call itself is made, and success asserted
        //  3. The return value is decoded, which in turn checks the size of the returned data.
        // solhint-disable-next-line max-line-length
        require(address(token).isContract(), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "SafeERC20: low-level call failed");

        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

contract FarmController is Ownable {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    IRewardDistributionRecipientTokenOnly[] public farms;
    mapping(address => address) public lpFarm;
    mapping(address => uint256) public rate;
    uint256 public weightSum;
    IERC20 public rewardToken;

    mapping(address => bool) public blackListed;

    function initialize(address token) external {
        Ownable.initializeOwnable();
        rewardToken = IERC20(token);
    }

    function addFarm(address _lptoken) external onlyOwner returns(address farm){
        require(lpFarm[_lptoken] == address(0), "farm exists.");
        bytes memory bytecode = type(LPFarm).creationCode;
        bytes32 salt = keccak256(abi.encodePacked(_lptoken));
        assembly {
            farm := create2(0, add(bytecode, 32), mload(bytecode), salt)
        }
        LPFarm(farm).initialize(_lptoken, address(this));
        farms.push(IRewardDistributionRecipientTokenOnly(farm));
        rewardToken.approve(farm, uint256(-1));
        lpFarm[_lptoken] = farm;
        // it will just set the rates to zero before it get's it's own rate
    }

    function setRates(uint256[] memory _rates) external onlyOwner {
        require(_rates.length == farms.length);
        uint256 sum = 0;
        for(uint256 i = 0; i<_rates.length; i++){
            sum += _rates[i];
            rate[address(farms[i])] = _rates[i];
        }
        weightSum = sum;
    }

    function setRateOf(address _farm, uint256 _rate) external onlyOwner {
        weightSum -= rate[_farm];
        weightSum += _rate;
        rate[_farm] = _rate;
    }

    function notifyRewards(uint256 amount) external onlyOwner {
        rewardToken.transferFrom(msg.sender, address(this), amount);
        for(uint256 i = 0; i<farms.length; i++){
            IRewardDistributionRecipientTokenOnly farm = farms[i];
            farm.notifyRewardAmount(amount.mul(rate[address(farm)]).div(weightSum));
        }
    }

    // should transfer rewardToken prior to calling this contract
    // this is implemented to take care of the out-of-gas situation
    function notifyRewardsPartial(uint256 amount, uint256 from, uint256 to) external onlyOwner {
        require(from < to, "from should be smaller than to");
        require(to <= farms.length, "to should be smaller or equal to farms.length");
        for(uint256 i = from; i < to; i++){
            IRewardDistributionRecipientTokenOnly farm = farms[i];
            farm.notifyRewardAmount(amount.mul(rate[address(farm)]).div(weightSum));
        }
    }

    function blockUser(address target) external onlyOwner {
        blackListed[target] = true;
    }

    function unblockUser(address target) external onlyOwner {
        blackListed[target] = false;
    }
}


contract TokenWrapper {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    IERC20 public stakeToken;

    uint256 private _totalSupply;
    mapping(address => uint256) private _balances;

    function totalSupply() public view returns (uint256) {
        return _totalSupply;
    }

    function balanceOf(address account) public view returns (uint256) {
        return _balances[account];
    }

    function stake(uint256 amount) public virtual {
        _totalSupply = _totalSupply.add(amount);
        _balances[msg.sender] = _balances[msg.sender].add(amount);
        stakeToken.safeTransferFrom(msg.sender, address(this), amount);
    }

    function withdraw(uint256 amount) public virtual {
        _totalSupply = _totalSupply.sub(amount);
        _balances[msg.sender] = _balances[msg.sender].sub(amount);
        stakeToken.safeTransfer(msg.sender, amount);
    }
}

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

/**
* MIT License
* ===========
*
* Copyright (c) 2020 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/

contract LPFarm is TokenWrapper, IRewardDistributionRecipientTokenOnly {
    IERC20 public override rewardToken;
    address public rewardDistribution;
    FarmController public controller;
    uint256 public constant DURATION = 7 days;

    uint256 public periodFinish = 0;
    uint256 public rewardRate = 0;
    uint256 public lastUpdateTime;
    uint256 public rewardPerTokenStored;
    mapping(address => uint256) public userRewardPerTokenPaid;
    mapping(address => uint256) public rewards;

    event RewardAdded(uint256 reward);
    event Staked(address indexed user, uint256 amount);
    event Withdrawn(address indexed user, uint256 amount);
    event RewardPaid(address indexed user, uint256 reward);

    modifier updateReward(address account) {
        rewardPerTokenStored = rewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();
        if (account != address(0)) {
            rewards[account] = earned(account);
            userRewardPerTokenPaid[account] = rewardPerTokenStored;
        }
        _;
    }

    modifier onlyController() {
        require(msg.sender == address(controller), "Caller is not controller");
        _;
    }

    modifier onlyOwner() {
        require(msg.sender == Ownable(address(controller)).owner(), "Caller is not owner");
        _;
    }

    modifier checkBlackList(address user) {
        require(!controller.blackListed(user), "User is blacklisted");
        _;
    }

    function initialize(address _stakeToken, address _controller)
      external
    {
        require(address(stakeToken) == address(0), "already initialized");
        stakeToken = IERC20(_stakeToken);
        controller = FarmController(_controller);
        rewardToken = controller.rewardToken();
    }

    function setRewardDistribution(address _rewardDistribution)
        external
        override
        onlyOwner
    {
    }


    function lastTimeRewardApplicable() public view returns (uint256) {
        return Math.min(block.timestamp, periodFinish);
    }

    function rewardPerToken() public view returns (uint256) {
        if (totalSupply() == 0) {
            return rewardPerTokenStored;
        }
        return
            rewardPerTokenStored.add(
                lastTimeRewardApplicable()
                    .sub(lastUpdateTime)
                    .mul(rewardRate)
                    .mul(1e18)
                    .div(totalSupply())
            );
    }

    function earned(address account) public view returns (uint256) {
        return
            balanceOf(account)
                .mul(rewardPerToken().sub(userRewardPerTokenPaid[account]))
                .div(1e18)
                .add(rewards[account]);
    }

    // stake visibility is public as overriding LPTokenWrapper's stake() function
    function stake(uint256 amount) public override checkBlackList(msg.sender) updateReward(msg.sender) {
        require(amount > 0, "Cannot stake 0");
        super.stake(amount);
        emit Staked(msg.sender, amount);
    }

    function withdraw(uint256 amount) public override checkBlackList(msg.sender) updateReward(msg.sender) {
        require(amount > 0, "Cannot withdraw 0");
        super.withdraw(amount);
        emit Withdrawn(msg.sender, amount);
    }

    function exit() external {
        withdraw(balanceOf(msg.sender));
        getReward();
    }

    function getReward() public checkBlackList(msg.sender) updateReward(msg.sender) {
        uint256 reward = earned(msg.sender);
        if (reward > 0) {
            rewards[msg.sender] = 0;
            rewardToken.safeTransfer(msg.sender, reward);
            emit RewardPaid(msg.sender, reward);
        }
    }

    function notifyRewardAmount(uint256 reward)
        external
        override
        onlyController
        updateReward(address(0))
    {
        rewardToken.safeTransferFrom(msg.sender, address(this), reward);
        if (block.timestamp >= periodFinish) {
            rewardRate = reward.div(DURATION);
        } else {
            uint256 remaining = periodFinish.sub(block.timestamp);
            uint256 leftover = remaining.mul(rewardRate);
            rewardRate = reward.add(leftover).div(DURATION);
        }
        lastUpdateTime = block.timestamp;
        periodFinish = block.timestamp.add(DURATION);
        emit RewardAdded(reward);
    }
}

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract FarmController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"},{"internalType":"address","name":"_controller","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardDistribution","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardDistribution","type":"address"}],"name":"setRewardDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

0x60806040526000600655600060075534801561001a57600080fd5b5061113c8061002a6000396000f3fe608060405234801561001057600080fd5b506004361061014c5760003560e01c806370a08231116100c3578063cd3daf9d1161007c578063cd3daf9d14610304578063df136d651461030c578063e9fad8ee14610314578063ebe2b12b1461031c578063f77c479114610324578063f7c618c11461032c5761014c565b806370a08231146102835780637b0a47ee146102a957806380faa57d146102b15780638b876347146102b9578063a694fc3a146102df578063c8f33c91146102fc5761014c565b80631be05289116101155780631be05289146102035780632e1a7d4d1461020b5780633c6b16ab146102285780633d18b91214610245578063485cc9551461024d57806351ed6a301461027b5761014c565b80628cc262146101515780630700037d146101895780630d68b761146101af578063101114cf146101d757806318160ddd146101fb575b600080fd5b6101776004803603602081101561016757600080fd5b50356001600160a01b0316610334565b60408051918252519081900360200190f35b6101776004803603602081101561019f57600080fd5b50356001600160a01b03166103a2565b6101d5600480360360208110156101c557600080fd5b50356001600160a01b03166103b4565b005b6101df610483565b604080516001600160a01b039092168252519081900360200190f35b610177610492565b610177610499565b6101d56004803603602081101561022157600080fd5b50356104a0565b6101d56004803603602081101561023e57600080fd5b5035610649565b6101d56107c9565b6101d56004803603604081101561026357600080fd5b506001600160a01b038135811691602001351661095d565b6101df610a6a565b6101776004803603602081101561029957600080fd5b50356001600160a01b0316610a79565b610177610a94565b610177610a9a565b610177600480360360208110156102cf57600080fd5b50356001600160a01b0316610aad565b6101d5600480360360208110156102f557600080fd5b5035610abf565b610177610c65565b610177610c6b565b610177610cb9565b6101d5610cbf565b610177610cda565b6101df610ce0565b6101df610cef565b6001600160a01b0381166000908152600b6020908152604080832054600a90925282205461039c919061039690670de0b6b3a764000090610390906103819061037b610c6b565b90610cfe565b61038a88610a79565b90610d13565b90610d41565b90610d63565b92915050565b600b6020526000908152604090205481565b600560009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561040257600080fd5b505afa158015610416573d6000803e3d6000fd5b505050506040513d602081101561042c57600080fd5b50516001600160a01b03163314610480576040805162461bcd60e51b815260206004820152601360248201527221b0b63632b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b50565b6004546001600160a01b031681565b6001545b90565b62093a8081565b6005546040805163bbde5b2560e01b81523360048201819052915191926001600160a01b03169163bbde5b2591602480820192602092909190829003018186803b1580156104ed57600080fd5b505afa158015610501573d6000803e3d6000fd5b505050506040513d602081101561051757600080fd5b505115610561576040805162461bcd60e51b8152602060048201526013602482015272155cd95c881a5cc8189b1858dadb1a5cdd1959606a1b604482015290519081900360640190fd5b3361056a610c6b565b600955610575610a9a565b6008556001600160a01b038116156105bc5761059081610334565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a909152919020555b60008311610605576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b61060e83610d75565b60408051848152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2505050565b6005546001600160a01b031633146106a8576040805162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420636f6e74726f6c6c65720000000000000000604482015290519081900360640190fd5b60006106b2610c6b565b6009556106bd610a9a565b6008556001600160a01b03811615610704576106d881610334565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a909152919020555b60035461071c906001600160a01b0316333085610dca565b600654421061073a576107328262093a80610d41565b60075561077c565b60065460009061074a9042610cfe565b9050600061076360075483610d1390919063ffffffff16565b905061077662093a806103908684610d63565b60075550505b42600881905561078f9062093a80610d63565b6006556040805183815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a15050565b6005546040805163bbde5b2560e01b81523360048201819052915191926001600160a01b03169163bbde5b2591602480820192602092909190829003018186803b15801561081657600080fd5b505afa15801561082a573d6000803e3d6000fd5b505050506040513d602081101561084057600080fd5b50511561088a576040805162461bcd60e51b8152602060048201526013602482015272155cd95c881a5cc8189b1858dadb1a5cdd1959606a1b604482015290519081900360640190fd5b33610893610c6b565b60095561089e610a9a565b6008556001600160a01b038116156108e5576108b981610334565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a909152919020555b60006108f033610334565b9050801561095857336000818152600b6020526040812055600354610921916001600160a01b039091169083610e2a565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505050565b6000546001600160a01b0316156109b1576040805162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b600080546001600160a01b038085166001600160a01b03199283161790925560058054848416921691909117908190556040805163f7c618c160e01b81529051919092169163f7c618c1916004808301926020929190829003018186803b158015610a1b57600080fd5b505afa158015610a2f573d6000803e3d6000fd5b505050506040513d6020811015610a4557600080fd5b5051600380546001600160a01b0319166001600160a01b039092169190911790555050565b6000546001600160a01b031681565b6001600160a01b031660009081526002602052604090205490565b60075481565b6000610aa842600654610e7c565b905090565b600a6020526000908152604090205481565b6005546040805163bbde5b2560e01b81523360048201819052915191926001600160a01b03169163bbde5b2591602480820192602092909190829003018186803b158015610b0c57600080fd5b505afa158015610b20573d6000803e3d6000fd5b505050506040513d6020811015610b3657600080fd5b505115610b80576040805162461bcd60e51b8152602060048201526013602482015272155cd95c881a5cc8189b1858dadb1a5cdd1959606a1b604482015290519081900360640190fd5b33610b89610c6b565b600955610b94610a9a565b6008556001600160a01b03811615610bdb57610baf81610334565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a909152919020555b60008311610c21576040805162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015290519081900360640190fd5b610c2a83610e92565b60408051848152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2505050565b60085481565b6000610c75610492565b610c825750600954610496565b610aa8610cb0610c90610492565b610390670de0b6b3a764000061038a60075461038a60085461037b610a9a565b60095490610d63565b60095481565b610cd0610ccb33610a79565b6104a0565b610cd86107c9565b565b60065481565b6005546001600160a01b031681565b6003546001600160a01b031681565b600082821115610d0d57600080fd5b50900390565b600082610d225750600061039c565b82820282848281610d2f57fe5b0414610d3a57600080fd5b9392505050565b6000808211610d4f57600080fd5b6000828481610d5a57fe5b04949350505050565b600082820183811015610d3a57600080fd5b600154610d829082610cfe565b60015533600090815260026020526040902054610d9f9082610cfe565b336000818152600260205260408120929092559054610480916001600160a01b039091169083610e2a565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610e24908590610ee8565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610958908490610ee8565b6000818310610e8b5781610d3a565b5090919050565b600154610e9f9082610d63565b60015533600090815260026020526040902054610ebc9082610d63565b336000818152600260205260408120929092559054610480916001600160a01b03909116903084610dca565b610efa826001600160a01b03166110a0565b610f4b576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310610f895780518252601f199092019160209182019101610f6a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610feb576040519150601f19603f3d011682016040523d82523d6000602084013e610ff0565b606091505b509150915081611047576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610e245780806020019051602081101561106357600080fd5b5051610e245760405162461bcd60e51b815260040180806020018281038252602a8152602001806110dd602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906110d45750808214155b94935050505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212200f22040927838888f40dd08139345ee3082848f6d35700512085fc2990b0029464736f6c634300060c0033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061014c5760003560e01c806370a08231116100c3578063cd3daf9d1161007c578063cd3daf9d14610304578063df136d651461030c578063e9fad8ee14610314578063ebe2b12b1461031c578063f77c479114610324578063f7c618c11461032c5761014c565b806370a08231146102835780637b0a47ee146102a957806380faa57d146102b15780638b876347146102b9578063a694fc3a146102df578063c8f33c91146102fc5761014c565b80631be05289116101155780631be05289146102035780632e1a7d4d1461020b5780633c6b16ab146102285780633d18b91214610245578063485cc9551461024d57806351ed6a301461027b5761014c565b80628cc262146101515780630700037d146101895780630d68b761146101af578063101114cf146101d757806318160ddd146101fb575b600080fd5b6101776004803603602081101561016757600080fd5b50356001600160a01b0316610334565b60408051918252519081900360200190f35b6101776004803603602081101561019f57600080fd5b50356001600160a01b03166103a2565b6101d5600480360360208110156101c557600080fd5b50356001600160a01b03166103b4565b005b6101df610483565b604080516001600160a01b039092168252519081900360200190f35b610177610492565b610177610499565b6101d56004803603602081101561022157600080fd5b50356104a0565b6101d56004803603602081101561023e57600080fd5b5035610649565b6101d56107c9565b6101d56004803603604081101561026357600080fd5b506001600160a01b038135811691602001351661095d565b6101df610a6a565b6101776004803603602081101561029957600080fd5b50356001600160a01b0316610a79565b610177610a94565b610177610a9a565b610177600480360360208110156102cf57600080fd5b50356001600160a01b0316610aad565b6101d5600480360360208110156102f557600080fd5b5035610abf565b610177610c65565b610177610c6b565b610177610cb9565b6101d5610cbf565b610177610cda565b6101df610ce0565b6101df610cef565b6001600160a01b0381166000908152600b6020908152604080832054600a90925282205461039c919061039690670de0b6b3a764000090610390906103819061037b610c6b565b90610cfe565b61038a88610a79565b90610d13565b90610d41565b90610d63565b92915050565b600b6020526000908152604090205481565b600560009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561040257600080fd5b505afa158015610416573d6000803e3d6000fd5b505050506040513d602081101561042c57600080fd5b50516001600160a01b03163314610480576040805162461bcd60e51b815260206004820152601360248201527221b0b63632b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b50565b6004546001600160a01b031681565b6001545b90565b62093a8081565b6005546040805163bbde5b2560e01b81523360048201819052915191926001600160a01b03169163bbde5b2591602480820192602092909190829003018186803b1580156104ed57600080fd5b505afa158015610501573d6000803e3d6000fd5b505050506040513d602081101561051757600080fd5b505115610561576040805162461bcd60e51b8152602060048201526013602482015272155cd95c881a5cc8189b1858dadb1a5cdd1959606a1b604482015290519081900360640190fd5b3361056a610c6b565b600955610575610a9a565b6008556001600160a01b038116156105bc5761059081610334565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a909152919020555b60008311610605576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b61060e83610d75565b60408051848152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a2505050565b6005546001600160a01b031633146106a8576040805162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420636f6e74726f6c6c65720000000000000000604482015290519081900360640190fd5b60006106b2610c6b565b6009556106bd610a9a565b6008556001600160a01b03811615610704576106d881610334565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a909152919020555b60035461071c906001600160a01b0316333085610dca565b600654421061073a576107328262093a80610d41565b60075561077c565b60065460009061074a9042610cfe565b9050600061076360075483610d1390919063ffffffff16565b905061077662093a806103908684610d63565b60075550505b42600881905561078f9062093a80610d63565b6006556040805183815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a15050565b6005546040805163bbde5b2560e01b81523360048201819052915191926001600160a01b03169163bbde5b2591602480820192602092909190829003018186803b15801561081657600080fd5b505afa15801561082a573d6000803e3d6000fd5b505050506040513d602081101561084057600080fd5b50511561088a576040805162461bcd60e51b8152602060048201526013602482015272155cd95c881a5cc8189b1858dadb1a5cdd1959606a1b604482015290519081900360640190fd5b33610893610c6b565b60095561089e610a9a565b6008556001600160a01b038116156108e5576108b981610334565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a909152919020555b60006108f033610334565b9050801561095857336000818152600b6020526040812055600354610921916001600160a01b039091169083610e2a565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505050565b6000546001600160a01b0316156109b1576040805162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481a5b9a5d1a585b1a5e9959606a1b604482015290519081900360640190fd5b600080546001600160a01b038085166001600160a01b03199283161790925560058054848416921691909117908190556040805163f7c618c160e01b81529051919092169163f7c618c1916004808301926020929190829003018186803b158015610a1b57600080fd5b505afa158015610a2f573d6000803e3d6000fd5b505050506040513d6020811015610a4557600080fd5b5051600380546001600160a01b0319166001600160a01b039092169190911790555050565b6000546001600160a01b031681565b6001600160a01b031660009081526002602052604090205490565b60075481565b6000610aa842600654610e7c565b905090565b600a6020526000908152604090205481565b6005546040805163bbde5b2560e01b81523360048201819052915191926001600160a01b03169163bbde5b2591602480820192602092909190829003018186803b158015610b0c57600080fd5b505afa158015610b20573d6000803e3d6000fd5b505050506040513d6020811015610b3657600080fd5b505115610b80576040805162461bcd60e51b8152602060048201526013602482015272155cd95c881a5cc8189b1858dadb1a5cdd1959606a1b604482015290519081900360640190fd5b33610b89610c6b565b600955610b94610a9a565b6008556001600160a01b03811615610bdb57610baf81610334565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a909152919020555b60008311610c21576040805162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b604482015290519081900360640190fd5b610c2a83610e92565b60408051848152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a2505050565b60085481565b6000610c75610492565b610c825750600954610496565b610aa8610cb0610c90610492565b610390670de0b6b3a764000061038a60075461038a60085461037b610a9a565b60095490610d63565b60095481565b610cd0610ccb33610a79565b6104a0565b610cd86107c9565b565b60065481565b6005546001600160a01b031681565b6003546001600160a01b031681565b600082821115610d0d57600080fd5b50900390565b600082610d225750600061039c565b82820282848281610d2f57fe5b0414610d3a57600080fd5b9392505050565b6000808211610d4f57600080fd5b6000828481610d5a57fe5b04949350505050565b600082820183811015610d3a57600080fd5b600154610d829082610cfe565b60015533600090815260026020526040902054610d9f9082610cfe565b336000818152600260205260408120929092559054610480916001600160a01b039091169083610e2a565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610e24908590610ee8565b50505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610958908490610ee8565b6000818310610e8b5781610d3a565b5090919050565b600154610e9f9082610d63565b60015533600090815260026020526040902054610ebc9082610d63565b336000818152600260205260408120929092559054610480916001600160a01b03909116903084610dca565b610efa826001600160a01b03166110a0565b610f4b576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310610f895780518252601f199092019160209182019101610f6a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610feb576040519150601f19603f3d011682016040523d82523d6000602084013e610ff0565b606091505b509150915081611047576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610e245780806020019051602081101561106357600080fd5b5051610e245760405162461bcd60e51b815260040180806020018281038252602a8152602001806110dd602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906110d45750808214155b94935050505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212200f22040927838888f40dd08139345ee3082848f6d35700512085fc2990b0029464736f6c634300060c0033

Deployed Bytecode Sourcemap

21269:4456:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23780:265;;;;;;;;;;;;;;;;-1:-1:-1;23780:265:0;-1:-1:-1;;;;;23780:265:0;;:::i;:::-;;;;;;;;;;;;;;;;21733:42;;;;;;;;;;;;;;;;-1:-1:-1;21733:42:0;-1:-1:-1;;;;;21733:42:0;;:::i;23075:128::-;;;;;;;;;;;;;;;;-1:-1:-1;23075:128:0;-1:-1:-1;;;;;23075:128:0;;:::i;:::-;;21388:33;;;:::i;:::-;;;;-1:-1:-1;;;;;21388:33:0;;;;;;;;;;;;;;18653:91;;;:::i;21467:41::-;;;:::i;24371:239::-;;;;;;;;;;;;;;;;-1:-1:-1;24371:239:0;;:::i;25050:672::-;;;;;;;;;;;;;;;;-1:-1:-1;25050:672:0;;:::i;24723:319::-;;;:::i;22757:310::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;22757:310:0;;;;;;;;;;:::i;18531:24::-;;;:::i;18752:110::-;;;;;;;;;;;;;;;;-1:-1:-1;18752:110:0;-1:-1:-1;;;;;18752:110:0;;:::i;21555:29::-;;;:::i;23213:131::-;;;:::i;21669:57::-;;;;;;;;;;;;;;;;-1:-1:-1;21669:57:0;-1:-1:-1;;;;;21669:57:0;;:::i;24136:227::-;;;;;;;;;;;;;;;;-1:-1:-1;24136:227:0;;:::i;21591:29::-;;;:::i;23352:420::-;;;:::i;21627:35::-;;;:::i;24618:97::-;;;:::i;21517:31::-;;;:::i;21428:32::-;;;:::i;21347:34::-;;;:::i;23780:265::-;-1:-1:-1;;;;;24020:16:0;;23834:7;24020:16;;;:7;:16;;;;;;;;;23936:22;:31;;;;;;23874:163;;24020:16;23874:123;;23992:4;;23874:95;;23915:53;;:16;:14;:16::i;:::-;:20;;:53::i;:::-;23874:18;23884:7;23874:9;:18::i;:::-;:40;;:95::i;:::-;:117;;:123::i;:::-;:145;;:163::i;:::-;23854:183;23780:265;-1:-1:-1;;23780:265:0:o;21733:42::-;;;;;;;;;;;;;:::o;23075:128::-;22547:10;;22531:36;;;-1:-1:-1;;;22531:36:0;;;;-1:-1:-1;;;;;22547:10:0;;;;22531:34;;:36;;;;;;;;;;;;;;;22547:10;22531:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;22531:36:0;-1:-1:-1;;;;;22517:50:0;:10;:50;22509:82;;;;;-1:-1:-1;;;22509:82:0;;;;;;;;;;;;-1:-1:-1;;;22509:82:0;;;;;;;;;;;;;;;23075:128;:::o;21388:33::-;;;-1:-1:-1;;;;;21388:33:0;;:::o;18653:91::-;18724:12;;18653:91;;:::o;21467:41::-;21502:6;21467:41;:::o;24371:239::-;22677:10;;:28;;;-1:-1:-1;;;22677:28:0;;24436:10;22677:28;;;;;;;;24436:10;;-1:-1:-1;;;;;22677:10:0;;-1:-1:-1;;22677:28:0;;;;;;;;;;;;;;;:10;:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;22677:28:0;22676:29;22668:61;;;;;-1:-1:-1;;;22668:61:0;;;;;;;;;;;;-1:-1:-1;;;22668:61:0;;;;;;;;;;;;;;;24461:10:::1;22077:16;:14;:16::i;:::-;22054:20;:39:::0;22121:26:::1;:24;:26::i;:::-;22104:14;:43:::0;-1:-1:-1;;;;;22162:21:0;::::1;::::0;22158:157:::1;;22219:15;22226:7;22219:6;:15::i;:::-;-1:-1:-1::0;;;;;22200:16:0;::::1;;::::0;;;:7:::1;:16;::::0;;;;;;;:34;;;;22283:20:::1;::::0;22249:22:::1;:31:::0;;;;;;:54;22158:157:::1;24501:1:::2;24492:6;:10;24484:40;;;::::0;;-1:-1:-1;;;24484:40:0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;24484:40:0;;;;;;;;;;;;;::::2;;24535:22;24550:6;24535:14;:22::i;:::-;24573:29;::::0;;;;;;;24583:10:::2;::::0;24573:29:::2;::::0;;;;;::::2;::::0;;::::2;22740:1:::1;24371:239:::0;;:::o;25050:672::-;22409:10;;-1:-1:-1;;;;;22409:10:0;22387;:33;22379:70;;;;;-1:-1:-1;;;22379:70:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;25184:1:::1;22077:16;:14;:16::i;:::-;22054:20;:39:::0;22121:26:::1;:24;:26::i;:::-;22104:14;:43:::0;-1:-1:-1;;;;;22162:21:0;::::1;::::0;22158:157:::1;;22219:15;22226:7;22219:6;:15::i;:::-;-1:-1:-1::0;;;;;22200:16:0;::::1;;::::0;;;:7:::1;:16;::::0;;;;;;;:34;;;;22283:20:::1;::::0;22249:22:::1;:31:::0;;;;;;:54;22158:157:::1;25204:11:::2;::::0;:63:::2;::::0;-1:-1:-1;;;;;25204:11:0::2;25233:10;25253:4;25260:6:::0;25204:28:::2;:63::i;:::-;25301:12;;25282:15;:31;25278:304;;25343:20;:6:::0;21502::::2;25343:10;:20::i;:::-;25330:10;:33:::0;25278:304:::2;;;25416:12;::::0;25396:17:::2;::::0;25416:33:::2;::::0;25433:15:::2;25416:16;:33::i;:::-;25396:53;;25464:16;25483:25;25497:10;;25483:9;:13;;:25;;;;:::i;:::-;25464:44:::0;-1:-1:-1;25536:34:0::2;21502:6;25536:20;:6:::0;25464:44;25536:10:::2;:20::i;:34::-;25523:10;:47:::0;-1:-1:-1;;25278:304:0::2;25609:15;25592:14;:32:::0;;;25650:29:::2;::::0;21502:6:::2;25650:19;:29::i;:::-;25635:12;:44:::0;25695:19:::2;::::0;;;;;;;::::2;::::0;;;;::::2;::::0;;::::2;22460:1:::1;25050:672:::0;:::o;24723:319::-;22677:10;;:28;;;-1:-1:-1;;;22677:28:0;;24766:10;22677:28;;;;;;;;24766:10;;-1:-1:-1;;;;;22677:10:0;;-1:-1:-1;;22677:28:0;;;;;;;;;;;;;;;:10;:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;22677:28:0;22676:29;22668:61;;;;;-1:-1:-1;;;22668:61:0;;;;;;;;;;;;-1:-1:-1;;;22668:61:0;;;;;;;;;;;;;;;24791:10:::1;22077:16;:14;:16::i;:::-;22054:20;:39:::0;22121:26:::1;:24;:26::i;:::-;22104:14;:43:::0;-1:-1:-1;;;;;22162:21:0;::::1;::::0;22158:157:::1;;22219:15;22226:7;22219:6;:15::i;:::-;-1:-1:-1::0;;;;;22200:16:0;::::1;;::::0;;;:7:::1;:16;::::0;;;;;;;:34;;;;22283:20:::1;::::0;22249:22:::1;:31:::0;;;;;;:54;22158:157:::1;24814:14:::2;24831:18;24838:10;24831:6;:18::i;:::-;24814:35:::0;-1:-1:-1;24864:10:0;;24860:175:::2;;24899:10;24913:1;24891:19:::0;;;:7:::2;:19;::::0;;;;:23;24929:11:::2;::::0;:44:::2;::::0;-1:-1:-1;;;;;24929:11:0;;::::2;::::0;24966:6;24929:24:::2;:44::i;:::-;24993:30;::::0;;;;;;;25004:10:::2;::::0;24993:30:::2;::::0;;;;;::::2;::::0;;::::2;24860:175;22325:1;22740::::1;24723:319:::0;:::o;22757:310::-;22890:1;22867:10;-1:-1:-1;;;;;22867:10:0;22859:33;22851:65;;;;;-1:-1:-1;;;22851:65:0;;;;;;;;;;;;-1:-1:-1;;;22851:65:0;;;;;;;;;;;;;;;22927:10;:32;;-1:-1:-1;;;;;22927:32:0;;;-1:-1:-1;;;;;;22927:32:0;;;;;;;22970:10;:40;;;;;;;;;;;;;;;23035:24;;;-1:-1:-1;;;23035:24:0;;;;:10;;;;;-1:-1:-1;;23035:24:0;;;;;;;;;;;;;;:10;:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;23035:24:0;23021:11;:38;;-1:-1:-1;;;;;;23021:38:0;-1:-1:-1;;;;;23021:38:0;;;;;;;;;-1:-1:-1;;22757:310:0:o;18531:24::-;;;-1:-1:-1;;;;;18531:24:0;;:::o;18752:110::-;-1:-1:-1;;;;;18836:18:0;18809:7;18836:18;;;:9;:18;;;;;;;18752:110::o;21555:29::-;;;;:::o;23213:131::-;23270:7;23297:39;23306:15;23323:12;;23297:8;:39::i;:::-;23290:46;;23213:131;:::o;21669:57::-;;;;;;;;;;;;;:::o;24136:227::-;22677:10;;:28;;;-1:-1:-1;;;22677:28:0;;24198:10;22677:28;;;;;;;;24198:10;;-1:-1:-1;;;;;22677:10:0;;-1:-1:-1;;22677:28:0;;;;;;;;;;;;;;;:10;:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;22677:28:0;22676:29;22668:61;;;;;-1:-1:-1;;;22668:61:0;;;;;;;;;;;;-1:-1:-1;;;22668:61:0;;;;;;;;;;;;;;;24223:10:::1;22077:16;:14;:16::i;:::-;22054:20;:39:::0;22121:26:::1;:24;:26::i;:::-;22104:14;:43:::0;-1:-1:-1;;;;;22162:21:0;::::1;::::0;22158:157:::1;;22219:15;22226:7;22219:6;:15::i;:::-;-1:-1:-1::0;;;;;22200:16:0;::::1;;::::0;;;:7:::1;:16;::::0;;;;;;;:34;;;;22283:20:::1;::::0;22249:22:::1;:31:::0;;;;;;:54;22158:157:::1;24263:1:::2;24254:6;:10;24246:37;;;::::0;;-1:-1:-1;;;24246:37:0;;::::2;;::::0;::::2;::::0;::::2;::::0;;;;-1:-1:-1;;;24246:37:0;;;;;;;;;;;;;::::2;;24294:19;24306:6;24294:11;:19::i;:::-;24329:26;::::0;;;;;;;24336:10:::2;::::0;24329:26:::2;::::0;;;;;::::2;::::0;;::::2;22740:1:::1;24136:227:::0;;:::o;21591:29::-;;;;:::o;23352:420::-;23399:7;23423:13;:11;:13::i;:::-;23419:78;;-1:-1:-1;23465:20:0;;23458:27;;23419:78;23527:237;23570:179;23735:13;:11;:13::i;:::-;23570:138;23703:4;23570:106;23665:10;;23570:68;23623:14;;23570:26;:24;:26::i;:179::-;23527:20;;;:24;:237::i;21627:35::-;;;;:::o;24618:97::-;24654:31;24663:21;24673:10;24663:9;:21::i;:::-;24654:8;:31::i;:::-;24696:11;:9;:11::i;:::-;24618:97::o;21517:31::-;;;;:::o;21428:32::-;;;-1:-1:-1;;;;;21428:32:0;;:::o;21347:34::-;;;-1:-1:-1;;;;;21347:34:0;;:::o;11213:150::-;11271:7;11304:1;11299;:6;;11291:15;;;;;;-1:-1:-1;11329:5:0;;;11213:150::o;10204:433::-;10262:7;10506:6;10502:47;;-1:-1:-1;10536:1:0;10529:8;;10502:47;10573:5;;;10577:1;10573;:5;:1;10597:5;;;;;:10;10589:19;;;;;;10628:1;10204:433;-1:-1:-1;;;10204:433:0:o;10772:303::-;10830:7;10929:1;10925;:5;10917:14;;;;;;10942:9;10958:1;10954;:5;;;;;;;10772:303;-1:-1:-1;;;;10772:303:0:o;11451:150::-;11509:7;11541:5;;;11565:6;;;;11557:15;;;;;19123:229;19198:12;;:24;;19215:6;19198:16;:24::i;:::-;19183:12;:39;19267:10;19257:21;;;;:9;:21;;;;;;:33;;19283:6;19257:25;:33::i;:::-;19243:10;19233:21;;;;:9;:21;;;;;:57;;;;19301:10;;:43;;-1:-1:-1;;;;;19301:10:0;;;;19337:6;19301:23;:43::i;12637:204::-;12764:68;;;-1:-1:-1;;;;;12764:68:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;12764:68:0;-1:-1:-1;;;12764:68:0;;;12738:95;;12757:5;;12738:18;:95::i;:::-;12637:204;;;;:::o;12453:176::-;12562:58;;;-1:-1:-1;;;;;12562:58:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;12562:58:0;-1:-1:-1;;;12562:58:0;;;12536:85;;12555:5;;12536:18;:85::i;19706:106::-;19764:7;19795:1;19791;:5;:13;;19803:1;19791:13;;;-1:-1:-1;19799:1:0;;19784:20;-1:-1:-1;19706:106:0:o;18870:245::-;18942:12;;:24;;18959:6;18942:16;:24::i;:::-;18927:12;:39;19011:10;19001:21;;;;:9;:21;;;;;;:33;;19027:6;19001:25;:33::i;:::-;18987:10;18977:21;;;;:9;:21;;;;;:57;;;;19045:10;;:62;;-1:-1:-1;;;;;19045:10:0;;;;19093:4;19100:6;19045:27;:62::i;14447:1114::-;15051:27;-1:-1:-1;;;;;15051:25:0;;;:27::i;:::-;15043:71;;;;;-1:-1:-1;;;15043:71:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;15188:12;15202:23;15237:5;-1:-1:-1;;;;;15229:19:0;15249:4;15229:25;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;15229:25:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15187:67;;;;15273:7;15265:52;;;;;-1:-1:-1;;;15265:52:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15334:17;;:21;15330:224;;15476:10;15465:30;;;;;;;;;;;;;;;-1:-1:-1;15465:30:0;15457:85;;;;-1:-1:-1;;;15457:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7443:810;7503:4;8162:20;;8005:66;8202:15;;;;;:42;;;8233:11;8221:8;:23;;8202:42;8194:51;7443:810;-1:-1:-1;;;;7443:810:0:o

Swarm Source

ipfs://0f22040927838888f40dd08139345ee3082848f6d35700512085fc2990b00294

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.