ETH Price: $2,049.25 (+0.63%)

Contract

0x65Bf376c5aA79F4DDB911CE94c23DA608DbDFa0E
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Recover ERC20202125502024-07-01 15:25:47618 days ago1719847547IN
0x65Bf376c...08DbDFa0E
0 ETH0.0005553514.66795871
Withdraw201917832024-06-28 17:49:35621 days ago1719596975IN
0x65Bf376c...08DbDFa0E
0 ETH0.000680414.03347936
Stake201482992024-06-22 16:01:11627 days ago1719072071IN
0x65Bf376c...08DbDFa0E
0 ETH0.000848854.48730086
Get Reward201482722024-06-22 15:55:35627 days ago1719071735IN
0x65Bf376c...08DbDFa0E
0 ETH0.001114073.68988629
Withdraw201256092024-06-19 11:52:47630 days ago1718797967IN
0x65Bf376c...08DbDFa0E
0 ETH0.000672773.9881696
Get Reward201256052024-06-19 11:51:59630 days ago1718797919IN
0x65Bf376c...08DbDFa0E
0 ETH0.001404054.65031975
Withdraw201083172024-06-17 1:45:35632 days ago1718588735IN
0x65Bf376c...08DbDFa0E
0 ETH0.001120156.63979023
Get Reward201083112024-06-17 1:44:23632 days ago1718588663IN
0x65Bf376c...08DbDFa0E
0 ETH0.001913286.33693543
Withdraw201051562024-06-16 15:09:11633 days ago1718550551IN
0x65Bf376c...08DbDFa0E
0 ETH0.000834334.94592511
Get Reward201051392024-06-16 15:05:47633 days ago1718550347IN
0x65Bf376c...08DbDFa0E
0 ETH0.001376664.18074442
Withdraw201007812024-06-16 0:30:59634 days ago1718497859IN
0x65Bf376c...08DbDFa0E
0 ETH0.000407592.41619657
Get Reward201007732024-06-16 0:29:23634 days ago1718497763IN
0x65Bf376c...08DbDFa0E
0 ETH0.00084152.55554708
Get Reward200983312024-06-15 16:17:11634 days ago1718468231IN
0x65Bf376c...08DbDFa0E
0 ETH0.000803015.51139112
Withdraw200983282024-06-15 16:16:35634 days ago1718468195IN
0x65Bf376c...08DbDFa0E
0 ETH0.001938335.71579252
Get Reward200951182024-06-15 5:29:23634 days ago1718429363IN
0x65Bf376c...08DbDFa0E
0 ETH0.00073554.51782718
Withdraw200951152024-06-15 5:28:47634 days ago1718429327IN
0x65Bf376c...08DbDFa0E
0 ETH0.000848744.71774587
Stake200937582024-06-15 0:54:35635 days ago1718412875IN
0x65Bf376c...08DbDFa0E
0 ETH0.000808514.27402442
Get Reward200937502024-06-15 0:52:59635 days ago1718412779IN
0x65Bf376c...08DbDFa0E
0 ETH0.000735684.22220222
Get Reward200889422024-06-14 8:46:59635 days ago1718354819IN
0x65Bf376c...08DbDFa0E
0 ETH0.002721118.26368544
Get Reward200877432024-06-14 4:44:59635 days ago1718340299IN
0x65Bf376c...08DbDFa0E
0 ETH0.002184297.0206111
Withdraw200877162024-06-14 4:39:35635 days ago1718339975IN
0x65Bf376c...08DbDFa0E
0 ETH0.002229597.15166243
Withdraw200846682024-06-13 18:24:59636 days ago1718303099IN
0x65Bf376c...08DbDFa0E
0 ETH0.0018524710.98062519
Get Reward200846552024-06-13 18:22:23636 days ago1718302943IN
0x65Bf376c...08DbDFa0E
0 ETH0.0037466812.40929587
Withdraw200846102024-06-13 18:13:11636 days ago1718302391IN
0x65Bf376c...08DbDFa0E
0 ETH0.002349613.92739608
Get Reward200845452024-06-13 17:59:47636 days ago1718301587IN
0x65Bf376c...08DbDFa0E
0 ETH0.0023543612.42401673
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading
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

Contract Source Code Verified (Exact Match)

Contract Name:
MultiStakingRewards

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: UNLICENSED
// solhint-disable not-rely-on-time

pragma solidity ^0.8.3;

import "./openzeppelin-solidity/contracts/Math.sol";
import "./openzeppelin-solidity/contracts/SafeMath.sol";
import "./openzeppelin-solidity/contracts/SafeERC20.sol";
import "./openzeppelin-solidity/contracts/ReentrancyGuard.sol";

// Inheritance
import "./synthetix/contracts/interfaces/IStakingRewards.sol";
import "./synthetix/contracts/RewardsDistributionRecipient.sol";

