S Price: $0.776736 (-6.51%)

Contract

0xcA4E380BD0ecd85d80a80f64333aDCf40F24b060

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
Harvest42009582025-01-16 22:17:011 hr ago1737065821IN
0xcA4E380B...40F24b060
0 S0.13196029110
Harvest42009542025-01-16 22:17:001 hr ago1737065820IN
0xcA4E380B...40F24b060
0 S0.14542583110
Harvest42009532025-01-16 22:16:581 hr ago1737065818IN
0xcA4E380B...40F24b060
0 S0.14051345110
Harvest41863792025-01-16 19:23:524 hrs ago1737055432IN
0xcA4E380B...40F24b060
0 S0.17331617160.56
Harvest41690682025-01-16 16:16:037 hrs ago1737044163IN
0xcA4E380B...40F24b060
0 S0.10135598110
Harvest41690632025-01-16 16:16:017 hrs ago1737044161IN
0xcA4E380B...40F24b060
0 S0.11241868110
Harvest41560032025-01-16 14:15:419 hrs ago1737036941IN
0xcA4E380B...40F24b060
0 S0.10090135110
Harvest41441532025-01-16 12:15:2411 hrs ago1737029724IN
0xcA4E380B...40F24b060
0 S0.13126806110
Harvest41334052025-01-16 10:15:1013 hrs ago1737022510IN
0xcA4E380B...40F24b060
0 S0.11139623110
Harvest41334042025-01-16 10:15:0813 hrs ago1737022508IN
0xcA4E380B...40F24b060
0 S0.12018193110
Harvest41206142025-01-16 8:14:4715 hrs ago1737015287IN
0xcA4E380B...40F24b060
0 S0.0390048133
Harvest41206102025-01-16 8:14:4615 hrs ago1737015286IN
0xcA4E380B...40F24b060
0 S0.0417295533
Harvest41082382025-01-16 6:14:3217 hrs ago1737008072IN
0xcA4E380B...40F24b060
0 S0.0334671433
Harvest41082352025-01-16 6:14:3017 hrs ago1737008070IN
0xcA4E380B...40F24b060
0 S0.0361089633
Harvest40979552025-01-16 4:14:1719 hrs ago1737000857IN
0xcA4E380B...40F24b060
0 S0.0309949233
Harvest40874632025-01-16 2:14:0621 hrs ago1736993646IN
0xcA4E380B...40F24b060
0 S0.0301475433
Harvest40874582025-01-16 2:14:0421 hrs ago1736993644IN
0xcA4E380B...40F24b060
0 S0.037695833
Harvest40874522025-01-16 2:14:0321 hrs ago1736993643IN
0xcA4E380B...40F24b060
0 S0.0375252533
Harvest40686432025-01-15 23:47:0023 hrs ago1736984820IN
0xcA4E380B...40F24b060
0 S0.0398599733.01
Harvest40649082025-01-15 23:15:2324 hrs ago1736982923IN
0xcA4E380B...40F24b060
0 S0.0342641434
Harvest40636262025-01-15 23:05:0724 hrs ago1736982307IN
0xcA4E380B...40F24b060
0 S0.0391306733
Harvest40600192025-01-15 22:32:5725 hrs ago1736980377IN
0xcA4E380B...40F24b060
0 S0.0353517933.01
Harvest39713842025-01-15 8:59:1338 hrs ago1736931553IN
0xcA4E380B...40F24b060
0 S0.031715833
Harvest39713662025-01-15 8:59:0338 hrs ago1736931543IN
0xcA4E380B...40F24b060
0 S0.0355256833
Harvest39643242025-01-15 7:33:5340 hrs ago1736926433IN
0xcA4E380B...40F24b060
0 S0.0379854733
View all transactions

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

Contract Source Code Verified (Exact Match)

Contract Name:
Blacksail_SwapX_AURUM_Strategy

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

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

