S Price: $0.520176 (+6.86%)

Contract

0xde44cDac7a4CEdA7B702573e0C8589D79702569b

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Pause52848442025-01-24 17:45:375 days ago1737740737IN
0xde44cDac...79702569b
0 S0.0040777555
Unpause52846242025-01-24 17:42:485 days ago1737740568IN
0xde44cDac...79702569b
0 S0.0090303455
Pause52846122025-01-24 17:42:375 days ago1737740557IN
0xde44cDac...79702569b
0 S0.0040777555
Harvest52252312025-01-24 6:17:156 days ago1737699435IN
0xde44cDac...79702569b
0 S0.0216246255
Harvest51994622025-01-24 0:58:506 days ago1737680330IN
0xde44cDac...79702569b
0 S0.0220566555
Harvest51583542025-01-23 18:20:346 days ago1737656434IN
0xde44cDac...79702569b
0 S0.0220566555
Harvest51263062025-01-23 13:26:296 days ago1737638789IN
0xde44cDac...79702569b
0 S0.024061860
Harvest51037452025-01-23 9:23:317 days ago1737624211IN
0xde44cDac...79702569b
0 S0.0220566555
Harvest50785782025-01-23 4:17:137 days ago1737605833IN
0xde44cDac...79702569b
0 S0.0229971555
Harvest50646932025-01-23 1:30:447 days ago1737595844IN
0xde44cDac...79702569b
0 S0.0239286355
Harvest50352022025-01-22 20:55:467 days ago1737579346IN
0xde44cDac...79702569b
0 S0.0231421355
Harvest50139302025-01-22 17:25:187 days ago1737566718IN
0xde44cDac...79702569b
0 S0.0252459660
Harvest49998742025-01-22 15:28:247 days ago1737559704IN
0xde44cDac...79702569b
0 S0.0252459660
Harvest42154872025-01-17 1:26:1213 days ago1737077172IN
0xde44cDac...79702569b
0 S0.04628426110
Harvest41472132025-01-16 12:46:5613 days ago1737031616IN
0xde44cDac...79702569b
0 S0.04628426110
Harvest41433552025-01-16 12:06:1913 days ago1737029179IN
0xde44cDac...79702569b
0 S0.04628426110
Harvest41360332025-01-16 10:48:0913 days ago1737024489IN
0xde44cDac...79702569b
0 S0.04628426110
Harvest41303452025-01-16 9:42:5014 days ago1737020570IN
0xde44cDac...79702569b
0 S0.04628426110
Harvest41300172025-01-16 9:39:2414 days ago1737020364IN
0xde44cDac...79702569b
0 S0.04628426110
Harvest41297572025-01-16 9:36:4414 days ago1737020204IN
0xde44cDac...79702569b
0 S0.04628426110
Harvest41295472025-01-16 9:33:5214 days ago1737020032IN
0xde44cDac...79702569b
0 S0.05004626110
Set Vault41290312025-01-16 9:27:2014 days ago1737019640IN
0xde44cDac...79702569b
0 S0.00364408110

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Blacksail_Shadow_StrategyV2

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 20 : Blacksail_Shadow_StrategyV2.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "../interfacing/shadow/IVoter.sol";
import "../interfacing/shadow/IGauge.sol";
import "../interfacing/shadow/IRouter.sol";
import "../interfacing/shadow/IPair.sol";

contract Blacksail_Shadow_StrategyV2 is Ownable, Pausable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    // Tokens
    address public constant native_token = address(0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38);
    address public lp0;
    address public lp1;
    address public reward_token;
    address public xReward_token;
    address public staking_token;

    // Fee structure
    uint256 public WITHDRAWAL_MAX = 100000;
    uint256 public WITHDRAW_FEE = 100;
    uint256 public DIVISOR = 1000;
    uint256 public CALL_FEE = 100;
    uint256 public FEE_BATCH = 900;
    uint256 public PLATFORM_FEE = 45;

    // Third Party Addresses
    address public rewardPool;
    address public xRewardPool;
    address public unirouter;

    // Information
    uint256 public lastHarvest;
    bool public harvestOnDeposit;

    // Platform Addresses
    address public vault;
    address public treasury;

    // Routes
    address[] public rewards;
    uint256 public slippageTolerance;

    event Deposit(uint256 amount);
    event Withdraw(uint256 amount);
    event Harvest(address indexed harvester);
    event ChargeFees(uint256 callFee, uint256 protocolFee);
    event SetVault(address indexed newVault);
    event SetWithdrawalFee(uint256 newFee);
    event SetSlippageTolerance(uint256 newTolerance);

    /**
     *
     * This constructor:
     * - Sets up the core token and contract addresses for staking, rewards, and routing.
     * - Enables or disables harvest-on-deposit, with a default withdrawal fee of 0 if enabled.
     * - Defines the reward-to-native token conversion path for liquidity and fee operations.
     * - Grants initial token allowances to external contracts. */

    constructor(
        address _staking_token,
        address _rewardPool,
        address _reward_token,
        address _xRewardPool,
        address _xReward_token,
        address _unirouter,
        bool _harvestOnDeposit,
        address _treasury
    ) Ownable(msg.sender) {
        staking_token = _staking_token;
        rewardPool = _rewardPool;
        xRewardPool = _xRewardPool;
        xReward_token = _xReward_token;
        unirouter = _unirouter;
        treasury = _treasury;

        lp0 = IPair(staking_token).token0();
        lp1 = IPair(staking_token).token1();

        harvestOnDeposit = _harvestOnDeposit;

        if (harvestOnDeposit) {
            setWithdrawalFee(0);
        }

        reward_token = _reward_token;

        rewards.push(reward_token);
        _giveAllowances();
    }

    /** @dev Sets the vault connected to this strategy */
    function setVault(address _vault) external onlyOwner {
        require(isContract(_vault), "Vault must be a contract");
        vault = _vault;
        emit SetVault(_vault);
    }

    /** @dev Function to synchronize balances before new user deposit. Can be overridden in the strategy. */
    function beforeDeposit() external virtual {
        if (harvestOnDeposit) {
            require(msg.sender == vault, "Vault deposit only");
            _harvest(address(this));
        }
    }

    /** @dev Deposits funds into third party farm */
    function deposit() public onlyAuthorized whenNotPaused {
        _deposit();
    }

    function _deposit() internal {
        uint256 staking_balance = IERC20(staking_token).balanceOf(
            address(this)
        );

        if (staking_balance > 0) {
            IGauge(rewardPool).deposit(staking_balance);
        }
    }

    /**
     * @dev Withdraws a specified amount of staking tokens to the vault.
     * Handles balance retrieval from the reward pool if needed and deducts withdrawal fees if applicable.
     *
     * @param _amount The amount of staking tokens to withdraw.
     *
     * Requirements:
     * - Can only be called by the vault.
     * - If not the owner and contract is not paused, a withdrawal fee is deducted unless `harvestOnDeposit` is enabled.
     *
     * Emits a {Withdraw} event with the updated strategy balance. */

    function withdraw(uint256 _amount) external nonReentrant {
        require(msg.sender == vault, "!vault");

        uint256 stakingBal = IERC20(staking_token).balanceOf(address(this));

        if (stakingBal < _amount) {
            IGauge(rewardPool).withdraw(_amount - stakingBal);
            stakingBal = IERC20(staking_token).balanceOf(address(this));
        }

        if (stakingBal > _amount) {
            stakingBal = _amount;
        }

        uint256 wFee = (stakingBal * WITHDRAW_FEE) / WITHDRAWAL_MAX;

        if (!paused() && !harvestOnDeposit) {
            stakingBal = stakingBal - wFee;
        }

        IERC20(staking_token).safeTransfer(vault, stakingBal);

        emit Withdraw(balanceOf());
    }

    /**
     * @dev Triggers the harvest process to compound earnings.
     * Internally calls `_harvest` to collect rewards, charge fees, add liquidity, and reinvest. */

    function harvest() external {
        require(
            !isContract(msg.sender) || msg.sender == vault,
            "!auth Contract Harvest"
        );
        _harvest(msg.sender);
    }

    /** @dev Compounds the strategy's earnings and charges fees */
    function _harvest(address caller) internal whenNotPaused {
        IGauge(rewardPool).getReward(address(this), rewards);
        uint256 rewardAmt = IERC20(reward_token).balanceOf(address(this));

        if (rewardAmt > 0) {
            chargeFees(caller);
            stakeX();
            addLiquidity();
            _deposit();
        }

        lastHarvest = block.timestamp;
        emit Harvest(msg.sender);
    }

    /** @dev This function converts all funds to WFTM, charges fees, and sends fees to respective accounts */
    function chargeFees(address caller) internal {
        uint256 toNative = (IERC20(reward_token).balanceOf(address(this)) * PLATFORM_FEE) / DIVISOR;

        IRouter.route[] memory routes = new IRouter.route[](1);

        routes[0].from = reward_token;
        routes[0].to = native_token;
        routes[0].stable = false;

        IRouter(unirouter).swapExactTokensForTokensSupportingFeeOnTransferTokens(toNative, 1, routes, address(this), block.timestamp);

        uint256 nativeBal = IERC20(native_token).balanceOf(address(this));

        uint256 callFeeAmount = (nativeBal * CALL_FEE) / DIVISOR;
        uint256 treasuryFee = nativeBal - callFeeAmount;

        if (caller != address(this)) {
            IERC20(native_token).safeTransfer(caller, callFeeAmount);
        }

        IERC20(native_token).safeTransfer(treasury, treasuryFee);

        emit ChargeFees(callFeeAmount, nativeBal);
    }

    function stakeX() internal {
        uint256 xBal = IERC20(xReward_token).balanceOf(address(this));
        if (xBal > 0) {
            IVoter(xRewardPool).deposit(xBal);
        }

        IVoter(xRewardPool).getReward();
    }

    /**
     * @dev Adds liquidity by converting native tokens to the deposit token and forwarding them to the ICHI Vault.
     *
     * - Checks for sufficient native token balance.
     * - Converts native tokens to the deposit token using the Uniswap V3 router if required.
     * - Approves the necessary allowances for the Uniswap V3 router.
     * - Forwards the converted deposit tokens to the ICHI Vault for staking.
     *
     * Requirements:
     * - The contract must have a positive balance of the native token. */

    function addLiquidity() internal {
        uint256 halfRewardBal = IERC20(reward_token).balanceOf(address(this)) / 2;

        IRouter.route[] memory route = new IRouter.route[](1);

        if (reward_token != lp0) {
            route[0].from = reward_token;
            route[0].to = lp0;
            route[0].stable = false;

            IRouter(unirouter).swapExactTokensForTokensSupportingFeeOnTransferTokens(halfRewardBal, 1, route, address(this), block.timestamp);
        }

        if (reward_token != lp1) {
            route[0].from = reward_token;
            route[0].to = lp1;
            route[0].stable = false;

            IRouter(unirouter).swapExactTokensForTokensSupportingFeeOnTransferTokens(halfRewardBal, 1, route, address(this), block.timestamp);
        }

        uint256 lp0b = IERC20(lp0).balanceOf(address(this));
        uint256 lp1b = IERC20(lp1).balanceOf(address(this));

        IRouter(unirouter).addLiquidity(lp0, lp1, false, lp0b, lp1b, 1, 1, address(this), block.timestamp);
    }

    /** @dev Determines the amount of reward in WFTM upon calling the harvest function */
    function harvestCallReward() public view returns (uint256) {
        return uint256(0);
    }

    /** @dev Sets harvest on deposit to @param _harvestOnDeposit */
    function setHarvestOnDeposit(bool _harvestOnDeposit) external onlyOwner {
        harvestOnDeposit = _harvestOnDeposit;

        if (harvestOnDeposit) {
            setWithdrawalFee(0);
        } else {
            setWithdrawalFee(10);
        }
    }

    /** @dev Returns the amount of rewards that are pending */
    function rewardsAvailable() public view returns (uint256) {
        return IGauge(rewardPool).earned(reward_token, address(this));
    }

    /** @dev calculate the total underlaying staking tokens held by the strat */
    function balanceOf() public view returns (uint256) {
        return balanceOfStakingToken() + balanceOfPool();
    }

    /** @dev it calculates how many staking tokens this contract holds */
    function balanceOfStakingToken() public view returns (uint256) {
        return IERC20(staking_token).balanceOf(address(this));
    }

    /** @dev it calculates how many staking tokens the strategy has working in the farm */
    function balanceOfPool() public view returns (uint256) {
        return IGauge(rewardPool).balanceOf(address(this));
    }

    /** @dev called as part of strat migration. Sends all the available funds back to the vault */
    function retireStrat() external {
        require(msg.sender == vault, "!vault");
        IGauge(rewardPool).withdraw(balanceOfPool());
        uint256 stakingBal = IERC20(staking_token).balanceOf(address(this));
        IERC20(staking_token).transfer(vault, stakingBal);
    }

    /** @dev Pauses the strategy contract */
    function pause() public onlyOwner {
        _pause();
        _removeAllowances();
    }

    /** @dev Unpauses the strategy contract */
    function unpause() external onlyOwner {
        _unpause();
        _giveAllowances();
        _deposit();
    }

    /** @dev Gives allowances to spenders */
    function _giveAllowances() internal {
        IERC20(staking_token).approve(rewardPool, type(uint256).max);
        IERC20(native_token).approve(unirouter, type(uint256).max);
        IERC20(reward_token).approve(unirouter, type(uint256).max);
        IERC20(xReward_token).approve(xRewardPool, type(uint256).max);
        IERC20(lp0).approve(unirouter, type(uint256).max);
        IERC20(lp1).approve(unirouter, type(uint256).max);
    }

    /** @dev Removes allowances to spenders */
    function _removeAllowances() internal {
        IERC20(staking_token).approve(rewardPool, 0);
        IERC20(native_token).approve(unirouter, 0);
        IERC20(reward_token).approve(unirouter, 0);
        IERC20(xReward_token).approve(xRewardPool, 0);
        IERC20(lp0).approve(unirouter, 0);
        IERC20(lp1).approve(unirouter, 0);
    }

    /**
     * @dev Sets the withdrawal fee for the strategy.
     *
     * - Ensures that the fee does not exceed 100 (representing 1%).
     * - Updates the `WITHDRAW_FEE` variable with the new fee value.
     *
     * Requirements:
     * - `fee` must be less than or equal to 100.
     *
     * @param fee The new withdrawal fee (scaled by 100,000 for precision). */

    function setWithdrawalFee(uint256 fee) internal {
        require(fee <= 100, "Fee too high");

        WITHDRAW_FEE = fee;
        emit SetWithdrawalFee(fee);
    }

    function delegateVotingPower(address delegatee) external onlyOwner {
        IVoter(xRewardPool).delegate(delegatee);
    }

    /**
     * @dev Allows the contract owner to set the slippage tolerance for token swaps.
     * This value is used to calculate the minimum acceptable output amount in swaps,
     * helping to mitigate the risks of slippage and unfavorable price changes.
     *
     * Requirements:
     * - The caller must be the contract owner.
     * - The provided tolerance must be less than or equal to 1500 (representing a maximum of 15% slippage).
     *
     * Emits:
     * - A {SetSlippageTolerance} event indicating the updated slippage tolerance.
     *
     * @param _tolerance The new slippage tolerance value, scaled by 10,000 (e.g., 1500 = 15%).
     */
    function setSlippageTolerance(uint256 _tolerance) external onlyOwner {
        require(_tolerance <= 1500, "Invalid tolerance"); // Max 15%

        slippageTolerance = _tolerance;
        emit SetSlippageTolerance(slippageTolerance);
    }

    function sellL2Reward(IRouter.route[] memory routes) external onlyOwner {
        require(
            routes[0].from != reward_token && 
            routes[0].from != native_token && 
            routes[0].from != staking_token, 
            "!Allowed"
        );
        uint256 bal = IERC20(routes[0].from).balanceOf(address(this));
        IERC20(routes[0].from).approve(unirouter, bal);
    }

    function isContract(address account) internal view returns (bool) {
        return account.code.length > 0;
    }

    modifier onlyAuthorized() {
        require(
            msg.sender == vault || msg.sender == address(this),
            "Not authorized, only Vault or Strategy"
        );
        _;
    }
}