contract MultiStakingRewards is RewardsDistributionRecipient, ReentrancyGuard {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    /* ========== STATE VARIABLES ========== */

    IERC20 public immutable rewardsToken;
    IERC20 public immutable stakingToken;
    IERC20[] public externalRewardsTokens;
    uint256 public periodFinish = 0;
    uint256 public rewardRate = 0;
    uint256 public rewardsDuration = 7 days;
    uint256 public lastUpdateTime;
    uint256 public rewardPerTokenStored;

    mapping(address => uint256) public userRewardPerTokenPaid;
    mapping(address => uint256) public rewards;
    mapping(address => mapping(IERC20 => uint256)) public externalRewards;

    mapping(IERC20 => uint256) private externalRewardPerTokenStoredWad;
    mapping(address => mapping(IERC20 => uint256))
        private externalUserRewardPerTokenPaidWad;

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

    IStakingRewards public immutable externalStakingRewards;

    /* ========== CONSTRUCTOR ========== */

    constructor(
        address _owner,
        address _rewardsDistribution,
        IERC20 _rewardsToken,
        IStakingRewards _externalStakingRewards,
        IERC20[] memory _externalRewardsTokens
    ) Owned(_owner) {
        require(
            _externalRewardsTokens.length > 0,
            "Empty externalRewardsTokens"
        );
        rewardsToken = _rewardsToken;
        rewardsDistribution = _rewardsDistribution;
        externalStakingRewards = _externalStakingRewards;
        externalRewardsTokens = _externalRewardsTokens;
        stakingToken = _externalStakingRewards.stakingToken();
    }

    /* ========== VIEWS ========== */

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

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

    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
            _balances[account]
                .mul(rewardPerToken().sub(userRewardPerTokenPaid[account]))
                .div(1e18)
                .add(rewards[account]);
    }

    function earnedExternal(address account)
        public
        returns (uint256[] memory result)
    {
        IERC20[] memory externalTokens = externalRewardsTokens;
        uint256[] memory externalOldTotalRewards = new uint256[](
            externalTokens.length
        );
        result = new uint256[](externalTokens.length);

        for (uint256 i = 0; i < externalTokens.length; i++) {
            externalOldTotalRewards[i] = externalTokens[i].balanceOf(
                address(this)
            );
        }

        externalStakingRewards.getReward();

        for (uint256 i = 0; i < externalTokens.length; i++) {
            IERC20 externalToken = externalTokens[i];
            uint256 externalTotalRewards = externalToken.balanceOf(
                address(this)
            );

            uint256 newExternalRewardsAmount = externalTotalRewards.sub(
                externalOldTotalRewards[i]
            );

            if (_totalSupply > 0) {
                externalRewardPerTokenStoredWad[
                    externalToken
                ] = externalRewardPerTokenStoredWad[externalToken].add(
                    newExternalRewardsAmount.mul(1e18).div(_totalSupply)
                );
            }

            result[i] = _balances[account]
                .mul(
                    externalRewardPerTokenStoredWad[externalToken].sub(
                        externalUserRewardPerTokenPaidWad[account][
                            externalToken
                        ]
                    )
                )
                .div(1e18)
                .add(externalRewards[account][externalToken]);

            externalUserRewardPerTokenPaidWad[account][
                externalToken
            ] = externalRewardPerTokenStoredWad[externalToken];
            externalRewards[account][externalToken] = result[i];
        }

        return result;
    }

    function getRewardForDuration() external view returns (uint256) {
        return rewardRate.mul(rewardsDuration);
    }

    /* ========== MUTATIVE FUNCTIONS ========== */

    // XXX: removed notPaused
    function stake(uint256 amount)
        external
        nonReentrant
        updateReward(msg.sender)
    {
        require(amount > 0, "Cannot stake 0");
        _totalSupply = _totalSupply.add(amount);
        _balances[msg.sender] = _balances[msg.sender].add(amount);
        stakingToken.safeTransferFrom(msg.sender, address(this), amount);
        stakingToken.approve(address(externalStakingRewards), amount);
        externalStakingRewards.stake(amount);
        emit Staked(msg.sender, amount);
    }

    function withdraw(uint256 amount)
        public
        nonReentrant
        updateReward(msg.sender)
    {
        require(amount > 0, "Cannot withdraw 0");
        _totalSupply = _totalSupply.sub(amount);
        _balances[msg.sender] = _balances[msg.sender].sub(amount);
        externalStakingRewards.withdraw(amount);
        stakingToken.safeTransfer(msg.sender, amount);
        emit Withdrawn(msg.sender, amount);
    }

    function getReward() public nonReentrant updateReward(msg.sender) {
        uint256 reward = rewards[msg.sender];
        IERC20[] memory externalTokens = externalRewardsTokens;

        if (reward > 0) {
            rewards[msg.sender] = 0;
            rewardsToken.safeTransfer(msg.sender, reward);
            emit RewardPaid(msg.sender, reward);
        }

        for (uint256 i = 0; i < externalTokens.length; i++) {
            IERC20 externalToken = externalTokens[i];
            uint256 externalReward = externalRewards[msg.sender][externalToken];
            if (externalReward > 0) {
                externalRewards[msg.sender][externalToken] = 0;
                externalToken.safeTransfer(msg.sender, externalReward);
                emit ExternalRewardPaid(msg.sender, externalReward);
            }
        }
    }

    function exit() external {
        withdraw(_balances[msg.sender]);
        getReward();
    }

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

    function notifyRewardAmount(uint256 reward)
        external
        override
        onlyRewardsDistribution
        updateReward(address(0))
    {
        if (block.timestamp >= periodFinish) {
            rewardRate = reward.div(rewardsDuration);
        } else {
            uint256 remaining = periodFinish.sub(block.timestamp);
            uint256 leftover = remaining.mul(rewardRate);
            rewardRate = reward.add(leftover).div(rewardsDuration);
        }

        // Ensure the provided reward amount is not more than the balance in the contract.
        // This keeps the reward rate in the right range, preventing overflows due to
        // very high values of rewardRate in the earned and rewardsPerToken functions;
        // Reward + leftover must be less than 2^256 / 10^18 to avoid overflow.
        uint256 balance = rewardsToken.balanceOf(address(this));
        require(
            rewardRate <= balance.div(rewardsDuration),
            "Provided reward too high"
        );

        lastUpdateTime = block.timestamp;
        periodFinish = block.timestamp.add(rewardsDuration);
        emit RewardAdded(reward);
    }

    // End rewards emission earlier
    function updatePeriodFinish(uint256 timestamp)
        external
        onlyOwner
        updateReward(address(0))
    {
        require(timestamp > lastUpdateTime, "Invalid new period finish");
        periodFinish = timestamp;
    }

    // Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders
    function recoverERC20(address tokenAddress, uint256 tokenAmount)
        external
        onlyOwner
    {
        require(
            tokenAddress != address(stakingToken),
            "Cannot withdraw the staking token"
        );
        IERC20(tokenAddress).safeTransfer(owner, tokenAmount);
        emit Recovered(tokenAddress, tokenAmount);
    }

    function setRewardsDuration(uint256 _rewardsDuration) external onlyOwner {
        require(
            block.timestamp > periodFinish,
            "Previous rewards period must be complete before changing the duration for the new period"
        );
        rewardsDuration = _rewardsDuration;
        emit RewardsDurationUpdated(rewardsDuration);
    }

    /* ========== MODIFIERS ========== */

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

    /* ========== EVENTS ========== */

    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);
    event ExternalRewardPaid(address indexed user, uint256 reward);
    event RewardsDurationUpdated(uint256 newDuration);
    event Recovered(address token, uint256 amount);
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // 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) + 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
            // solhint-disable-next-line max-line-length
            require(
                abi.decode(returndata, (bool)),
                "SafeERC20: ERC20 operation did not succeed"
            );
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