import "@openzeppelin/contracts/token/ERC20/IERC20.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/swapX/IPair.sol";
import "../interfacing/ISwapX.sol";
import "../interfacing/ISwapXGauge.sol";
import "../interfacing/swapX/IRouterV2.sol";
import "../interfacing/swapX/IV2SwapRouter.sol";
import "../interfacing/Aurum/IPool.sol";

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

    // Tokens
    address public constant native_token = address(0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38);
    address public constant usdc = address(0x29219dd400f2Bf60E5a23d13Be72B486D4038894);
    address public lp0;
    address public lp1;
    address public reward_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 constant AURUM = address(0x69f196a108002FD75d4B0a1118Ee04C065a63dE9);
    address public rewardPool;
    address public unirouter;
    address public lpRouter;

    // Information
    uint256 public lastHarvest;
    bool public harvestOnDeposit;
    uint16 public refCode;

    // 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 _unirouter,
        address _lpRouter,
        bool _harvestOnDeposit,
        address _treasury
    ) Ownable(msg.sender) {
        staking_token = _staking_token;
        rewardPool = _rewardPool;
        unirouter = _unirouter;
        lpRouter = _lpRouter;
        treasury = _treasury;

        lp0 = IPair(staking_token).token0(); // AURUM
        lp1 = IPair(staking_token).token1(); // auUSDC

        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) {
            ISwapXGauge(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) {
            ISwapXGauge(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 {
        ISwapXGauge(rewardPool).getReward();
        uint256 rewardAmt = IERC20(reward_token).balanceOf(address(this));

        if (rewardAmt > 0) {
            chargeFees(caller);
            lend();
            rebalance();
            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));

        ISwapX.ExactInputSingleParams memory eisp;
        eisp.tokenIn = reward_token;
        eisp.tokenOut = native_token;
        eisp.recipient = address(this);
        eisp.amountIn = toNative;
        eisp.limitSqrtPrice = 0;

        ISwapX(unirouter).exactInputSingleSupportingFeeOnTransferTokens(eisp);
        uint256 nativeBal = IERC20(native_token).balanceOf(address(this));

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

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

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

        emit ChargeFees(callFeeAmount, platformFee);
    }

    function rebalance() internal {
        uint256 aurBal = IERC20(lp0).balanceOf(address(this));

        IV2SwapRouter.Route[] memory route = new IV2SwapRouter.Route[](1);

        if (aurBal > 0) {
            route[0].from = lp0;
            route[0].to = lp1;
            route[0].stable = false;

            try IV2SwapRouter(unirouter).swapExactTokensForTokens(aurBal, 1, route, address(this)) {

            } catch {
                // do nothing, just incase of failure due to dust amounts
            }
        }
    }

    function lend() internal {
        uint256 nativeBal = IERC20(native_token).balanceOf(address(this));

        ISwapX.ExactInputSingleParams memory eisp;
        eisp.tokenIn = native_token;
        eisp.tokenOut = usdc;
        eisp.recipient = address(this);
        eisp.amountIn = nativeBal;
        eisp.limitSqrtPrice = 0;

        if (nativeBal > 0) {
            ISwapX(unirouter).exactInputSingleSupportingFeeOnTransferTokens(eisp);
        } 

        uint256 usdcBal = IERC20(usdc).balanceOf(address(this));

        if (usdcBal > 0) {
            IPool(AURUM).supply(usdc, usdcBal, address(this), refCode);
        }
    }

    /**
     * @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 half_auUSDC_bal = IERC20(lp1).balanceOf(address(this)) / 2;

        IV2SwapRouter.Route[] memory route = new IV2SwapRouter.Route[](1);

        if (half_auUSDC_bal > 0 ) {
            route[0].from = lp1;
            route[0].to = lp0;
            route[0].stable = false;

            IV2SwapRouter(unirouter).swapExactTokensForTokens(half_auUSDC_bal, 1, route, address(this));
        }

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

        if (lp0b > 0 && lp1b > 0) {
            IRouterV2(lpRouter).addLiquidity(lp0, lp1, false, lp0b, lp1b, 0, 0, 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 ISwapXGauge(rewardPool).earned(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 ISwapXGauge(rewardPool).balanceOf(address(this));
        // return _amount;
    }

    /** @dev called as part of strat migration. Sends all the available funds back to the vault */
    function retireStrat() external {
        require(msg.sender == vault, "!vault");
        ISwapXGauge(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(usdc).approve(AURUM, type(uint256).max);
        IERC20(lp0).approve(unirouter, type(uint256).max);
        IERC20(lp1).approve(unirouter, type(uint256).max);
        IERC20(lp0).approve(lpRouter, type(uint256).max);
        IERC20(lp1).approve(lpRouter, 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(usdc).approve(AURUM, 0);
        IERC20(lp0).approve(unirouter, 0);
        IERC20(lp1).approve(unirouter, 0);
        IERC20(lp0).approve(lpRouter, 0);
        IERC20(lp1).approve(lpRouter, 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);
    }

    /**
     * @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 isContract(address account) internal view returns (bool) {
        return account.code.length > 0;
    }

    function setRefCode(uint16 _code) external onlyOwner {
        refCode = _code;
    }

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

File 2 of 19 : 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 19 : 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 4 of 19 : 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 5 of 19 : 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 6 of 19 : 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 7 of 19 : 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 8 of 19 : 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 9 of 19 : 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 10 of 19 : 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 11 of 19 : 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 12 of 19 : 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 13 of 19 : 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 14 of 19 : IPool.sol
pragma solidity ^0.8.0;

/**
 * @title IPool
 * @author Aave
 * @notice Defines the basic interface for an Aave Pool.
 */
interface IPool {

  /**
   * @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
   * - E.g. User supplies 100 USDC and gets in return 100 aUSDC
   * @param asset The address of the underlying asset to supply
   * @param amount The amount to be supplied
   * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
   *   wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
   *   is a different wallet
   * @param referralCode Code used to register the integrator originating the operation, for potential rewards.
   *   0 if the action is executed directly by the user, without any middle-man
   */
  function supply(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external;

  /**
   * @notice Supply with transfer approval of asset to be supplied done via permit function
   * see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713
   * @param asset The address of the underlying asset to supply
   * @param amount The amount to be supplied
   * @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
   *   wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
   *   is a different wallet
   * @param deadline The deadline timestamp that the permit is valid
   * @param referralCode Code used to register the integrator originating the operation, for potential rewards.
   *   0 if the action is executed directly by the user, without any middle-man
   * @param permitV The V parameter of ERC712 permit sig
   * @param permitR The R parameter of ERC712 permit sig
   * @param permitS The S parameter of ERC712 permit sig
   */
  function supplyWithPermit(
    address asset,
    uint256 amount,
    address onBehalfOf,
    uint16 referralCode,
    uint256 deadline,
    uint8 permitV,
    bytes32 permitR,
    bytes32 permitS
  ) external;

  /**
   * @notice Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned
   * E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC
   * @param asset The address of the underlying asset to withdraw
   * @param amount The underlying amount to be withdrawn
   *   - Send the value type(uint256).max in order to withdraw the whole aToken balance
   * @param to The address that will receive the underlying, same as msg.sender if the user
   *   wants to receive it on his own wallet, or a different address if the beneficiary is a
   *   different wallet
   * @return The final amount withdrawn
   */
  function withdraw(address asset, uint256 amount, address to) external returns (uint256);

  /**
   * @notice Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower
   * already supplied enough collateral, or he was given enough allowance by a credit delegator on the
   * corresponding debt token (StableDebtToken or VariableDebtToken)
   * - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet
   *   and 100 stable/variable debt tokens, depending on the `interestRateMode`
   * @param asset The address of the underlying asset to borrow
   * @param amount The amount to be borrowed
   * @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable
   * @param referralCode The code used to register the integrator originating the operation, for potential rewards.
   *   0 if the action is executed directly by the user, without any middle-man
   * @param onBehalfOf The address of the user who will receive the debt. Should be the address of the borrower itself
   * calling the function if he wants to borrow against his own collateral, or the address of the credit delegator
   * if he has been given credit delegation allowance
   */
  function borrow(
    address asset,
    uint256 amount,
    uint256 interestRateMode,
    uint16 referralCode,
    address onBehalfOf
  ) external;

  /**
   * @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned
   * - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address
   * @param asset The address of the borrowed underlying asset previously borrowed
   * @param amount The amount to repay
   * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
   * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
   * @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the
   * user calling the function if he wants to reduce/remove his own debt, or the address of any other
   * other borrower whose debt should be removed
   * @return The final amount repaid
   */
  function repay(
    address asset,
    uint256 amount,
    uint256 interestRateMode,
    address onBehalfOf
  ) external returns (uint256);

  /**
   * @notice Repay with transfer approval of asset to be repaid done via permit function
   * see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713
   * @param asset The address of the borrowed underlying asset previously borrowed
   * @param amount The amount to repay
   * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
   * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
   * @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the
   * user calling the function if he wants to reduce/remove his own debt, or the address of any other
   * other borrower whose debt should be removed
   * @param deadline The deadline timestamp that the permit is valid
   * @param permitV The V parameter of ERC712 permit sig
   * @param permitR The R parameter of ERC712 permit sig
   * @param permitS The S parameter of ERC712 permit sig
   * @return The final amount repaid
   */
  function repayWithPermit(
    address asset,
    uint256 amount,
    uint256 interestRateMode,
    address onBehalfOf,
    uint256 deadline,
    uint8 permitV,
    bytes32 permitR,
    bytes32 permitS
  ) external returns (uint256);

  /**
   * @notice Repays a borrowed `amount` on a specific reserve using the reserve aTokens, burning the
   * equivalent debt tokens
   * - E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens
   * @dev  Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken
   * balance is not enough to cover the whole debt
   * @param asset The address of the borrowed underlying asset previously borrowed
   * @param amount The amount to repay
   * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
   * @param interestRateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
   * @return The final amount repaid
   */
  function repayWithATokens(
    address asset,
    uint256 amount,
    uint256 interestRateMode
  ) external returns (uint256);

  /**
   * @notice Allows a borrower to swap his debt between stable and variable mode, or vice versa
   * @param asset The address of the underlying asset borrowed
   * @param interestRateMode The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable
   */
  function swapBorrowRateMode(address asset, uint256 interestRateMode) external;

  /**
   * @notice Rebalances the stable interest rate of a user to the current stable rate defined on the reserve.
   * - Users can be rebalanced if the following conditions are satisfied:
   *     1. Usage ratio is above 95%
   *     2. the current supply APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too
   *        much has been borrowed at a stable rate and suppliers are not earning enough
   * @param asset The address of the underlying asset borrowed
   * @param user The address of the user to be rebalanced
   */
  function rebalanceStableBorrowRate(address asset, address user) external;

  /**
   * @notice Allows suppliers to enable/disable a specific supplied asset as collateral
   * @param asset The address of the underlying asset supplied
   * @param useAsCollateral True if the user wants to use the supply as collateral, false otherwise
   */
  function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) external;

  /**
   * @notice Function to liquidate a non-healthy position collateral-wise, with Health Factor below 1
   * - The caller (liquidator) covers `debtToCover` amount of debt of the user getting liquidated, and receives
   *   a proportionally amount of the `collateralAsset` plus a bonus to cover market risk
   * @param collateralAsset The address of the underlying asset used as collateral, to receive as result of the liquidation
   * @param debtAsset The address of the underlying borrowed asset to be repaid with the liquidation
   * @param user The address of the borrower getting liquidated
   * @param debtToCover The debt amount of borrowed `asset` the liquidator wants to cover
   * @param receiveAToken True if the liquidators wants to receive the collateral aTokens, `false` if he wants
   * to receive the underlying collateral asset directly
   */
  function liquidationCall(
    address collateralAsset,
    address debtAsset,
    address user,
    uint256 debtToCover,
    bool receiveAToken
  ) external;

  /**
   * @notice Returns the user account data across all the reserves
   * @param user The address of the user
   * @return totalCollateralBase The total collateral of the user in the base currency used by the price feed
   * @return totalDebtBase The total debt of the user in the base currency used by the price feed
   * @return availableBorrowsBase The borrowing power left of the user in the base currency used by the price feed
   * @return currentLiquidationThreshold The liquidation threshold of the user
   * @return ltv The loan to value of The user
   * @return healthFactor The current health factor of the user
   */
  function getUserAccountData(
    address user
  )
    external
    view
    returns (
      uint256 totalCollateralBase,
      uint256 totalDebtBase,
      uint256 availableBorrowsBase,
      uint256 currentLiquidationThreshold,
      uint256 ltv,
      uint256 healthFactor
    );

  /**
   * @notice Validates and finalizes an aToken transfer
   * @dev Only callable by the overlying aToken of the `asset`
   * @param asset The address of the underlying asset of the aToken
   * @param from The user from which the aTokens are transferred
   * @param to The user receiving the aTokens
   * @param amount The amount being transferred/withdrawn
   * @param balanceFromBefore The aToken balance of the `from` user before the transfer
   * @param balanceToBefore The aToken balance of the `to` user before the transfer
   */
  function finalizeTransfer(
    address asset,
    address from,
    address to,
    uint256 amount,
    uint256 balanceFromBefore,
    uint256 balanceToBefore
  ) external;

  /**
   * @notice Returns the list of the underlying assets of all the initialized reserves
   * @dev It does not include dropped reserves
   * @return The addresses of the underlying assets of the initialized reserves
   */
  function getReservesList() external view returns (address[] memory);

  /**
   * @notice Returns the address of the underlying asset of a reserve by the reserve id as stored in the DataTypes.ReserveData struct
   * @param id The id of the reserve as stored in the DataTypes.ReserveData struct
   * @return The address of the reserve associated with id
   */
  function getReserveAddressById(uint16 id) external view returns (address);

  /**
   * @notice Updates flash loan premiums. Flash loan premium consists of two parts:
   * - A part is sent to aToken holders as extra, one time accumulated interest
   * - A part is collected by the protocol treasury
   * @dev The total premium is calculated on the total borrowed amount
   * @dev The premium to protocol is calculated on the total premium, being a percentage of `flashLoanPremiumTotal`
   * @dev Only callable by the PoolConfigurator contract
   * @param flashLoanPremiumTotal The total premium, expressed in bps
   * @param flashLoanPremiumToProtocol The part of the premium sent to the protocol treasury, expressed in bps
   */
  function updateFlashloanPremiums(
    uint128 flashLoanPremiumTotal,
    uint128 flashLoanPremiumToProtocol
  ) external;

  /**
   * @notice Allows a user to use the protocol in eMode
   * @param categoryId The id of the category
   */
  function setUserEMode(uint8 categoryId) external;

  /**
   * @notice Returns the eMode the user is using
   * @param user The address of the user
   * @return The eMode id
   */
  function getUserEMode(address user) external view returns (uint256);

  /**
   * @notice Resets the isolation mode total debt of the given asset to zero
   * @dev It requires the given asset has zero debt ceiling
   * @param asset The address of the underlying asset to reset the isolationModeTotalDebt
   */
  function resetIsolationModeTotalDebt(address asset) external;

  /**
   * @notice Returns the percentage of available liquidity that can be borrowed at once at stable rate
   * @return The percentage of available liquidity to borrow, expressed in bps
   */
  function MAX_STABLE_RATE_BORROW_SIZE_PERCENT() external view returns (uint256);

  /**
   * @notice Returns the total fee on flash loans
   * @return The total fee on flashloans
   */
  function FLASHLOAN_PREMIUM_TOTAL() external view returns (uint128);

  /**
   * @notice Returns the part of the bridge fees sent to protocol
   * @return The bridge fee sent to the protocol treasury
   */
  function BRIDGE_PROTOCOL_FEE() external view returns (uint256);

  /**
   * @notice Returns the part of the flashloan fees sent to protocol
   * @return The flashloan fee sent to the protocol treasury
   */
  function FLASHLOAN_PREMIUM_TO_PROTOCOL() external view returns (uint128);

  /**
   * @notice Returns the maximum number of reserves supported to be listed in this Pool
   * @return The maximum number of reserves supported
   */
  function MAX_NUMBER_RESERVES() external view returns (uint16);

}

File 15 of 19 : ISwapX.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;


/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Algebra
/// @dev Credit to Uniswap Labs under GPL-2.0-or-later license:
/// https://github.com/Uniswap/v3-periphery
interface ISwapX {
    struct ExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        address recipient;
        uint256 amountIn;
        uint256 amountOutMinimum;
        uint160 limitSqrtPrice;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another token
    /// @dev Setting `amountIn` to 0 will cause the contract to look up its own balance,
    /// and swap the entire amount, enabling contracts to send tokens before calling this function.
    /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);

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

    /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
    /// @dev Setting `amountIn` to 0 will cause the contract to look up its own balance,
    /// and swap the entire amount, enabling contracts to send tokens before calling this function.
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);

    struct ExactOutputSingleParams {
        address tokenIn;
        address tokenOut;
        address recipient;
        uint256 amountOut;
        uint256 amountInMaximum;
        uint160 limitSqrtPrice;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another token
    /// that may remain in the router after the swap.
    /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);

    struct ExactOutputParams {
        bytes path;
        address recipient;
        uint256 amountOut;
        uint256 amountInMaximum;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
    /// that may remain in the router after the swap.
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);

    /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
    /// @dev Unlike standard swaps, handles transferring from user before the actual swap.
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInputSingleSupportingFeeOnTransferTokens(
        ExactInputSingleParams calldata params
    ) external payable returns (uint256 amountOut);
}

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

interface ISwapXGauge {

    /* -----------------------------------------------------------------------------
    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------
                                        VIEW
    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------
    ----------------------------------------------------------------------------- */

    ///@notice total supply held
    function totalSupply() external view returns (uint256);

    ///@notice balance of a user
    function balanceOf(address account) external view returns (uint256);

    ///@notice last time reward
    function lastTimeRewardApplicable() external view returns (uint256);

    ///@notice  reward for a sinle token
    function rewardPerToken() external view returns (uint256);

    ///@notice see earned rewards for user
    function earned(address account) external view returns (uint256);

    ///@notice get total reward for the duration
    function rewardForDuration() external view returns (uint256);

    function _periodFinish() external view returns (uint256);

    /* -----------------------------------------------------------------------------
    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------
                                    USER INTERACTION
    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------
    ----------------------------------------------------------------------------- */

    ///@notice deposit all TOKEN of msg.sender
    function depositAll() external;

    ///@notice deposit amount TOKEN
    function deposit(uint256 amount) external;


    ///@notice withdraw all token
    function withdrawAll() external;

    ///@notice withdraw a certain amount of TOKEN
    function withdraw(uint256 amount) external;

    function emergencyWithdraw() external;

    function emergencyWithdrawAmount(uint256 _amount) external;

    ///@notice withdraw all TOKEN and harvest rewardToken
    function withdrawAllAndHarvest() external;
    ///@notice User harvest function called from distribution (voter allows harvest on multiple gauges)
    function getReward(address _user) external;

    ///@notice User harvest function
    function getReward() external;

    /* -----------------------------------------------------------------------------
    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------
                                    DISTRIBUTION
    --------------------------------------------------------------------------------
    --------------------------------------------------------------------------------
    ----------------------------------------------------------------------------- */

    /// @dev Receive rewards from distribution
    function notifyRewardAmount(
        address token,
        uint reward
    ) external;

    function claimFees()
        external
        returns (uint claimed0, uint claimed1);
}

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

interface IPair {
    function metadata() external view returns (uint dec0, uint dec1, uint r0, uint r1, bool st, address t0, address t1);
    function claimFees() external returns (uint, uint);
    function tokens() external view returns (address, address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function transferFrom(address src, address dst, uint amount) external returns (bool);
    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function burn(address to) external returns (uint amount0, uint amount1);
    function mint(address to) external returns (uint liquidity);
    function getReserves() external view returns (uint _reserve0, uint _reserve1, uint _blockTimestampLast);
    function getAmountOut(uint, address) external view returns (uint);

    function name() external view returns(string memory);
    function symbol() external view returns(string memory);
    function totalSupply() external view returns (uint);
    function decimals() external view returns (uint8);

    function claimable0(address _user) external view returns (uint);
    function claimable1(address _user) external view returns (uint);

    function isStable() external view returns(bool);


}

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

interface IRouterV2 {
    struct route {
        address from;
        address to;
        bool stable;
    }

    // performs chained getAmountOut calculations on any number of pairs
    function getAmountOut(
        uint amountIn,
        address tokenIn,
        address tokenOut
    ) external view returns (uint amount, bool stable);

    // performs chained getAmountOut calculations on any number of pairs
    function getAmountsOut(
        uint amountIn,
        route[] memory routes
    ) external view returns (uint[] memory amounts);

    function isPair(address pair) external view returns (bool);

    function quoteAddLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint amountADesired,
        uint amountBDesired
    ) external view returns (uint amountA, uint amountB, uint liquidity);

    function quoteRemoveLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint liquidity
    ) external view returns (uint amountA, uint amountB);

    function addLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);

    function addLiquidityETH(
        address token,
        bool stable,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH, uint liquidity);

    // **** REMOVE LIQUIDITY ****
    function removeLiquidity(
        address tokenA,
        address tokenB,
        bool stable,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);

    function removeLiquidityETH(
        address token,
        bool stable,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);

    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        bool stable,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint amountA, uint amountB);

    function removeLiquidityETHWithPermit(
        address token,
        bool stable,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint amountToken, uint amountETH);

    function swapExactTokensForTokensSimple(
        uint amountIn,
        uint amountOutMin,
        address tokenFrom,
        address tokenTo,
        bool stable,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);

    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        route[] calldata routes,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);

    function swapExactETHForTokens(
        uint amountOutMin,
        route[] calldata routes,
        address to,
        uint deadline
    ) external payable returns (uint[] memory amounts);

    function swapExactTokensForETH(
        uint amountIn,
        uint amountOutMin,
        route[] calldata routes,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        route[] calldata routes,
        address to,
        uint deadline
    ) external;

    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        route[] calldata routes,
        address to,
        uint deadline
    ) external payable;

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        route[] calldata routes,
        address to,
        uint deadline
    ) external;
}

