ETH Price: $2,071.05 (+4.29%)
Gas: 0.14 Gwei

Contract

0x7ac09d90f8fCf0cCe77F0D3Bc7aAEf3aD75dEe7A
 

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
Transfer Ownersh...149241382022-06-08 1:55:021391 days ago1654653302IN
0x7ac09d90...aD75dEe7A
0 ETH0.0010585336.83664225
Set Approvals149215412022-06-07 15:12:141391 days ago1654614734IN
0x7ac09d90...aD75dEe7A
0 ETH0.0097518751.46814458

Latest 20 internal transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
Exchange_underly...153972222022-08-23 14:45:551314 days ago1661265955
0x7ac09d90...aD75dEe7A
21.40148174 ETH
Transfer153972222022-08-23 14:45:551314 days ago1661265955
0x7ac09d90...aD75dEe7A
0.01138232 ETH
Transfer153972222022-08-23 14:45:551314 days ago1661265955
0x7ac09d90...aD75dEe7A
3.99551757 ETH
Transfer153972222022-08-23 14:45:551314 days ago1661265955
0x7ac09d90...aD75dEe7A
17.41734649 ETH
Exchange_underly...153081562022-08-09 13:04:391329 days ago1660050279
0x7ac09d90...aD75dEe7A
21.94306848 ETH
Transfer153081562022-08-09 13:04:391329 days ago1660050279
0x7ac09d90...aD75dEe7A
0.01112563 ETH
Transfer153081562022-08-09 13:04:391329 days ago1660050279
0x7ac09d90...aD75dEe7A
17.44038482 ETH
Transfer153081562022-08-09 13:04:391329 days ago1660050279
0x7ac09d90...aD75dEe7A
4.5138093 ETH
Exchange_underly...152185422022-07-26 14:09:041342 days ago1658844544
0x7ac09d90...aD75dEe7A
17.31985191 ETH
Transfer152185422022-07-26 14:09:041342 days ago1658844544
0x7ac09d90...aD75dEe7A
0.03881392 ETH
Transfer152185422022-07-26 14:09:041342 days ago1658844544
0x7ac09d90...aD75dEe7A
3.48943584 ETH
Transfer152185422022-07-26 14:09:041342 days ago1658844544
0x7ac09d90...aD75dEe7A
13.86922999 ETH
Exchange_underly...151302512022-07-12 21:19:111356 days ago1657660751
0x7ac09d90...aD75dEe7A
12.42283543 ETH
Transfer151302512022-07-12 21:19:111356 days ago1657660751
0x7ac09d90...aD75dEe7A
0.05881392 ETH
Transfer151302512022-07-12 21:19:111356 days ago1657660751
0x7ac09d90...aD75dEe7A
12.48164935 ETH
Exchange_underly...150498582022-06-30 10:16:541369 days ago1656584214
0x7ac09d90...aD75dEe7A
6.72074607 ETH
Transfer150498582022-06-30 10:16:541369 days ago1656584214
0x7ac09d90...aD75dEe7A
0.05881392 ETH
Transfer150498582022-06-30 10:16:541369 days ago1656584214
0x7ac09d90...aD75dEe7A
2.12919308 ETH
Transfer150498582022-06-30 10:16:541369 days ago1656584214
0x7ac09d90...aD75dEe7A
2.37599863 ETH
Transfer150498582022-06-30 10:16:541369 days ago1656584214
0x7ac09d90...aD75dEe7A
2.27436827 ETH
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:
PirexClaims

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "Ownable.sol";
import "SafeERC20.sol";
import "IMultiMerkleStash.sol";
import "IMerkleDistributorV2.sol";
import "IUniV2Router.sol";
import "IWETH.sol";
import "ICvxCrvDeposit.sol";
import "IVotiumRegistry.sol";
import "IUniV3Router.sol";
import "ICurveV2Pool.sol";
import "IPirexCVX.sol";
import "IPirexStrategy.sol";
import "UnionBase.sol";