File 5 of 10 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.3;

// Inheritance
import "./Owned.sol";


// https://docs.synthetix.io/contracts/source/contracts/rewardsdistributionrecipient
abstract contract RewardsDistributionRecipient is Owned {
    address public rewardsDistribution;

    function notifyRewardAmount(uint256 reward) external virtual;

    modifier onlyRewardsDistribution() {
        require(msg.sender == rewardsDistribution, "Caller is not RewardsDistribution contract");
        _;
    }

    function setRewardsDistribution(address _rewardsDistribution) external onlyOwner {
        rewardsDistribution = _rewardsDistribution;
    }
}

// SPDX-License-Identifier: MIT

pragma solidity >=0.4.24;

import "../../../openzeppelin-solidity/contracts/SafeERC20.sol";

// https://docs.synthetix.io/contracts/source/interfaces/istakingrewards
interface IStakingRewards {
    // Views
    function rewardsToken() external view returns (IERC20);

    function stakingToken() external view returns (IERC20);

    function lastTimeRewardApplicable() external view returns (uint256);

    function rewardPerToken() external view returns (uint256);

    function earned(address account) external view returns (uint256);

    function getRewardForDuration() external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    // Mutative

    function stake(uint256 amount) external;

    function withdraw(uint256 amount) external;

    function getReward() external;

    function exit() external;
}

// SPDX-License-Identifier: MIT

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

// SPDX-License-Identifier: MIT

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;
        // solhint-disable-next-line no-inline-assembly
        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"
        );

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.3;


// https://docs.synthetix.io/contracts/source/contracts/owned
contract Owned {
    address public owner;
    address public nominatedOwner;

    constructor(address _owner) {
        require(_owner != address(0), "Owner address cannot be 0");
        owner = _owner;
        emit OwnerChanged(address(0), _owner);
    }

    function nominateNewOwner(address _owner) external onlyOwner {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    function acceptOwnership() external {
        require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
        emit OwnerChanged(owner, nominatedOwner);
        owner = nominatedOwner;
        nominatedOwner = address(0);
    }

    modifier onlyOwner {
        _onlyOwner();
        _;
    }

    function _onlyOwner() private view {
        require(msg.sender == owner, "Only the contract owner may perform this action");
    }

    event OwnerNominated(address newOwner);
    event OwnerChanged(address oldOwner, address newOwner);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_rewardsDistribution","type":"address"},{"internalType":"contract IERC20","name":"_rewardsToken","type":"address"},{"internalType":"contract IStakingRewards","name":"_externalStakingRewards","type":"address"},{"internalType":"contract IERC20[]","name":"_externalRewardsTokens","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"ExternalRewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Recovered","type":"event"},{"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":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"RewardsDurationUpdated","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":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earnedExternal","outputs":[{"internalType":"uint256[]","name":"result","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"contract IERC20","name":"","type":"address"}],"name":"externalRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"externalRewardsTokens","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"externalStakingRewards","outputs":[{"internalType":"contract IStakingRewards","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getRewardForDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"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":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDistribution","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardsDistribution","type":"address"}],"name":"setRewardsDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardsDuration","type":"uint256"}],"name":"setRewardsDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingToken","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":"uint256","name":"timestamp","type":"uint256"}],"name":"updatePeriodFinish","outputs":[],"stateMutability":"nonpayable","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"}]