File 19 of 19 : IV2SwapRouter.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V2
interface IV2SwapRouter {

    struct Route {
        address from;
        address to;
        bool stable;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another token
    /// @dev Setting `amountIn` to 0 will cause the contract to look up its own balance,
    /// and swap the entire amount, enabling contracts to send tokens before calling this function.
    /// @param amountIn The amount of token to swap
    /// @param amountOutMin The minimum amount of output that must be received
    /// @param path The ordered list of tokens to swap through
    /// @param to The recipient address
    /// @return amountOut The amount of the received token
    function swapExactTokensForTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        Route[] calldata path,
        address to
    ) external payable returns (uint256 amountOut);

}

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":"_unirouter","type":"address"},{"internalType":"address","name":"_lpRouter","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":"AURUM","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"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":[],"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":"lpRouter","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":"refCode","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"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":[{"internalType":"bool","name":"_harvestOnDeposit","type":"bool"}],"name":"setHarvestOnDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_code","type":"uint16"}],"name":"setRefCode","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":"usdc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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"}]

6080604081815234620007355760e082620032ca80380380916200002482856200073a565b83398101031262000735576200003a8262000774565b916020906200004b82820162000774565b916200005984830162000774565b91620000686060820162000774565b93620000776080830162000774565b936200009460c06200008c60a0860162000789565b940162000774565b9233156200071d57600095865489519560018060a01b0380809d8194338d7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08584169180a360ff60a01b1933169060018060a81b031916178c5560018055620186a060065560646007556103e86008556064600955610384600a55602d600b5516938160018060a01b031998868a60055416176005551688600c541617600c5581600d9c16888d5416178c551686600e541617600e5516846011541617601155630dfe168160e01b855260049486818781855afa9081156200052857918b889288948b91620006d9575b50168660025416176002558a519283809263d21220a760e01b82525afa9081156200048557908a939291889162000694575b50831684600354161760035560ff8019601054169115151680911760105562000662575b168082845416178355601254680100000000000000008110156200064f5760018101806012558110156200063c576012865284862001918254161790558286600554169487600c54169087519063095ea7b360e01b928383528583015260001991868160249a858c8301528160449889925af18015620005285762000600575b5089815416895190848252868201528289820152868186818b73039e2fb66102314ce7b64ce5ce3e5183bc94ad385af1801562000528578a86888b8f8e968d96620005b7575b50888184541691895416955197889687958d87528601528401525af1801562000528576200057b575b5088518381527369f196a108002fd75d4b0a1118ee04c065a63de9868201528289820152868186818b7329219dd400f2bf60e5a23d13be72b486d40388945af1801562000528578a86888b8f8e968d9662000532575b5088816002541691895416955197889687958d87528601528401525af180156200052857858b8a86958f8c968f96620004dc575b508060035416915416925196879586948b86528d8601528401525af18015620004855788858b8a8e87968c966200048f575b50806002541690600e5416925196879586948b86528d8601528401525af180156200048557918798999a9187989362000437575b50816003541691600e5416998b519a8b97889687528601528401525af180156200042d57620003ec575b8351612b329081620007988239f35b82813d831162000425575b6200040381836200073a565b81010312620004225750620004189062000789565b50388080620003dd565b80fd5b503d620003f7565b84513d84823e3d90fd5b878193959697989294503d83116200047d575b6200045681836200073a565b81010312620004795791879162000471889796959462000789565b5038620003b3565b8780fd5b503d6200044a565b89513d89823e3d90fd5b9650505050505081813d8311620004d4575b620004ad81836200073a565b81010312620004d0578588858b8a8e620004c8889762000789565b50386200037f565b8680fd5b503d620004a1565b96955050955050505081813d831162000520575b620004fc81836200073a565b81010312620004795788858b8a86958f620005188d9762000789565b50386200034d565b503d620004f0565b8a513d8a823e3d90fd5b9650505050505081813d831162000573575b6200055081836200073a565b810103126200047957868a86888b8f6200056b8f9762000789565b503862000319565b503d62000544565b8681813d8311620005af575b6200059381836200073a565b810103126200047957620005a79062000789565b5038620002c3565b503d62000587565b9650505050505081813d8311620005f8575b620005d581836200073a565b810103126200047957868a86888b8f620005f08f9762000789565b50386200029a565b503d620005c9565b8681813d831162000634575b6200061881836200073a565b8101031262000479576200062c9062000789565b503862000254565b503d6200060c565b634e487b7160e01b865260328452602486fd5b634e487b7160e01b865260418452602486fd5b856007557f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af858951888152a1620001d4565b8092939450878092503d8311620006d1575b620006b281836200073a565b81010312620004d0579089620006ca81949362000774565b90620001b0565b503d620006a6565b93929450505081813d831162000715575b620006f681836200073a565b81010312620004795785918b6200070e899362000774565b386200017e565b503d620006ea565b8751631e4fbdf760e01b815260006004820152602490fd5b600080fd5b601f909101601f19168101906001600160401b038211908210176200075e57604052565b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b03821682036200073557565b51908115158203620007355756fe608080604052600436101561001357600080fd5b600090813560e01c908163025e30b0146126065750806309746324146125dd5780630c8106dc146125b45780630e8fbb5a14612512578063104ba865146124e357806311588086146124c8578063117da1ee14612437578063171d21891461241b578063257ae0de146123f25780632638c09e146123c957806327ced5371461239a5780632dc7d74c146123715780632e1a7d4d146120b657806330f5e661146120745780633410fe6e1461205657806334fbc9a1146120385780633e413bee146120095780633f4ba83a14611c445780634641257d1461145b57806354518b1a1461143d578063573fef0a14610bba5780635c975abb14610b9557806361d027b314610b6c578063635677f214610b4757806366666aa914610b1e5780636817031b14610a53578063715018a6146109f9578063722713f7146109de5780637b83fc1d146109b55780637ff8f1e9146109925780638456cb591461069a5780638912cb8b146106775780638da5cb5b14610650578063951d6d20146106325780639bff5ddb14610614578063d03153aa146105f6578063d0e30db014610555578063e7a7250a146104c2578063f1a392da146104a4578063f2fde38b14610412578063f301af42146103b6578063fb617787146102295763fbfa77cf146101fa57600080fd5b3461022657806003193601126102265760105460405160189190911c6001600160a01b03168152602090f35b80fd5b503461022657806003193601126102265760018060a01b036102538160105460181c163314612779565b8181600c5416610261612aa6565b813b156103b2578291602483926040519485938492632e1a7d4d60e01b845260048401525af180156103a75761038f575b505080600554166040516370a0823160e01b81523060048201526020928382602481865afa908115610384578492869261034c575b5060105460405163a9059cbb60e01b81526001600160a01b0360189290921c9092161660048201526024810191909152918290818681604481015b03925af1801561034157610314578280f35b8161033392903d1061033a575b61032b8183612699565b810190612ae4565b5038808280f35b503d610321565b6040513d85823e3d90fd5b8381949293503d831161037d575b6103648183612699565b8101031261037857905183916103026102c7565b600080fd5b503d61035a565b6040513d87823e3d90fd5b6103989061266f565b6103a3578138610292565b5080fd5b6040513d84823e3d90fd5b8280fd5b5034610226576020366003190112610226576004356012548110156103a35760129091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec344401546040516001600160a01b039091168152602090f35b5034610226576020366003190112610226576004356001600160a01b03818116918290036103b257610442612622565b811561048b57600054826bffffffffffffffffffffffff60a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b604051631e4fbdf760e01b815260048101849052602490fd5b50346102265780600319360112610226576020600f54604051908152f35b5034610226578060031936011261022657600c546040516246613160e11b81523060048201529190602090839060249082906001600160a01b03165afa9081156105495790610517575b602090604051908152f35b506020813d8211610541575b8161053060209383612699565b81010312610378576020905161050c565b3d9150610523565b604051903d90823e3d90fd5b50346102265780600319360112610226576010543360189190911c6001600160a01b03161480156105ed575b156105995761058e61264e565b6105966126bb565b80f35b60405162461bcd60e51b815260206004820152602660248201527f4e6f7420617574686f72697a65642c206f6e6c79205661756c74206f7220537460448201526572617465677960d01b6064820152608490fd5b50303314610581565b50346102265780600319360112610226576020601354604051908152f35b50346102265780600319360112610226576020600754604051908152f35b50346102265780600319360112610226576020600954604051908152f35b5034610226578060031936011261022657546040516001600160a01b039091168152602090f35b5034610226578060031936011261022657602060ff601054166040519015158152f35b50346102265780600319360112610226576106b3612622565b6106bb61264e565b805460ff60a01b1916600160a01b1781556040513381526020907f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258908290a160018060a01b03828160055416918181600c541660405163095ea7b360e01b918282526004820152868160249785898301528160449687925af1801561038457610975575b5082600d54166040519082825260048201528486820152868184818873039e2fb66102314ce7b64ce5ce3e5183bc94ad385af1801561038457610958575b50838684600454168486600d541660405194859384928884526004840152818c8401525af180156103845761093b575b506040518181527369f196a108002fd75d4b0a1118ee04c065a63de96004820152848682015286818481887329219dd400f2bf60e5a23d13be72b486d40388945af180156103845761091e575b50838684600254168486600d541660405194859384928884526004840152818c8401525af1801561038457610901575b50838684600354168486600d541660405194859384928884526004840152818c8401525af18015610384576108e4575b508583600254168385600e541660405197889384928784526004840152818b8401525af19384156108d95786946108bc575b5086836003541693600e541693816040519788968795865260048601528401525af1801561034157610314578280f35b6108d290853d871161033a5761032b8183612699565b503861088c565b6040513d89823e3d90fd5b6108fa90873d891161033a5761032b8183612699565b503861085a565b61091790873d891161033a5761032b8183612699565b503861082a565b61093490873d891161033a5761032b8183612699565b50386107fa565b61095190873d891161033a5761032b8183612699565b50386107ad565b61096e90873d891161033a5761032b8183612699565b503861077d565b61098b90873d891161033a5761032b8183612699565b503861073f565b503461022657806003193601126102265760206109ad612a3a565b604051908152f35b50346102265780600319360112610226576002546040516001600160a01b039091168152602090f35b503461022657806003193601126102265760206109ad612a1e565b5034610226578060031936011261022657610a12612622565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5034610226576020366003190112610226576004356001600160a01b038116908181036103b257610a82612622565b803b15610ad957601080546301000000600160b81b03191660189290921b6301000000600160b81b03169190911790557fd459c7242e23d490831b5676a611c4342d899d28f342d89ae80793e56a930f308280a280f35b60405162461bcd60e51b815260206004820152601860248201527f5661756c74206d757374206265206120636f6e747261637400000000000000006044820152606490fd5b5034610226578060031936011261022657600c546040516001600160a01b039091168152602090f35b5034610226578060031936011261022657602061ffff60105460081c16604051908152f35b50346102265780600319360112610226576011546040516001600160a01b039091168152602090f35b503461022657806003193601126102265760ff6020915460a01c166040519015158152f35b503461022657806003193601126102265760105460ff8116610bda575080f35b6001600160a01b039060181c8116330361140357610bf661264e565b8181600c5416803b156103a357818091600460405180948193631e8c5c8960e11b83525af180156103a7576113ef575b5050806004541690604051906370a0823160e01b9182815230600482015260209160249183818481895afa9081156108d95787916113c2575b50610c96575b505050505042600f55337f188a622567eeca997c3d494fd65f76ca910b90a50a0c44d5e37b2ea5539e027b8280a280f35b856040519585875230600488015284878581845afa9687156103a757829761138f575b50610cc261287c565b90815273039e2fb66102314ce7b64ce5ce3e5183bc94ad38908186820152306040820152606097888201528260a082015283600d5416866040518092818781610d1963076c8e2d60e11b98898352600483016128bf565b03925af1908115611321578791611360575b505060405187815230600482015286818781865afa90811561132157849161132c575b506040610d7f7f5c48b059bc2759d631bf4951f184f5641ca6db26a8ad956276910a01562d59b392600b54906127d1565b610da1610d8f60085480936127e4565b91610d9c600954846127d1565b6127e4565b90610db9610daf83836127ae565b8960115416612804565b825191825289820152a160405187815230600482015286818781865afa92831561132157879185946112ef575b50610def61287c565b9081527329219dd400f2bf60e5a23d13be72b486d4038894938483830152306040830152808b8301528560a0830152611288575b5050506040519086825230600483015285828681845afa918215610341578392611256575b50816111d4575b50505080600254166040519085825230600483015284828581845afa90811561110857859289926111a3575b50610e8461290b565b9180611113575b50505050806003541660405185815230600482015284818581855afa801561110857859189916110d9575b5060011c610ec261290b565b81611041575b5050505080600254168660405186815230600482015285818681865afa9081156103a7578291611010575b50836003541696604051908152306004820152868187818b5afa968715610341578397610fdd575b505080151580610fd4575b610f45575b5050505050505050610f3b6126bb565b3880808080610c65565b879561012494600e5416916040519889978896635a47ddc360e01b88526004880152860152836044860152606485015260848401528160a48401528160c48401523060e4840152426101048401525af1801561034157610fab575b808080808681610f2b565b813d8311610fcd575b610fbe8183612699565b81010312610226573880610fa0565b503d610fb4565b50851515610f26565b809297508193503d8311611009575b610ff68183612699565b8101031261037857879051943880610f1b565b503d610fec565b809250868092503d831161103a575b6110298183612699565b810103126103785787905138610ef3565b503d61101f565b6110969361104e82612978565b515284600254168361105f83612978565b51015289604061106e83612978565b51015284600d5416908a604051809681958294632fdb223960e01b845230916004850161299b565b03925af19081156108d95784916110b0575b808291610ec8565b813d83116110d2575b6110c38183612699565b810103126103785782386110a8565b503d6110b9565b82819392503d8311611101575b6110f08183612699565b810103126103785784905138610eb6565b503d6110e6565b6040513d8a823e3d90fd5b82849261112261116a95612978565b515285600354168361113383612978565b5101528a604061114283612978565b51015285600d5416908b604051809681958294632fdb223960e01b845230916004850161299b565b03925af161117a575b8080610e8b565b813d831161119c575b61118d8183612699565b81010312610378578238611173565b503d611183565b8381949293503d83116111cd575b6111bb8183612699565b81010312610378578491519038610e7b565b503d6111b1565b61ffff60105460081c16917369f196a108002fd75d4b0a1118ee04c065a63de9803b1561125257849283608492604051968795869463617ba03760e01b865260048601528b85015230604485015260648401525af180156103a75761123a575b80610e4f565b6112439061266f565b61124e578538611234565b8580fd5b8480fd5b925090508482813d8111611281575b61126f8183612699565b81010312610378578791519038610e48565b503d611265565b6112a79286600d541690866040518096819582948352600483016128bf565b03925af19081156103415786916112c0575b8190610e23565b90809293503d83116112e8575b6112d78183612699565b8101031261037857869084386112b9565b503d6112cd565b9450925083813d831161131a575b6113078183612699565b8101031261037857858993519238610de6565b503d6112fd565b6040513d86823e3d90fd5b809450878092503d8311611359575b6113458183612699565b810103126103785791518892906040610d4e565b503d61133b565b90809294503d8311611388575b6113778183612699565b810103126103785787918538610d2b565b503d61136d565b85809298508193503d83116113bb575b6113a98183612699565b81010312610378578690519538610cb9565b503d61139f565b90508381813d83116113e8575b6113d98183612699565b81010312610378575138610c5f565b503d6113cf565b6113f89061266f565b6103a3578138610c26565b60405162461bcd60e51b81526020600482015260126024820152715661756c74206465706f736974206f6e6c7960701b6044820152606490fd5b50346102265780600319360112610226576020600654604051908152f35b5034610226578060031936011261022657333b158015611c2a575b15611bec5761148361264e565b600c546001600160a01b039082908216803b156103a357818091600460405180948193631e8c5c8960e11b83525af180156103a757611bd8575b5050806004541690604051906370a0823160e01b9182815230600482015260209160249183818481895afa9081156108d9578791611bab575b50611529575b8542600f55337f188a622567eeca997c3d494fd65f76ca910b90a50a0c44d5e37b2ea5539e027b8280a280f35b856040519585875230600488015284878581845afa9687156103a7578297611b78575b5061155561287c565b90815273039e2fb66102314ce7b64ce5ce3e5183bc94ad38908186820152306040820152606097888201528260a082015283600d54168660405180928187816115ac63076c8e2d60e11b98898352600483016128bf565b03925af1908115611321578791611b49575b505060405187815230600482015286818781865afa908115611321578491611b15575b5060406116127f5c48b059bc2759d631bf4951f184f5641ca6db26a8ad956276910a01562d59b392600b54906127d1565b611622610d8f60085480936127e4565b9061164161163083836127ae565b303303611b06578960115416612804565b825191825289820152a160405187815230600482015286818781865afa9283156113215787918594611ad4575b5061167761287c565b9081527329219dd400f2bf60e5a23d13be72b486d4038894938483830152306040830152808b8301528560a0830152611a6d575b5050506040519086825230600483015285828681845afa918215610341578392611a3b575b50816119c1575b50505080600254166040519085825230600483015284828581845afa9081156111085785928992611990575b5061170c61290b565b9180611948575b50505050806003541660405185815230600482015284818581855afa80156111085785918991611919575b5060011c61174a61290b565b816118c9575b5050505080600254168660405186815230600482015285818681865afa9081156103a7578291611898575b50836003541696604051908152306004820152868187818b5afa968715610341578397611865575b50508015158061185c575b6117cd575b50505050505050506117c36126bb565b38808080806114fc565b879561012494600e5416916040519889978896635a47ddc360e01b88526004880152860152836044860152606485015260848401528160a48401528160c48401523060e4840152426101048401525af1801561034157611833575b8080808086816117b3565b813d8311611855575b6118468183612699565b81010312610226573880611828565b503d61183c565b508515156117ae565b809297508193503d8311611891575b61187e8183612699565b81010312610378578790519438806117a3565b503d611874565b809250868092503d83116118c2575b6118b18183612699565b81010312610378578790513861177b565b503d6118a7565b6118d69361104e82612978565b03925af19081156108d95784916118f0575b808291611750565b813d8311611912575b6119038183612699565b810103126103785782386118e8565b503d6118f9565b82819392503d8311611941575b6119308183612699565b81010312610378578490513861173e565b503d611926565b82849261112261195795612978565b03925af1611967575b8080611713565b813d8311611989575b61197a8183612699565b81010312610378578238611960565b503d611970565b8381949293503d83116119ba575b6119a88183612699565b81010312610378578491519038611703565b503d61199e565b61ffff60105460081c16917369f196a108002fd75d4b0a1118ee04c065a63de9803b1561125257849283608492604051968795869463617ba03760e01b865260048601528b85015230604485015260648401525af180156103a757611a27575b806116d7565b611a309061266f565b61124e578538611a21565b925090508482813d8111611a66575b611a548183612699565b810103126103785787915190386116d0565b503d611a4a565b611a8c9286600d541690866040518096819582948352600483016128bf565b03925af1908115610341578691611aa5575b81906116ab565b90809293503d8311611acd575b611abc8183612699565b810103126103785786908438611a9e565b503d611ab2565b9450925083813d8311611aff575b611aec8183612699565b810103126103785785899351923861166e565b503d611ae2565b611b108433612804565b610daf565b809450878092503d8311611b42575b611b2e8183612699565b8101031261037857915188929060406115e1565b503d611b24565b90809294503d8311611b71575b611b608183612699565b8101031261037857879185386115be565b503d611b56565b85809298508193503d8311611ba4575b611b928183612699565b8101031261037857869051953861154c565b503d611b88565b90508381813d8311611bd1575b611bc28183612699565b810103126103785751386114f6565b503d611bb8565b611be19061266f565b6103a35781386114bd565b60405162461bcd60e51b815260206004820152601660248201527508585d5d1a0810dbdb9d1c9858dd0812185c9d995cdd60521b6044820152606490fd5b506010543360189190911c6001600160a01b031614611476565b5034610226578060031936011261022657611c5d612622565b805460ff8160a01c1615611ff75760ff60a01b191681556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a1600554600c5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af180156103a757611fd8575b50600d5460405163095ea7b360e01b81526001600160a01b03909116600482015260001960248201526020816044818573039e2fb66102314ce7b64ce5ce3e5183bc94ad385af180156103a757611fb9575b5060048054600d5460405163095ea7b360e01b81526001600160a01b03918216938101939093526000196024840152602091839160449183918791165af180156103a757611f9a575b5060405163095ea7b360e01b81527369f196a108002fd75d4b0a1118ee04c065a63de960048201526000196024820152602081604481857329219dd400f2bf60e5a23d13be72b486d40388945af180156103a757611f7b575b50600254600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af180156103a757611f5c575b50600354600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af180156103a757611f3d575b50600254600e5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af180156103a757611f1e575b50600354600e5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af180156103a757611eff575b506105966126bb565b611f179060203d60201161033a5761032b8183612699565b5038611ef6565b611f369060203d60201161033a5761032b8183612699565b5038611eaf565b611f559060203d60201161033a5761032b8183612699565b5038611e68565b611f749060203d60201161033a5761032b8183612699565b5038611e21565b611f939060203d60201161033a5761032b8183612699565b5038611dda565b611fb29060203d60201161033a5761032b8183612699565b5038611d81565b611fd19060203d60201161033a5761032b8183612699565b5038611d38565b611ff09060203d60201161033a5761032b8183612699565b5038611ce6565b604051638dfc202b60e01b8152600490fd5b503461022657806003193601126102265760206040517329219dd400f2bf60e5a23d13be72b486d40388948152f35b50346102265780600319360112610226576020600b54604051908152f35b50346102265780600319360112610226576020600854604051908152f35b50346102265760203660031901126102265760043561ffff811681036103a35761209c612622565b62ffff006010549160081b169062ffff0019161760105580f35b5034610226576020806003193601126103a35760043560026001541461235f57600260015560018060a01b03906120f58260105460181c163314612779565b8160055416906040519084826024816370a0823160e01b968782523060048301525afa908115612323578592879261232e575b508682828110612266575b5050600092935080821161225e575b5061215b612152600754836127d1565b600654906127e4565b60ff875460a01c161580612251575b612242575b5060055460105460405163a9059cbb60e01b86820190815260189290921c87166001600160a01b031660248201526044810193909352941693906121c081606481015b03601f198101835282612699565b519082855af115612236576000513d61222d5750803b155b61221557507f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d90612207612a1e565b604051908152a16001805580f35b60249060405190635274afe760e01b82526004820152fd5b600114156121d8565b6040513d6000823e3d90fd5b61224b916127ae565b3861216f565b5060ff601054161561216a565b905038612142565b919350915061227a85600c541691846127ae565b90803b156103b257602483926040519485938492632e1a7d4d60e01b845260048401525af1801561232357612310575b508383600554169260246040518095819382523060048301525afa801561038457849286916122de575b5082918638612133565b8381939492503d8311612309575b6122f68183612699565b81010312610378575183919060006122d4565b503d6122ec565b61231c9095919561266f565b93386122aa565b6040513d88823e3d90fd5b8381949293503d8311612358575b6123468183612699565b8101031261124e578491519038612128565b503d61233c565b604051633ee5aeb560e01b8152600490fd5b50346102265780600319360112610226576005546040516001600160a01b039091168152602090f35b5034610226578060031936011261022657602060405173039e2fb66102314ce7b64ce5ce3e5183bc94ad388152f35b50346102265780600319360112610226576004546040516001600160a01b039091168152602090f35b5034610226578060031936011261022657600d546040516001600160a01b039091168152602090f35b5034610226578060031936011261022657602090604051908152f35b503461022657602036600319011261022657600435612454612622565b6105dc811161248f576020817fe4a7fd2711237e77309a9a16ff636a748dbf956fd91f6e6da800d9302f441a7992601355604051908152a180f35b60405162461bcd60e51b8152602060048201526011602482015270496e76616c696420746f6c6572616e636560781b6044820152606490fd5b503461022657806003193601126102265760206109ad612aa6565b503461022657806003193601126102265760206040517369f196a108002fd75d4b0a1118ee04c065a63de98152f35b5034610226576020366003190112610226576004358015158091036103a357612539612622565b60ff801960105416911680911760105560001461258157806007557f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af6020604051838152a180f35b600a6007557f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af6020604051600a8152a180f35b5034610226578060031936011261022657600e546040516001600160a01b039091168152602090f35b50346102265780600319360112610226576003546040516001600160a01b039091168152602090f35b9050346103a357816003193601126103a357602090600a548152f35b6000546001600160a01b0316330361263657565b60405163118cdaa760e01b8152336004820152602490fd5b60ff60005460a01c1661265d57565b60405163d93c066560e01b8152600490fd5b67ffffffffffffffff811161268357604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761268357604052565b6005546040516370a0823160e01b8152306004820152906001600160a01b03906020908390602490829085165afa91821561223657600092612746575b5081612702575050565b600c541690813b156103785760009160248392604051948593849263b6b55f2560e01b845260048401525af180156122365761273b5750565b6127449061266f565b565b90916020823d8211612771575b8161276060209383612699565b8101031261022657505190386126f8565b3d9150612753565b1561278057565b60405162461bcd60e51b8152602060048201526006602482015265085d985d5b1d60d21b6044820152606490fd5b919082039182116127bb57565b634e487b7160e01b600052601160045260246000fd5b818102929181159184041417156127bb57565b81156127ee570490565b634e487b7160e01b600052601260045260246000fd5b60405163a9059cbb60e01b60208281019182526001600160a01b039093166024830152604482019390935260009061283f81606481016121b2565b5173039e2fb66102314ce7b64ce5ce3e5183bc94ad389382855af115612236576000513d6128735750803b155b6122155750565b6001141561286c565b6040519060c0820182811067ffffffffffffffff821117612683576040528160a06000918281528260208201528260408201528260608201528260808201520152565b91909160a060c082019381600180821b03918281511685528260208201511660208601528260408201511660408601526060810151606086015260808101516080860152015116910152565b6040805167ffffffffffffffff928183018481118382101761268357835260018252819260005b6020908181101561296f57825160608101928184108985111761268357602093855260008252600081830152600085830152828701015201612932565b50505091925050565b8051156129855760200190565b634e487b7160e01b600052603260045260246000fd5b91939293608083019183526001602092818486015260409360808587015283518092528060a087019401946000905b8382106129e8575050505050606091509360018060a01b0316910152565b865180516001600160a01b03908116885284820151168488015281015115158187015295820195606090950194908401906129ca565b612a26612a3a565b612a2e612aa6565b81018091116127bb5790565b6005546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa90811561223657600091612a78575090565b906020823d8211612a9e575b81612a9160209383612699565b8101031261022657505190565b3d9150612a84565b600c546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa90811561223657600091612a78575090565b9081602091031261037857518015158103610378579056fea2646970667358221220183b37f4b4137ef864a026ecb3b05c94ebf511ac8e9bef24746c50d6fae503f664736f6c63430008140033000000000000000000000000f9b7a6da525f6f05910f99b298bb792025128c6f000000000000000000000000ca958280ba083545c36a64e1aed18075317e3529000000000000000000000000a04bc7140c26fc9bb1f36b1a604c7a5a88fb0e70000000000000000000000000a047e2abf8263fca7c368f43e2f960a06fd9949f000000000000000000000000f5f7231073b3b41c04ba655e1a7438b1a7b29c2700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000c16da76872131bc6095f73b894b4757873dace1