contract PirexClaims is Ownable, UnionBase {
    using SafeERC20 for IERC20;

    address private constant SUSHI_ROUTER =
        0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F;
    address private constant UNISWAP_ROUTER =
        0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
    address private constant UNIV3_ROUTER =
        0xE592427A0AEce92De3Edee1F18E0157C05861564;
    address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
    address private constant CVXCRV_DEPOSIT =
        0x8014595F2AB54cD7c604B00E9fb932176fDc86Ae;
    address public constant VOTIUM_REGISTRY =
        0x92e6E43f99809dF84ed2D533e1FD8017eb966ee2;

    address private constant PIREX_CVX =
        0x35A398425d9f1029021A92bc3d2557D42C8588D7;
    address private constant PXCVX_TOKEN =
        0xBCe0Cf87F513102F22232436CCa2ca49e815C3aC;
    address private constant PCVX_STRATEGY =
        0x45F97D07dAB04B21F36fA3b1149c35e316b35d03;
    address private constant CURVE_CVX_PCVX_POOL =
        0xF38a67dA7a3A12aA12A9981ae6a79C0fdDdd71aB;

    mapping(uint256 => address) private routers;
    mapping(uint256 => uint24) private fees;

    struct curveSwapParams {
        address pool;
        uint16 ethIndex;
    }

    mapping(address => curveSwapParams) public curveRegistry;

    event FundsRetrieved(address token, address to, uint256 amount);
    event CurvePoolUpdated(address token, address pool);

    constructor() {
        routers[0] = SUSHI_ROUTER;
        routers[1] = UNISWAP_ROUTER;
        fees[0] = 3000;
        fees[1] = 10000;
    }

    /// @notice Add a pool and its swap params to the registry
    /// @param token - Address of the token to swap on Curve
    /// @param params - Address of the pool and WETH index there
    function addCurvePool(address token, curveSwapParams calldata params)
        external
        onlyOwner
    {
        curveRegistry[token] = params;
        IERC20(token).safeApprove(params.pool, 0);
        IERC20(token).safeApprove(params.pool, type(uint256).max);
        emit CurvePoolUpdated(token, params.pool);
    }

    /// @notice Remove a pool from the registry
    /// @param token - Address of token associated with the pool
    function removeCurvePool(address token) external onlyOwner {
        IERC20(token).safeApprove(curveRegistry[token].pool, 0);
        delete curveRegistry[token];
        emit CurvePoolUpdated(token, address(0));
    }

    /// @notice Withdraws specified ERC20 tokens to the multisig
    /// @param tokens - the tokens to retrieve
    /// @param to - address to send the tokens to
    /// @dev This is needed to handle tokens that don't have ETH pairs on sushi
    /// or need to be swapped on other chains (NBST, WormholeLUNA...)
    function retrieveTokens(address[] calldata tokens, address to)
        external
        onlyOwner
    {
        require(to != address(0));
        for (uint256 i; i < tokens.length; ++i) {
            address token = tokens[i];
            uint256 tokenBalance = IERC20(token).balanceOf(address(this));
            IERC20(token).safeTransfer(to, tokenBalance);
            emit FundsRetrieved(token, to, tokenBalance);
        }
    }

    /// @notice Execute calls on behalf of contract in case of emergency
    function execute(
        address _to,
        uint256 _value,
        bytes calldata _data
    ) external onlyOwner returns (bool, bytes memory) {
        (bool success, bytes memory result) = _to.call{value: _value}(_data);
        return (success, result);
    }

    /// @notice Set approvals for the tokens used when swapping
    function setApprovals() external onlyOwner {
        IERC20(CRV_TOKEN).safeApprove(CURVE_CRV_ETH_POOL, 0);
        IERC20(CRV_TOKEN).safeApprove(CURVE_CRV_ETH_POOL, type(uint256).max);

        IERC20(CRV_TOKEN).safeApprove(CURVE_CVXCRV_CRV_POOL, 0);
        IERC20(CRV_TOKEN).safeApprove(CURVE_CVXCRV_CRV_POOL, type(uint256).max);

        IERC20(CVXCRV_TOKEN).safeApprove(CURVE_CVXCRV_CRV_POOL, 0);
        IERC20(CVXCRV_TOKEN).safeApprove(
            CURVE_CVXCRV_CRV_POOL,
            type(uint256).max
        );

        IERC20(CVX_TOKEN).safeApprove(PIREX_CVX, 0);
        IERC20(CVX_TOKEN).safeApprove(PIREX_CVX, type(uint256).max);

        IERC20(CVX_TOKEN).safeApprove(CURVE_CVX_PCVX_POOL, 0);
        IERC20(CVX_TOKEN).safeApprove(CURVE_CVX_PCVX_POOL, type(uint256).max);
    }

    /// @notice Swap a token for ETH on Curve
    /// @dev Needs the token to have been added to the registry with params
    /// @param token - address of the token to swap
    /// @param amount - amount of the token to swap
    function _swapToETHCurve(address token, uint256 amount) internal {
        curveSwapParams memory params = curveRegistry[token];
        require(params.pool != address(0));
        IERC20(token).safeApprove(params.pool, 0);
        IERC20(token).safeApprove(params.pool, amount);
        ICurveV2Pool(params.pool).exchange_underlying(
            params.ethIndex ^ 1,
            params.ethIndex,
            amount,
            0
        );
    }

    /// @notice Swap a token for ETH
    /// @param token - address of the token to swap
    /// @param amount - amount of the token to swap
    /// @dev Swaps are executed via Sushi or UniV2 router, will revert if pair
    /// does not exist. Tokens must have a WETH pair.
    function _swapToETH(
        address token,
        uint256 amount,
        address router
    ) internal {
        require(router != address(0));
        address[] memory _path = new address[](2);
        _path[0] = token;
        _path[1] = WETH;

        IERC20(token).safeApprove(router, 0);
        IERC20(token).safeApprove(router, amount);

        IUniV2Router(router).swapExactTokensForETH(
            amount,
            1,
            _path,
            address(this),
            block.timestamp + 1
        );
    }

    /// @notice Swap a token for ETH on UniSwap V3
    /// @param token - address of the token to swap
    /// @param amount - amount of the token to swap
    /// @param fee - the pool's fee
    function _swapToETHUniV3(
        address token,
        uint256 amount,
        uint24 fee
    ) internal {
        IERC20(token).safeApprove(UNIV3_ROUTER, 0);
        IERC20(token).safeApprove(UNIV3_ROUTER, amount);
        IUniV3Router.ExactInputSingleParams memory _params = IUniV3Router
            .ExactInputSingleParams(
                token,
                WETH,
                fee,
                address(this),
                block.timestamp + 1,
                amount,
                1,
                0
            );
        uint256 _wethReceived = IUniV3Router(UNIV3_ROUTER).exactInputSingle(
            _params
        );
        IWETH(WETH).withdraw(_wethReceived);
    }

    /// @notice Claims all specified rewards from the strategy contract
    /// @param epoch - epoch to claim for
    /// @param rewardIndexes - an array containing the info necessary to claim for
    /// each available token
    /// @dev Used to retrieve tokens that need to be transferred
    function claim(uint256 epoch, uint256[] calldata rewardIndexes)
        public
        onlyOwner
    {
        // claim all from strat
        IPirexStrategy(PCVX_STRATEGY).redeemRewards(epoch, rewardIndexes);
    }

    function swap(
        address[] calldata tokens,
        uint256 routerChoices,
        uint256 gasRefund
    ) public onlyOwner {
        // swap all claims to ETH
        for (uint256 i; i < tokens.length; ++i) {
            address _token = tokens[i];
            uint256 _balance = IERC20(_token).balanceOf(address(this));
            // avoid wasting gas / reverting if no balance
            if (_balance <= 1) {
                continue;
            } else {
                // leave one gwei to lower future claim gas costs
                // https://twitter.com/libevm/status/1474870670429360129?s=21
                _balance -= 1;
            }
            // unwrap WETH
            if (_token == WETH) {
                IWETH(WETH).withdraw(_balance);
            } else if (_token == CRV_TOKEN) {
                _crvToEth(_balance, 0);
            } else if (_token == CVXCRV_TOKEN) {
                _swapCrvToEth(_swapCvxCrvToCrv(_balance, address(this)));
            }
            // no need to swap bribes paid out in CVX
            else if (_token == CVX_TOKEN) {
                continue;
            } else {
                uint256 _choice = routerChoices & 7;
                if (_choice >= 4) {
                    _swapToETHCurve(_token, _balance);
                } else if (_choice >= 2) {
                    _swapToETHUniV3(_token, _balance, fees[_choice - 2]);
                } else {
                    _swapToETH(_token, _balance, routers[_choice]);
                }
            }
            routerChoices = routerChoices >> 3;
        }

        (bool success, ) = (tx.origin).call{value: gasRefund}("");
        require(success, "ETH transfer failed");
    }

    function deposit(
        bool lock,
        uint256 minAmountOut
    ) public onlyOwner {
        uint256 _ethBalance = address(this).balance;

        // swap from ETH to CVX
        _swapEthToCvx(_ethBalance, 0);

        uint256 _cvxBalance = IERC20(CVX_TOKEN).balanceOf(address(this));

        // swap on Curve if there is a premium for doing so
        if (!lock) {
            uint256 _pxCvxAmount = ICurveFactoryPool(CURVE_CVX_PCVX_POOL)
                .exchange(1, 0, _cvxBalance, minAmountOut, PCVX_STRATEGY);
        } else {
            require(_cvxBalance >= minAmountOut, "slippage");
            IPirexCVX(PIREX_CVX).deposit(
                _cvxBalance,
                PCVX_STRATEGY,
                false,
                address(0)
            );
        }
        // queue in new rewards
        IPirexStrategy(PCVX_STRATEGY).notifyRewardAmount();
    }

    /// @notice Claims all specified rewards and swaps them to ETH
    /// @param epoch - epoch to claim for
    /// @param rewardIndexes - an array containing the info necessary to claim from strat
    /// @param tokens - addresses of all reward tokens
    /// @param routerChoices - the router to use for the swap
    /// @param claimBeforeSwap - whether to claim on Votium or not
    /// @param lock - whether to deposit or swap cvx to pxcvx
    /// @param stake - whether to stake cvxcrv (if distributor is vault)
    /// @param minAmountOut - min output amount of cvxCRV or CRV (if locking)
    /// @dev routerChoices is a 3-bit bitmap such that
    /// 0b000 (0) - Sushi
    /// 0b001 (1) - UniV2
    /// 0b010 (2) - UniV3 0.3%
    /// 0b011 (3) - UniV3 1%
    /// 0b100 (4) - Curve
    /// Ex: 136 = 010 001 000 will swap token 1 on UniV3, 2 on UniV3, last on Sushi
    /// Passing 0 will execute all swaps on sushi
    /// @dev claimBeforeSwap is used in case 3rd party already claimed on Votium
    function distribute(
        uint256 epoch,
        uint256[] calldata rewardIndexes,
        address[] calldata tokens,
        uint256 routerChoices,
        bool claimBeforeSwap,
        bool lock,
        bool stake,
        uint256 minAmountOut,
        uint256 gasRefund
    ) external onlyOwner {
        // claim
        if (claimBeforeSwap) {
            claim(epoch, rewardIndexes);
        }

        // swap
        swap(tokens, routerChoices, gasRefund);

        // deposit to strategy
        if (stake) {
            deposit(lock, minAmountOut);
        }
    }

    receive() external payable {}
}

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

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

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

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

// 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;