60e06040526000600555600060065562093a806007553480156200002257600080fd5b506040516200230d3803806200230d8339810160408190526200004591620002cb565b846001600160a01b038116620000a25760405162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f7420626520300000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b03831690811782556040805192835260208301919091527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a150600160035580516200014f5760405162461bcd60e51b815260206004820152601b60248201527f456d7074792065787465726e616c52657761726473546f6b656e730000000000604482015260640162000099565b6001600160a01b03838116608052600280546001600160a01b031916868316179055821660c05280516200018b90600490602084019062000209565b50816001600160a01b03166372f702f36040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001cb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f19190620003f7565b6001600160a01b031660a052506200041e9350505050565b82805482825590600052602060002090810192821562000261579160200282015b828111156200026157825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200022a565b506200026f92915062000273565b5090565b5b808211156200026f576000815560010162000274565b6001600160a01b0381168114620002a057600080fd5b50565b8051620002b0816200028a565b919050565b634e487b7160e01b600052604160045260246000fd5b600080600080600060a08688031215620002e457600080fd5b8551620002f1816200028a565b8095505060208087015162000306816200028a565b604088015190955062000319816200028a565b60608801519094506200032c816200028a565b60808801519093506001600160401b03808211156200034a57600080fd5b818901915089601f8301126200035f57600080fd5b815181811115620003745762000374620002b5565b8060051b604051601f19603f830116810181811085821117156200039c576200039c620002b5565b60405291825284820192508381018501918c831115620003bb57600080fd5b938501935b82851015620003e457620003d485620002a3565b84529385019392850192620003c0565b8096505050505050509295509295909350565b6000602082840312156200040a57600080fd5b815162000417816200028a565b9392505050565b60805160a05160c051611e7962000494600039600081816104170152818161078701528181610b9201528181611565015261161801526000818161039101528181610bfb015281816113250152818161151e015261159401526000818161047501528181610dda015261101a0152611e796000f3fe608060405234801561001057600080fd5b50600436106101fa5760003560e01c806370a082311161011a5780639b8a14ee116100ad578063cd3daf9d1161007c578063cd3daf9d14610468578063d1af0c7d14610470578063df136d6514610497578063e9fad8ee146104a0578063ebe2b12b146104a857600080fd5b80639b8a14ee14610412578063a694fc3a14610439578063c8f33c911461044c578063cc1a378f1461045557600080fd5b806380faa57d116100e957806380faa57d146103c45780638980f11f146103cc5780638b876347146103df5780638da5cb5b146103ff57600080fd5b806370a082311461036357806372f702f31461038c57806379ba5097146103b35780637b0a47ee146103bb57600080fd5b806333bddbc6116101925780633fc6df6e116101615780633fc6df6e146102ff57806353a47bb714610312578063556f6e6b146103255780636be7bb1f1461033857600080fd5b806333bddbc6146102b0578063386a9525146102db5780633c6b16ab146102e45780633d18b912146102f757600080fd5b806319762143116101ce57806319762143146102625780631c1f78eb146102755780631e02cee31461027d5780632e1a7d4d1461029d57600080fd5b80628cc262146101ff5780630700037d146102255780631627540c1461024557806318160ddd1461025a575b600080fd5b61021261020d366004611bbd565b6104b1565b6040519081526020015b60405180910390f35b610212610233366004611bbd565b600b6020526000908152604090205481565b610258610253366004611bbd565b61052f565b005b600f54610212565b610258610270366004611bbd565b61058c565b6102126105b6565b61029061028b366004611bbd565b6105d4565b60405161021c9190611bda565b6102586102ab366004611c1e565b610a5e565b6102c36102be366004611c1e565b610c63565b6040516001600160a01b03909116815260200161021c565b61021260075481565b6102586102f2366004611c1e565b610c8d565b610258610f03565b6002546102c3906001600160a01b031681565b6001546102c3906001600160a01b031681565b610258610333366004611c1e565b61115e565b610212610346366004611c37565b600c60209081526000928352604080842090915290825290205481565b610212610371366004611bbd565b6001600160a01b031660009081526010602052604090205490565b6102c37f000000000000000000000000000000000000000000000000000000000000000081565b610258611223565b61021260065481565b61021261130d565b6102586103da366004611c70565b61131b565b6102126103ed366004611bbd565b600a6020526000908152604090205481565b6000546102c3906001600160a01b031681565b6102c37f000000000000000000000000000000000000000000000000000000000000000081565b610258610447366004611c1e565b61140e565b61021260085481565b610258610463366004611c1e565b6116ae565b610212611788565b6102c37f000000000000000000000000000000000000000000000000000000000000000081565b61021260095481565b6102586117d3565b61021260055481565b6001600160a01b0381166000908152600b6020908152604080832054600a909252822054610529919061052390670de0b6b3a76400009061051d906104fe906104f8611788565b906117f6565b6001600160a01b03881660009081526010602052604090205490611809565b90611815565b90611821565b92915050565b61053761182d565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906020015b60405180910390a150565b61059461182d565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60006105cf60075460065461180990919063ffffffff16565b905090565b60606000600480548060200260200160405190810160405280929190818152602001828054801561062e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610610575b505050505090506000815167ffffffffffffffff81111561065157610651611c9c565b60405190808252806020026020018201604052801561067a578160200160208202803683370190505b509050815167ffffffffffffffff81111561069757610697611c9c565b6040519080825280602002602001820160405280156106c0578160200160208202803683370190505b50925060005b8251811015610784578281815181106106e1576106e1611cb2565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190611cc8565b82828151811061076757610767611cb2565b60209081029190910101528061077c81611cf7565b9150506106c6565b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107e057600080fd5b505af11580156107f4573d6000803e3d6000fd5b5050505060005b8251811015610a5657600083828151811061081857610818611cb2565b60209081029190910101516040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561086d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108919190611cc8565b905060006108c18585815181106108aa576108aa611cb2565b6020026020010151836117f690919063ffffffff16565b600f549091501561092257600f54610908906108e99061051d84670de0b6b3a7640000611809565b6001600160a01b0385166000908152600d602052604090205490611821565b6001600160a01b0384166000908152600d60205260409020555b6001600160a01b038089166000818152600c6020908152604080832094881680845294825280832054938352600e825280832094835293815283822054600d909152929020546109a69261052391670de0b6b3a76400009161051d91610987916117f6565b6001600160a01b038e1660009081526010602052604090205490611809565b8785815181106109b8576109b8611cb2565b6020908102919091018101919091526001600160a01b038085166000818152600d8452604080822054938d168252600e855280822092825291909352909120558651879085908110610a0c57610a0c611cb2565b6020908102919091018101516001600160a01b03808b166000908152600c845260408082209790921681529590925293209290925550819050610a4e81611cf7565b9150506107fb565b505050919050565b600260035403610a895760405162461bcd60e51b8152600401610a8090611d10565b60405180910390fd5b600260035533610a97611788565b600955610aa261130d565b6008556001600160a01b03811615610af357610abd816104b1565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a90915291902055610af1816105d4565b505b60008211610b375760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b6044820152606401610a80565b600f54610b4490836117f6565b600f5533600090815260106020526040902054610b6190836117f6565b33600090815260106020526040908190209190915551632e1a7d4d60e01b8152600481018390526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690632e1a7d4d90602401600060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b50610c249250506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169050338461189f565b60405182815233907f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5906020015b60405180910390a250506001600355565b60048181548110610c7357600080fd5b6000918252602090912001546001600160a01b0316905081565b6002546001600160a01b03163314610cfa5760405162461bcd60e51b815260206004820152602a60248201527f43616c6c6572206973206e6f742052657761726473446973747269627574696f6044820152691b8818dbdb9d1c9858dd60b21b6064820152608401610a80565b6000610d04611788565b600955610d0f61130d565b6008556001600160a01b03811615610d6057610d2a816104b1565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a90915291902055610d5e816105d4565b505b6005544210610d7f57600754610d77908390611815565b600655610dc2565b600554600090610d8f90426117f6565b90506000610da86006548361180990919063ffffffff16565b600754909150610dbc9061051d8684611821565b60065550505b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4d9190611cc8565b9050610e646007548261181590919063ffffffff16565b6006541115610eb55760405162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f206869676800000000000000006044820152606401610a80565b426008819055600754610ec89190611821565b6005556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a1505050565b600260035403610f255760405162461bcd60e51b8152600401610a8090611d10565b600260035533610f33611788565b600955610f3e61130d565b6008556001600160a01b03811615610f8f57610f59816104b1565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a90915291902055610f8d816105d4565b505b336000908152600b602090815260408083205460048054835181860281018601909452808452919493909190830182828015610ff457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610fd6575b50505050509050600082111561107f57336000818152600b6020526040812055611049907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316908461189f565b60405182815233907fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04869060200160405180910390a25b60005b815181101561115357600082828151811061109f5761109f611cb2565b602090810291909101810151336000908152600c835260408082206001600160a01b03841683529093529190912054909150801561113e57336000818152600c602090815260408083206001600160a01b0387168085529252822091909155611108918361189f565b60405181815233907fce68cdb84849c4239fa00c1e372fda2ae0f55014178702abf36b26508d8639599060200160405180910390a25b5050808061114b90611cf7565b915050611082565b505060016003555050565b61116661182d565b6000611170611788565b60095561117b61130d565b6008556001600160a01b038116156111cc57611196816104b1565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a909152919020556111ca816105d4565b505b600854821161121d5760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206e657720706572696f642066696e697368000000000000006044820152606401610a80565b50600555565b6001546001600160a01b0316331461129b5760405162461bcd60e51b815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527402063616e20616363657074206f776e65727368697605c1b6064820152608401610a80565b600054600154604080516001600160a01b0393841681529290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60006105cf42600554611907565b61132361182d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316036113ae5760405162461bcd60e51b815260206004820152602160248201527f43616e6e6f7420776974686472617720746865207374616b696e6720746f6b656044820152603760f91b6064820152608401610a80565b6000546113c8906001600160a01b0384811691168361189f565b604080516001600160a01b0384168152602081018390527f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa28910160405180910390a15050565b6002600354036114305760405162461bcd60e51b8152600401610a8090611d10565b60026003553361143e611788565b60095561144961130d565b6008556001600160a01b0381161561149a57611464816104b1565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a90915291902055611498816105d4565b505b600082116114db5760405162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b6044820152606401610a80565b600f546114e89083611821565b600f55336000908152601060205260409020546115059083611821565b3360008181526010602052604090209190915561154e907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690308561191d565b60405163095ea7b360e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af11580156115dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116019190611d47565b5060405163534a7e1d60e11b8152600481018390527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a694fc3a90602401600060405180830381600087803b15801561166457600080fd5b505af1158015611678573d6000803e3d6000fd5b50506040518481523392507f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d9150602001610c52565b6116b661182d565b60055442116117535760405162461bcd60e51b815260206004820152605860248201527f50726576696f7573207265776172647320706572696f64206d7573742062652060448201527f636f6d706c657465206265666f7265206368616e67696e67207468652064757260648201527f6174696f6e20666f7220746865206e657720706572696f640000000000000000608482015260a401610a80565b60078190556040518181527ffb46ca5a5e06d4540d6387b930a7c978bce0db5f449ec6b3f5d07c6e1d44f2d390602001610581565b6000600f5460000361179b575060095490565b6105cf6117ca600f5461051d670de0b6b3a76400006117c46006546117c46008546104f861130d565b90611809565b60095490611821565b336000908152601060205260409020546117ec90610a5e565b6117f4610f03565b565b60006118028284611d69565b9392505050565b60006118028284611d7c565b60006118028284611d9b565b60006118028284611dbd565b6000546001600160a01b031633146117f45760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201526e37b936903a3434b99030b1ba34b7b760891b6064820152608401610a80565b6040516001600160a01b03831660248201526044810182905261190290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261195b565b505050565b60008183106119165781611802565b5090919050565b6040516001600160a01b03808516602483015283166044820152606481018290526119559085906323b872dd60e01b906084016118cb565b50505050565b60006119b0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a2d9092919063ffffffff16565b80519091501561190257808060200190518101906119ce9190611d47565b6119025760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a80565b6060611a3c8484600085611a44565b949350505050565b606082471015611aa55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610a80565b843b611af35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a80565b600080866001600160a01b03168587604051611b0f9190611df4565b60006040518083038185875af1925050503d8060008114611b4c576040519150601f19603f3d011682016040523d82523d6000602084013e611b51565b606091505b5091509150611b61828286611b6c565b979650505050505050565b60608315611b7b575081611802565b825115611b8b5782518084602001fd5b8160405162461bcd60e51b8152600401610a809190611e10565b6001600160a01b0381168114611bba57600080fd5b50565b600060208284031215611bcf57600080fd5b813561180281611ba5565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835183529284019291840191600101611bf6565b50909695505050505050565b600060208284031215611c3057600080fd5b5035919050565b60008060408385031215611c4a57600080fd5b8235611c5581611ba5565b91506020830135611c6581611ba5565b809150509250929050565b60008060408385031215611c8357600080fd5b8235611c8e81611ba5565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060208284031215611cda57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611d0957611d09611ce1565b5060010190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600060208284031215611d5957600080fd5b8151801515811461180257600080fd5b8181038181111561052957610529611ce1565b6000816000190483118215151615611d9657611d96611ce1565b500290565b600082611db857634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561052957610529611ce1565b60005b83811015611deb578181015183820152602001611dd3565b50506000910152565b60008251611e06818460208701611dd0565b9190910192915050565b6020815260008251806020840152611e2f816040850160208701611dd0565b601f01601f1916919091016040019291505056fea26469706673582212205d62f7de326009f98779969664885ac8062dbddf502b8cfa531bfd6fa960841464736f6c6343000810003300000000000000000000000019bb3f29e989c3c3007f08170f5e5ee0dc5eafe000000000000000000000000019bb3f29e989c3c3007f08170f5e5ee0dc5eafe00000000000000000000000008eb5bd8c9ab0f8ad28e94693f3c889f490be2ab0000000000000000000000000cb51fd7c1981579f65da79de881bdcb76481e7d400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101fa5760003560e01c806370a082311161011a5780639b8a14ee116100ad578063cd3daf9d1161007c578063cd3daf9d14610468578063d1af0c7d14610470578063df136d6514610497578063e9fad8ee146104a0578063ebe2b12b146104a857600080fd5b80639b8a14ee14610412578063a694fc3a14610439578063c8f33c911461044c578063cc1a378f1461045557600080fd5b806380faa57d116100e957806380faa57d146103c45780638980f11f146103cc5780638b876347146103df5780638da5cb5b146103ff57600080fd5b806370a082311461036357806372f702f31461038c57806379ba5097146103b35780637b0a47ee146103bb57600080fd5b806333bddbc6116101925780633fc6df6e116101615780633fc6df6e146102ff57806353a47bb714610312578063556f6e6b146103255780636be7bb1f1461033857600080fd5b806333bddbc6146102b0578063386a9525146102db5780633c6b16ab146102e45780633d18b912146102f757600080fd5b806319762143116101ce57806319762143146102625780631c1f78eb146102755780631e02cee31461027d5780632e1a7d4d1461029d57600080fd5b80628cc262146101ff5780630700037d146102255780631627540c1461024557806318160ddd1461025a575b600080fd5b61021261020d366004611bbd565b6104b1565b6040519081526020015b60405180910390f35b610212610233366004611bbd565b600b6020526000908152604090205481565b610258610253366004611bbd565b61052f565b005b600f54610212565b610258610270366004611bbd565b61058c565b6102126105b6565b61029061028b366004611bbd565b6105d4565b60405161021c9190611bda565b6102586102ab366004611c1e565b610a5e565b6102c36102be366004611c1e565b610c63565b6040516001600160a01b03909116815260200161021c565b61021260075481565b6102586102f2366004611c1e565b610c8d565b610258610f03565b6002546102c3906001600160a01b031681565b6001546102c3906001600160a01b031681565b610258610333366004611c1e565b61115e565b610212610346366004611c37565b600c60209081526000928352604080842090915290825290205481565b610212610371366004611bbd565b6001600160a01b031660009081526010602052604090205490565b6102c37f0000000000000000000000008eb5bd8c9ab0f8ad28e94693f3c889f490be2ab081565b610258611223565b61021260065481565b61021261130d565b6102586103da366004611c70565b61131b565b6102126103ed366004611bbd565b600a6020526000908152604090205481565b6000546102c3906001600160a01b031681565b6102c37f000000000000000000000000cb51fd7c1981579f65da79de881bdcb76481e7d481565b610258610447366004611c1e565b61140e565b61021260085481565b610258610463366004611c1e565b6116ae565b610212611788565b6102c37f0000000000000000000000008eb5bd8c9ab0f8ad28e94693f3c889f490be2ab081565b61021260095481565b6102586117d3565b61021260055481565b6001600160a01b0381166000908152600b6020908152604080832054600a909252822054610529919061052390670de0b6b3a76400009061051d906104fe906104f8611788565b906117f6565b6001600160a01b03881660009081526010602052604090205490611809565b90611815565b90611821565b92915050565b61053761182d565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22906020015b60405180910390a150565b61059461182d565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60006105cf60075460065461180990919063ffffffff16565b905090565b60606000600480548060200260200160405190810160405280929190818152602001828054801561062e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610610575b505050505090506000815167ffffffffffffffff81111561065157610651611c9c565b60405190808252806020026020018201604052801561067a578160200160208202803683370190505b509050815167ffffffffffffffff81111561069757610697611c9c565b6040519080825280602002602001820160405280156106c0578160200160208202803683370190505b50925060005b8251811015610784578281815181106106e1576106e1611cb2565b60209081029190910101516040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190611cc8565b82828151811061076757610767611cb2565b60209081029190910101528061077c81611cf7565b9150506106c6565b507f000000000000000000000000cb51fd7c1981579f65da79de881bdcb76481e7d46001600160a01b0316633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156107e057600080fd5b505af11580156107f4573d6000803e3d6000fd5b5050505060005b8251811015610a5657600083828151811061081857610818611cb2565b60209081029190910101516040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561086d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108919190611cc8565b905060006108c18585815181106108aa576108aa611cb2565b6020026020010151836117f690919063ffffffff16565b600f549091501561092257600f54610908906108e99061051d84670de0b6b3a7640000611809565b6001600160a01b0385166000908152600d602052604090205490611821565b6001600160a01b0384166000908152600d60205260409020555b6001600160a01b038089166000818152600c6020908152604080832094881680845294825280832054938352600e825280832094835293815283822054600d909152929020546109a69261052391670de0b6b3a76400009161051d91610987916117f6565b6001600160a01b038e1660009081526010602052604090205490611809565b8785815181106109b8576109b8611cb2565b6020908102919091018101919091526001600160a01b038085166000818152600d8452604080822054938d168252600e855280822092825291909352909120558651879085908110610a0c57610a0c611cb2565b6020908102919091018101516001600160a01b03808b166000908152600c845260408082209790921681529590925293209290925550819050610a4e81611cf7565b9150506107fb565b505050919050565b600260035403610a895760405162461bcd60e51b8152600401610a8090611d10565b60405180910390fd5b600260035533610a97611788565b600955610aa261130d565b6008556001600160a01b03811615610af357610abd816104b1565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a90915291902055610af1816105d4565b505b60008211610b375760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b6044820152606401610a80565b600f54610b4490836117f6565b600f5533600090815260106020526040902054610b6190836117f6565b33600090815260106020526040908190209190915551632e1a7d4d60e01b8152600481018390526001600160a01b037f000000000000000000000000cb51fd7c1981579f65da79de881bdcb76481e7d41690632e1a7d4d90602401600060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b50610c249250506001600160a01b037f0000000000000000000000008eb5bd8c9ab0f8ad28e94693f3c889f490be2ab0169050338461189f565b60405182815233907f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5906020015b60405180910390a250506001600355565b60048181548110610c7357600080fd5b6000918252602090912001546001600160a01b0316905081565b6002546001600160a01b03163314610cfa5760405162461bcd60e51b815260206004820152602a60248201527f43616c6c6572206973206e6f742052657761726473446973747269627574696f6044820152691b8818dbdb9d1c9858dd60b21b6064820152608401610a80565b6000610d04611788565b600955610d0f61130d565b6008556001600160a01b03811615610d6057610d2a816104b1565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a90915291902055610d5e816105d4565b505b6005544210610d7f57600754610d77908390611815565b600655610dc2565b600554600090610d8f90426117f6565b90506000610da86006548361180990919063ffffffff16565b600754909150610dbc9061051d8684611821565b60065550505b6040516370a0823160e01b81523060048201526000907f0000000000000000000000008eb5bd8c9ab0f8ad28e94693f3c889f490be2ab06001600160a01b0316906370a0823190602401602060405180830381865afa158015610e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4d9190611cc8565b9050610e646007548261181590919063ffffffff16565b6006541115610eb55760405162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f206869676800000000000000006044820152606401610a80565b426008819055600754610ec89190611821565b6005556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a1505050565b600260035403610f255760405162461bcd60e51b8152600401610a8090611d10565b600260035533610f33611788565b600955610f3e61130d565b6008556001600160a01b03811615610f8f57610f59816104b1565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a90915291902055610f8d816105d4565b505b336000908152600b602090815260408083205460048054835181860281018601909452808452919493909190830182828015610ff457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610fd6575b50505050509050600082111561107f57336000818152600b6020526040812055611049907f0000000000000000000000008eb5bd8c9ab0f8ad28e94693f3c889f490be2ab06001600160a01b0316908461189f565b60405182815233907fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e04869060200160405180910390a25b60005b815181101561115357600082828151811061109f5761109f611cb2565b602090810291909101810151336000908152600c835260408082206001600160a01b03841683529093529190912054909150801561113e57336000818152600c602090815260408083206001600160a01b0387168085529252822091909155611108918361189f565b60405181815233907fce68cdb84849c4239fa00c1e372fda2ae0f55014178702abf36b26508d8639599060200160405180910390a25b5050808061114b90611cf7565b915050611082565b505060016003555050565b61116661182d565b6000611170611788565b60095561117b61130d565b6008556001600160a01b038116156111cc57611196816104b1565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a909152919020556111ca816105d4565b505b600854821161121d5760405162461bcd60e51b815260206004820152601960248201527f496e76616c6964206e657720706572696f642066696e697368000000000000006044820152606401610a80565b50600555565b6001546001600160a01b0316331461129b5760405162461bcd60e51b815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527402063616e20616363657074206f776e65727368697605c1b6064820152608401610a80565b600054600154604080516001600160a01b0393841681529290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60006105cf42600554611907565b61132361182d565b7f0000000000000000000000008eb5bd8c9ab0f8ad28e94693f3c889f490be2ab06001600160a01b0316826001600160a01b0316036113ae5760405162461bcd60e51b815260206004820152602160248201527f43616e6e6f7420776974686472617720746865207374616b696e6720746f6b656044820152603760f91b6064820152608401610a80565b6000546113c8906001600160a01b0384811691168361189f565b604080516001600160a01b0384168152602081018390527f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa28910160405180910390a15050565b6002600354036114305760405162461bcd60e51b8152600401610a8090611d10565b60026003553361143e611788565b60095561144961130d565b6008556001600160a01b0381161561149a57611464816104b1565b6001600160a01b0382166000908152600b6020908152604080832093909355600954600a90915291902055611498816105d4565b505b600082116114db5760405162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b6044820152606401610a80565b600f546114e89083611821565b600f55336000908152601060205260409020546115059083611821565b3360008181526010602052604090209190915561154e907f0000000000000000000000008eb5bd8c9ab0f8ad28e94693f3c889f490be2ab06001600160a01b031690308561191d565b60405163095ea7b360e01b81526001600160a01b037f000000000000000000000000cb51fd7c1981579f65da79de881bdcb76481e7d481166004830152602482018490527f0000000000000000000000008eb5bd8c9ab0f8ad28e94693f3c889f490be2ab0169063095ea7b3906044016020604051808303816000875af11580156115dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116019190611d47565b5060405163534a7e1d60e11b8152600481018390527f000000000000000000000000cb51fd7c1981579f65da79de881bdcb76481e7d46001600160a01b03169063a694fc3a90602401600060405180830381600087803b15801561166457600080fd5b505af1158015611678573d6000803e3d6000fd5b50506040518481523392507f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d9150602001610c52565b6116b661182d565b60055442116117535760405162461bcd60e51b815260206004820152605860248201527f50726576696f7573207265776172647320706572696f64206d7573742062652060448201527f636f6d706c657465206265666f7265206368616e67696e67207468652064757260648201527f6174696f6e20666f7220746865206e657720706572696f640000000000000000608482015260a401610a80565b60078190556040518181527ffb46ca5a5e06d4540d6387b930a7c978bce0db5f449ec6b3f5d07c6e1d44f2d390602001610581565b6000600f5460000361179b575060095490565b6105cf6117ca600f5461051d670de0b6b3a76400006117c46006546117c46008546104f861130d565b90611809565b60095490611821565b336000908152601060205260409020546117ec90610a5e565b6117f4610f03565b565b60006118028284611d69565b9392505050565b60006118028284611d7c565b60006118028284611d9b565b60006118028284611dbd565b6000546001600160a01b031633146117f45760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201526e37b936903a3434b99030b1ba34b7b760891b6064820152608401610a80565b6040516001600160a01b03831660248201526044810182905261190290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261195b565b505050565b60008183106119165781611802565b5090919050565b6040516001600160a01b03808516602483015283166044820152606481018290526119559085906323b872dd60e01b906084016118cb565b50505050565b60006119b0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a2d9092919063ffffffff16565b80519091501561190257808060200190518101906119ce9190611d47565b6119025760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a80565b6060611a3c8484600085611a44565b949350505050565b606082471015611aa55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610a80565b843b611af35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a80565b600080866001600160a01b03168587604051611b0f9190611df4565b60006040518083038185875af1925050503d8060008114611b4c576040519150601f19603f3d011682016040523d82523d6000602084013e611b51565b606091505b5091509150611b61828286611b6c565b979650505050505050565b60608315611b7b575081611802565b825115611b8b5782518084602001fd5b8160405162461bcd60e51b8152600401610a809190611e10565b6001600160a01b0381168114611bba57600080fd5b50565b600060208284031215611bcf57600080fd5b813561180281611ba5565b6020808252825182820181905260009190848201906040850190845b81811015611c1257835183529284019291840191600101611bf6565b50909695505050505050565b600060208284031215611c3057600080fd5b5035919050565b60008060408385031215611c4a57600080fd5b8235611c5581611ba5565b91506020830135611c6581611ba5565b809150509250929050565b60008060408385031215611c8357600080fd5b8235611c8e81611ba5565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060208284031215611cda57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600060018201611d0957611d09611ce1565b5060010190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600060208284031215611d5957600080fd5b8151801515811461180257600080fd5b8181038181111561052957610529611ce1565b6000816000190483118215151615611d9657611d96611ce1565b500290565b600082611db857634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561052957610529611ce1565b60005b83811015611deb578181015183820152602001611dd3565b50506000910152565b60008251611e06818460208701611dd0565b9190910192915050565b6020815260008251806020840152611e2f816040850160208701611dd0565b601f01601f1916919091016040019291505056fea26469706673582212205d62f7de326009f98779969664885ac8062dbddf502b8cfa531bfd6fa960841464736f6c63430008100033

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