Deployed Bytecode

0x608080604052600436101561001357600080fd5b600090813560e01c908163025e30b0146126065750806309746324146125dd5780630c8106dc146125b45780630e8fbb5a14612512578063104ba865146124e357806311588086146124c8578063117da1ee14612437578063171d21891461241b578063257ae0de146123f25780632638c09e146123c957806327ced5371461239a5780632dc7d74c146123715780632e1a7d4d146120b657806330f5e661146120745780633410fe6e1461205657806334fbc9a1146120385780633e413bee146120095780633f4ba83a14611c445780634641257d1461145b57806354518b1a1461143d578063573fef0a14610bba5780635c975abb14610b9557806361d027b314610b6c578063635677f214610b4757806366666aa914610b1e5780636817031b14610a53578063715018a6146109f9578063722713f7146109de5780637b83fc1d146109b55780637ff8f1e9146109925780638456cb591461069a5780638912cb8b146106775780638da5cb5b14610650578063951d6d20146106325780639bff5ddb14610614578063d03153aa146105f6578063d0e30db014610555578063e7a7250a146104c2578063f1a392da146104a4578063f2fde38b14610412578063f301af42146103b6578063fb617787146102295763fbfa77cf146101fa57600080fd5b3461022657806003193601126102265760105460405160189190911c6001600160a01b03168152602090f35b80fd5b503461022657806003193601126102265760018060a01b036102538160105460181c163314612779565b8181600c5416610261612aa6565b813b156103b2578291602483926040519485938492632e1a7d4d60e01b845260048401525af180156103a75761038f575b505080600554166040516370a0823160e01b81523060048201526020928382602481865afa908115610384578492869261034c575b5060105460405163a9059cbb60e01b81526001600160a01b0360189290921c9092161660048201526024810191909152918290818681604481015b03925af1801561034157610314578280f35b8161033392903d1061033a575b61032b8183612699565b810190612ae4565b5038808280f35b503d610321565b6040513d85823e3d90fd5b8381949293503d831161037d575b6103648183612699565b8101031261037857905183916103026102c7565b600080fd5b503d61035a565b6040513d87823e3d90fd5b6103989061266f565b6103a3578138610292565b5080fd5b6040513d84823e3d90fd5b8280fd5b5034610226576020366003190112610226576004356012548110156103a35760129091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec344401546040516001600160a01b039091168152602090f35b5034610226576020366003190112610226576004356001600160a01b03818116918290036103b257610442612622565b811561048b57600054826bffffffffffffffffffffffff60a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b604051631e4fbdf760e01b815260048101849052602490fd5b50346102265780600319360112610226576020600f54604051908152f35b5034610226578060031936011261022657600c546040516246613160e11b81523060048201529190602090839060249082906001600160a01b03165afa9081156105495790610517575b602090604051908152f35b506020813d8211610541575b8161053060209383612699565b81010312610378576020905161050c565b3d9150610523565b604051903d90823e3d90fd5b50346102265780600319360112610226576010543360189190911c6001600160a01b03161480156105ed575b156105995761058e61264e565b6105966126bb565b80f35b60405162461bcd60e51b815260206004820152602660248201527f4e6f7420617574686f72697a65642c206f6e6c79205661756c74206f7220537460448201526572617465677960d01b6064820152608490fd5b50303314610581565b50346102265780600319360112610226576020601354604051908152f35b50346102265780600319360112610226576020600754604051908152f35b50346102265780600319360112610226576020600954604051908152f35b5034610226578060031936011261022657546040516001600160a01b039091168152602090f35b5034610226578060031936011261022657602060ff601054166040519015158152f35b50346102265780600319360112610226576106b3612622565b6106bb61264e565b805460ff60a01b1916600160a01b1781556040513381526020907f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258908290a160018060a01b03828160055416918181600c541660405163095ea7b360e01b918282526004820152868160249785898301528160449687925af1801561038457610975575b5082600d54166040519082825260048201528486820152868184818873039e2fb66102314ce7b64ce5ce3e5183bc94ad385af1801561038457610958575b50838684600454168486600d541660405194859384928884526004840152818c8401525af180156103845761093b575b506040518181527369f196a108002fd75d4b0a1118ee04c065a63de96004820152848682015286818481887329219dd400f2bf60e5a23d13be72b486d40388945af180156103845761091e575b50838684600254168486600d541660405194859384928884526004840152818c8401525af1801561038457610901575b50838684600354168486600d541660405194859384928884526004840152818c8401525af18015610384576108e4575b508583600254168385600e541660405197889384928784526004840152818b8401525af19384156108d95786946108bc575b5086836003541693600e541693816040519788968795865260048601528401525af1801561034157610314578280f35b6108d290853d871161033a5761032b8183612699565b503861088c565b6040513d89823e3d90fd5b6108fa90873d891161033a5761032b8183612699565b503861085a565b61091790873d891161033a5761032b8183612699565b503861082a565b61093490873d891161033a5761032b8183612699565b50386107fa565b61095190873d891161033a5761032b8183612699565b50386107ad565b61096e90873d891161033a5761032b8183612699565b503861077d565b61098b90873d891161033a5761032b8183612699565b503861073f565b503461022657806003193601126102265760206109ad612a3a565b604051908152f35b50346102265780600319360112610226576002546040516001600160a01b039091168152602090f35b503461022657806003193601126102265760206109ad612a1e565b5034610226578060031936011261022657610a12612622565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5034610226576020366003190112610226576004356001600160a01b038116908181036103b257610a82612622565b803b15610ad957601080546301000000600160b81b03191660189290921b6301000000600160b81b03169190911790557fd459c7242e23d490831b5676a611c4342d899d28f342d89ae80793e56a930f308280a280f35b60405162461bcd60e51b815260206004820152601860248201527f5661756c74206d757374206265206120636f6e747261637400000000000000006044820152606490fd5b5034610226578060031936011261022657600c546040516001600160a01b039091168152602090f35b5034610226578060031936011261022657602061ffff60105460081c16604051908152f35b50346102265780600319360112610226576011546040516001600160a01b039091168152602090f35b503461022657806003193601126102265760ff6020915460a01c166040519015158152f35b503461022657806003193601126102265760105460ff8116610bda575080f35b6001600160a01b039060181c8116330361140357610bf661264e565b8181600c5416803b156103a357818091600460405180948193631e8c5c8960e11b83525af180156103a7576113ef575b5050806004541690604051906370a0823160e01b9182815230600482015260209160249183818481895afa9081156108d95787916113c2575b50610c96575b505050505042600f55337f188a622567eeca997c3d494fd65f76ca910b90a50a0c44d5e37b2ea5539e027b8280a280f35b856040519585875230600488015284878581845afa9687156103a757829761138f575b50610cc261287c565b90815273039e2fb66102314ce7b64ce5ce3e5183bc94ad38908186820152306040820152606097888201528260a082015283600d5416866040518092818781610d1963076c8e2d60e11b98898352600483016128bf565b03925af1908115611321578791611360575b505060405187815230600482015286818781865afa90811561132157849161132c575b506040610d7f7f5c48b059bc2759d631bf4951f184f5641ca6db26a8ad956276910a01562d59b392600b54906127d1565b610da1610d8f60085480936127e4565b91610d9c600954846127d1565b6127e4565b90610db9610daf83836127ae565b8960115416612804565b825191825289820152a160405187815230600482015286818781865afa92831561132157879185946112ef575b50610def61287c565b9081527329219dd400f2bf60e5a23d13be72b486d4038894938483830152306040830152808b8301528560a0830152611288575b5050506040519086825230600483015285828681845afa918215610341578392611256575b50816111d4575b50505080600254166040519085825230600483015284828581845afa90811561110857859289926111a3575b50610e8461290b565b9180611113575b50505050806003541660405185815230600482015284818581855afa801561110857859189916110d9575b5060011c610ec261290b565b81611041575b5050505080600254168660405186815230600482015285818681865afa9081156103a7578291611010575b50836003541696604051908152306004820152868187818b5afa968715610341578397610fdd575b505080151580610fd4575b610f45575b5050505050505050610f3b6126bb565b3880808080610c65565b879561012494600e5416916040519889978896635a47ddc360e01b88526004880152860152836044860152606485015260848401528160a48401528160c48401523060e4840152426101048401525af1801561034157610fab575b808080808681610f2b565b813d8311610fcd575b610fbe8183612699565b81010312610226573880610fa0565b503d610fb4565b50851515610f26565b809297508193503d8311611009575b610ff68183612699565b8101031261037857879051943880610f1b565b503d610fec565b809250868092503d831161103a575b6110298183612699565b810103126103785787905138610ef3565b503d61101f565b6110969361104e82612978565b515284600254168361105f83612978565b51015289604061106e83612978565b51015284600d5416908a604051809681958294632fdb223960e01b845230916004850161299b565b03925af19081156108d95784916110b0575b808291610ec8565b813d83116110d2575b6110c38183612699565b810103126103785782386110a8565b503d6110b9565b82819392503d8311611101575b6110f08183612699565b810103126103785784905138610eb6565b503d6110e6565b6040513d8a823e3d90fd5b82849261112261116a95612978565b515285600354168361113383612978565b5101528a604061114283612978565b51015285600d5416908b604051809681958294632fdb223960e01b845230916004850161299b565b03925af161117a575b8080610e8b565b813d831161119c575b61118d8183612699565b81010312610378578238611173565b503d611183565b8381949293503d83116111cd575b6111bb8183612699565b81010312610378578491519038610e7b565b503d6111b1565b61ffff60105460081c16917369f196a108002fd75d4b0a1118ee04c065a63de9803b1561125257849283608492604051968795869463617ba03760e01b865260048601528b85015230604485015260648401525af180156103a75761123a575b80610e4f565b6112439061266f565b61124e578538611234565b8580fd5b8480fd5b925090508482813d8111611281575b61126f8183612699565b81010312610378578791519038610e48565b503d611265565b6112a79286600d541690866040518096819582948352600483016128bf565b03925af19081156103415786916112c0575b8190610e23565b90809293503d83116112e8575b6112d78183612699565b8101031261037857869084386112b9565b503d6112cd565b9450925083813d831161131a575b6113078183612699565b8101031261037857858993519238610de6565b503d6112fd565b6040513d86823e3d90fd5b809450878092503d8311611359575b6113458183612699565b810103126103785791518892906040610d4e565b503d61133b565b90809294503d8311611388575b6113778183612699565b810103126103785787918538610d2b565b503d61136d565b85809298508193503d83116113bb575b6113a98183612699565b81010312610378578690519538610cb9565b503d61139f565b90508381813d83116113e8575b6113d98183612699565b81010312610378575138610c5f565b503d6113cf565b6113f89061266f565b6103a3578138610c26565b60405162461bcd60e51b81526020600482015260126024820152715661756c74206465706f736974206f6e6c7960701b6044820152606490fd5b50346102265780600319360112610226576020600654604051908152f35b5034610226578060031936011261022657333b158015611c2a575b15611bec5761148361264e565b600c546001600160a01b039082908216803b156103a357818091600460405180948193631e8c5c8960e11b83525af180156103a757611bd8575b5050806004541690604051906370a0823160e01b9182815230600482015260209160249183818481895afa9081156108d9578791611bab575b50611529575b8542600f55337f188a622567eeca997c3d494fd65f76ca910b90a50a0c44d5e37b2ea5539e027b8280a280f35b856040519585875230600488015284878581845afa9687156103a7578297611b78575b5061155561287c565b90815273039e2fb66102314ce7b64ce5ce3e5183bc94ad38908186820152306040820152606097888201528260a082015283600d54168660405180928187816115ac63076c8e2d60e11b98898352600483016128bf565b03925af1908115611321578791611b49575b505060405187815230600482015286818781865afa908115611321578491611b15575b5060406116127f5c48b059bc2759d631bf4951f184f5641ca6db26a8ad956276910a01562d59b392600b54906127d1565b611622610d8f60085480936127e4565b9061164161163083836127ae565b303303611b06578960115416612804565b825191825289820152a160405187815230600482015286818781865afa9283156113215787918594611ad4575b5061167761287c565b9081527329219dd400f2bf60e5a23d13be72b486d4038894938483830152306040830152808b8301528560a0830152611a6d575b5050506040519086825230600483015285828681845afa918215610341578392611a3b575b50816119c1575b50505080600254166040519085825230600483015284828581845afa9081156111085785928992611990575b5061170c61290b565b9180611948575b50505050806003541660405185815230600482015284818581855afa80156111085785918991611919575b5060011c61174a61290b565b816118c9575b5050505080600254168660405186815230600482015285818681865afa9081156103a7578291611898575b50836003541696604051908152306004820152868187818b5afa968715610341578397611865575b50508015158061185c575b6117cd575b50505050505050506117c36126bb565b38808080806114fc565b879561012494600e5416916040519889978896635a47ddc360e01b88526004880152860152836044860152606485015260848401528160a48401528160c48401523060e4840152426101048401525af1801561034157611833575b8080808086816117b3565b813d8311611855575b6118468183612699565b81010312610226573880611828565b503d61183c565b508515156117ae565b809297508193503d8311611891575b61187e8183612699565b81010312610378578790519438806117a3565b503d611874565b809250868092503d83116118c2575b6118b18183612699565b81010312610378578790513861177b565b503d6118a7565b6118d69361104e82612978565b03925af19081156108d95784916118f0575b808291611750565b813d8311611912575b6119038183612699565b810103126103785782386118e8565b503d6118f9565b82819392503d8311611941575b6119308183612699565b81010312610378578490513861173e565b503d611926565b82849261112261195795612978565b03925af1611967575b8080611713565b813d8311611989575b61197a8183612699565b81010312610378578238611960565b503d611970565b8381949293503d83116119ba575b6119a88183612699565b81010312610378578491519038611703565b503d61199e565b61ffff60105460081c16917369f196a108002fd75d4b0a1118ee04c065a63de9803b1561125257849283608492604051968795869463617ba03760e01b865260048601528b85015230604485015260648401525af180156103a757611a27575b806116d7565b611a309061266f565b61124e578538611a21565b925090508482813d8111611a66575b611a548183612699565b810103126103785787915190386116d0565b503d611a4a565b611a8c9286600d541690866040518096819582948352600483016128bf565b03925af1908115610341578691611aa5575b81906116ab565b90809293503d8311611acd575b611abc8183612699565b810103126103785786908438611a9e565b503d611ab2565b9450925083813d8311611aff575b611aec8183612699565b810103126103785785899351923861166e565b503d611ae2565b611b108433612804565b610daf565b809450878092503d8311611b42575b611b2e8183612699565b8101031261037857915188929060406115e1565b503d611b24565b90809294503d8311611b71575b611b608183612699565b8101031261037857879185386115be565b503d611b56565b85809298508193503d8311611ba4575b611b928183612699565b8101031261037857869051953861154c565b503d611b88565b90508381813d8311611bd1575b611bc28183612699565b810103126103785751386114f6565b503d611bb8565b611be19061266f565b6103a35781386114bd565b60405162461bcd60e51b815260206004820152601660248201527508585d5d1a0810dbdb9d1c9858dd0812185c9d995cdd60521b6044820152606490fd5b506010543360189190911c6001600160a01b031614611476565b5034610226578060031936011261022657611c5d612622565b805460ff8160a01c1615611ff75760ff60a01b191681556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90602090a1600554600c5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af180156103a757611fd8575b50600d5460405163095ea7b360e01b81526001600160a01b03909116600482015260001960248201526020816044818573039e2fb66102314ce7b64ce5ce3e5183bc94ad385af180156103a757611fb9575b5060048054600d5460405163095ea7b360e01b81526001600160a01b03918216938101939093526000196024840152602091839160449183918791165af180156103a757611f9a575b5060405163095ea7b360e01b81527369f196a108002fd75d4b0a1118ee04c065a63de960048201526000196024820152602081604481857329219dd400f2bf60e5a23d13be72b486d40388945af180156103a757611f7b575b50600254600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af180156103a757611f5c575b50600354600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af180156103a757611f3d575b50600254600e5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af180156103a757611f1e575b50600354600e5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291602091839160449183918791165af180156103a757611eff575b506105966126bb565b611f179060203d60201161033a5761032b8183612699565b5038611ef6565b611f369060203d60201161033a5761032b8183612699565b5038611eaf565b611f559060203d60201161033a5761032b8183612699565b5038611e68565b611f749060203d60201161033a5761032b8183612699565b5038611e21565b611f939060203d60201161033a5761032b8183612699565b5038611dda565b611fb29060203d60201161033a5761032b8183612699565b5038611d81565b611fd19060203d60201161033a5761032b8183612699565b5038611d38565b611ff09060203d60201161033a5761032b8183612699565b5038611ce6565b604051638dfc202b60e01b8152600490fd5b503461022657806003193601126102265760206040517329219dd400f2bf60e5a23d13be72b486d40388948152f35b50346102265780600319360112610226576020600b54604051908152f35b50346102265780600319360112610226576020600854604051908152f35b50346102265760203660031901126102265760043561ffff811681036103a35761209c612622565b62ffff006010549160081b169062ffff0019161760105580f35b5034610226576020806003193601126103a35760043560026001541461235f57600260015560018060a01b03906120f58260105460181c163314612779565b8160055416906040519084826024816370a0823160e01b968782523060048301525afa908115612323578592879261232e575b508682828110612266575b5050600092935080821161225e575b5061215b612152600754836127d1565b600654906127e4565b60ff875460a01c161580612251575b612242575b5060055460105460405163a9059cbb60e01b86820190815260189290921c87166001600160a01b031660248201526044810193909352941693906121c081606481015b03601f198101835282612699565b519082855af115612236576000513d61222d5750803b155b61221557507f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d90612207612a1e565b604051908152a16001805580f35b60249060405190635274afe760e01b82526004820152fd5b600114156121d8565b6040513d6000823e3d90fd5b61224b916127ae565b3861216f565b5060ff601054161561216a565b905038612142565b919350915061227a85600c541691846127ae565b90803b156103b257602483926040519485938492632e1a7d4d60e01b845260048401525af1801561232357612310575b508383600554169260246040518095819382523060048301525afa801561038457849286916122de575b5082918638612133565b8381939492503d8311612309575b6122f68183612699565b81010312610378575183919060006122d4565b503d6122ec565b61231c9095919561266f565b93386122aa565b6040513d88823e3d90fd5b8381949293503d8311612358575b6123468183612699565b8101031261124e578491519038612128565b503d61233c565b604051633ee5aeb560e01b8152600490fd5b50346102265780600319360112610226576005546040516001600160a01b039091168152602090f35b5034610226578060031936011261022657602060405173039e2fb66102314ce7b64ce5ce3e5183bc94ad388152f35b50346102265780600319360112610226576004546040516001600160a01b039091168152602090f35b5034610226578060031936011261022657600d546040516001600160a01b039091168152602090f35b5034610226578060031936011261022657602090604051908152f35b503461022657602036600319011261022657600435612454612622565b6105dc811161248f576020817fe4a7fd2711237e77309a9a16ff636a748dbf956fd91f6e6da800d9302f441a7992601355604051908152a180f35b60405162461bcd60e51b8152602060048201526011602482015270496e76616c696420746f6c6572616e636560781b6044820152606490fd5b503461022657806003193601126102265760206109ad612aa6565b503461022657806003193601126102265760206040517369f196a108002fd75d4b0a1118ee04c065a63de98152f35b5034610226576020366003190112610226576004358015158091036103a357612539612622565b60ff801960105416911680911760105560001461258157806007557f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af6020604051838152a180f35b600a6007557f3aa4413905e8f015896ec5880bdde24088ccb19b578f9fcf6800354d5320d4af6020604051600a8152a180f35b5034610226578060031936011261022657600e546040516001600160a01b039091168152602090f35b50346102265780600319360112610226576003546040516001600160a01b039091168152602090f35b9050346103a357816003193601126103a357602090600a548152f35b6000546001600160a01b0316330361263657565b60405163118cdaa760e01b8152336004820152602490fd5b60ff60005460a01c1661265d57565b60405163d93c066560e01b8152600490fd5b67ffffffffffffffff811161268357604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761268357604052565b6005546040516370a0823160e01b8152306004820152906001600160a01b03906020908390602490829085165afa91821561223657600092612746575b5081612702575050565b600c541690813b156103785760009160248392604051948593849263b6b55f2560e01b845260048401525af180156122365761273b5750565b6127449061266f565b565b90916020823d8211612771575b8161276060209383612699565b8101031261022657505190386126f8565b3d9150612753565b1561278057565b60405162461bcd60e51b8152602060048201526006602482015265085d985d5b1d60d21b6044820152606490fd5b919082039182116127bb57565b634e487b7160e01b600052601160045260246000fd5b818102929181159184041417156127bb57565b81156127ee570490565b634e487b7160e01b600052601260045260246000fd5b60405163a9059cbb60e01b60208281019182526001600160a01b039093166024830152604482019390935260009061283f81606481016121b2565b5173039e2fb66102314ce7b64ce5ce3e5183bc94ad389382855af115612236576000513d6128735750803b155b6122155750565b6001141561286c565b6040519060c0820182811067ffffffffffffffff821117612683576040528160a06000918281528260208201528260408201528260608201528260808201520152565b91909160a060c082019381600180821b03918281511685528260208201511660208601528260408201511660408601526060810151606086015260808101516080860152015116910152565b6040805167ffffffffffffffff928183018481118382101761268357835260018252819260005b6020908181101561296f57825160608101928184108985111761268357602093855260008252600081830152600085830152828701015201612932565b50505091925050565b8051156129855760200190565b634e487b7160e01b600052603260045260246000fd5b91939293608083019183526001602092818486015260409360808587015283518092528060a087019401946000905b8382106129e8575050505050606091509360018060a01b0316910152565b865180516001600160a01b03908116885284820151168488015281015115158187015295820195606090950194908401906129ca565b612a26612a3a565b612a2e612aa6565b81018091116127bb5790565b6005546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa90811561223657600091612a78575090565b906020823d8211612a9e575b81612a9160209383612699565b8101031261022657505190565b3d9150612a84565b600c546040516370a0823160e01b815230600482015290602090829060249082906001600160a01b03165afa90811561223657600091612a78575090565b9081602091031261037857518015158103610378579056fea2646970667358221220183b37f4b4137ef864a026ecb3b05c94ebf511ac8e9bef24746c50d6fae503f664736f6c63430008140033

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