/**
 * @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.9;

interface IMultiMerkleStash {
    struct claimParam {
        address token;
        uint256 index;
        uint256 amount;
        bytes32[] merkleProof;
    }

    function isClaimed(address token, uint256 index)
        external
        view
        returns (bool);

    function claim(
        address token,
        uint256 index,
        address account,
        uint256 amount,
        bytes32[] calldata merkleProof
    ) external;

    function claimMulti(address account, claimParam[] calldata claims) external;

    function updateMerkleRoot(address token, bytes32 _merkleRoot) external;

    event Claimed(
        address indexed token,
        uint256 index,
        uint256 amount,
        address indexed account,
        uint256 indexed update
    );
    event MerkleRootUpdated(
        address indexed token,
        bytes32 indexed merkleRoot,
        uint256 indexed update
    );
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IMerkleDistributorV2 {
    enum Option {
        Claim,
        ClaimAsETH,
        ClaimAsCRV,
        ClaimAsCVX,
        ClaimAndStake
    }

    function vault() external view returns (address);

    function merkleRoot() external view returns (bytes32);

    function week() external view returns (uint32);

    function frozen() external view returns (bool);

    function isClaimed(uint256 index) external view returns (bool);

    function setApprovals() external;

    function claim(
        uint256 index,
        address account,
        uint256 amount,
        bytes32[] calldata merkleProof
    ) external;

    function claimAs(
        uint256 index,
        address account,
        uint256 amount,
        bytes32[] calldata merkleProof,
        Option option
    ) external;

    function claimAs(
        uint256 index,
        address account,
        uint256 amount,
        bytes32[] calldata merkleProof,
        Option option,
        uint256 minAmountOut
    ) external;

    function freeze() external;

    function unfreeze() external;

    function stake() external;

    function updateMerkleRoot(bytes32 newMerkleRoot, bool unfreeze) external;

    function updateDepositor(address newDepositor) external;

    function updateAdmin(address newAdmin) external;

    function updateVault(address newVault) external;

    event Claimed(
        uint256 index,
        uint256 amount,
        address indexed account,
        uint256 indexed week,
        Option option
    );

    event DepositorUpdated(
        address indexed oldDepositor,
        address indexed newDepositor
    );

    event AdminUpdated(address indexed oldAdmin, address indexed newAdmin);

    event VaultUpdated(address indexed oldVault, address indexed newVault);

    event MerkleRootUpdated(bytes32 indexed merkleRoot, uint32 indexed week);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IUniV2Router {
    function swapExactTokensForETH(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);

    function swapExactETHForTokens(
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);

    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);

    function getAmountsOut(uint256 amountIn, address[] memory path)
        external
        view
        returns (uint256[] memory amounts);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IWETH {
    function deposit() external payable;

    function transfer(address to, uint256 value) external returns (bool);

    function withdraw(uint256) external;
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface ICvxCrvDeposit {
    function deposit(uint256, bool) external;
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IVotiumRegistry {
    struct Registry {
        uint256 start;
        address to;
        uint256 expiration;
    }

    function registry(address _from)
        external
        view
        returns (Registry memory registry);

    function setRegistry(address _to) external;
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IUniV3Router {
    struct ExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
        uint160 sqrtPriceLimitX96;
    }

    function exactInputSingle(ExactInputSingleParams calldata params)
        external
        payable
        returns (uint256 amountOut);

    struct ExactInputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
    }

    function exactInput(ExactInputParams calldata params)
        external
        payable
        returns (uint256 amountOut);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface ICurveV2Pool {
    function get_dy(
        uint256 i,
        uint256 j,
        uint256 dx
    ) external view returns (uint256);

    function calc_token_amount(uint256[2] calldata amounts)
        external
        view
        returns (uint256);

    function exchange_underlying(
        uint256 i,
        uint256 j,
        uint256 dx,
        uint256 min_dy
    ) external payable returns (uint256);

    function add_liquidity(uint256[2] calldata amounts, uint256 min_mint_amount)
        external
        returns (uint256);

    function lp_price() external view returns (uint256);

    function price_oracle() external view returns (uint256);

    function remove_liquidity_one_coin(
        uint256 token_amount,
        uint256 i,
        uint256 min_amount,
        bool use_eth,
        address receiver
    ) external returns (uint256);
}

File 15 of 19 : IPirexCVX.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IPirexCVX {
    function deposit(
        uint256 assets,
        address receiver,
        bool shouldCompound,
        address developer
    ) external;
}

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

interface IPirexStrategy {
    function notifyRewardAmount() external;

    function recoverERC20(address tokenAddress, uint256 tokenAmount) external;

    function setDistributor(address _distributor) external;

    function getReward() external;

    function withdraw(uint256 amount) external;

    function stake(uint256 amount) external;

    function getRewardForDuration() external view returns (uint256);

    function earned() external view returns (uint256);

    function rewardPerToken() external view returns (uint256);

    function lastTimeRewardApplicable() external view returns (uint256);

    function totalSupplyWithRewards() external view returns (uint256, uint256);

    function totalSupply() external view returns (uint256);

    function rewards() external view returns (uint256);

    function periodFinish() external view returns (uint256);

    function lastUpdateTime() external view returns (uint256);

    function rewardRate() external view returns (uint256);

    function owner() external view returns (address);

    function redeemRewards(uint256 epoch, uint256[] calldata rewardIndexes)
        external;
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "ICurveV2Pool.sol";
import "ICurveFactoryPool.sol";
import "IBasicRewards.sol";

// Common variables and functions
contract UnionBase {
    address public constant CVXCRV_STAKING_CONTRACT =
        0x3Fe65692bfCD0e6CF84cB1E7d24108E434A7587e;
    address public constant CURVE_CRV_ETH_POOL =
        0x8301AE4fc9c624d1D396cbDAa1ed877821D7C511;
    address public constant CURVE_CVX_ETH_POOL =
        0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4;
    address public constant CURVE_CVXCRV_CRV_POOL =
        0x9D0464996170c6B9e75eED71c68B99dDEDf279e8;

    address public constant CRV_TOKEN =
        0xD533a949740bb3306d119CC777fa900bA034cd52;
    address public constant CVXCRV_TOKEN =
        0x62B9c7356A2Dc64a1969e19C23e4f579F9810Aa7;
    address public constant CVX_TOKEN =
        0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B;

    uint256 public constant CRVETH_ETH_INDEX = 0;
    uint256 public constant CRVETH_CRV_INDEX = 1;
    int128 public constant CVXCRV_CRV_INDEX = 0;
    int128 public constant CVXCRV_CVXCRV_INDEX = 1;
    uint256 public constant CVXETH_ETH_INDEX = 0;
    uint256 public constant CVXETH_CVX_INDEX = 1;

    IBasicRewards cvxCrvStaking = IBasicRewards(CVXCRV_STAKING_CONTRACT);
    ICurveV2Pool cvxEthSwap = ICurveV2Pool(CURVE_CVX_ETH_POOL);
    ICurveV2Pool crvEthSwap = ICurveV2Pool(CURVE_CRV_ETH_POOL);
    ICurveFactoryPool crvCvxCrvSwap = ICurveFactoryPool(CURVE_CVXCRV_CRV_POOL);

    /// @notice Swap CRV for cvxCRV on Curve
    /// @param amount - amount to swap
    /// @param recipient - where swapped tokens will be sent to
    /// @return amount of CRV obtained after the swap
    function _swapCrvToCvxCrv(uint256 amount, address recipient)
        internal
        returns (uint256)
    {
        return _crvToCvxCrv(amount, recipient, 0);
    }

    /// @notice Swap CRV for cvxCRV on Curve
    /// @param amount - amount to swap
    /// @param recipient - where swapped tokens will be sent to
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _swapCrvToCvxCrv(
        uint256 amount,
        address recipient,
        uint256 minAmountOut
    ) internal returns (uint256) {
        return _crvToCvxCrv(amount, recipient, minAmountOut);
    }

    /// @notice Swap CRV for cvxCRV on Curve
    /// @param amount - amount to swap
    /// @param recipient - where swapped tokens will be sent to
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _crvToCvxCrv(
        uint256 amount,
        address recipient,
        uint256 minAmountOut
    ) internal returns (uint256) {
        return
            crvCvxCrvSwap.exchange(
                CVXCRV_CRV_INDEX,
                CVXCRV_CVXCRV_INDEX,
                amount,
                minAmountOut,
                recipient
            );
    }

    /// @notice Swap cvxCRV for CRV on Curve
    /// @param amount - amount to swap
    /// @param recipient - where swapped tokens will be sent to
    /// @return amount of CRV obtained after the swap
    function _swapCvxCrvToCrv(uint256 amount, address recipient)
        internal
        returns (uint256)
    {
        return _cvxCrvToCrv(amount, recipient, 0);
    }

    /// @notice Swap cvxCRV for CRV on Curve
    /// @param amount - amount to swap
    /// @param recipient - where swapped tokens will be sent to
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _swapCvxCrvToCrv(
        uint256 amount,
        address recipient,
        uint256 minAmountOut
    ) internal returns (uint256) {
        return _cvxCrvToCrv(amount, recipient, minAmountOut);
    }

    /// @notice Swap cvxCRV for CRV on Curve
    /// @param amount - amount to swap
    /// @param recipient - where swapped tokens will be sent to
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _cvxCrvToCrv(
        uint256 amount,
        address recipient,
        uint256 minAmountOut
    ) internal returns (uint256) {
        return
            crvCvxCrvSwap.exchange(
                CVXCRV_CVXCRV_INDEX,
                CVXCRV_CRV_INDEX,
                amount,
                minAmountOut,
                recipient
            );
    }

    /// @notice Swap CRV for native ETH on Curve
    /// @param amount - amount to swap
    /// @return amount of ETH obtained after the swap
    function _swapCrvToEth(uint256 amount) internal returns (uint256) {
        return _crvToEth(amount, 0);
    }

    /// @notice Swap CRV for native ETH on Curve
    /// @param amount - amount to swap
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of ETH obtained after the swap
    function _swapCrvToEth(uint256 amount, uint256 minAmountOut)
        internal
        returns (uint256)
    {
        return _crvToEth(amount, minAmountOut);
    }

    /// @notice Swap CRV for native ETH on Curve
    /// @param amount - amount to swap
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of ETH obtained after the swap
    function _crvToEth(uint256 amount, uint256 minAmountOut)
        internal
        returns (uint256)
    {
        return
            crvEthSwap.exchange_underlying{value: 0}(
                CRVETH_CRV_INDEX,
                CRVETH_ETH_INDEX,
                amount,
                minAmountOut
            );
    }

    /// @notice Swap native ETH for CRV on Curve
    /// @param amount - amount to swap
    /// @return amount of CRV obtained after the swap
    function _swapEthToCrv(uint256 amount) internal returns (uint256) {
        return _ethToCrv(amount, 0);
    }

    /// @notice Swap native ETH for CRV on Curve
    /// @param amount - amount to swap
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _swapEthToCrv(uint256 amount, uint256 minAmountOut)
        internal
        returns (uint256)
    {
        return _ethToCrv(amount, minAmountOut);
    }

    /// @notice Swap native ETH for CRV on Curve
    /// @param amount - amount to swap
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _ethToCrv(uint256 amount, uint256 minAmountOut)
        internal
        returns (uint256)
    {
        return
            crvEthSwap.exchange_underlying{value: amount}(
                CRVETH_ETH_INDEX,
                CRVETH_CRV_INDEX,
                amount,
                minAmountOut
            );
    }

    /// @notice Swap native ETH for CVX on Curve
    /// @param amount - amount to swap
    /// @return amount of CRV obtained after the swap
    function _swapEthToCvx(uint256 amount) internal returns (uint256) {
        return _ethToCvx(amount, 0);
    }

    /// @notice Swap native ETH for CVX on Curve
    /// @param amount - amount to swap
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _swapEthToCvx(uint256 amount, uint256 minAmountOut)
        internal
        returns (uint256)
    {
        return _ethToCvx(amount, minAmountOut);
    }

    /// @notice Swap native ETH for CVX on Curve
    /// @param amount - amount to swap
    /// @param minAmountOut - minimum expected amount of output tokens
    /// @return amount of CRV obtained after the swap
    function _ethToCvx(uint256 amount, uint256 minAmountOut)
        internal
        returns (uint256)
    {
        return
            cvxEthSwap.exchange_underlying{value: amount}(
                CVXETH_ETH_INDEX,
                CVXETH_CVX_INDEX,
                amount,
                minAmountOut
            );
    }

    modifier notToZeroAddress(address _to) {
        require(_to != address(0), "Invalid address!");
        _;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface ICurveFactoryPool {
    function get_dy(
        int128 i,
        int128 j,
        uint256 dx
    ) external view returns (uint256);

    function get_balances() external view returns (uint256[2] memory);

    function add_liquidity(
        uint256[2] memory _amounts,
        uint256 _min_mint_amount,
        address _receiver
    ) external returns (uint256);

    function exchange(
        int128 i,
        int128 j,
        uint256 _dx,
        uint256 _min_dy,
        address _receiver
    ) external returns (uint256);
}

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.9;

interface IBasicRewards {
    function stakeFor(address, uint256) external returns (bool);

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

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

    function withdrawAll(bool) external returns (bool);

    function withdraw(uint256, bool) external returns (bool);

    function withdrawAndUnwrap(uint256 amount, bool claim)
        external
        returns (bool);

    function getReward() external returns (bool);

    function stake(uint256) external returns (bool);

    function extraRewards(uint256) external view returns (address);

    function exit() external returns (bool);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"CurvePoolUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FundsRetrieved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"CRVETH_CRV_INDEX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CRVETH_ETH_INDEX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CRV_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CURVE_CRV_ETH_POOL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CURVE_CVXCRV_CRV_POOL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CURVE_CVX_ETH_POOL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CVXCRV_CRV_INDEX","outputs":[{"internalType":"int128","name":"","type":"int128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CVXCRV_CVXCRV_INDEX","outputs":[{"internalType":"int128","name":"","type":"int128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CVXCRV_STAKING_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CVXCRV_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CVXETH_CVX_INDEX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CVXETH_ETH_INDEX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CVX_TOKEN","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VOTIUM_REGISTRY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"components":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint16","name":"ethIndex","type":"uint16"}],"internalType":"struct PirexClaims.curveSwapParams","name":"params","type":"tuple"}],"name":"addCurvePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256[]","name":"rewardIndexes","type":"uint256[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"curveRegistry","outputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint16","name":"ethIndex","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"lock","type":"bool"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256[]","name":"rewardIndexes","type":"uint256[]"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"routerChoices","type":"uint256"},{"internalType":"bool","name":"claimBeforeSwap","type":"bool"},{"internalType":"bool","name":"lock","type":"bool"},{"internalType":"bool","name":"stake","type":"bool"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"uint256","name":"gasRefund","type":"uint256"}],"name":"distribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"execute","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeCurvePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"address","name":"to","type":"address"}],"name":"retrieveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setApprovals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"routerChoices","type":"uint256"},{"internalType":"uint256","name":"gasRefund","type":"uint256"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052600180546001600160a01b0319908116733fe65692bfcd0e6cf84cb1e7d24108e434a7587e1790915560028054821673b576491f1e6e5e62f1d8f26062ee822b40b0e0d4179055600380548216738301ae4fc9c624d1d396cbdaa1ed877821d7c51117905560048054909116739d0464996170c6b9e75eed71c68b99ddedf279e817905534801561009457600080fd5b50600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3507f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc80546001600160a01b031990811673d9e1ce17f2641f24ae83637ab66a2cca9c378b9f179091557f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b8054909116737a250d5630b4cf539739df2c5dacb4c659f2488d17905560066020527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f8805462ffffff19908116610bb81790915560016000527f3e5fec24aa4dc4e5aee2e025e51e1392c72a2500577559fae9665c6d52bd6a31805490911661271017905561245b806101d36000396000f3fe6080604052600436106101a05760003560e01c806388dcc3fe116100ec578063b61d27f61161008a578063d8697a5011610064578063d8697a50146104de578063ddd2c684146104f3578063f1d5253e14610513578063f2fde38b1461053b57600080fd5b8063b61d27f614610468578063c70eddff14610496578063d67edf59146104be57600080fd5b8063961deefe116100c6578063961deefe14610400578063ab6e25cd14610213578063b1b6665214610428578063b3950de11461044857600080fd5b806388dcc3fe1461039a5780638da5cb5b146103ba57806393516676146103d857600080fd5b806360c3a38c11610159578063715018a611610133578063715018a6146103205780637506ceb9146103355780637ec5508a1461035d5780638757b15b1461038557600080fd5b806360c3a38c146102e3578063657428a3146102f85780636acabc2e146102e357600080fd5b80630960b7fa146101ac57806315d89591146101f15780631857b30814610213578063316f244d146102365780633f3e37e41461025e578063455c3eb51461027e57600080fd5b366101a757005b600080fd5b3480156101b857600080fd5b506101d4734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b81565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101fd57600080fd5b5061021161020c366004611db3565b61055b565b005b34801561021f57600080fd5b50610228600081565b6040519081526020016101e8565b34801561024257600080fd5b506101d47392e6e43f99809df84ed2d533e1fd8017eb966ee281565b34801561026a57600080fd5b50610211610279366004611e0a565b6106cc565b34801561028a57600080fd5b506102c1610299366004611e5b565b6007602052600090815260409020546001600160a01b03811690600160a01b900461ffff1682565b604080516001600160a01b03909316835261ffff9091166020830152016101e8565b3480156102ef57600080fd5b50610228600181565b34801561030457600080fd5b506101d473d533a949740bb3306d119cc777fa900ba034cd5281565b34801561032c57600080fd5b50610211610a16565b34801561034157600080fd5b506101d4739d0464996170c6b9e75eed71c68b99ddedf279e881565b34801561036957600080fd5b506101d47362b9c7356a2dc64a1969e19c23e4f579f9810aa781565b34801561039157600080fd5b50610211610a8a565b3480156103a657600080fd5b506102116103b5366004611e78565b610cc3565b3480156103c657600080fd5b506000546001600160a01b03166101d4565b3480156103e457600080fd5b506103ed600181565b604051600f9190910b81526020016101e8565b34801561040c57600080fd5b506101d473b576491f1e6e5e62f1d8f26062ee822b40b0e0d481565b34801561043457600080fd5b50610211610443366004611eb9565b610daf565b34801561045457600080fd5b50610211610463366004611f23565b610e4b565b34801561047457600080fd5b50610488610483366004611f4f565b611103565b6040516101e8929190612030565b3480156104a257600080fd5b506101d4733fe65692bfcd0e6cf84cb1e7d24108e434a7587e81565b3480156104ca57600080fd5b506102116104d936600461204b565b6111a1565b3480156104ea57600080fd5b506103ed600081565b3480156104ff57600080fd5b5061021161050e366004611e5b565b611205565b34801561051f57600080fd5b506101d4738301ae4fc9c624d1d396cbdaa1ed877821d7c51181565b34801561054757600080fd5b50610211610556366004611e5b565b6112b7565b6000546001600160a01b0316331461058e5760405162461bcd60e51b81526004016105859061211b565b60405180910390fd5b6001600160a01b0381166105a157600080fd5b60005b828110156106c65760008484838181106105c0576105c0612150565b90506020020160208101906105d59190611e5b565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a082319060240160206040518083038186803b15801561061a57600080fd5b505afa15801561062e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106529190612166565b90506106686001600160a01b03831685836113a1565b604080516001600160a01b038085168252861660208201529081018290527fe28922b10f7326500f50066b3f57b135330212ae30fe5332cd9200e09917ecad9060600160405180910390a15050806106bf90612195565b90506105a4565b50505050565b6000546001600160a01b031633146106f65760405162461bcd60e51b81526004016105859061211b565b60005b8381101561098057600085858381811061071557610715612150565b905060200201602081019061072a9190611e5b565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a082319060240160206040518083038186803b15801561076f57600080fd5b505afa158015610783573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a79190612166565b9050600181116107b8575050610970565b6107c36001826121b0565b90506001600160a01b03821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2141561085457604051632e1a7d4d60e01b81526004810182905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b15801561083757600080fd5b505af115801561084b573d6000803e3d6000fd5b50505050610966565b6001600160a01b03821673d533a949740bb3306d119cc777fa900ba034cd52141561088a57610884816000611409565b50610966565b6001600160a01b0382167362b9c7356a2dc64a1969e19c23e4f579f9810aa714156108c1576108846108bc82306114a7565b6114b5565b6001600160a01b038216734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b14156108ed575050610970565b60078516600481106109085761090383836114c8565b610964565b6002811061093f576109038383600660006109246002876121b0565b815260208101919091526040016000205462ffffff166115dc565b60008181526005602052604090205461096490849084906001600160a01b03166117f4565b505b600385901c945050505b61097981612195565b90506106f9565b50604051600090329083908381818185875af1925050503d80600081146109c3576040519150601f19603f3d011682016040523d82523d6000602084013e6109c8565b606091505b5050905080610a0f5760405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152606401610585565b5050505050565b6000546001600160a01b03163314610a405760405162461bcd60e51b81526004016105859061211b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ab45760405162461bcd60e51b81526004016105859061211b565b610ae873d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c5116000611950565b610b1d73d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c511600019611950565b610b5173d533a949740bb3306d119cc777fa900ba034cd52739d0464996170c6b9e75eed71c68b99ddedf279e86000611950565b610b8673d533a949740bb3306d119cc777fa900ba034cd52739d0464996170c6b9e75eed71c68b99ddedf279e8600019611950565b610bba7362b9c7356a2dc64a1969e19c23e4f579f9810aa7739d0464996170c6b9e75eed71c68b99ddedf279e86000611950565b610bef7362b9c7356a2dc64a1969e19c23e4f579f9810aa7739d0464996170c6b9e75eed71c68b99ddedf279e8600019611950565b610c23734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b7335a398425d9f1029021a92bc3d2557d42c8588d76000611950565b610c58734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b7335a398425d9f1029021a92bc3d2557d42c8588d7600019611950565b610c8c734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b73f38a67da7a3a12aa12a9981ae6a79c0fdddd71ab6000611950565b610cc1734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b73f38a67da7a3a12aa12a9981ae6a79c0fdddd71ab600019611950565b565b6000546001600160a01b03163314610ced5760405162461bcd60e51b81526004016105859061211b565b6001600160a01b03821660009081526007602052604090208190610d1182826121c7565b50610d369050610d246020830183611e5b565b6001600160a01b038416906000611950565b610d59610d466020830183611e5b565b6001600160a01b03841690600019611950565b7f8fca21c5d308d0debabdfc9dddde40c80ec0ad3e7fac4a6e5f72f038c3aef82d82610d886020840184611e5b565b604080516001600160a01b0393841681529290911660208301520160405180910390a15050565b6000546001600160a01b03163314610dd95760405162461bcd60e51b81526004016105859061211b565b6040516318bbb46f60e01b81527345f97d07dab04b21f36fa3b1149c35e316b35d03906318bbb46f90610e1490869086908690600401612228565b600060405180830381600087803b158015610e2e57600080fd5b505af1158015610e42573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b03163314610e755760405162461bcd60e51b81526004016105859061211b565b47610e81816000611a74565b506040516370a0823160e01b8152306004820152600090734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b906370a082319060240160206040518083038186803b158015610ecf57600080fd5b505afa158015610ee3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f079190612166565b905083610fcd5760405163ddc1f59d60e01b81526001600482015260006024820181905260448201839052606482018590527345f97d07dab04b21f36fa3b1149c35e316b35d0360848301529073f38a67da7a3a12aa12a9981ae6a79c0fdddd71ab9063ddc1f59d9060a401602060405180830381600087803b158015610f8d57600080fd5b505af1158015610fa1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc59190612166565b905050611096565b828110156110085760405162461bcd60e51b8152602060048201526008602482015267736c69707061676560c01b6044820152606401610585565b604051636117ca0360e11b8152600481018290527345f97d07dab04b21f36fa3b1149c35e316b35d03602482015260006044820181905260648201527335a398425d9f1029021a92bc3d2557d42c8588d79063c22f940690608401600060405180830381600087803b15801561107d57600080fd5b505af1158015611091573d6000803e3d6000fd5b505050505b7345f97d07dab04b21f36fa3b1149c35e316b35d036001600160a01b0316630c51dde46040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156110e557600080fd5b505af11580156110f9573d6000803e3d6000fd5b5050505050505050565b600080546060906001600160a01b031633146111315760405162461bcd60e51b81526004016105859061211b565b600080876001600160a01b031687878760405161114f92919061226c565b60006040518083038185875af1925050503d806000811461118c576040519150601f19603f3d011682016040523d82523d6000602084013e611191565b606091505b5090999098509650505050505050565b6000546001600160a01b031633146111cb5760405162461bcd60e51b81526004016105859061211b565b84156111dc576111dc8b8b8b610daf565b6111e8888888846106cc565b82156111f8576111f88483610e4b565b5050505050505050505050565b6000546001600160a01b0316331461122f5760405162461bcd60e51b81526004016105859061211b565b6001600160a01b03808216600081815260076020526040812054611254931690611950565b6001600160a01b038116600081815260076020908152604080832080546001600160b01b03191690558051938452908301919091527f8fca21c5d308d0debabdfc9dddde40c80ec0ad3e7fac4a6e5f72f038c3aef82d910160405180910390a150565b6000546001600160a01b031633146112e15760405162461bcd60e51b81526004016105859061211b565b6001600160a01b0381166113465760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610585565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b03831660248201526044810182905261140490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611a80565b505050565b6003546040516365b2489b60e01b8152600160048201526000602482018190526044820185905260648201849052916001600160a01b0316906365b2489b9083906084015b6020604051808303818588803b15801561146757600080fd5b505af115801561147b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114a09190612166565b9392505050565b60006114a083836000611b52565b60006114c2826000611409565b92915050565b6001600160a01b03828116600090815260076020908152604091829020825180840190935254928316808352600160a01b90930461ffff16908201529061150e57600080fd5b8051611526906001600160a01b038516906000611950565b805161153d906001600160a01b0385169084611950565b805160208201516040516365b2489b60e01b815261ffff6001831881166004830152909116602482015260448101849052600060648201526001600160a01b03909116906365b2489b90608401602060405180830381600087803b1580156115a457600080fd5b505af11580156115b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c69190612166565b6116056001600160a01b03841673e592427a0aece92de3edee1f18e0157c058615646000611950565b61162d6001600160a01b03841673e592427a0aece92de3edee1f18e0157c0586156484611950565b60408051610100810182526001600160a01b038516815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2602082015262ffffff8316918101919091523060608201526000906080810161168342600161227c565b81526020808201869052600160408084019190915260006060938401819052815163414bf38960e01b815285516001600160a01b03908116600483015293860151841660248201529185015162ffffff16604483015292840151821660648201526080840151608482015260a084015160a482015260c084015160c482015260e084015190911660e48201529192509073e592427a0aece92de3edee1f18e0157c058615649063414bf3899061010401602060405180830381600087803b15801561174d57600080fd5b505af1158015611761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117859190612166565b604051632e1a7d4d60e01b81526004810182905290915073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b1580156117d557600080fd5b505af11580156117e9573d6000803e3d6000fd5b505050505050505050565b6001600160a01b03811661180757600080fd5b604080516002808252606082018352600092602083019080368337019050509050838160008151811061183c5761183c612150565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160018151811061188457611884612150565b6001600160a01b0392831660209182029290920101526118a8908516836000611950565b6118bc6001600160a01b0385168385611950565b6001600160a01b0382166318cbafe584600184306118da428461227c565b6040518663ffffffff1660e01b81526004016118fa9594939291906122aa565b600060405180830381600087803b15801561191457600080fd5b505af1158015611928573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a0f919081019061231b565b8015806119d95750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561199f57600080fd5b505afa1580156119b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d79190612166565b155b611a445760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610585565b6040516001600160a01b03831660248201526044810182905261140490849063095ea7b360e01b906064016113cd565b60006114a08383611bfb565b6000611ad5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611c449092919063ffffffff16565b8051909150156114045780806020019051810190611af391906123d9565b6114045760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610585565b6004805460405163ddc1f59d60e01b815260019281019290925260006024830181905260448301869052606483018490526001600160a01b038581166084850152909291169063ddc1f59d9060a401602060405180830381600087803b158015611bbb57600080fd5b505af1158015611bcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bf39190612166565b949350505050565b6002546040516365b2489b60e01b8152600060048201819052600160248301526044820185905260648201849052916001600160a01b0316906365b2489b90859060840161144e565b6060611bf3848460008585843b611c9d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610585565b600080866001600160a01b03168587604051611cb991906123f6565b60006040518083038185875af1925050503d8060008114611cf6576040519150601f19603f3d011682016040523d82523d6000602084013e611cfb565b606091505b5091509150611d0b828286611d16565b979650505050505050565b60608315611d255750816114a0565b825115611d355782518084602001fd5b8160405162461bcd60e51b81526004016105859190612412565b60008083601f840112611d6157600080fd5b50813567ffffffffffffffff811115611d7957600080fd5b6020830191508360208260051b8501011115611d9457600080fd5b9250929050565b6001600160a01b0381168114611db057600080fd5b50565b600080600060408486031215611dc857600080fd5b833567ffffffffffffffff811115611ddf57600080fd5b611deb86828701611d4f565b9094509250506020840135611dff81611d9b565b809150509250925092565b60008060008060608587031215611e2057600080fd5b843567ffffffffffffffff811115611e3757600080fd5b611e4387828801611d4f565b90989097506020870135966040013595509350505050565b600060208284031215611e6d57600080fd5b81356114a081611d9b565b6000808284036060811215611e8c57600080fd5b8335611e9781611d9b565b92506040601f1982011215611eab57600080fd5b506020830190509250929050565b600080600060408486031215611ece57600080fd5b83359250602084013567ffffffffffffffff811115611eec57600080fd5b611ef886828701611d4f565b9497909650939450505050565b8015158114611db057600080fd5b8035611f1e81611f05565b919050565b60008060408385031215611f3657600080fd5b8235611f4181611f05565b946020939093013593505050565b60008060008060608587031215611f6557600080fd5b8435611f7081611d9b565b935060208501359250604085013567ffffffffffffffff80821115611f9457600080fd5b818701915087601f830112611fa857600080fd5b813581811115611fb757600080fd5b886020828501011115611fc957600080fd5b95989497505060200194505050565b60005b83811015611ff3578181015183820152602001611fdb565b838111156106c65750506000910152565b6000815180845261201c816020860160208601611fd8565b601f01601f19169290920160200192915050565b8215158152604060208201526000611bf36040830184612004565b60008060008060008060008060008060006101208c8e03121561206d57600080fd5b8b359a5067ffffffffffffffff8060208e0135111561208b57600080fd5b61209b8e60208f01358f01611d4f565b909b50995060408d01358110156120b157600080fd5b506120c28d60408e01358e01611d4f565b909850965060608c0135955060808c01356120dc81611f05565b945060a08c01356120ec81611f05565b93506120fa60c08d01611f13565b925060e08c013591506101008c013590509295989b509295989b9093969950565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561217857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156121a9576121a961217f565b5060010190565b6000828210156121c2576121c261217f565b500390565b81356121d281611d9b565b81546001600160a01b031981166001600160a01b03929092169182178355602084013561ffff8116811461220557600080fd5b6001600160b01b03199190911690911760a09190911b61ffff60a01b1617905550565b838152604060208201819052810182905260006001600160fb1b0383111561224f57600080fd5b8260051b8085606085013760009201606001918252509392505050565b8183823760009101908152919050565b6000821982111561228f5761228f61217f565b500190565b634e487b7160e01b600052604160045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122fa5784516001600160a01b0316835293830193918301916001016122d5565b50506001600160a01b03969096166060850152505050608001529392505050565b6000602080838503121561232e57600080fd5b825167ffffffffffffffff8082111561234657600080fd5b818501915085601f83011261235a57600080fd5b81518181111561236c5761236c612294565b8060051b604051601f19603f8301168101818110858211171561239157612391612294565b6040529182528482019250838101850191888311156123af57600080fd5b938501935b828510156123cd578451845293850193928501926123b4565b98975050505050505050565b6000602082840312156123eb57600080fd5b81516114a081611f05565b60008251612408818460208701611fd8565b9190910192915050565b6020815260006114a0602083018461200456fea2646970667358221220ad8ef4321004205492aa6821144bb062fa4e7d37d3cbe6bb816fbaf4b6e4c70c64736f6c63430008090033

Deployed Bytecode

0x6080604052600436106101a05760003560e01c806388dcc3fe116100ec578063b61d27f61161008a578063d8697a5011610064578063d8697a50146104de578063ddd2c684146104f3578063f1d5253e14610513578063f2fde38b1461053b57600080fd5b8063b61d27f614610468578063c70eddff14610496578063d67edf59146104be57600080fd5b8063961deefe116100c6578063961deefe14610400578063ab6e25cd14610213578063b1b6665214610428578063b3950de11461044857600080fd5b806388dcc3fe1461039a5780638da5cb5b146103ba57806393516676146103d857600080fd5b806360c3a38c11610159578063715018a611610133578063715018a6146103205780637506ceb9146103355780637ec5508a1461035d5780638757b15b1461038557600080fd5b806360c3a38c146102e3578063657428a3146102f85780636acabc2e146102e357600080fd5b80630960b7fa146101ac57806315d89591146101f15780631857b30814610213578063316f244d146102365780633f3e37e41461025e578063455c3eb51461027e57600080fd5b366101a757005b600080fd5b3480156101b857600080fd5b506101d4734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b81565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101fd57600080fd5b5061021161020c366004611db3565b61055b565b005b34801561021f57600080fd5b50610228600081565b6040519081526020016101e8565b34801561024257600080fd5b506101d47392e6e43f99809df84ed2d533e1fd8017eb966ee281565b34801561026a57600080fd5b50610211610279366004611e0a565b6106cc565b34801561028a57600080fd5b506102c1610299366004611e5b565b6007602052600090815260409020546001600160a01b03811690600160a01b900461ffff1682565b604080516001600160a01b03909316835261ffff9091166020830152016101e8565b3480156102ef57600080fd5b50610228600181565b34801561030457600080fd5b506101d473d533a949740bb3306d119cc777fa900ba034cd5281565b34801561032c57600080fd5b50610211610a16565b34801561034157600080fd5b506101d4739d0464996170c6b9e75eed71c68b99ddedf279e881565b34801561036957600080fd5b506101d47362b9c7356a2dc64a1969e19c23e4f579f9810aa781565b34801561039157600080fd5b50610211610a8a565b3480156103a657600080fd5b506102116103b5366004611e78565b610cc3565b3480156103c657600080fd5b506000546001600160a01b03166101d4565b3480156103e457600080fd5b506103ed600181565b604051600f9190910b81526020016101e8565b34801561040c57600080fd5b506101d473b576491f1e6e5e62f1d8f26062ee822b40b0e0d481565b34801561043457600080fd5b50610211610443366004611eb9565b610daf565b34801561045457600080fd5b50610211610463366004611f23565b610e4b565b34801561047457600080fd5b50610488610483366004611f4f565b611103565b6040516101e8929190612030565b3480156104a257600080fd5b506101d4733fe65692bfcd0e6cf84cb1e7d24108e434a7587e81565b3480156104ca57600080fd5b506102116104d936600461204b565b6111a1565b3480156104ea57600080fd5b506103ed600081565b3480156104ff57600080fd5b5061021161050e366004611e5b565b611205565b34801561051f57600080fd5b506101d4738301ae4fc9c624d1d396cbdaa1ed877821d7c51181565b34801561054757600080fd5b50610211610556366004611e5b565b6112b7565b6000546001600160a01b0316331461058e5760405162461bcd60e51b81526004016105859061211b565b60405180910390fd5b6001600160a01b0381166105a157600080fd5b60005b828110156106c65760008484838181106105c0576105c0612150565b90506020020160208101906105d59190611e5b565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a082319060240160206040518083038186803b15801561061a57600080fd5b505afa15801561062e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106529190612166565b90506106686001600160a01b03831685836113a1565b604080516001600160a01b038085168252861660208201529081018290527fe28922b10f7326500f50066b3f57b135330212ae30fe5332cd9200e09917ecad9060600160405180910390a15050806106bf90612195565b90506105a4565b50505050565b6000546001600160a01b031633146106f65760405162461bcd60e51b81526004016105859061211b565b60005b8381101561098057600085858381811061071557610715612150565b905060200201602081019061072a9190611e5b565b6040516370a0823160e01b81523060048201529091506000906001600160a01b038316906370a082319060240160206040518083038186803b15801561076f57600080fd5b505afa158015610783573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a79190612166565b9050600181116107b8575050610970565b6107c36001826121b0565b90506001600160a01b03821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2141561085457604051632e1a7d4d60e01b81526004810182905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b15801561083757600080fd5b505af115801561084b573d6000803e3d6000fd5b50505050610966565b6001600160a01b03821673d533a949740bb3306d119cc777fa900ba034cd52141561088a57610884816000611409565b50610966565b6001600160a01b0382167362b9c7356a2dc64a1969e19c23e4f579f9810aa714156108c1576108846108bc82306114a7565b6114b5565b6001600160a01b038216734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b14156108ed575050610970565b60078516600481106109085761090383836114c8565b610964565b6002811061093f576109038383600660006109246002876121b0565b815260208101919091526040016000205462ffffff166115dc565b60008181526005602052604090205461096490849084906001600160a01b03166117f4565b505b600385901c945050505b61097981612195565b90506106f9565b50604051600090329083908381818185875af1925050503d80600081146109c3576040519150601f19603f3d011682016040523d82523d6000602084013e6109c8565b606091505b5050905080610a0f5760405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152606401610585565b5050505050565b6000546001600160a01b03163314610a405760405162461bcd60e51b81526004016105859061211b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ab45760405162461bcd60e51b81526004016105859061211b565b610ae873d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c5116000611950565b610b1d73d533a949740bb3306d119cc777fa900ba034cd52738301ae4fc9c624d1d396cbdaa1ed877821d7c511600019611950565b610b5173d533a949740bb3306d119cc777fa900ba034cd52739d0464996170c6b9e75eed71c68b99ddedf279e86000611950565b610b8673d533a949740bb3306d119cc777fa900ba034cd52739d0464996170c6b9e75eed71c68b99ddedf279e8600019611950565b610bba7362b9c7356a2dc64a1969e19c23e4f579f9810aa7739d0464996170c6b9e75eed71c68b99ddedf279e86000611950565b610bef7362b9c7356a2dc64a1969e19c23e4f579f9810aa7739d0464996170c6b9e75eed71c68b99ddedf279e8600019611950565b610c23734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b7335a398425d9f1029021a92bc3d2557d42c8588d76000611950565b610c58734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b7335a398425d9f1029021a92bc3d2557d42c8588d7600019611950565b610c8c734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b73f38a67da7a3a12aa12a9981ae6a79c0fdddd71ab6000611950565b610cc1734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b73f38a67da7a3a12aa12a9981ae6a79c0fdddd71ab600019611950565b565b6000546001600160a01b03163314610ced5760405162461bcd60e51b81526004016105859061211b565b6001600160a01b03821660009081526007602052604090208190610d1182826121c7565b50610d369050610d246020830183611e5b565b6001600160a01b038416906000611950565b610d59610d466020830183611e5b565b6001600160a01b03841690600019611950565b7f8fca21c5d308d0debabdfc9dddde40c80ec0ad3e7fac4a6e5f72f038c3aef82d82610d886020840184611e5b565b604080516001600160a01b0393841681529290911660208301520160405180910390a15050565b6000546001600160a01b03163314610dd95760405162461bcd60e51b81526004016105859061211b565b6040516318bbb46f60e01b81527345f97d07dab04b21f36fa3b1149c35e316b35d03906318bbb46f90610e1490869086908690600401612228565b600060405180830381600087803b158015610e2e57600080fd5b505af1158015610e42573d6000803e3d6000fd5b50505050505050565b6000546001600160a01b03163314610e755760405162461bcd60e51b81526004016105859061211b565b47610e81816000611a74565b506040516370a0823160e01b8152306004820152600090734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b906370a082319060240160206040518083038186803b158015610ecf57600080fd5b505afa158015610ee3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f079190612166565b905083610fcd5760405163ddc1f59d60e01b81526001600482015260006024820181905260448201839052606482018590527345f97d07dab04b21f36fa3b1149c35e316b35d0360848301529073f38a67da7a3a12aa12a9981ae6a79c0fdddd71ab9063ddc1f59d9060a401602060405180830381600087803b158015610f8d57600080fd5b505af1158015610fa1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc59190612166565b905050611096565b828110156110085760405162461bcd60e51b8152602060048201526008602482015267736c69707061676560c01b6044820152606401610585565b604051636117ca0360e11b8152600481018290527345f97d07dab04b21f36fa3b1149c35e316b35d03602482015260006044820181905260648201527335a398425d9f1029021a92bc3d2557d42c8588d79063c22f940690608401600060405180830381600087803b15801561107d57600080fd5b505af1158015611091573d6000803e3d6000fd5b505050505b7345f97d07dab04b21f36fa3b1149c35e316b35d036001600160a01b0316630c51dde46040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156110e557600080fd5b505af11580156110f9573d6000803e3d6000fd5b5050505050505050565b600080546060906001600160a01b031633146111315760405162461bcd60e51b81526004016105859061211b565b600080876001600160a01b031687878760405161114f92919061226c565b60006040518083038185875af1925050503d806000811461118c576040519150601f19603f3d011682016040523d82523d6000602084013e611191565b606091505b5090999098509650505050505050565b6000546001600160a01b031633146111cb5760405162461bcd60e51b81526004016105859061211b565b84156111dc576111dc8b8b8b610daf565b6111e8888888846106cc565b82156111f8576111f88483610e4b565b5050505050505050505050565b6000546001600160a01b0316331461122f5760405162461bcd60e51b81526004016105859061211b565b6001600160a01b03808216600081815260076020526040812054611254931690611950565b6001600160a01b038116600081815260076020908152604080832080546001600160b01b03191690558051938452908301919091527f8fca21c5d308d0debabdfc9dddde40c80ec0ad3e7fac4a6e5f72f038c3aef82d910160405180910390a150565b6000546001600160a01b031633146112e15760405162461bcd60e51b81526004016105859061211b565b6001600160a01b0381166113465760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610585565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040516001600160a01b03831660248201526044810182905261140490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611a80565b505050565b6003546040516365b2489b60e01b8152600160048201526000602482018190526044820185905260648201849052916001600160a01b0316906365b2489b9083906084015b6020604051808303818588803b15801561146757600080fd5b505af115801561147b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114a09190612166565b9392505050565b60006114a083836000611b52565b60006114c2826000611409565b92915050565b6001600160a01b03828116600090815260076020908152604091829020825180840190935254928316808352600160a01b90930461ffff16908201529061150e57600080fd5b8051611526906001600160a01b038516906000611950565b805161153d906001600160a01b0385169084611950565b805160208201516040516365b2489b60e01b815261ffff6001831881166004830152909116602482015260448101849052600060648201526001600160a01b03909116906365b2489b90608401602060405180830381600087803b1580156115a457600080fd5b505af11580156115b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c69190612166565b6116056001600160a01b03841673e592427a0aece92de3edee1f18e0157c058615646000611950565b61162d6001600160a01b03841673e592427a0aece92de3edee1f18e0157c0586156484611950565b60408051610100810182526001600160a01b038516815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2602082015262ffffff8316918101919091523060608201526000906080810161168342600161227c565b81526020808201869052600160408084019190915260006060938401819052815163414bf38960e01b815285516001600160a01b03908116600483015293860151841660248201529185015162ffffff16604483015292840151821660648201526080840151608482015260a084015160a482015260c084015160c482015260e084015190911660e48201529192509073e592427a0aece92de3edee1f18e0157c058615649063414bf3899061010401602060405180830381600087803b15801561174d57600080fd5b505af1158015611761573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117859190612166565b604051632e1a7d4d60e01b81526004810182905290915073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b1580156117d557600080fd5b505af11580156117e9573d6000803e3d6000fd5b505050505050505050565b6001600160a01b03811661180757600080fd5b604080516002808252606082018352600092602083019080368337019050509050838160008151811061183c5761183c612150565b60200260200101906001600160a01b031690816001600160a01b03168152505073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160018151811061188457611884612150565b6001600160a01b0392831660209182029290920101526118a8908516836000611950565b6118bc6001600160a01b0385168385611950565b6001600160a01b0382166318cbafe584600184306118da428461227c565b6040518663ffffffff1660e01b81526004016118fa9594939291906122aa565b600060405180830381600087803b15801561191457600080fd5b505af1158015611928573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a0f919081019061231b565b8015806119d95750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561199f57600080fd5b505afa1580156119b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d79190612166565b155b611a445760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610585565b6040516001600160a01b03831660248201526044810182905261140490849063095ea7b360e01b906064016113cd565b60006114a08383611bfb565b6000611ad5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611c449092919063ffffffff16565b8051909150156114045780806020019051810190611af391906123d9565b6114045760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610585565b6004805460405163ddc1f59d60e01b815260019281019290925260006024830181905260448301869052606483018490526001600160a01b038581166084850152909291169063ddc1f59d9060a401602060405180830381600087803b158015611bbb57600080fd5b505af1158015611bcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bf39190612166565b949350505050565b6002546040516365b2489b60e01b8152600060048201819052600160248301526044820185905260648201849052916001600160a01b0316906365b2489b90859060840161144e565b6060611bf3848460008585843b611c9d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610585565b600080866001600160a01b03168587604051611cb991906123f6565b60006040518083038185875af1925050503d8060008114611cf6576040519150601f19603f3d011682016040523d82523d6000602084013e611cfb565b606091505b5091509150611d0b828286611d16565b979650505050505050565b60608315611d255750816114a0565b825115611d355782518084602001fd5b8160405162461bcd60e51b81526004016105859190612412565b60008083601f840112611d6157600080fd5b50813567ffffffffffffffff811115611d7957600080fd5b6020830191508360208260051b8501011115611d9457600080fd5b9250929050565b6001600160a01b0381168114611db057600080fd5b50565b600080600060408486031215611dc857600080fd5b833567ffffffffffffffff811115611ddf57600080fd5b611deb86828701611d4f565b9094509250506020840135611dff81611d9b565b809150509250925092565b60008060008060608587031215611e2057600080fd5b843567ffffffffffffffff811115611e3757600080fd5b611e4387828801611d4f565b90989097506020870135966040013595509350505050565b600060208284031215611e6d57600080fd5b81356114a081611d9b565b6000808284036060811215611e8c57600080fd5b8335611e9781611d9b565b92506040601f1982011215611eab57600080fd5b506020830190509250929050565b600080600060408486031215611ece57600080fd5b83359250602084013567ffffffffffffffff811115611eec57600080fd5b611ef886828701611d4f565b9497909650939450505050565b8015158114611db057600080fd5b8035611f1e81611f05565b919050565b60008060408385031215611f3657600080fd5b8235611f4181611f05565b946020939093013593505050565b60008060008060608587031215611f6557600080fd5b8435611f7081611d9b565b935060208501359250604085013567ffffffffffffffff80821115611f9457600080fd5b818701915087601f830112611fa857600080fd5b813581811115611fb757600080fd5b886020828501011115611fc957600080fd5b95989497505060200194505050565b60005b83811015611ff3578181015183820152602001611fdb565b838111156106c65750506000910152565b6000815180845261201c816020860160208601611fd8565b601f01601f19169290920160200192915050565b8215158152604060208201526000611bf36040830184612004565b60008060008060008060008060008060006101208c8e03121561206d57600080fd5b8b359a5067ffffffffffffffff8060208e0135111561208b57600080fd5b61209b8e60208f01358f01611d4f565b909b50995060408d01358110156120b157600080fd5b506120c28d60408e01358e01611d4f565b909850965060608c0135955060808c01356120dc81611f05565b945060a08c01356120ec81611f05565b93506120fa60c08d01611f13565b925060e08c013591506101008c013590509295989b509295989b9093969950565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561217857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60006000198214156121a9576121a961217f565b5060010190565b6000828210156121c2576121c261217f565b500390565b81356121d281611d9b565b81546001600160a01b031981166001600160a01b03929092169182178355602084013561ffff8116811461220557600080fd5b6001600160b01b03199190911690911760a09190911b61ffff60a01b1617905550565b838152604060208201819052810182905260006001600160fb1b0383111561224f57600080fd5b8260051b8085606085013760009201606001918252509392505050565b8183823760009101908152919050565b6000821982111561228f5761228f61217f565b500190565b634e487b7160e01b600052604160045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122fa5784516001600160a01b0316835293830193918301916001016122d5565b50506001600160a01b03969096166060850152505050608001529392505050565b6000602080838503121561232e57600080fd5b825167ffffffffffffffff8082111561234657600080fd5b818501915085601f83011261235a57600080fd5b81518181111561236c5761236c612294565b8060051b604051601f19603f8301168101818110858211171561239157612391612294565b6040529182528482019250838101850191888311156123af57600080fd5b938501935b828510156123cd578451845293850193928501926123b4565b98975050505050505050565b6000602082840312156123eb57600080fd5b81516114a081611f05565b60008251612408818460208701611fd8565b9190910192915050565b6020815260006114a0602083018461200456fea2646970667358221220ad8ef4321004205492aa6821144bb062fa4e7d37d3cbe6bb816fbaf4b6e4c70c64736f6c63430008090033

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.