File 2 of 20 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

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

File 3 of 20 : draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC-20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC-721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC-1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

File 4 of 20 : IERC1363.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

File 5 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../utils/introspection/IERC165.sol";

File 6 of 20 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

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

File 7 of 20 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC-20
 * applications.
 */
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
    mapping(address account => uint256) private _balances;

    mapping(address account => mapping(address spender => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `value`.
     */
    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, value);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, value);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Skips emitting an {Approval} event indicating an allowance update. This is not
     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `value`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `value`.
     */
    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _transfer(from, to, value);
        return true;
    }

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
     * this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            _totalSupply += value;
        } else {
            uint256 fromBalance = _balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                _balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                _totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                _balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
     * true using the following override:
     *
     * ```solidity
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        _allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `value`.
     *
     * Does not update the allowance value in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Does not emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }
}

File 8 of 20 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC-20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

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

File 9 of 20 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

File 10 of 20 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 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 {
    /**
     * @dev An operation with an ERC-20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}

File 11 of 20 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)

pragma solidity ^0.8.20;

import {Errors} from "./Errors.sol";

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert Errors.InsufficientBalance(address(this).balance, amount);
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert Errors.FailedCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {Errors.FailedCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert Errors.InsufficientBalance(address(this).balance, value);
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

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

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
     * of an unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {Errors.FailedCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

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

File 12 of 20 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 13 of 20 : Errors.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of common custom errors used in multiple contracts
 *
 * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
 * It is recommended to avoid relying on the error API for critical functionality.
 *
 * _Available since v5.1._
 */
library Errors {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error InsufficientBalance(uint256 balance, uint256 needed);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedCall();

    /**
     * @dev The deployment failed.
     */
    error FailedDeployment();

    /**
     * @dev A necessary precompile is missing.
     */
    error MissingPrecompile(address);
}

File 14 of 20 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 15 of 20 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 16 of 20 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

File 17 of 20 : IGauge.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IGauge {

    event NotifyReward(
        address indexed from,
        address indexed reward,
        uint256 amount
    );

    event ClaimRewards(
        address indexed from,
        address indexed reward,
        uint256 amount
    );

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

    /// @notice returns an array with all the addresses of the rewards
    /// @return _rewards array of addresses for rewards
    function rewardsList() external view returns (address[] memory _rewards);

    /// @notice number of different rewards the gauge has facilitated that are 'active'
    /// @return _length the number of individual rewards
    function rewardsListLength() external view returns (uint256 _length);

    /// @notice returns the last time the reward was modified or periodFinish if the reward has ended
    /// @param token address of the token
    /// @return ltra last time reward applicable
    function lastTimeRewardApplicable(
        address token
    ) external view returns (uint256 ltra);

    /// @notice displays the data struct of rewards for a token
    /// @param token the address of the token
    /// @return data rewards struct
    function rewardData(
        address token
    ) external view returns (Reward memory data);

    /// @notice calculates the amount of tokens earned for an address
    /// @param token address of the token to check
    /// @param account address to check
    /// @return _reward amount of token claimable
    function earned(
        address token,
        address account
    ) external view returns (uint256 _reward);
    /// @notice claims rewards (shadow + any external LP Incentives)
    /// @param account the address to claim for
    /// @param tokens an array of the tokens to claim
    function getReward(address account, address[] calldata tokens) external;

    /// @notice claims all rewards and instant exits xshadow into shadow
    function getRewardAndExit(
        address account,
        address[] calldata tokens
    ) external;

    /// @notice calculates the token amounts earned per lp token
    /// @param token address of the token to check
    /// @return rpt reward per token
    function rewardPerToken(address token) external view returns (uint256 rpt);

    /// @notice deposit all LP tokens from msg.sender's wallet to the gauge
    function depositAll() external;
    /// @param recipient the address of who to deposit on behalf of
    /// @param amount the amount of LP tokens to withdraw
    function depositFor(address recipient, uint256 amount) external;

    /// @notice deposit LP tokens to the gauge
    /// @param amount the amount of LP tokens to withdraw
    function deposit(uint256 amount) external;

    /// @notice withdraws all fungible LP tokens from legacy gauges
    function withdrawAll() external;

    /// @notice withdraws fungible LP tokens from legacy gauges
    /// @param amount the amount of LP tokens to withdraw
    function withdraw(uint256 amount) external;

    /// @notice calculates how many tokens are left to be distributed
    /// @dev reduces per second
    /// @param token the address of the token
    function left(address token) external view returns (uint256);
    /// @notice add a reward to the whitelist
    /// @param _reward address of the reward
    function whitelistReward(address _reward) external;

    /// @notice remove rewards from the whitelist
    /// @param _reward address of the reward
    function removeRewardWhitelist(address _reward) external;

    /**
     * @notice amount must be greater than left() for the token, this is to prevent griefing attacks
     * @notice notifying rewards is completely permissionless
     * @notice if nobody registers for a newly added reward for the period it will remain in the contract indefinitely
     */
    function notifyRewardAmount(address token, uint256 amount) external;

    struct Reward {
        /// @dev tokens per second
        uint256 rewardRate;
        /// @dev 7 days after start
        uint256 periodFinish;
        uint256 lastUpdateTime;
        uint256 rewardPerTokenStored;
    }

    /// @notice checks if a reward is whitelisted
    /// @param reward the address of the reward
    /// @return true if the reward is whitelisted, false otherwise
    function isWhitelisted(address reward) external view returns (bool);
}

File 18 of 20 : IPair.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IPair {

    function token0() external view returns (address);
    function token1() external view returns (address);
}

File 19 of 20 : IRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IRouter {
    struct route {
        /// @dev token from
        address from;
        /// @dev token to
        address to;
        /// @dev is stable route
        bool stable;
    }

    /// @notice sorts the tokens to see what the expected LP output would be for token0 and token1 (A/B)
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @return token0 address of which becomes token0
    /// @return token1 address of which becomes token1
    function sortTokens(
        address tokenA,
        address tokenB
    ) external pure returns (address token0, address token1);

    /// @notice calculates the CREATE2 address for a pair without making any external calls
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @return pair address of the pair
    function pairFor(
        address tokenA,
        address tokenB,
        bool stable
    ) external view returns (address pair);

    /// @notice fetches and sorts the reserves for a pair
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @return reserveA get the reserves for tokenA
    /// @return reserveB get the reserves for tokenB
    function getReserves(
        address tokenA,
        address tokenB,
        bool stable
    ) external view returns (uint256 reserveA, uint256 reserveB);

    /// @notice performs chained getAmountOut calculations on any number of pairs
    /// @param amountIn the amount of tokens of routes[0] to swap
    /// @param routes the struct of the hops the swap should take
    /// @return amounts uint array of the amounts out
    function getAmountsOut(
        uint256 amountIn,
        route[] memory routes
    ) external view returns (uint256[] memory amounts);

    /// @notice performs chained getAmountOut calculations on any number of pairs
    /// @param amountIn amount of tokenIn
    /// @param tokenIn address of the token going in
    /// @param tokenOut address of the token coming out
    /// @return amount uint amount out
    /// @return stable if the curve used is stable or not
    function getAmountOut(
        uint256 amountIn,
        address tokenIn,
        address tokenOut
    ) external view returns (uint256 amount, bool stable);

    /// @notice performs calculations to determine the expected state when adding liquidity
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @param amountADesired amount of tokenA desired to be added
    /// @param amountBDesired amount of tokenB desired to be added
    /// @return amountA amount of tokenA added
    /// @return amountB amount of tokenB added
    /// @return liquidity liquidity value added
    function quoteAddLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint256 amountADesired,
        uint256 amountBDesired
    )
        external
        view
        returns (uint256 amountA, uint256 amountB, uint256 liquidity);

    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @param liquidity liquidity value to remove
    /// @return amountA amount of tokenA removed
    /// @return amountB amount of tokenB removed
    function quoteRemoveLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint256 liquidity
    ) external view returns (uint256 amountA, uint256 amountB);

    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @param amountADesired amount of tokenA desired to be added
    /// @param amountBDesired amount of tokenB desired to be added
    /// @param amountAMin slippage for tokenA calculated from this param
    /// @param amountBMin slippage for tokenB calculated from this param
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountA amount of tokenA used
    /// @return amountB amount of tokenB used
    /// @return liquidity amount of liquidity minted
    function addLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);

    /// @param token the address of token
    /// @param stable if the pair is using the stable curve
    /// @param amountTokenDesired desired amount for token
    /// @param amountTokenMin slippage for token
    /// @param amountETHMin minimum amount of ETH added (slippage)
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountToken amount of the token used
    /// @return amountETH amount of ETH used
    /// @return liquidity amount of liquidity minted
    function addLiquidityETH(
        address token,
        bool stable,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    )
        external
        payable
        returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @param amountADesired amount of tokenA desired to be added
    /// @param amountBDesired amount of tokenB desired to be added
    /// @param amountAMin slippage for tokenA calculated from this param
    /// @param amountBMin slippage for tokenB calculated from this param
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountA amount of tokenA used
    /// @return amountB amount of tokenB used
    /// @return liquidity amount of liquidity minted
    function addLiquidityAndStake(
        address tokenA,
        address tokenB,
        bool stable,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);

    /// @notice adds liquidity to a legacy pair using ETH, and stakes it into a gauge on "to's" behalf
    /// @param token the address of token
    /// @param stable if the pair is using the stable curve
    /// @param amountTokenDesired amount of token to be used
    /// @param amountTokenMin slippage of token
    /// @param amountETHMin slippage of ETH
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountA amount of tokenA used
    /// @return amountB amount of tokenB used
    /// @return liquidity amount of liquidity minted
    function addLiquidityETHAndStake(
        address token,
        bool stable,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    )
        external
        payable
        returns (uint256 amountA, uint256 amountB, uint256 liquidity);
    /// @param tokenA the address of tokenA
    /// @param tokenB the address of tokenB
    /// @param stable if the pair is using the stable curve
    /// @param liquidity amount of LP tokens to remove
    /// @param amountAMin slippage of tokenA
    /// @param amountBMin slippage of tokenB
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountA amount of tokenA used
    /// @return amountB amount of tokenB used
    function removeLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountA, uint256 amountB);
    /// @param token address of the token
    /// @param stable if the pair is using the stable curve
    /// @param liquidity liquidity tokens to remove
    /// @param amountTokenMin slippage of token
    /// @param amountETHMin slippage of ETH
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amountToken amount of token used
    /// @return amountETH amount of ETH used
    function removeLiquidityETH(
        address token,
        bool stable,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);
    /// @param amountIn amount to send ideally
    /// @param amountOutMin slippage of amount out
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        route[] memory routes,
        address to,
        uint deadline
    ) external returns (uint256[] memory amounts);
    /// @param amountOutMin slippage of token
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapExactETHForTokens(
        uint256 amountOutMin,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external payable returns (uint256[] memory amounts);
    /// @param amountOut amount of tokens to get out
    /// @param amountInMax max amount of tokens to put in to achieve amountOut (slippage)
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapTokensForExactETH(
        uint amountOut,
        uint amountInMax,
        route[] calldata routes,
        address to,
        uint deadline
    ) external returns (uint256[] memory amounts);
    /// @param amountIn amount of tokens to swap
    /// @param amountOutMin slippage of token
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapExactTokensForETH(
        uint256 amountIn,
        uint256 amountOutMin,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external returns (uint256[] memory amounts);
    /// @param amountOut exact amount out or revert
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    /// @return amounts amounts returned
    function swapETHForExactTokens(
        uint amountOut,
        route[] calldata routes,
        address to,
        uint deadline
    ) external payable returns (uint256[] memory amounts);

    /// @param amountIn token amount to swap
    /// @param amountOutMin slippage of token
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external;

    /// @param amountOutMin slippage of token
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint256 amountOutMin,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external payable;

    /// @param amountIn token amount to swap
    /// @param amountOutMin slippage of token
    /// @param routes the hops the swap should take
    /// @param to the address the liquidity tokens should be minted to
    /// @param deadline timestamp deadline
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        route[] calldata routes,
        address to,
        uint256 deadline
    ) external;

    /// @notice **** REMOVE LIQUIDITY (supporting fee-on-transfer tokens)****
    /// @param token address of the token
    /// @param stable if the swap curve is stable
    /// @param liquidity liquidity value (lp tokens)
    /// @param amountTokenMin slippage of token
    /// @param amountETHMin slippage of ETH
    /// @param to address to send to
    /// @param deadline timestamp deadline
    /// @return amountToken amount of token received
    /// @return amountETH amount of ETH received
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        bool stable,
        uint256 liquidity,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external returns (uint256 amountToken, uint256 amountETH);
}

File 20 of 20 : IVoter.sol
//SPDX-License-Identifier: MIT
pragma solidity 0.8.20;

interface IVoter {

    function delegate(address delegatee) external;
    function deposit(uint256 amount) external;
    function getReward() external;
    function withdraw(uint256 amount) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_staking_token","type":"address"},{"internalType":"address","name":"_rewardPool","type":"address"},{"internalType":"address","name":"_reward_token","type":"address"},{"internalType":"address","name":"_xRewardPool","type":"address"},{"internalType":"address","name":"_xReward_token","type":"address"},{"internalType":"address","name":"_unirouter","type":"address"},{"internalType":"bool","name":"_harvestOnDeposit","type":"bool"},{"internalType":"address","name":"_treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"callFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolFee","type":"uint256"}],"name":"ChargeFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"harvester","type":"address"}],"name":"Harvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newTolerance","type":"uint256"}],"name":"SetSlippageTolerance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newVault","type":"address"}],"name":"SetVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"SetWithdrawalFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"CALL_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DIVISOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_BATCH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PLATFORM_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWAL_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balanceOfPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balanceOfStakingToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"beforeDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegateVotingPower","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"harvestCallReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvestOnDeposit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastHarvest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lp0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lp1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"native_token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"retireStrat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reward_token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bool","name":"stable","type":"bool"}],"internalType":"struct IRouter.route[]","name":"routes","type":"tuple[]"}],"name":"sellL2Reward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_harvestOnDeposit","type":"bool"}],"name":"setHarvestOnDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tolerance","type":"uint256"}],"name":"setSlippageTolerance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"setVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"slippageTolerance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"staking_token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unirouter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"xRewardPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xReward_token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040818152346200064f576101008262003099803803809162000025828562000654565b8339810103126200064f576200003b826200068e565b916020926200004c8483016200068e565b936200005a8484016200068e565b62000068606085016200068e565b9562000077608086016200068e565b916200008660a087016200068e565b95620000a360e06200009b60c08401620006a3565b92016200068e565b983315620006375760009687549a888b519760018060a01b03809e819582948392338482167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08480a360ff60a01b1933169060018060a81b03191617905560018055620186a060075560646008556103e86009556064600a55610384600b55602d600c5516958160018060a01b03199a888c6006541617600655168a600d541617600d551688600e541617600e551686600554161760055581600f9a16868b5416178a5516846012541617601255630dfe168160e01b855260049486818781855afa9081156200042357918b889288948b91620005f3575b50168660025416176002558a519283809263d21220a760e01b82525afa908115620005e957908a9392918891620005a0575b50831684600354161760035560ff801960115416911515168091176011556200056e575b168082845416178355601354680100000000000000008110156200055b57600181018060135581101562000548576013865284862001918254161790558286600654169487600d54169087519863095ea7b360e01b92838b52858b015260001999868160249a8d8c8301528160449889925af1801562000423576200050c575b5080825416895190848252868201528a89820152868186818b73039e2fb66102314ce7b64ce5ce3e5183bc94ad385af1801562000423578a86888b8f8e968d96620004c3575b508783541690888a5416955197889687958d87528601528401525af1801562000423578a86888b8f8e968d966200047a575b5087600554169088600e5416955197889687958d87528601528401525af1801562000423578a86888b8f8e968d966200042d575b50876002541690888a5416955197889687958d87528601528401525af1801562000423579188999a9b9188999493620003d3575b508060035416925416998b519a8b97889687528601528401525af18015620003c95762000388575b83516129e79081620006b28239f35b82813d8311620003c1575b6200039f818362000654565b81010312620003be5750620003b490620006a3565b5038808062000379565b80fd5b503d62000393565b84513d84823e3d90fd5b80929450889193959697983d83116200041b575b620003f3818362000654565b810103126200041757918796959493916200040f8a94620006a3565b503862000351565b8880fd5b503d620003e7565b8a513d8a823e3d90fd5b9650505050505081813d831162000472575b6200044b818362000654565b810103126200046e57868a86888b8f620004668f97620006a3565b50386200031d565b8780fd5b503d6200043f565b9650505050505081813d8311620004bb575b62000498818362000654565b810103126200046e57868a86888b8f620004b38f97620006a3565b5038620002e9565b503d6200048c565b9650505050505081813d831162000504575b620004e1818362000654565b810103126200046e57868a86888b8f620004fc8f97620006a3565b5038620002b7565b503d620004d5565b8681813d831162000540575b62000524818362000654565b810103126200046e576200053890620006a3565b503862000271565b503d62000518565b634e487b7160e01b865260328452602486fd5b634e487b7160e01b865260418452602486fd5b856008557f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af858951888152a1620001f1565b8092939450878092503d8311620005e1575b620005be818362000654565b81010312620005dd579089620005d68194936200068e565b90620001cd565b8680fd5b503d620005b2565b89513d89823e3d90fd5b93929450505081813d83116200062f575b62000610818362000654565b810103126200046e5785918b6200062889936200068e565b386200019b565b503d62000604565b8851631e4fbdf760e01b815260006004820152602490fd5b600080fd5b601f909101601f19168101906001600160401b038211908210176200067857604052565b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036200064f57565b519081151582036200064f5756fe608080604052600436101561001357600080fd5b600090813560e01c908163025e30b01461251e5750806309746324146124f55780630e8fbb5a146124535780631158808614612438578063117da1ee146123a7578063171d21891461238b578063257ae0de146123625780632638c09e1461233957806327ced5371461230a5780632dc7d74c146122e15780632e1a7d4d146120225780633410fe6e1461200457806334fbc9a114611fe65780633f4ba83a14611cff5780634641257d1461157957806354518b1a1461155b578063573fef0a14610de15780635ac7f47914610db85780635c975abb14610d9357806361d027b314610d6a57806364f37ec414610d4157806366666aa914610d185780636817031b14610c59578063715018a614610bff578063722713f714610be45780637b83fc1d14610bbb5780637ff8f1e914610b985780638456cb59146109575780638912cb8b146109345780638da5cb5b1461090d578063951d6d20146108ef5780639bff5ddb146108d1578063a64a3e931461068a578063d03153aa1461066c578063d0e30db0146105cb578063e7a7250a14610530578063f1a392da14610512578063f2fde38b14610482578063f301af4214610426578063f3ff955a146103ab578063fb6177871461021e5763fbfa77cf146101ef57600080fd5b3461021b578060031936011261021b5760115460405160089190911c6001600160a01b03168152602090f35b80fd5b503461021b578060031936011261021b5760018060a01b036102488160115460081c1633146126c1565b8181600d541661025661295b565b813b156103a7578291602483926040519485938492632e1a7d4d60e01b845260048401525af1801561039c57610384575b505080600654166040516370a0823160e01b81523060048201526020928382602481865afa9081156103795784928692610341575b5060115460405163a9059cbb60e01b81526001600160a01b0360089290921c9092161660048201526024810191909152918290818681604481015b03925af1801561033657610309578280f35b8161032892903d1061032f575b6103208183612594565b810190612999565b5038808280f35b503d610316565b6040513d85823e3d90fd5b8381949293503d8311610372575b6103598183612594565b8101031261036d57905183916102f76102bc565b600080fd5b503d61034f565b6040513d87823e3d90fd5b61038d90612564565b610398578138610287565b5080fd5b6040513d84823e3d90fd5b8280fd5b503461021b57602036600319011261021b57806103c661253a565b6103ce6125b6565b600e546001600160a01b039081169190823b1561042157602484928360405195869485936317066a5760e21b85521660048401525af1801561039c576104115750f35b61041a90612564565b61021b5780f35b505050fd5b503461021b57602036600319011261021b576004356013548110156103985760139091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09001546040516001600160a01b039091168152602090f35b503461021b57602036600319011261021b5761049c61253a565b6104a46125b6565b6001600160a01b039081169081156104f957600054826bffffffffffffffffffffffff60a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b604051631e4fbdf760e01b815260048101849052602490fd5b503461021b578060031936011261021b576020601054604051908152f35b503461021b578060031936011261021b5760018060a01b0390602082600d5416926004541660446040518095819363211dc32d60e01b835260048301523060248301525afa9081156105bf579061058d575b602090604051908152f35b506020813d82116105b7575b816105a660209383612594565b8101031261036d5760209051610582565b3d9150610599565b604051903d90823e3d90fd5b503461021b578060031936011261021b576011543360089190911c6001600160a01b0316148015610663575b1561060f576106046125e2565b61060c612603565b80f35b60405162461bcd60e51b815260206004820152602660248201527f4e6f7420617574686f72697a65642c206f6e6c79205661756c74206f7220537460448201526572617465677960d01b6064820152608490fd5b503033146105f7565b503461021b578060031936011261021b576020601454604051908152f35b503461021b576020806003193601126103985760043567ffffffffffffffff8082116108cd57366023830112156108cd5781600401359081116108b757604051916106da848360051b0184612594565b81835283830160246060809402830101913683116108b357602401905b828210610860575050505061070a6125b6565b6001600160a01b03908161071d82612826565b5151168260045416141580610836575b8061081c575b156107ec57808383610746602494612826565b515116604051938480926370a0823160e01b82523060048301525afa90811561037957849286926107bb575b5092806107816102f795612826565b51511690600f54168660405180968195829463095ea7b360e01b84526004840160209093929193604081019460018060a01b031681520152565b8381949293503d83116107e5575b6107d38183612594565b8101031261036d579051839183610772565b503d6107c9565b60405162461bcd60e51b815260048101849052600860248201526708505b1b1bddd95960c21b6044820152606490fd5b508161082782612826565b51511682600654161415610733565b5073039e2fb66102314ce7b64ce5ce3e5183bc94ad388261085683612826565b515116141561072d565b83823603126108b3576040519061087682612578565b61087f83612550565b825261088c878401612550565b87830152604083013590811515820361036d578288926040889501528152019101906106f7565b8680fd5b634e487b7160e01b600052604160045260246000fd5b8380fd5b503461021b578060031936011261021b576020600854604051908152f35b503461021b578060031936011261021b576020600a54604051908152f35b503461021b578060031936011261021b57546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b57602060ff601154166040519015158152f35b503461021b578060031936011261021b576109706125b6565b6109786125e2565b805460ff60a01b1916600160a01b1781556040513381526020907f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258908290a160018060a01b03828160065416918181600d541660405163095ea7b360e01b918282526004820152868160249785898301528160449687925af1801561037957610b7b575b5082600f54166040519082825260048201528486820152868184818873039e2fb66102314ce7b64ce5ce3e5183bc94ad385af1801561037957610b5e575b50838684600454168486600f541660405194859384928884526004840152818c8401525af1801561037957610b41575b50838684600554168486600e541660405194859384928884526004840152818c8401525af1801561037957610b24575b508583600254168385600f541660405197889384928784526004840152818b8401525af1938415610b19578694610afc575b5086836003541693600f541693816040519788968795865260048601528401525af1801561033657610309578280f35b610b1290853d871161032f576103208183612594565b5038610acc565b6040513d89823e3d90fd5b610b3a90873d891161032f576103208183612594565b5038610a9a565b610b5790873d891161032f576103208183612594565b5038610a6a565b610b7490873d891161032f576103208183612594565b5038610a3a565b610b9190873d891161032f576103208183612594565b50386109fc565b503461021b578060031936011261021b576020610bb36128ef565b604051908152f35b503461021b578060031936011261021b576002546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b576020610bb36128d3565b503461021b578060031936011261021b57610c186125b6565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461021b57602036600319011261021b57610c7361253a565b610c7b6125b6565b803b15610cd35760118054610100600160a81b031916600883901b610100600160a81b03161790556001600160a01b03167fd459c7242e23d490831b5676a611c4342d899d28f342d89ae80793e56a930f308280a280f35b60405162461bcd60e51b815260206004820152601860248201527f5661756c74206d757374206265206120636f6e747261637400000000000000006044820152606490fd5b503461021b578060031936011261021b57600d546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b57600e546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b576012546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b5760ff6020915460a01c166040519015158152f35b503461021b578060031936011261021b576005546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b5760115460ff8116610e01575080f35b6001600160a01b039060081c8116330361152157610e1d6125e2565b80600d541690813b156103a757826040516331279d3d60e01b815260448101933060048301526024946040868401526013548091526064830190601385527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09090855b818110611506575050508391838381809403925af1801561039c576114f2575b5050806004541691604051846370a0823160e01b9485835230600484015260209283818681855afa9081156103365783916114c1575b50610f0d575b50505050505042601055337f188a622567eeca997c3d494fd65f76ca910b90a50a0c44d5e37b2ea5539e027b8280a280f35b60405186815230600482015283818681855afa90811561033657839161148c575b50610f3f610f4891600c5490612719565b6009549061272c565b90610f516127c4565b90610f5b82612826565b515273039e2fb66102314ce7b64ce5ce3e5183bc94ad38908185610f7e83612826565b510152836040610f8d83612826565b51015286600f5416803b156112fa57610fc68592918392604051948580948193636cc1ae1360e01b9a8b84524291309160048601612849565b03925af191821561123d578486928894611470575b5050604051928380928b82523060048301525afa90811561033657839161143c575b5060407f5c48b059bc2759d631bf4951f184f5641ca6db26a8ad956276910a01562d59b391611031610f3f600a5483612719565b9061104961103f83836126f6565b8a6012541661274c565b825191825286820152a183838660055416604051928380928b82523060048301525afa90811561033657839161140b575b50806113b8575b5084600e5416803b156103a757828091600460405180948193631e8c5c8960e11b83525af19081156103365783916113a4575b505084600454169060405187815230600482015284818781865afa90811561123d578491611373575b5060011c916110ea6127c4565b908760025416908181036112fe575b5050866004541687600354169081810361127b575b50505050508360025416916040519486865230600487015281868681875afa958615610336578396611248575b50806003541696604051908152306004820152828187818b5afa92831561123d578493611205575b505094610124939291606096600f5416916040519889978896635a47ddc360e01b8852600488015286015283604486015260648501526084840152600160a4840152600160c48401523060e4840152426101048401525af1801561039c576111da575b506111cf612603565b388080808481610edb565b606090813d81116111fe575b6111f08183612594565b8101031261021b57386111c6565b503d6111e6565b80929594508193503d8311611236575b61121f8183612594565b8101031261036d5751909186919080610124611163565b503d611215565b6040513d86823e3d90fd5b82809297508194503d8311611274575b6112628183612594565b8101031261036d57869151943861113b565b503d611258565b61128483612826565b51528561129083612826565b51015283604061129f83612826565b51015286600f5416803b156112fa576112ce938580946040519687958694859384524291309160048601612849565b03925af1801561039c576112e6575b8080808061110e565b6112ef90612564565b6112fa5784386112dd565b8480fd5b61130783612826565b51528561131383612826565b51015283604061132283612826565b51015286600f5416803b156112fa5784604051809285825281838161134d42308a8d60048601612849565b03925af1908115610379578591156110f95761136890612564565b6108cd5783386110f9565b809450858092503d831161139d575b61138c8183612594565b8101031261036d57879251386110dd565b503d611382565b6113ad90612564565b6103985781386110b4565b85600e541690813b156108cd578391868392604051948593849263b6b55f2560e01b845260048401525af19081156103365783916113f7575b50611081565b61140090612564565b6103985781386113f1565b809350848092503d8311611435575b6114248183612594565b8101031261036d578691513861107a565b503d61141a565b809350848092503d8311611469575b6114558183612594565b8101031261036d5790518691906040610ffd565b503d61144b565b90925061147e919350612564565b6103a7578385918438610fdb565b809350848092503d83116114ba575b6114a58183612594565b8101031261036d579051869190610f3f610f2e565b503d61149b565b809350848092503d83116114eb575b6114da8183612594565b8101031261036d5786915138610ed5565b503d6114d0565b6114fb90612564565b6103a7578238610e9f565b82548816845289965060209093019260019283019201610e7f565b60405162461bcd60e51b81526020600482015260126024820152715661756c74206465706f736974206f6e6c7960701b6044820152606490fd5b503461021b578060031936011261021b576020600754604051908152f35b503461021b578060031936011261021b57333b158015611ce5575b15611ca7576115a16125e2565b600d546001600160a01b0390811690813b156103a757826040516331279d3d60e01b815260448101933060048301526024946040868401526013548091526064830190601385527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09090855b818110611c8c575050508391838381809403925af1801561039c57611c78575b5050806004541691604051846370a0823160e01b9485835230600484015260209283818681855afa908115610336578391611c47575b50611695575b5042601055337f188a622567eeca997c3d494fd65f76ca910b90a50a0c44d5e37b2ea5539e027b8280a280f35b60405186815230600482015283818681855afa908115610336578391611c12575b50610f3f6116c791600c5490612719565b906116d06127c4565b906116da82612826565b515273039e2fb66102314ce7b64ce5ce3e5183bc94ad389081856116fd83612826565b51015283604061170c83612826565b51015286600f5416803b156112fa576117458592918392604051948580948193636cc1ae1360e01b9a8b84524291309160048601612849565b03925af191821561123d578486928894611bf6575b5050604051928380928b82523060048301525afa908115610336578391611bc2575b5060407f5c48b059bc2759d631bf4951f184f5641ca6db26a8ad956276910a01562d59b3916117b0610f3f600a5483612719565b906117cf6117be83836126f6565b303303611bb3578a6012541661274c565b825191825286820152a183838660055416604051928380928b82523060048301525afa908115610336578391611b82575b5080611b2f575b5084600e5416803b156103a757828091600460405180948193631e8c5c8960e11b83525af1908115610336578391611b1b575b505084600454169060405187815230600482015284818781865afa90811561123d578491611aea575b5060011c916118706127c4565b90876002541690818103611a75575b505086600454168760035416908181036119f6575b50505050508360025416916040519486865230600487015281868681875afa9586156103365783966119c3575b50806003541696604051908152306004820152828187818b5afa92831561123d57849361198b575b505094610124939291606096600f5416916040519889978896635a47ddc360e01b8852600488015286015283604486015260648501526084840152600160a4840152600160c48401523060e4840152426101048401525af1801561039c57611960575b50611955612603565b388080808481611668565b606090813d8111611984575b6119768183612594565b8101031261021b573861194c565b503d61196c565b80929594508193503d83116119bc575b6119a58183612594565b8101031261036d57519091869190806101246118e9565b503d61199b565b82809297508194503d83116119ef575b6119dd8183612594565b8101031261036d5786915194386118c1565b503d6119d3565b6119ff83612826565b515285611a0b83612826565b510152836040611a1a83612826565b51015286600f5416803b156112fa57611a49938580946040519687958694859384524291309160048601612849565b03925af1801561039c57611a61575b80808080611894565b611a6a90612564565b6112fa578438611a58565b611a7e83612826565b515285611a8a83612826565b510152836040611a9983612826565b51015286600f5416803b156112fa57846040518092858252818381611ac442308a8d60048601612849565b03925af19081156103795785911561187f57611adf90612564565b6108cd57833861187f565b809450858092503d8311611b14575b611b038183612594565b8101031261036d5787925138611863565b503d611af9565b611b2490612564565b61039857813861183a565b85600e541690813b156108cd578391868392604051948593849263b6b55f2560e01b845260048401525af1908115610336578391611b6e575b50611807565b611b7790612564565b610398578138611b68565b809350848092503d8311611bac575b611b9b8183612594565b8101031261036d5786915138611800565b503d611b91565b611bbd843361274c565b61103f565b809350848092503d8311611bef575b611bdb8183612594565b8101031261036d579051869190604061177c565b503d611bd1565b909250611c04919350612564565b6103a757838591843861175a565b809350848092503d8311611c40575b611c2b8183612594565b8101031261036d579051869190610f3f6116b6565b503d611c21565b809350848092503d8311611c71575b611c608183612594565b8101031261036d5786915138611662565b503d611c56565b611c8190612564565b6103a757823861162c565b8254881684528996506020909301926001928301920161160c565b60405162461bcd60e51b815260206004820152601660248201527508585d5d1a0810dbdb9d1c9858dd0812185c9d995cdd60521b6044820152606490fd5b506011543360089190911c6001600160a01b031614611594565b503461021b578060031936011261021b57611d186125b6565b805460ff8160a01c1615611fd45760ff60a01b191681556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a1600654600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af1801561039c57611fb5575b50600f5460405163095ea7b360e01b81526001600160a01b03909116600482015260001960248201526020816044818573039e2fb66102314ce7b64ce5ce3e5183bc94ad385af1801561039c57611f96575b5060048054600f5460405163095ea7b360e01b81526001600160a01b03918216938101939093526000196024840152602091839160449183918791165af1801561039c57611f77575b50600554600e5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af1801561039c57611f58575b50600254600f5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af1801561039c57611f39575b50600354600f5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af1801561039c57611f1a575b5061060c612603565b611f329060203d60201161032f576103208183612594565b5038611f11565b611f519060203d60201161032f576103208183612594565b5038611eca565b611f709060203d60201161032f576103208183612594565b5038611e83565b611f8f9060203d60201161032f576103208183612594565b5038611e3c565b611fae9060203d60201161032f576103208183612594565b5038611df3565b611fcd9060203d60201161032f576103208183612594565b5038611da1565b604051638dfc202b60e01b8152600490fd5b503461021b578060031936011261021b576020600c54604051908152f35b503461021b578060031936011261021b576020600954604051908152f35b503461021b57602080600319360112610398576004356002600154146122cf57600260015560018060a01b03906120618260115460081c1633146126c1565b8160065416906040519084826024816370a0823160e01b968782523060048301525afa90811561228f578592879261229a575b5086828281106121d2575b505060009293508082116121ca575b506120c76120be60085483612719565b6007549061272c565b60ff875460a01c1615806121bd575b6121ae575b5060065460115460405163a9059cbb60e01b86820190815260089290921c87166001600160a01b0316602482015260448101939093529416939061212c81606481015b03601f198101835282612594565b519082855af1156121a2576000513d6121995750803b155b61218157507f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d906121736128d3565b604051908152a16001805580f35b60249060405190635274afe760e01b82526004820152fd5b60011415612144565b6040513d6000823e3d90fd5b6121b7916126f6565b386120db565b5060ff60115416156120d6565b9050386120ae565b91935091506121e685600d541691846126f6565b90803b156103a757602483926040519485938492632e1a7d4d60e01b845260048401525af1801561228f5761227c575b508383600654169260246040518095819382523060048301525afa8015610379578492869161224a575b508291863861209f565b8381939492503d8311612275575b6122628183612594565b8101031261036d57518391906000612240565b503d612258565b61228890959195612564565b9338612216565b6040513d88823e3d90fd5b8381949293503d83116122c8575b6122b28183612594565b810103126122c4578491519038612094565b8580fd5b503d6122a8565b604051633ee5aeb560e01b8152600490fd5b503461021b578060031936011261021b576006546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b57602060405173039e2fb66102314ce7b64ce5ce3e5183bc94ad388152f35b503461021b578060031936011261021b576004546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b57600f546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b57602090604051908152f35b503461021b57602036600319011261021b576004356123c46125b6565b6105dc81116123ff576020817fe4a7fd2711237e77309a9a16ff636a748dbf956fd91f6e6da800d9302f441a7992601455604051908152a180f35b60405162461bcd60e51b8152602060048201526011602482015270496e76616c696420746f6c6572616e636560781b6044820152606490fd5b503461021b578060031936011261021b576020610bb361295b565b503461021b57602036600319011261021b576004358015158091036103985761247a6125b6565b60ff80196011541691168091176011556000146124c257806008557f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af6020604051838152a180f35b600a6008557f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af6020604051600a8152a180f35b503461021b578060031936011261021b576003546040516001600160a01b039091168152602090f35b905034610398578160031936011261039857602090600b548152f35b600435906001600160a01b038216820361036d57565b35906001600160a01b038216820361036d57565b67ffffffffffffffff81116108b757604052565b6060810190811067ffffffffffffffff8211176108b757604052565b90601f8019910116810190811067ffffffffffffffff8211176108b757604052565b6000546001600160a01b031633036125ca57565b60405163118cdaa760e01b8152336004820152602490fd5b60ff60005460a01c166125f157565b60405163d93c066560e01b8152600490fd5b6006546040516370a0823160e01b8152306004820152906001600160a01b03906020908390602490829085165afa9182156121a25760009261268e575b508161264a575050565b600d541690813b1561036d5760009160248392604051948593849263b6b55f2560e01b845260048401525af180156121a2576126835750565b61268c90612564565b565b90916020823d82116126b9575b816126a860209383612594565b8101031261021b5750519038612640565b3d915061269b565b156126c857565b60405162461bcd60e51b8152602060048201526006602482015265085d985d5b1d60d21b6044820152606490fd5b9190820391821161270357565b634e487b7160e01b600052601160045260246000fd5b8181029291811591840414171561270357565b8115612736570490565b634e487b7160e01b600052601260045260246000fd5b60405163a9059cbb60e01b60208281019182526001600160a01b0390931660248301526044820193909352600090612787816064810161211e565b5173039e2fb66102314ce7b64ce5ce3e5183bc94ad389382855af1156121a2576000513d6127bb5750803b155b6121815750565b600114156127b4565b60409081519180830183811067ffffffffffffffff8211176108b75781526001835282916000805b60208082101561281d5784516020929161280582612578565b848252848183015284878301528289010152016127ec565b50505091925050565b8051156128335760200190565b634e487b7160e01b600052603260045260246000fd5b91909493929460a083019083526001602091818386015260409260a08487015284518092528060c087019501936000905b83821061289d57505050505050906080919460018060a01b031660608201520152565b855180516001600160a01b039081168952848201511684890152810151151581880152606090960195948201949084019061287a565b6128db6128ef565b6128e361295b565b81018091116127035790565b6006546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa9081156121a25760009161292d575090565b906020823d8211612953575b8161294660209383612594565b8101031261021b57505190565b3d9150612939565b600d546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa9081156121a25760009161292d575090565b9081602091031261036d5751801515810361036d579056fea26469706673582212206194f537380f3243b15d8943e56cb9afafd7b8deb80661e10f111bdc0df3a77864736f6c63430008140033000000000000000000000000f19748a0e269c6965a84f8c98ca8c47a064d4dd0000000000000000000000000cbcad939e2bbbe01850a141f204f25df63b8fc5b0000000000000000000000003333b97138d4b086720b5ae8a7844b1345a33333000000000000000000000000dcb5a24ec708cc13cee12bfe6799a78a79b666b40000000000000000000000005050bc082ff4a74fb6b0b04385defddb114b24240000000000000000000000001d368773735ee1e678950b7a97bca2cafb330cdc00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000c16da76872131bc6095f73b894b4757873dace1

Deployed Bytecode

0x608080604052600436101561001357600080fd5b600090813560e01c908163025e30b01461251e5750806309746324146124f55780630e8fbb5a146124535780631158808614612438578063117da1ee146123a7578063171d21891461238b578063257ae0de146123625780632638c09e1461233957806327ced5371461230a5780632dc7d74c146122e15780632e1a7d4d146120225780633410fe6e1461200457806334fbc9a114611fe65780633f4ba83a14611cff5780634641257d1461157957806354518b1a1461155b578063573fef0a14610de15780635ac7f47914610db85780635c975abb14610d9357806361d027b314610d6a57806364f37ec414610d4157806366666aa914610d185780636817031b14610c59578063715018a614610bff578063722713f714610be45780637b83fc1d14610bbb5780637ff8f1e914610b985780638456cb59146109575780638912cb8b146109345780638da5cb5b1461090d578063951d6d20146108ef5780639bff5ddb146108d1578063a64a3e931461068a578063d03153aa1461066c578063d0e30db0146105cb578063e7a7250a14610530578063f1a392da14610512578063f2fde38b14610482578063f301af4214610426578063f3ff955a146103ab578063fb6177871461021e5763fbfa77cf146101ef57600080fd5b3461021b578060031936011261021b5760115460405160089190911c6001600160a01b03168152602090f35b80fd5b503461021b578060031936011261021b5760018060a01b036102488160115460081c1633146126c1565b8181600d541661025661295b565b813b156103a7578291602483926040519485938492632e1a7d4d60e01b845260048401525af1801561039c57610384575b505080600654166040516370a0823160e01b81523060048201526020928382602481865afa9081156103795784928692610341575b5060115460405163a9059cbb60e01b81526001600160a01b0360089290921c9092161660048201526024810191909152918290818681604481015b03925af1801561033657610309578280f35b8161032892903d1061032f575b6103208183612594565b810190612999565b5038808280f35b503d610316565b6040513d85823e3d90fd5b8381949293503d8311610372575b6103598183612594565b8101031261036d57905183916102f76102bc565b600080fd5b503d61034f565b6040513d87823e3d90fd5b61038d90612564565b610398578138610287565b5080fd5b6040513d84823e3d90fd5b8280fd5b503461021b57602036600319011261021b57806103c661253a565b6103ce6125b6565b600e546001600160a01b039081169190823b1561042157602484928360405195869485936317066a5760e21b85521660048401525af1801561039c576104115750f35b61041a90612564565b61021b5780f35b505050fd5b503461021b57602036600319011261021b576004356013548110156103985760139091527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09001546040516001600160a01b039091168152602090f35b503461021b57602036600319011261021b5761049c61253a565b6104a46125b6565b6001600160a01b039081169081156104f957600054826bffffffffffffffffffffffff60a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b604051631e4fbdf760e01b815260048101849052602490fd5b503461021b578060031936011261021b576020601054604051908152f35b503461021b578060031936011261021b5760018060a01b0390602082600d5416926004541660446040518095819363211dc32d60e01b835260048301523060248301525afa9081156105bf579061058d575b602090604051908152f35b506020813d82116105b7575b816105a660209383612594565b8101031261036d5760209051610582565b3d9150610599565b604051903d90823e3d90fd5b503461021b578060031936011261021b576011543360089190911c6001600160a01b0316148015610663575b1561060f576106046125e2565b61060c612603565b80f35b60405162461bcd60e51b815260206004820152602660248201527f4e6f7420617574686f72697a65642c206f6e6c79205661756c74206f7220537460448201526572617465677960d01b6064820152608490fd5b503033146105f7565b503461021b578060031936011261021b576020601454604051908152f35b503461021b576020806003193601126103985760043567ffffffffffffffff8082116108cd57366023830112156108cd5781600401359081116108b757604051916106da848360051b0184612594565b81835283830160246060809402830101913683116108b357602401905b828210610860575050505061070a6125b6565b6001600160a01b03908161071d82612826565b5151168260045416141580610836575b8061081c575b156107ec57808383610746602494612826565b515116604051938480926370a0823160e01b82523060048301525afa90811561037957849286926107bb575b5092806107816102f795612826565b51511690600f54168660405180968195829463095ea7b360e01b84526004840160209093929193604081019460018060a01b031681520152565b8381949293503d83116107e5575b6107d38183612594565b8101031261036d579051839183610772565b503d6107c9565b60405162461bcd60e51b815260048101849052600860248201526708505b1b1bddd95960c21b6044820152606490fd5b508161082782612826565b51511682600654161415610733565b5073039e2fb66102314ce7b64ce5ce3e5183bc94ad388261085683612826565b515116141561072d565b83823603126108b3576040519061087682612578565b61087f83612550565b825261088c878401612550565b87830152604083013590811515820361036d578288926040889501528152019101906106f7565b8680fd5b634e487b7160e01b600052604160045260246000fd5b8380fd5b503461021b578060031936011261021b576020600854604051908152f35b503461021b578060031936011261021b576020600a54604051908152f35b503461021b578060031936011261021b57546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b57602060ff601154166040519015158152f35b503461021b578060031936011261021b576109706125b6565b6109786125e2565b805460ff60a01b1916600160a01b1781556040513381526020907f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258908290a160018060a01b03828160065416918181600d541660405163095ea7b360e01b918282526004820152868160249785898301528160449687925af1801561037957610b7b575b5082600f54166040519082825260048201528486820152868184818873039e2fb66102314ce7b64ce5ce3e5183bc94ad385af1801561037957610b5e575b50838684600454168486600f541660405194859384928884526004840152818c8401525af1801561037957610b41575b50838684600554168486600e541660405194859384928884526004840152818c8401525af1801561037957610b24575b508583600254168385600f541660405197889384928784526004840152818b8401525af1938415610b19578694610afc575b5086836003541693600f541693816040519788968795865260048601528401525af1801561033657610309578280f35b610b1290853d871161032f576103208183612594565b5038610acc565b6040513d89823e3d90fd5b610b3a90873d891161032f576103208183612594565b5038610a9a565b610b5790873d891161032f576103208183612594565b5038610a6a565b610b7490873d891161032f576103208183612594565b5038610a3a565b610b9190873d891161032f576103208183612594565b50386109fc565b503461021b578060031936011261021b576020610bb36128ef565b604051908152f35b503461021b578060031936011261021b576002546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b576020610bb36128d3565b503461021b578060031936011261021b57610c186125b6565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461021b57602036600319011261021b57610c7361253a565b610c7b6125b6565b803b15610cd35760118054610100600160a81b031916600883901b610100600160a81b03161790556001600160a01b03167fd459c7242e23d490831b5676a611c4342d899d28f342d89ae80793e56a930f308280a280f35b60405162461bcd60e51b815260206004820152601860248201527f5661756c74206d757374206265206120636f6e747261637400000000000000006044820152606490fd5b503461021b578060031936011261021b57600d546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b57600e546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b576012546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b5760ff6020915460a01c166040519015158152f35b503461021b578060031936011261021b576005546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b5760115460ff8116610e01575080f35b6001600160a01b039060081c8116330361152157610e1d6125e2565b80600d541690813b156103a757826040516331279d3d60e01b815260448101933060048301526024946040868401526013548091526064830190601385527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09090855b818110611506575050508391838381809403925af1801561039c576114f2575b5050806004541691604051846370a0823160e01b9485835230600484015260209283818681855afa9081156103365783916114c1575b50610f0d575b50505050505042601055337f188a622567eeca997c3d494fd65f76ca910b90a50a0c44d5e37b2ea5539e027b8280a280f35b60405186815230600482015283818681855afa90811561033657839161148c575b50610f3f610f4891600c5490612719565b6009549061272c565b90610f516127c4565b90610f5b82612826565b515273039e2fb66102314ce7b64ce5ce3e5183bc94ad38908185610f7e83612826565b510152836040610f8d83612826565b51015286600f5416803b156112fa57610fc68592918392604051948580948193636cc1ae1360e01b9a8b84524291309160048601612849565b03925af191821561123d578486928894611470575b5050604051928380928b82523060048301525afa90811561033657839161143c575b5060407f5c48b059bc2759d631bf4951f184f5641ca6db26a8ad956276910a01562d59b391611031610f3f600a5483612719565b9061104961103f83836126f6565b8a6012541661274c565b825191825286820152a183838660055416604051928380928b82523060048301525afa90811561033657839161140b575b50806113b8575b5084600e5416803b156103a757828091600460405180948193631e8c5c8960e11b83525af19081156103365783916113a4575b505084600454169060405187815230600482015284818781865afa90811561123d578491611373575b5060011c916110ea6127c4565b908760025416908181036112fe575b5050866004541687600354169081810361127b575b50505050508360025416916040519486865230600487015281868681875afa958615610336578396611248575b50806003541696604051908152306004820152828187818b5afa92831561123d578493611205575b505094610124939291606096600f5416916040519889978896635a47ddc360e01b8852600488015286015283604486015260648501526084840152600160a4840152600160c48401523060e4840152426101048401525af1801561039c576111da575b506111cf612603565b388080808481610edb565b606090813d81116111fe575b6111f08183612594565b8101031261021b57386111c6565b503d6111e6565b80929594508193503d8311611236575b61121f8183612594565b8101031261036d5751909186919080610124611163565b503d611215565b6040513d86823e3d90fd5b82809297508194503d8311611274575b6112628183612594565b8101031261036d57869151943861113b565b503d611258565b61128483612826565b51528561129083612826565b51015283604061129f83612826565b51015286600f5416803b156112fa576112ce938580946040519687958694859384524291309160048601612849565b03925af1801561039c576112e6575b8080808061110e565b6112ef90612564565b6112fa5784386112dd565b8480fd5b61130783612826565b51528561131383612826565b51015283604061132283612826565b51015286600f5416803b156112fa5784604051809285825281838161134d42308a8d60048601612849565b03925af1908115610379578591156110f95761136890612564565b6108cd5783386110f9565b809450858092503d831161139d575b61138c8183612594565b8101031261036d57879251386110dd565b503d611382565b6113ad90612564565b6103985781386110b4565b85600e541690813b156108cd578391868392604051948593849263b6b55f2560e01b845260048401525af19081156103365783916113f7575b50611081565b61140090612564565b6103985781386113f1565b809350848092503d8311611435575b6114248183612594565b8101031261036d578691513861107a565b503d61141a565b809350848092503d8311611469575b6114558183612594565b8101031261036d5790518691906040610ffd565b503d61144b565b90925061147e919350612564565b6103a7578385918438610fdb565b809350848092503d83116114ba575b6114a58183612594565b8101031261036d579051869190610f3f610f2e565b503d61149b565b809350848092503d83116114eb575b6114da8183612594565b8101031261036d5786915138610ed5565b503d6114d0565b6114fb90612564565b6103a7578238610e9f565b82548816845289965060209093019260019283019201610e7f565b60405162461bcd60e51b81526020600482015260126024820152715661756c74206465706f736974206f6e6c7960701b6044820152606490fd5b503461021b578060031936011261021b576020600754604051908152f35b503461021b578060031936011261021b57333b158015611ce5575b15611ca7576115a16125e2565b600d546001600160a01b0390811690813b156103a757826040516331279d3d60e01b815260448101933060048301526024946040868401526013548091526064830190601385527f66de8ffda797e3de9c05e8fc57b3bf0ec28a930d40b0d285d93c06501cf6a09090855b818110611c8c575050508391838381809403925af1801561039c57611c78575b5050806004541691604051846370a0823160e01b9485835230600484015260209283818681855afa908115610336578391611c47575b50611695575b5042601055337f188a622567eeca997c3d494fd65f76ca910b90a50a0c44d5e37b2ea5539e027b8280a280f35b60405186815230600482015283818681855afa908115610336578391611c12575b50610f3f6116c791600c5490612719565b906116d06127c4565b906116da82612826565b515273039e2fb66102314ce7b64ce5ce3e5183bc94ad389081856116fd83612826565b51015283604061170c83612826565b51015286600f5416803b156112fa576117458592918392604051948580948193636cc1ae1360e01b9a8b84524291309160048601612849565b03925af191821561123d578486928894611bf6575b5050604051928380928b82523060048301525afa908115610336578391611bc2575b5060407f5c48b059bc2759d631bf4951f184f5641ca6db26a8ad956276910a01562d59b3916117b0610f3f600a5483612719565b906117cf6117be83836126f6565b303303611bb3578a6012541661274c565b825191825286820152a183838660055416604051928380928b82523060048301525afa908115610336578391611b82575b5080611b2f575b5084600e5416803b156103a757828091600460405180948193631e8c5c8960e11b83525af1908115610336578391611b1b575b505084600454169060405187815230600482015284818781865afa90811561123d578491611aea575b5060011c916118706127c4565b90876002541690818103611a75575b505086600454168760035416908181036119f6575b50505050508360025416916040519486865230600487015281868681875afa9586156103365783966119c3575b50806003541696604051908152306004820152828187818b5afa92831561123d57849361198b575b505094610124939291606096600f5416916040519889978896635a47ddc360e01b8852600488015286015283604486015260648501526084840152600160a4840152600160c48401523060e4840152426101048401525af1801561039c57611960575b50611955612603565b388080808481611668565b606090813d8111611984575b6119768183612594565b8101031261021b573861194c565b503d61196c565b80929594508193503d83116119bc575b6119a58183612594565b8101031261036d57519091869190806101246118e9565b503d61199b565b82809297508194503d83116119ef575b6119dd8183612594565b8101031261036d5786915194386118c1565b503d6119d3565b6119ff83612826565b515285611a0b83612826565b510152836040611a1a83612826565b51015286600f5416803b156112fa57611a49938580946040519687958694859384524291309160048601612849565b03925af1801561039c57611a61575b80808080611894565b611a6a90612564565b6112fa578438611a58565b611a7e83612826565b515285611a8a83612826565b510152836040611a9983612826565b51015286600f5416803b156112fa57846040518092858252818381611ac442308a8d60048601612849565b03925af19081156103795785911561187f57611adf90612564565b6108cd57833861187f565b809450858092503d8311611b14575b611b038183612594565b8101031261036d5787925138611863565b503d611af9565b611b2490612564565b61039857813861183a565b85600e541690813b156108cd578391868392604051948593849263b6b55f2560e01b845260048401525af1908115610336578391611b6e575b50611807565b611b7790612564565b610398578138611b68565b809350848092503d8311611bac575b611b9b8183612594565b8101031261036d5786915138611800565b503d611b91565b611bbd843361274c565b61103f565b809350848092503d8311611bef575b611bdb8183612594565b8101031261036d579051869190604061177c565b503d611bd1565b909250611c04919350612564565b6103a757838591843861175a565b809350848092503d8311611c40575b611c2b8183612594565b8101031261036d579051869190610f3f6116b6565b503d611c21565b809350848092503d8311611c71575b611c608183612594565b8101031261036d5786915138611662565b503d611c56565b611c8190612564565b6103a757823861162c565b8254881684528996506020909301926001928301920161160c565b60405162461bcd60e51b815260206004820152601660248201527508585d5d1a0810dbdb9d1c9858dd0812185c9d995cdd60521b6044820152606490fd5b506011543360089190911c6001600160a01b031614611594565b503461021b578060031936011261021b57611d186125b6565b805460ff8160a01c1615611fd45760ff60a01b191681556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a1600654600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af1801561039c57611fb5575b50600f5460405163095ea7b360e01b81526001600160a01b03909116600482015260001960248201526020816044818573039e2fb66102314ce7b64ce5ce3e5183bc94ad385af1801561039c57611f96575b5060048054600f5460405163095ea7b360e01b81526001600160a01b03918216938101939093526000196024840152602091839160449183918791165af1801561039c57611f77575b50600554600e5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af1801561039c57611f58575b50600254600f5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af1801561039c57611f39575b50600354600f5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af1801561039c57611f1a575b5061060c612603565b611f329060203d60201161032f576103208183612594565b5038611f11565b611f519060203d60201161032f576103208183612594565b5038611eca565b611f709060203d60201161032f576103208183612594565b5038611e83565b611f8f9060203d60201161032f576103208183612594565b5038611e3c565b611fae9060203d60201161032f576103208183612594565b5038611df3565b611fcd9060203d60201161032f576103208183612594565b5038611da1565b604051638dfc202b60e01b8152600490fd5b503461021b578060031936011261021b576020600c54604051908152f35b503461021b578060031936011261021b576020600954604051908152f35b503461021b57602080600319360112610398576004356002600154146122cf57600260015560018060a01b03906120618260115460081c1633146126c1565b8160065416906040519084826024816370a0823160e01b968782523060048301525afa90811561228f578592879261229a575b5086828281106121d2575b505060009293508082116121ca575b506120c76120be60085483612719565b6007549061272c565b60ff875460a01c1615806121bd575b6121ae575b5060065460115460405163a9059cbb60e01b86820190815260089290921c87166001600160a01b0316602482015260448101939093529416939061212c81606481015b03601f198101835282612594565b519082855af1156121a2576000513d6121995750803b155b61218157507f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d906121736128d3565b604051908152a16001805580f35b60249060405190635274afe760e01b82526004820152fd5b60011415612144565b6040513d6000823e3d90fd5b6121b7916126f6565b386120db565b5060ff60115416156120d6565b9050386120ae565b91935091506121e685600d541691846126f6565b90803b156103a757602483926040519485938492632e1a7d4d60e01b845260048401525af1801561228f5761227c575b508383600654169260246040518095819382523060048301525afa8015610379578492869161224a575b508291863861209f565b8381939492503d8311612275575b6122628183612594565b8101031261036d57518391906000612240565b503d612258565b61228890959195612564565b9338612216565b6040513d88823e3d90fd5b8381949293503d83116122c8575b6122b28183612594565b810103126122c4578491519038612094565b8580fd5b503d6122a8565b604051633ee5aeb560e01b8152600490fd5b503461021b578060031936011261021b576006546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b57602060405173039e2fb66102314ce7b64ce5ce3e5183bc94ad388152f35b503461021b578060031936011261021b576004546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b57600f546040516001600160a01b039091168152602090f35b503461021b578060031936011261021b57602090604051908152f35b503461021b57602036600319011261021b576004356123c46125b6565b6105dc81116123ff576020817fe4a7fd2711237e77309a9a16ff636a748dbf956fd91f6e6da800d9302f441a7992601455604051908152a180f35b60405162461bcd60e51b8152602060048201526011602482015270496e76616c696420746f6c6572616e636560781b6044820152606490fd5b503461021b578060031936011261021b576020610bb361295b565b503461021b57602036600319011261021b576004358015158091036103985761247a6125b6565b60ff80196011541691168091176011556000146124c257806008557f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af6020604051838152a180f35b600a6008557f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af6020604051600a8152a180f35b503461021b578060031936011261021b576003546040516001600160a01b039091168152602090f35b905034610398578160031936011261039857602090600b548152f35b600435906001600160a01b038216820361036d57565b35906001600160a01b038216820361036d57565b67ffffffffffffffff81116108b757604052565b6060810190811067ffffffffffffffff8211176108b757604052565b90601f8019910116810190811067ffffffffffffffff8211176108b757604052565b6000546001600160a01b031633036125ca57565b60405163118cdaa760e01b8152336004820152602490fd5b60ff60005460a01c166125f157565b60405163d93c066560e01b8152600490fd5b6006546040516370a0823160e01b8152306004820152906001600160a01b03906020908390602490829085165afa9182156121a25760009261268e575b508161264a575050565b600d541690813b1561036d5760009160248392604051948593849263b6b55f2560e01b845260048401525af180156121a2576126835750565b61268c90612564565b565b90916020823d82116126b9575b816126a860209383612594565b8101031261021b5750519038612640565b3d915061269b565b156126c857565b60405162461bcd60e51b8152602060048201526006602482015265085d985d5b1d60d21b6044820152606490fd5b9190820391821161270357565b634e487b7160e01b600052601160045260246000fd5b8181029291811591840414171561270357565b8115612736570490565b634e487b7160e01b600052601260045260246000fd5b60405163a9059cbb60e01b60208281019182526001600160a01b0390931660248301526044820193909352600090612787816064810161211e565b5173039e2fb66102314ce7b64ce5ce3e5183bc94ad389382855af1156121a2576000513d6127bb5750803b155b6121815750565b600114156127b4565b60409081519180830183811067ffffffffffffffff8211176108b75781526001835282916000805b60208082101561281d5784516020929161280582612578565b848252848183015284878301528289010152016127ec565b50505091925050565b8051156128335760200190565b634e487b7160e01b600052603260045260246000fd5b91909493929460a083019083526001602091818386015260409260a08487015284518092528060c087019501936000905b83821061289d57505050505050906080919460018060a01b031660608201520152565b855180516001600160a01b039081168952848201511684890152810151151581880152606090960195948201949084019061287a565b6128db6128ef565b6128e361295b565b81018091116127035790565b6006546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa9081156121a25760009161292d575090565b906020823d8211612953575b8161294660209383612594565b8101031261021b57505190565b3d9150612939565b600d546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa9081156121a25760009161292d575090565b9081602091031261036d5751801515810361036d579056fea26469706673582212206194f537380f3243b15d8943e56cb9afafd7b8deb80661e10f111bdc0df3a77864736f6c63430008140033

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

000000000000000000000000f19748a0e269c6965a84f8c98ca8c47a064d4dd0000000000000000000000000cbcad939e2bbbe01850a141f204f25df63b8fc5b0000000000000000000000003333b97138d4b086720b5ae8a7844b1345a33333000000000000000000000000dcb5a24ec708cc13cee12bfe6799a78a79b666b40000000000000000000000005050bc082ff4a74fb6b0b04385defddb114b24240000000000000000000000001d368773735ee1e678950b7a97bca2cafb330cdc00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000c16da76872131bc6095f73b894b4757873dace1

-----Decoded View---------------
Arg [0] : _staking_token (address): 0xF19748a0E269c6965a84f8C98ca8C47A064D4dd0
Arg [1] : _rewardPool (address): 0xCBcAd939E2bbbe01850A141F204f25DF63b8FC5B
Arg [2] : _reward_token (address): 0x3333b97138D4b086720b5aE8A7844b1345a33333
Arg [3] : _xRewardPool (address): 0xDCB5A24ec708cc13cee12bFE6799A78a79b666b4
Arg [4] : _xReward_token (address): 0x5050bc082FF4A74Fb6B0B04385dEfdDB114b2424
Arg [5] : _unirouter (address): 0x1D368773735ee1E678950B7A97bcA2CafB330CDc
Arg [6] : _harvestOnDeposit (bool): True
Arg [7] : _treasury (address): 0x0c16Da76872131bC6095f73b894B4757873dAce1

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000f19748a0e269c6965a84f8c98ca8c47a064d4dd0
Arg [1] : 000000000000000000000000cbcad939e2bbbe01850a141f204f25df63b8fc5b
Arg [2] : 0000000000000000000000003333b97138d4b086720b5ae8a7844b1345a33333
Arg [3] : 000000000000000000000000dcb5a24ec708cc13cee12bfe6799a78a79b666b4
Arg [4] : 0000000000000000000000005050bc082ff4a74fb6b0b04385defddb114b2424
Arg [5] : 0000000000000000000000001d368773735ee1e678950b7a97bca2cafb330cdc
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [7] : 0000000000000000000000000c16da76872131bc6095f73b894b4757873dace1


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.