000000000000000000000000f9b7a6da525f6f05910f99b298bb792025128c6f000000000000000000000000ca958280ba083545c36a64e1aed18075317e3529000000000000000000000000a04bc7140c26fc9bb1f36b1a604c7a5a88fb0e70000000000000000000000000a047e2abf8263fca7c368f43e2f960a06fd9949f000000000000000000000000f5f7231073b3b41c04ba655e1a7438b1a7b29c2700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000c16da76872131bc6095f73b894b4757873dace1

-----Decoded View---------------
Arg [0] : _staking_token (address): 0xf9b7a6Da525f6f05910f99b298bb792025128C6f
Arg [1] : _rewardPool (address): 0xca958280Ba083545C36A64e1AED18075317E3529
Arg [2] : _reward_token (address): 0xA04BC7140c26fc9BB1F36B1A604C7A5a88fb0E70
Arg [3] : _unirouter (address): 0xA047e2AbF8263FcA7c368F43e2f960A06FD9949f
Arg [4] : _lpRouter (address): 0xF5F7231073b3B41c04BA655e1a7438b1a7b29c27
Arg [5] : _harvestOnDeposit (bool): True
Arg [6] : _treasury (address): 0x0c16Da76872131bC6095f73b894B4757873dAce1

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000f9b7a6da525f6f05910f99b298bb792025128c6f
Arg [1] : 000000000000000000000000ca958280ba083545c36a64e1aed18075317e3529
Arg [2] : 000000000000000000000000a04bc7140c26fc9bb1f36b1a604c7a5a88fb0e70
Arg [3] : 000000000000000000000000a047e2abf8263fca7c368f43e2f960a06fd9949f
Arg [4] : 000000000000000000000000f5f7231073b3b41c04ba655e1a7438b1a7b29c27
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [6] : 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.