00000000000000000000000019bb3f29e989c3c3007f08170f5e5ee0dc5eafe000000000000000000000000019bb3f29e989c3c3007f08170f5e5ee0dc5eafe00000000000000000000000008eb5bd8c9ab0f8ad28e94693f3c889f490be2ab0000000000000000000000000cb51fd7c1981579f65da79de881bdcb76481e7d400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-----Decoded View---------------
Arg [0] : _owner (address): 0x19bB3F29e989C3c3007f08170F5E5eE0dC5EaFe0
Arg [1] : _rewardsDistribution (address): 0x19bB3F29e989C3c3007f08170F5E5eE0dC5EaFe0
Arg [2] : _rewardsToken (address): 0x8eb5bD8c9Ab0F8ad28e94693F3c889F490bE2aB0
Arg [3] : _externalStakingRewards (address): 0xcb51fd7c1981579F65dA79De881bDCb76481e7D4
Arg [4] : _externalRewardsTokens (address[]): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 00000000000000000000000019bb3f29e989c3c3007f08170f5e5ee0dc5eafe0
Arg [1] : 00000000000000000000000019bb3f29e989c3c3007f08170f5e5ee0dc5eafe0
Arg [2] : 0000000000000000000000008eb5bd8c9ab0f8ad28e94693f3c889f490be2ab0
Arg [3] : 000000000000000000000000cb51fd7c1981579f65da79de881bdcb76481e7d4
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [6] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
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.