false
true
0

Contract Address Details

0x02b9E47F681CDe3EE1374d1508761E83e2eCf660

Contract Name
StrategyMasterChefV2
Creator
0xa04194–ace618 at 0x3f2e13–d1b952
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
25856714
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been partially verified via Sourcify. View contract in Sourcify repository
Contract name:
StrategyMasterChefV2




Optimization enabled
true
Compiler version
v0.8.20+commit.a1b79de6




Optimization runs
1
EVM Version
shanghai




Verified at
2026-02-12T16:09:05.763960Z

Constructor Arguments

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c9798c7447b209e79f12542691d4cda64b98bd96000000000000000000000000000000000000000000000000000000000000000300000000000000000000000074261876aec8c3f8a04f311ac7da620c48e4bf4a000000000000000000000000ca942990ef21446db490532e66992ed1ef76a82b000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a27000000000000000000000000165c3410fc91ef562c50559f7d2289febed552d900000000000000000000000064ec67306eb620f303d943841f7ba255bf1a7bf3000000000000000000000000a0419404ef7b81d9ec64367eb68e5f425eace618

Arg [0] (address) : 0x0000000000000000000000000000000000000000
Arg [1] (address) : 0xc9798c7447b209e79f12542691d4cda64b98bd96
Arg [2] (uint256) : 3
Arg [3] (address) : 0x74261876aec8c3f8a04f311ac7da620c48e4bf4a
Arg [4] (address) : 0xca942990ef21446db490532e66992ed1ef76a82b
Arg [5] (address) : 0xa1077a294dde1b09bb078844df40758a5d0f9a27
Arg [6] (address) : 0x165c3410fc91ef562c50559f7d2289febed552d9
Arg [7] (address) : 0x64ec67306eb620f303d943841f7ba255bf1a7bf3
Arg [8] (address) : 0xa0419404ef7b81d9ec64367eb68e5f425eace618

              

contracts/Vaults/StrategyMasterChefV2.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/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "./IStrategy.sol";

/// @title StrategyMasterChefV2
/// @notice Variant for MasterChef contracts that use deposit(pid, amount, referrer) signature
/// @dev Used by Emit and TrueFarms on PulseChain
interface IMasterChefV2 {
    function deposit(uint256 pid, uint256 amount, address referrer) external;
    function withdraw(uint256 pid, uint256 amount) external;
    function emergencyWithdraw(uint256 pid) external;
    function userInfo(uint256 pid, address user) external view returns (uint256 amount, uint256 rewardDebt);
    function pendingShare(uint256 pid, address user) external view returns (uint256);
}

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

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;

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

interface IUniPairV2 {
    function token0() external view returns (address);
    function token1() external view returns (address);
}

contract StrategyMasterChefV2 is IStrategy, Ownable, Pausable {
    using SafeERC20 for IERC20;

    // Core addresses
    address public override vault;
    address public override want;      // LP token
    address public earned;             // reward token from MasterChef
    address public native;             // WPLS - intermediate swap token

    // Farm
    IMasterChefV2 public masterChef;
    uint256 public pid;
    address public referrer;           // referral address for V2 MasterChef deposits

    // Router (dynamic - can be changed)
    IUniRouterV2 public router;

    // LP components
    address public lpToken0;
    address public lpToken1;

    // Swap paths (owner-configurable)
    address[] public earnedToNativePath;
    address[] public nativeToLp0Path;
    address[] public nativeToLp1Path;

    // Fees (basis points)
    uint256 public constant HARVEST_CALL_FEE = 50;    // 0.5% to harvest() caller
    uint256 public constant TREASURY_FEE = 400;        // 4.0% to treasury
    uint256 public constant TOTAL_FEE = 450;           // 4.5% total
    uint256 public constant FEE_DIVISOR = 10000;

    address public treasury;
    uint256 public lastHarvest;
    bool public feeOnTransfer; // true if earned/LP tokens have transfer tax

    event Harvest(address indexed caller, uint256 earned, uint256 callerFee, uint256 treasuryFee);
    event RouterUpdated(address indexed oldRouter, address indexed newRouter);
    event SwapPathsUpdated();

    constructor(
        address _vault,
        address _masterChef,
        uint256 _pid,
        address _want,
        address _earned,
        address _native,
        address _router,
        address _treasury,
        address _referrer
    ) Ownable(msg.sender) {
        vault = _vault;
        masterChef = IMasterChefV2(_masterChef);
        pid = _pid;
        want = _want;
        earned = _earned;
        native = _native;
        router = IUniRouterV2(_router);
        treasury = _treasury;
        referrer = _referrer;

        lpToken0 = IUniPairV2(_want).token0();
        lpToken1 = IUniPairV2(_want).token1();

        // Default paths: earned -> native, native -> lp0/lp1
        earnedToNativePath = new address[](2);
        earnedToNativePath[0] = _earned;
        earnedToNativePath[1] = _native;

        if (lpToken0 == _native) {
            nativeToLp0Path = new address[](1);
            nativeToLp0Path[0] = _native;
        } else {
            nativeToLp0Path = new address[](2);
            nativeToLp0Path[0] = _native;
            nativeToLp0Path[1] = lpToken0;
        }

        if (lpToken1 == _native) {
            nativeToLp1Path = new address[](1);
            nativeToLp1Path[0] = _native;
        } else {
            nativeToLp1Path = new address[](2);
            nativeToLp1Path[0] = _native;
            nativeToLp1Path[1] = lpToken1;
        }

        _giveAllowances();
    }

    modifier onlyVault() {
        require(msg.sender == vault, "!vault");
        _;
    }

    /// @notice Set vault address (only callable once, before vault is linked)
    function setVault(address _vault) external onlyOwner {
        require(vault == address(0), "vault already set");
        vault = _vault;
    }

    // --- IStrategy interface ---

    function beforeDeposit() external override onlyVault {}

    function deposit() public override whenNotPaused {
        if (msg.sender != vault) revert("!vault");
        uint256 wantBal = IERC20(want).balanceOf(address(this));
        if (wantBal > 0) {
            masterChef.deposit(pid, wantBal, referrer);
        }
    }

    function withdraw(uint256 _amount) external override onlyVault {
        uint256 wantBal = IERC20(want).balanceOf(address(this));
        if (wantBal < _amount) {
            masterChef.withdraw(pid, _amount - wantBal);
            wantBal = IERC20(want).balanceOf(address(this));
        }
        if (wantBal > _amount) {
            wantBal = _amount;
        }
        IERC20(want).safeTransfer(vault, wantBal);
    }

    function balanceOf() public view override returns (uint256) {
        return balanceOfWant() + balanceOfPool();
    }

    function balanceOfWant() public view override returns (uint256) {
        return IERC20(want).balanceOf(address(this));
    }

    function balanceOfPool() public view override returns (uint256) {
        (uint256 _amount, ) = masterChef.userInfo(pid, address(this));
        return _amount;
    }

    function paused() public view override(IStrategy, Pausable) returns (bool) {
        return super.paused();
    }

    // --- Harvest ---

    function harvest() public override whenNotPaused {
        masterChef.deposit(pid, 0, referrer); // claim pending rewards
        uint256 earnedBal = IERC20(earned).balanceOf(address(this));
        if (earnedBal == 0) return;

        _chargeFees(earnedBal);
        _addLiquidity();

        uint256 wantBal = IERC20(want).balanceOf(address(this));
        if (wantBal > 0) {
            masterChef.deposit(pid, wantBal, referrer);
        }

        lastHarvest = block.timestamp;
        emit Harvest(msg.sender, earnedBal, earnedBal * HARVEST_CALL_FEE / FEE_DIVISOR, earnedBal * TREASURY_FEE / FEE_DIVISOR);
    }

    function _swap(uint256 amountIn, address[] memory path) internal {
        IERC20(path[0]).forceApprove(address(router), amountIn);
        if (feeOnTransfer) {
            router.swapExactTokensForTokensSupportingFeeOnTransferTokens(
                amountIn, 0, path, address(this), block.timestamp
            );
        } else {
            router.swapExactTokensForTokens(
                amountIn, 0, path, address(this), block.timestamp
            );
        }
    }

    function _chargeFees(uint256 earnedBal) internal {
        uint256 totalFeeAmount = (earnedBal * TOTAL_FEE) / FEE_DIVISOR;

        // Swap fee portion to native
        if (earned != native) {
            _swap(totalFeeAmount, earnedToNativePath);
        }

        uint256 nativeBal = IERC20(native).balanceOf(address(this));
        uint256 callerAmount = (nativeBal * HARVEST_CALL_FEE) / TOTAL_FEE;
        uint256 treasuryAmount = nativeBal - callerAmount;

        if (callerAmount > 0) {
            IERC20(native).safeTransfer(msg.sender, callerAmount);
        }
        if (treasuryAmount > 0) {
            IERC20(native).safeTransfer(treasury, treasuryAmount);
        }
    }

    function _addLiquidity() internal {
        uint256 earnedHalf = IERC20(earned).balanceOf(address(this));
        if (earnedHalf == 0) return;

        if (earned != native) {
            _swap(earnedHalf, earnedToNativePath);
        }

        uint256 nativeBal = IERC20(native).balanceOf(address(this));
        uint256 halfNative = nativeBal / 2;

        if (nativeToLp0Path.length > 1) {
            _swap(halfNative, nativeToLp0Path);
        }

        if (nativeToLp1Path.length > 1) {
            uint256 otherHalf = IERC20(native).balanceOf(address(this));
            _swap(otherHalf, nativeToLp1Path);
        }

        uint256 lp0Bal = IERC20(lpToken0).balanceOf(address(this));
        uint256 lp1Bal = IERC20(lpToken1).balanceOf(address(this));

        if (lp0Bal > 0 && lp1Bal > 0) {
            IERC20(lpToken0).forceApprove(address(router), lp0Bal);
            IERC20(lpToken1).forceApprove(address(router), lp1Bal);
            router.addLiquidity(
                lpToken0,
                lpToken1,
                lp0Bal,
                lp1Bal,
                0,
                0,
                address(this),
                block.timestamp
            );
        }
    }

    // --- Owner functions ---

    function setRouter(address _router) external onlyOwner {
        emit RouterUpdated(address(router), _router);
        router = IUniRouterV2(_router);
        _giveAllowances();
    }

    function setSwapPaths(
        address[] calldata _earnedToNative,
        address[] calldata _nativeToLp0,
        address[] calldata _nativeToLp1
    ) external onlyOwner {
        require(_earnedToNative.length >= 2, "bad path");
        require(_earnedToNative[0] == earned, "path[0] != earned");
        require(_earnedToNative[_earnedToNative.length - 1] == native, "path[-1] != native");
        earnedToNativePath = _earnedToNative;
        nativeToLp0Path = _nativeToLp0;
        nativeToLp1Path = _nativeToLp1;
        emit SwapPathsUpdated();
    }

    function setTreasury(address _treasury) external onlyOwner {
        treasury = _treasury;
    }

    function setFeeOnTransfer(bool _feeOnTransfer) external onlyOwner {
        feeOnTransfer = _feeOnTransfer;
    }

    // --- Emergency ---

    function panic() public override onlyOwner {
        _pause();
        masterChef.emergencyWithdraw(pid);
    }

    function pause() public override onlyOwner {
        _pause();
        _removeAllowances();
    }

    function unpause() public override onlyOwner {
        _unpause();
        _giveAllowances();
        uint256 wantBal = IERC20(want).balanceOf(address(this));
        if (wantBal > 0) {
            masterChef.deposit(pid, wantBal, referrer);
        }
    }

    function retireStrat() external override onlyVault {
        masterChef.emergencyWithdraw(pid);
        uint256 wantBal = IERC20(want).balanceOf(address(this));
        IERC20(want).safeTransfer(vault, wantBal);
    }

    // --- Allowances ---

    function _giveAllowances() internal {
        IERC20(want).forceApprove(address(masterChef), type(uint256).max);
        IERC20(earned).forceApprove(address(router), type(uint256).max);
        IERC20(native).forceApprove(address(router), type(uint256).max);
        IERC20(lpToken0).forceApprove(address(router), type(uint256).max);
        IERC20(lpToken1).forceApprove(address(router), type(uint256).max);
    }

    function _removeAllowances() internal {
        IERC20(want).forceApprove(address(masterChef), 0);
        IERC20(earned).forceApprove(address(router), 0);
        IERC20(native).forceApprove(address(router), 0);
        IERC20(lpToken0).forceApprove(address(router), 0);
        IERC20(lpToken1).forceApprove(address(router), 0);
    }

    function inCaseTokensGetStuck(address _token) external onlyOwner {
        require(_token != want, "!want");
        require(_token != earned, "!earned");
        uint256 amount = IERC20(_token).balanceOf(address(this));
        IERC20(_token).safeTransfer(msg.sender, amount);
    }
}
        

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

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

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

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

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

/ERC20/utils/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);
    }
}
          

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

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

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

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

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

/

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

interface IStrategy {
    function vault() external view returns (address);
    function want() external view returns (address);
    function beforeDeposit() external;
    function deposit() external;
    function withdraw(uint256) external;
    function balanceOf() external view returns (uint256);
    function balanceOfWant() external view returns (uint256);
    function balanceOfPool() external view returns (uint256);
    function harvest() external;
    function retireStrat() external;
    function panic() external;
    function pause() external;
    function unpause() external;
    function paused() external view returns (bool);
}
          

Compiler Settings

{"remappings":[":@1inch/solidity-utils/=lib/solidity-utils/",":@chainlink/=lib/foundry-chainlink-toolkit/",":@chainlink/contracts/=lib/foundry-chainlink-toolkit/lib/chainlink-brownie-contracts/contracts/src/",":@forge-std/=lib/forge-std/src/",":@gearbox-protocol/core-v2/=lib/core-v2/",":@gearbox-protocol/core-v3/=lib/core-v3/",":@gearbox-protocol/sdk-gov/=lib/sdk-gov/",":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",":@redstone-finance/=lib/integrations-v3/node_modules/@redstone-finance/",":@uniswap/v2-core/=lib/v2-core/",":@uniswap/v2-periphery/=lib/v2-periphery/",":chainlink-brownie-contracts/=lib/foundry-chainlink-toolkit/lib/chainlink-brownie-contracts/contracts/src/v0.6/vendor/@arbitrum/nitro-contracts/src/",":chainlink/=lib/chainlink/",":core-v2/=lib/core-v2/contracts/",":core-v3/=lib/core-v3/contracts/",":ds-test/=lib/forge-std/lib/ds-test/src/",":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",":forge-std/=lib/forge-std/src/",":foundry-chainlink-toolkit/=lib/foundry-chainlink-toolkit/",":foundry-devops/=lib/foundry-devops/",":halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",":integrations-v3/=lib/integrations-v3/",":openzeppelin-contracts copy/=lib/openzeppelin-contracts copy/",":openzeppelin-contracts/=lib/openzeppelin-contracts/",":sdk-gov/=lib/sdk-gov/",":solidity-lib/=lib/solidity-lib/contracts/",":solidity-utils/=lib/solidity-utils/contracts/",":v2-core/=lib/v2-core/contracts/",":v2-periphery/=lib/v2-periphery/contracts/"],"optimizer":{"runs":1,"enabled":true},"metadata":{"bytecodeHash":"none"},"libraries":{},"evmVersion":"shanghai","compilationTarget":{"contracts/Vaults/StrategyMasterChefV2.sol":"StrategyMasterChefV2"}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_vault","internalType":"address"},{"type":"address","name":"_masterChef","internalType":"address"},{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"address","name":"_want","internalType":"address"},{"type":"address","name":"_earned","internalType":"address"},{"type":"address","name":"_native","internalType":"address"},{"type":"address","name":"_router","internalType":"address"},{"type":"address","name":"_treasury","internalType":"address"},{"type":"address","name":"_referrer","internalType":"address"}]},{"type":"error","name":"EnforcedPause","inputs":[]},{"type":"error","name":"ExpectedPause","inputs":[]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"type":"event","name":"Harvest","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint256","name":"earned","internalType":"uint256","indexed":false},{"type":"uint256","name":"callerFee","internalType":"uint256","indexed":false},{"type":"uint256","name":"treasuryFee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"RouterUpdated","inputs":[{"type":"address","name":"oldRouter","internalType":"address","indexed":true},{"type":"address","name":"newRouter","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SwapPathsUpdated","inputs":[],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"FEE_DIVISOR","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"HARVEST_CALL_FEE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TOTAL_FEE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TREASURY_FEE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOfPool","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOfWant","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"beforeDeposit","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"earned","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"earnedToNativePath","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"feeOnTransfer","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"harvest","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"inCaseTokensGetStuck","inputs":[{"type":"address","name":"_token","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastHarvest","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"lpToken0","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"lpToken1","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IMasterChefV2"}],"name":"masterChef","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"native","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"nativeToLp0Path","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"nativeToLp1Path","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"panic","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pid","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"referrer","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"retireStrat","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IUniRouterV2"}],"name":"router","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeOnTransfer","inputs":[{"type":"bool","name":"_feeOnTransfer","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRouter","inputs":[{"type":"address","name":"_router","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSwapPaths","inputs":[{"type":"address[]","name":"_earnedToNative","internalType":"address[]"},{"type":"address[]","name":"_nativeToLp0","internalType":"address[]"},{"type":"address[]","name":"_nativeToLp1","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTreasury","inputs":[{"type":"address","name":"_treasury","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setVault","inputs":[{"type":"address","name":"_vault","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"treasury","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"vault","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"want","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]}]
              

Contract Creation Code

Verify & Publish
0x608060405234801562000010575f80fd5b5060405162002a2f38038062002a2f83398101604081905262000033916200086f565b338062000060575f604051631e4fbdf760e01b81526004016200005791906200091b565b60405180910390fd5b6200006b8162000556565b505f805460ff60a01b19169055600180546001600160a01b03199081166001600160a01b038c8116919091179092556005805482168b84161790556006899055600280548216898416908117909155600380548316898516179055600480548316888516178155600880548416888616179055600e80548416878616179055600780549093169385169390931790915560408051630dfe168160e01b815290519192630dfe16819282820192602092908290030181865afa15801562000133573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906200015991906200092f565b60095f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550856001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001bb573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620001e191906200092f565b600a80546001600160a01b0319166001600160a01b03929092169190911790556040805160028082526060820183529091602083019080368337505081516200023292600b925060200190620007d5565b5084600b5f815481106200024a576200024a62000952565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b0316021790555083600b6001815481106200028d576200028d62000952565b5f91825260209091200180546001600160a01b0319166001600160a01b039283161790556009548582169116036200033957604080516001808252818301909252906020808301908036833750508151620002f092600c925060200190620007d5565b5083600c5f8154811062000308576200030862000952565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b03160217905550620003f3565b6040805160028082526060820183529091602083019080368337505081516200036a92600c925060200190620007d5565b5083600c5f8154811062000382576200038262000952565b5f91825260209091200180546001600160a01b0319166001600160a01b03928316179055600954600c80549190921691906001908110620003c757620003c762000952565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055505b600a546001600160a01b0380861691160362000483576040805160018082528183019092529060208083019080368337505081516200043a92600d925060200190620007d5565b5083600d5f8154811062000452576200045262000952565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055506200053d565b604080516002808252606082018352909160208301908036833750508151620004b492600d925060200190620007d5565b5083600d5f81548110620004cc57620004cc62000952565b5f91825260209091200180546001600160a01b0319166001600160a01b03928316179055600a54600d8054919092169190600190811062000511576200051162000952565b905f5260205f20015f6101000a8154816001600160a01b0302191690836001600160a01b031602179055505b62000547620005a5565b5050505050505050506200097f565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600554600254620005c5916001600160a01b0391821691165f1962000647565b600854600354620005e5916001600160a01b0391821691165f1962000647565b60085460045462000605916001600160a01b0391821691165f1962000647565b60085460095462000625916001600160a01b0391821691165f1962000647565b600854600a5462000645916001600160a01b0391821691165f1962000647565b565b5f836001600160a01b031663095ea7b384846040516024016200066c92919062000966565b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050509050620006ad84826200072060201b60201c565b6200071a576200070e84856001600160a01b031663095ea7b3865f604051602401620006db92919062000966565b60408051808303601f1901815291905260208101805160e09390931b6001600160e01b0393841617905291506200076c16565b6200071a84826200076c565b50505050565b5f805f8060205f8651602088015f8a5af192503d91505f519050828015620007625750811562000754578060011462000762565b5f866001600160a01b03163b115b9695505050505050565b5f8060205f8451602086015f885af1806200078c576040513d5f823e3d81fd5b50505f513d91508115620007a5578060011415620007b2565b6001600160a01b0384163b155b156200071a5783604051635274afe760e01b81526004016200005791906200091b565b828054828255905f5260205f209081019282156200082b579160200282015b828111156200082b57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620007f4565b50620008399291506200083d565b5090565b5b8082111562000839575f81556001016200083e565b80516001600160a01b03811681146200086a575f80fd5b919050565b5f805f805f805f805f6101208a8c03121562000889575f80fd5b620008948a62000853565b9850620008a460208b0162000853565b975060408a01519650620008bb60608b0162000853565b9550620008cb60808b0162000853565b9450620008db60a08b0162000853565b9350620008eb60c08b0162000853565b9250620008fb60e08b0162000853565b91506200090c6101008b0162000853565b90509295985092959850929598565b6001600160a01b0391909116815260200190565b5f6020828403121562000940575f80fd5b6200094b8262000853565b9392505050565b634e487b7160e01b5f52603260045260245ffd5b6001600160a01b03929092168252602082015260400190565b6120a2806200098d5f395ff3fe608060405234801561000f575f80fd5b50600436106101e1575f3560e01c80630fa1eeab146101e5578063115880861461020757806311b0b42d1461021d578063192678771461023d5780631f1fcd51146102455780632e1a7d4d146102585780633f4ba83a1461026d5780634641257d146102755780634700d3051461027d578063573fef0a14610285578063575a86b21461028d5780635c975abb146102a05780635ee167c0146102a857806361d027b3146102bb57806363db7eae146102ce5780636817031b146102d757806368447c93146102ea578063715018a6146102fd578063722713f7146103055780638456cb591461030d578063877562b6146103155780638b2b7139146103285780638c09b1be1461033b5780638ce1a4831461034e5780638da5cb5b146103575780639e93ad8e1461035f578063c0d7865514610368578063c1a3d44c1461037b578063d0e30db014610383578063d553e5601461038b578063d6f192621461039e578063db64d3a3146103b1578063def68a9c146103c4578063f0f44260146103d7578063f1068454146103ea578063f107779f146103f3578063f1a392da14610406578063f2fde38b1461040f578063f887ea4014610422578063fb61778714610435578063fbfa77cf1461043d575b5f80fd5b6010546101f29060ff1681565b60405190151581526020015b60405180910390f35b61020f610450565b6040519081526020016101fe565b600454610230906001600160a01b031681565b6040516101fe9190611cca565b61020f603281565b600254610230906001600160a01b031681565b61026b610266366004611cde565b6104cf565b005b61026b61068c565b61026b610788565b61026b6109e3565b61026b610a57565b600554610230906001600160a01b031681565b6101f2610a81565b600954610230906001600160a01b031681565b600e54610230906001600160a01b031681565b61020f6101c281565b61026b6102e5366004611cf5565b610a95565b600754610230906001600160a01b031681565b61026b610b0c565b61020f610b1d565b61026b610b38565b600a54610230906001600160a01b031681565b610230610336366004611cde565b610b50565b610230610349366004611cde565b610b78565b61020f61019081565b610230610b87565b61020f61271081565b61026b610376366004611cf5565b610b95565b61020f610bf9565b61026b610c68565b61026b610399366004611d69565b610c9a565b600354610230906001600160a01b031681565b6102306103bf366004611cde565b610e38565b61026b6103d2366004611cf5565b610e47565b61026b6103e5366004611cf5565b610f60565b61020f60065481565b61026b610401366004611dfb565b610f8a565b61020f600f5481565b61026b61041d366004611cf5565b610fa5565b600854610230906001600160a01b031681565b61026b610fdf565b600154610230906001600160a01b031681565b6005546006546040516393f1a40b60e01b815260048101919091523060248201525f9182916001600160a01b03909116906393f1a40b906044016040805180830381865afa1580156104a4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104c89190611e1a565b5092915050565b6001546001600160a01b031633146105025760405162461bcd60e51b81526004016104f990611e3c565b60405180910390fd5b6002546040516370a0823160e01b81525f916001600160a01b0316906370a0823190610532903090600401611cca565b602060405180830381865afa15801561054d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105719190611e5c565b905081811015610660576005546006546001600160a01b039091169063441a3e709061059d8486611e87565b6040516001600160e01b031960e085901b168152600481019290925260248201526044015f604051808303815f87803b1580156105d8575f80fd5b505af11580156105ea573d5f803e3d5ffd5b50506002546040516370a0823160e01b81526001600160a01b0390911692506370a08231915061061e903090600401611cca565b602060405180830381865afa158015610639573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061065d9190611e5c565b90505b8181111561066b5750805b600154600254610688916001600160a01b039182169116836110f8565b5050565b610694611155565b61069c611187565b6106a46111d5565b6002546040516370a0823160e01b81525f916001600160a01b0316906370a08231906106d4903090600401611cca565b602060405180830381865afa1580156106ef573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107139190611e5c565b9050801561078557600554600654600754604051638dbdbe6d60e01b81526001600160a01b0393841693638dbdbe6d93610757939092879290911690600401611e9a565b5f604051808303815f87803b15801561076e575f80fd5b505af1158015610780573d5f803e3d5ffd5b505050505b50565b61079061126b565b600554600654600754604051638dbdbe6d60e01b81526001600160a01b0393841693638dbdbe6d936107cc9390925f9290911690600401611e9a565b5f604051808303815f87803b1580156107e3575f80fd5b505af11580156107f5573d5f803e3d5ffd5b50506003546040516370a0823160e01b81525f93506001600160a01b0390911691506370a082319061082b903090600401611cca565b602060405180830381865afa158015610846573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061086a9190611e5c565b9050805f036108765750565b61087f81611291565b610887611402565b6002546040516370a0823160e01b81525f916001600160a01b0316906370a08231906108b7903090600401611cca565b602060405180830381865afa1580156108d2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108f69190611e5c565b9050801561096857600554600654600754604051638dbdbe6d60e01b81526001600160a01b0393841693638dbdbe6d9361093a939092879290911690600401611e9a565b5f604051808303815f87803b158015610951575f80fd5b505af1158015610963573d5f803e3d5ffd5b505050505b42600f55337f4534f107610758c3931de9ad1e176476fcfb8c74adf920167e1d54ee84fcfe768361271061099d603283611eb9565b6109a79190611ed0565b6127106109b661019088611eb9565b6109c09190611ed0565b6040805193845260208401929092529082015260600160405180910390a250505b565b6109eb611155565b6109f361189d565b600554600654604051632989754760e11b81526001600160a01b0390921691635312ea8e91610a289160040190815260200190565b5f604051808303815f87803b158015610a3f575f80fd5b505af1158015610a51573d5f803e3d5ffd5b50505050565b6001546001600160a01b031633146109e15760405162461bcd60e51b81526004016104f990611e3c565b5f54600160a01b900460ff1690565b905090565b610a9d611155565b6001546001600160a01b031615610aea5760405162461bcd60e51b81526020600482015260116024820152701d985d5b1d08185b1c9958591e481cd95d607a1b60448201526064016104f9565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b610b14611155565b6109e15f6118df565b5f610b26610450565b610b2e610bf9565b610a909190611eef565b610b40611155565b610b4861189d565b6109e161192e565b600b8181548110610b5f575f80fd5b5f918252602090912001546001600160a01b0316905081565b600d8181548110610b5f575f80fd5b5f546001600160a01b031690565b610b9d611155565b6008546040516001600160a01b038084169216907f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684905f90a3600880546001600160a01b0319166001600160a01b0383161790556107856111d5565b6002546040516370a0823160e01b81525f916001600160a01b0316906370a0823190610c29903090600401611cca565b602060405180830381865afa158015610c44573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a909190611e5c565b610c7061126b565b6001546001600160a01b031633146106a45760405162461bcd60e51b81526004016104f990611e3c565b610ca2611155565b6002851015610cde5760405162461bcd60e51b81526020600482015260086024820152670c4c2c840e0c2e8d60c31b60448201526064016104f9565b6003546001600160a01b031686865f81610cfa57610cfa611f02565b9050602002016020810190610d0f9190611cf5565b6001600160a01b031614610d595760405162461bcd60e51b81526020600482015260116024820152701c185d1a16cc1748084f4819585c9b9959607a1b60448201526064016104f9565b6004546001600160a01b03168686610d72600182611e87565b818110610d8157610d81611f02565b9050602002016020810190610d969190611cf5565b6001600160a01b031614610de15760405162461bcd60e51b8152602060048201526012602482015271706174685b2d315d20213d206e617469766560701b60448201526064016104f9565b610ded600b8787611c55565b50610dfa600c8585611c55565b50610e07600d8383611c55565b506040517f0671805877ede27b46ab75f0a8c64bf33c8a96ad87700ab5e1f4928296857a57905f90a1505050505050565b600c8181548110610b5f575f80fd5b610e4f611155565b6002546001600160a01b0390811690821603610e955760405162461bcd60e51b8152602060048201526005602482015264085dd85b9d60da1b60448201526064016104f9565b6003546001600160a01b0390811690821603610edd5760405162461bcd60e51b81526020600482015260076024820152660859585c9b995960ca1b60448201526064016104f9565b6040516370a0823160e01b81525f906001600160a01b038316906370a0823190610f0b903090600401611cca565b602060405180830381865afa158015610f26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f4a9190611e5c565b90506106886001600160a01b03831633836110f8565b610f68611155565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b610f92611155565b6010805460ff1916911515919091179055565b610fad611155565b6001600160a01b038116610fd6575f604051631e4fbdf760e01b81526004016104f99190611cca565b610785816118df565b6001546001600160a01b031633146110095760405162461bcd60e51b81526004016104f990611e3c565b600554600654604051632989754760e11b81526001600160a01b0390921691635312ea8e9161103e9160040190815260200190565b5f604051808303815f87803b158015611055575f80fd5b505af1158015611067573d5f803e3d5ffd5b50506002546040516370a0823160e01b81525f93506001600160a01b0390911691506370a082319061109d903090600401611cca565b602060405180830381865afa1580156110b8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110dc9190611e5c565b600154600254919250610785916001600160a01b039081169116835b61115083846001600160a01b031663a9059cbb858560405160240161111e929190611f16565b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506119bf565b505050565b3361115e610b87565b6001600160a01b0316146109e1573360405163118cdaa760e01b81526004016104f99190611cca565b61118f611a22565b5f805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516111cb9190611cca565b60405180910390a1565b6005546002546111f3916001600160a01b0391821691165f19611a47565b600854600354611211916001600160a01b0391821691165f19611a47565b60085460045461122f916001600160a01b0391821691165f19611a47565b60085460095461124d916001600160a01b0391821691165f19611a47565b600854600a546109e1916001600160a01b0391821691165f19611a47565b611273610a81565b156109e15760405163d93c066560e01b815260040160405180910390fd5b5f6127106112a16101c284611eb9565b6112ab9190611ed0565b6004546003549192506001600160a01b039182169116146113285761132881600b80548060200260200160405190810160405280929190818152602001828054801561131e57602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311611300575b5050505050611ad7565b600480546040516370a0823160e01b81525f926001600160a01b03909216916370a082319161135991309101611cca565b602060405180830381865afa158015611374573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113989190611e5c565b90505f6101c26113a9603284611eb9565b6113b39190611ed0565b90505f6113c08284611e87565b905081156113df576004546113df906001600160a01b031633846110f8565b801561078057600e54600454610780916001600160a01b039182169116836110f8565b6003546040516370a0823160e01b81525f916001600160a01b0316906370a0823190611432903090600401611cca565b602060405180830381865afa15801561144d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114719190611e5c565b9050805f0361147d5750565b6004546003546001600160a01b039081169116146114f5576114f581600b80548060200260200160405190810160405280929190818152602001828054801561131e57602002820191905f5260205f209081546001600160a01b03168152600190910190602001808311611300575050505050611ad7565b600480546040516370a0823160e01b81525f926001600160a01b03909216916370a082319161152691309101611cca565b602060405180830381865afa158015611541573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115659190611e5c565b90505f611573600283611ed0565b600c54909150600110156115e1576115e181600c80548060200260200160405190810160405280929190818152602001828054801561131e57602002820191905f5260205f209081546001600160a01b03168152600190910190602001808311611300575050505050611ad7565b600d54600110156116c057600480546040516370a0823160e01b81525f926001600160a01b03909216916370a082319161161d91309101611cca565b602060405180830381865afa158015611638573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061165c9190611e5c565b90506116be81600d80548060200260200160405190810160405280929190818152602001828054801561131e57602002820191905f5260205f209081546001600160a01b03168152600190910190602001808311611300575050505050611ad7565b505b6009546040516370a0823160e01b81525f916001600160a01b0316906370a08231906116f0903090600401611cca565b602060405180830381865afa15801561170b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061172f9190611e5c565b600a546040516370a0823160e01b81529192505f916001600160a01b03909116906370a0823190611764903090600401611cca565b602060405180830381865afa15801561177f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117a39190611e5c565b90505f821180156117b357505f81115b15610780576008546009546117d5916001600160a01b03918216911684611a47565b600854600a546117f2916001600160a01b03918216911683611a47565b600854600954600a5460405162e8e33760e81b81526001600160a01b039283166004820152908216602482015260448101859052606481018490525f6084820181905260a48201523060c48201524260e482015291169063e8e3370090610104016060604051808303815f875af115801561186f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118939190611f2f565b5050505050505050565b6118a561126b565b5f805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586111be3390565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60055460025461194b916001600160a01b0391821691165f611a47565b600854600354611968916001600160a01b0391821691165f611a47565b600854600454611985916001600160a01b0391821691165f611a47565b6008546009546119a2916001600160a01b0391821691165f611a47565b600854600a546109e1916001600160a01b0391821691165f611a47565b5f8060205f8451602086015f885af1806119de576040513d5f823e3d81fd5b50505f513d915081156119f5578060011415611a02565b6001600160a01b0384163b155b15610a515783604051635274afe760e01b81526004016104f99190611cca565b611a2a610a81565b6109e157604051638dfc202b60e01b815260040160405180910390fd5b5f836001600160a01b031663095ea7b38484604051602401611a6a929190611f16565b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050509050611aa38482611c0a565b610a5157611acd84856001600160a01b031663095ea7b3865f60405160240161111e929190611f16565b610a5184826119bf565b6008548151611b1c916001600160a01b031690849084905f90611afc57611afc611f02565b60200260200101516001600160a01b0316611a479092919063ffffffff16565b60105460ff1615611b9057600854604051635c11d79560e01b81526001600160a01b0390911690635c11d79590611b5f9085905f90869030904290600401611f5a565b5f604051808303815f87803b158015611b76575f80fd5b505af1158015611b88573d5f803e3d5ffd5b505050505050565b6008546040516338ed173960e01b81526001600160a01b03909116906338ed173990611bc89085905f90869030904290600401611f5a565b5f604051808303815f875af1158015611be3573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526111509190810190611fdd565b5f805f8060205f8651602088015f8a5af192503d91505f519050828015611c4957508115611c3b5780600114611c49565b5f866001600160a01b03163b115b93505050505b92915050565b828054828255905f5260205f20908101928215611ca6579160200282015b82811115611ca65781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190611c73565b50611cb2929150611cb6565b5090565b5b80821115611cb2575f8155600101611cb7565b6001600160a01b0391909116815260200190565b5f60208284031215611cee575f80fd5b5035919050565b5f60208284031215611d05575f80fd5b81356001600160a01b0381168114611d1b575f80fd5b9392505050565b5f8083601f840112611d32575f80fd5b5081356001600160401b03811115611d48575f80fd5b6020830191508360208260051b8501011115611d62575f80fd5b9250929050565b5f805f805f8060608789031215611d7e575f80fd5b86356001600160401b0380821115611d94575f80fd5b611da08a838b01611d22565b90985096506020890135915080821115611db8575f80fd5b611dc48a838b01611d22565b90965094506040890135915080821115611ddc575f80fd5b50611de989828a01611d22565b979a9699509497509295939492505050565b5f60208284031215611e0b575f80fd5b81358015158114611d1b575f80fd5b5f8060408385031215611e2b575f80fd5b505080516020909101519092909150565b602080825260069082015265085d985d5b1d60d21b604082015260600190565b5f60208284031215611e6c575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b81810381811115611c4f57611c4f611e73565b92835260208301919091526001600160a01b0316604082015260600190565b8082028115828204841417611c4f57611c4f611e73565b5f82611eea57634e487b7160e01b5f52601260045260245ffd5b500490565b80820180821115611c4f57611c4f611e73565b634e487b7160e01b5f52603260045260245ffd5b6001600160a01b03929092168252602082015260400190565b5f805f60608486031215611f41575f80fd5b8351925060208401519150604084015190509250925092565b5f60a082018783526020878185015260a0604085015281875180845260c08601915082890193505f5b81811015611fa85784516001600160a01b031683529383019391830191600101611f83565b50506001600160a01b03969096166060850152505050608001529392505050565b634e487b7160e01b5f52604160045260245ffd5b5f6020808385031215611fee575f80fd5b82516001600160401b0380821115612004575f80fd5b818501915085601f830112612017575f80fd5b81518181111561202957612029611fc9565b8060051b604051601f19603f8301168101818110858211171561204e5761204e611fc9565b60405291825284820192508381018501918883111561206b575f80fd5b938501935b8285101561208957845184529385019392850192612070565b9897505050505050505056fea164736f6c6343000814000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c9798c7447b209e79f12542691d4cda64b98bd96000000000000000000000000000000000000000000000000000000000000000300000000000000000000000074261876aec8c3f8a04f311ac7da620c48e4bf4a000000000000000000000000ca942990ef21446db490532e66992ed1ef76a82b000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a27000000000000000000000000165c3410fc91ef562c50559f7d2289febed552d900000000000000000000000064ec67306eb620f303d943841f7ba255bf1a7bf3000000000000000000000000a0419404ef7b81d9ec64367eb68e5f425eace618

Deployed ByteCode

0x608060405234801561000f575f80fd5b50600436106101e1575f3560e01c80630fa1eeab146101e5578063115880861461020757806311b0b42d1461021d578063192678771461023d5780631f1fcd51146102455780632e1a7d4d146102585780633f4ba83a1461026d5780634641257d146102755780634700d3051461027d578063573fef0a14610285578063575a86b21461028d5780635c975abb146102a05780635ee167c0146102a857806361d027b3146102bb57806363db7eae146102ce5780636817031b146102d757806368447c93146102ea578063715018a6146102fd578063722713f7146103055780638456cb591461030d578063877562b6146103155780638b2b7139146103285780638c09b1be1461033b5780638ce1a4831461034e5780638da5cb5b146103575780639e93ad8e1461035f578063c0d7865514610368578063c1a3d44c1461037b578063d0e30db014610383578063d553e5601461038b578063d6f192621461039e578063db64d3a3146103b1578063def68a9c146103c4578063f0f44260146103d7578063f1068454146103ea578063f107779f146103f3578063f1a392da14610406578063f2fde38b1461040f578063f887ea4014610422578063fb61778714610435578063fbfa77cf1461043d575b5f80fd5b6010546101f29060ff1681565b60405190151581526020015b60405180910390f35b61020f610450565b6040519081526020016101fe565b600454610230906001600160a01b031681565b6040516101fe9190611cca565b61020f603281565b600254610230906001600160a01b031681565b61026b610266366004611cde565b6104cf565b005b61026b61068c565b61026b610788565b61026b6109e3565b61026b610a57565b600554610230906001600160a01b031681565b6101f2610a81565b600954610230906001600160a01b031681565b600e54610230906001600160a01b031681565b61020f6101c281565b61026b6102e5366004611cf5565b610a95565b600754610230906001600160a01b031681565b61026b610b0c565b61020f610b1d565b61026b610b38565b600a54610230906001600160a01b031681565b610230610336366004611cde565b610b50565b610230610349366004611cde565b610b78565b61020f61019081565b610230610b87565b61020f61271081565b61026b610376366004611cf5565b610b95565b61020f610bf9565b61026b610c68565b61026b610399366004611d69565b610c9a565b600354610230906001600160a01b031681565b6102306103bf366004611cde565b610e38565b61026b6103d2366004611cf5565b610e47565b61026b6103e5366004611cf5565b610f60565b61020f60065481565b61026b610401366004611dfb565b610f8a565b61020f600f5481565b61026b61041d366004611cf5565b610fa5565b600854610230906001600160a01b031681565b61026b610fdf565b600154610230906001600160a01b031681565b6005546006546040516393f1a40b60e01b815260048101919091523060248201525f9182916001600160a01b03909116906393f1a40b906044016040805180830381865afa1580156104a4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104c89190611e1a565b5092915050565b6001546001600160a01b031633146105025760405162461bcd60e51b81526004016104f990611e3c565b60405180910390fd5b6002546040516370a0823160e01b81525f916001600160a01b0316906370a0823190610532903090600401611cca565b602060405180830381865afa15801561054d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105719190611e5c565b905081811015610660576005546006546001600160a01b039091169063441a3e709061059d8486611e87565b6040516001600160e01b031960e085901b168152600481019290925260248201526044015f604051808303815f87803b1580156105d8575f80fd5b505af11580156105ea573d5f803e3d5ffd5b50506002546040516370a0823160e01b81526001600160a01b0390911692506370a08231915061061e903090600401611cca565b602060405180830381865afa158015610639573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061065d9190611e5c565b90505b8181111561066b5750805b600154600254610688916001600160a01b039182169116836110f8565b5050565b610694611155565b61069c611187565b6106a46111d5565b6002546040516370a0823160e01b81525f916001600160a01b0316906370a08231906106d4903090600401611cca565b602060405180830381865afa1580156106ef573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107139190611e5c565b9050801561078557600554600654600754604051638dbdbe6d60e01b81526001600160a01b0393841693638dbdbe6d93610757939092879290911690600401611e9a565b5f604051808303815f87803b15801561076e575f80fd5b505af1158015610780573d5f803e3d5ffd5b505050505b50565b61079061126b565b600554600654600754604051638dbdbe6d60e01b81526001600160a01b0393841693638dbdbe6d936107cc9390925f9290911690600401611e9a565b5f604051808303815f87803b1580156107e3575f80fd5b505af11580156107f5573d5f803e3d5ffd5b50506003546040516370a0823160e01b81525f93506001600160a01b0390911691506370a082319061082b903090600401611cca565b602060405180830381865afa158015610846573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061086a9190611e5c565b9050805f036108765750565b61087f81611291565b610887611402565b6002546040516370a0823160e01b81525f916001600160a01b0316906370a08231906108b7903090600401611cca565b602060405180830381865afa1580156108d2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108f69190611e5c565b9050801561096857600554600654600754604051638dbdbe6d60e01b81526001600160a01b0393841693638dbdbe6d9361093a939092879290911690600401611e9a565b5f604051808303815f87803b158015610951575f80fd5b505af1158015610963573d5f803e3d5ffd5b505050505b42600f55337f4534f107610758c3931de9ad1e176476fcfb8c74adf920167e1d54ee84fcfe768361271061099d603283611eb9565b6109a79190611ed0565b6127106109b661019088611eb9565b6109c09190611ed0565b6040805193845260208401929092529082015260600160405180910390a250505b565b6109eb611155565b6109f361189d565b600554600654604051632989754760e11b81526001600160a01b0390921691635312ea8e91610a289160040190815260200190565b5f604051808303815f87803b158015610a3f575f80fd5b505af1158015610a51573d5f803e3d5ffd5b50505050565b6001546001600160a01b031633146109e15760405162461bcd60e51b81526004016104f990611e3c565b5f54600160a01b900460ff1690565b905090565b610a9d611155565b6001546001600160a01b031615610aea5760405162461bcd60e51b81526020600482015260116024820152701d985d5b1d08185b1c9958591e481cd95d607a1b60448201526064016104f9565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b610b14611155565b6109e15f6118df565b5f610b26610450565b610b2e610bf9565b610a909190611eef565b610b40611155565b610b4861189d565b6109e161192e565b600b8181548110610b5f575f80fd5b5f918252602090912001546001600160a01b0316905081565b600d8181548110610b5f575f80fd5b5f546001600160a01b031690565b610b9d611155565b6008546040516001600160a01b038084169216907f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f1684905f90a3600880546001600160a01b0319166001600160a01b0383161790556107856111d5565b6002546040516370a0823160e01b81525f916001600160a01b0316906370a0823190610c29903090600401611cca565b602060405180830381865afa158015610c44573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a909190611e5c565b610c7061126b565b6001546001600160a01b031633146106a45760405162461bcd60e51b81526004016104f990611e3c565b610ca2611155565b6002851015610cde5760405162461bcd60e51b81526020600482015260086024820152670c4c2c840e0c2e8d60c31b60448201526064016104f9565b6003546001600160a01b031686865f81610cfa57610cfa611f02565b9050602002016020810190610d0f9190611cf5565b6001600160a01b031614610d595760405162461bcd60e51b81526020600482015260116024820152701c185d1a16cc1748084f4819585c9b9959607a1b60448201526064016104f9565b6004546001600160a01b03168686610d72600182611e87565b818110610d8157610d81611f02565b9050602002016020810190610d969190611cf5565b6001600160a01b031614610de15760405162461bcd60e51b8152602060048201526012602482015271706174685b2d315d20213d206e617469766560701b60448201526064016104f9565b610ded600b8787611c55565b50610dfa600c8585611c55565b50610e07600d8383611c55565b506040517f0671805877ede27b46ab75f0a8c64bf33c8a96ad87700ab5e1f4928296857a57905f90a1505050505050565b600c8181548110610b5f575f80fd5b610e4f611155565b6002546001600160a01b0390811690821603610e955760405162461bcd60e51b8152602060048201526005602482015264085dd85b9d60da1b60448201526064016104f9565b6003546001600160a01b0390811690821603610edd5760405162461bcd60e51b81526020600482015260076024820152660859585c9b995960ca1b60448201526064016104f9565b6040516370a0823160e01b81525f906001600160a01b038316906370a0823190610f0b903090600401611cca565b602060405180830381865afa158015610f26573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f4a9190611e5c565b90506106886001600160a01b03831633836110f8565b610f68611155565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b610f92611155565b6010805460ff1916911515919091179055565b610fad611155565b6001600160a01b038116610fd6575f604051631e4fbdf760e01b81526004016104f99190611cca565b610785816118df565b6001546001600160a01b031633146110095760405162461bcd60e51b81526004016104f990611e3c565b600554600654604051632989754760e11b81526001600160a01b0390921691635312ea8e9161103e9160040190815260200190565b5f604051808303815f87803b158015611055575f80fd5b505af1158015611067573d5f803e3d5ffd5b50506002546040516370a0823160e01b81525f93506001600160a01b0390911691506370a082319061109d903090600401611cca565b602060405180830381865afa1580156110b8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110dc9190611e5c565b600154600254919250610785916001600160a01b039081169116835b61115083846001600160a01b031663a9059cbb858560405160240161111e929190611f16565b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506119bf565b505050565b3361115e610b87565b6001600160a01b0316146109e1573360405163118cdaa760e01b81526004016104f99190611cca565b61118f611a22565b5f805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516111cb9190611cca565b60405180910390a1565b6005546002546111f3916001600160a01b0391821691165f19611a47565b600854600354611211916001600160a01b0391821691165f19611a47565b60085460045461122f916001600160a01b0391821691165f19611a47565b60085460095461124d916001600160a01b0391821691165f19611a47565b600854600a546109e1916001600160a01b0391821691165f19611a47565b611273610a81565b156109e15760405163d93c066560e01b815260040160405180910390fd5b5f6127106112a16101c284611eb9565b6112ab9190611ed0565b6004546003549192506001600160a01b039182169116146113285761132881600b80548060200260200160405190810160405280929190818152602001828054801561131e57602002820191905f5260205f20905b81546001600160a01b03168152600190910190602001808311611300575b5050505050611ad7565b600480546040516370a0823160e01b81525f926001600160a01b03909216916370a082319161135991309101611cca565b602060405180830381865afa158015611374573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113989190611e5c565b90505f6101c26113a9603284611eb9565b6113b39190611ed0565b90505f6113c08284611e87565b905081156113df576004546113df906001600160a01b031633846110f8565b801561078057600e54600454610780916001600160a01b039182169116836110f8565b6003546040516370a0823160e01b81525f916001600160a01b0316906370a0823190611432903090600401611cca565b602060405180830381865afa15801561144d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114719190611e5c565b9050805f0361147d5750565b6004546003546001600160a01b039081169116146114f5576114f581600b80548060200260200160405190810160405280929190818152602001828054801561131e57602002820191905f5260205f209081546001600160a01b03168152600190910190602001808311611300575050505050611ad7565b600480546040516370a0823160e01b81525f926001600160a01b03909216916370a082319161152691309101611cca565b602060405180830381865afa158015611541573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115659190611e5c565b90505f611573600283611ed0565b600c54909150600110156115e1576115e181600c80548060200260200160405190810160405280929190818152602001828054801561131e57602002820191905f5260205f209081546001600160a01b03168152600190910190602001808311611300575050505050611ad7565b600d54600110156116c057600480546040516370a0823160e01b81525f926001600160a01b03909216916370a082319161161d91309101611cca565b602060405180830381865afa158015611638573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061165c9190611e5c565b90506116be81600d80548060200260200160405190810160405280929190818152602001828054801561131e57602002820191905f5260205f209081546001600160a01b03168152600190910190602001808311611300575050505050611ad7565b505b6009546040516370a0823160e01b81525f916001600160a01b0316906370a08231906116f0903090600401611cca565b602060405180830381865afa15801561170b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061172f9190611e5c565b600a546040516370a0823160e01b81529192505f916001600160a01b03909116906370a0823190611764903090600401611cca565b602060405180830381865afa15801561177f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117a39190611e5c565b90505f821180156117b357505f81115b15610780576008546009546117d5916001600160a01b03918216911684611a47565b600854600a546117f2916001600160a01b03918216911683611a47565b600854600954600a5460405162e8e33760e81b81526001600160a01b039283166004820152908216602482015260448101859052606481018490525f6084820181905260a48201523060c48201524260e482015291169063e8e3370090610104016060604051808303815f875af115801561186f573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118939190611f2f565b5050505050505050565b6118a561126b565b5f805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586111be3390565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60055460025461194b916001600160a01b0391821691165f611a47565b600854600354611968916001600160a01b0391821691165f611a47565b600854600454611985916001600160a01b0391821691165f611a47565b6008546009546119a2916001600160a01b0391821691165f611a47565b600854600a546109e1916001600160a01b0391821691165f611a47565b5f8060205f8451602086015f885af1806119de576040513d5f823e3d81fd5b50505f513d915081156119f5578060011415611a02565b6001600160a01b0384163b155b15610a515783604051635274afe760e01b81526004016104f99190611cca565b611a2a610a81565b6109e157604051638dfc202b60e01b815260040160405180910390fd5b5f836001600160a01b031663095ea7b38484604051602401611a6a929190611f16565b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050509050611aa38482611c0a565b610a5157611acd84856001600160a01b031663095ea7b3865f60405160240161111e929190611f16565b610a5184826119bf565b6008548151611b1c916001600160a01b031690849084905f90611afc57611afc611f02565b60200260200101516001600160a01b0316611a479092919063ffffffff16565b60105460ff1615611b9057600854604051635c11d79560e01b81526001600160a01b0390911690635c11d79590611b5f9085905f90869030904290600401611f5a565b5f604051808303815f87803b158015611b76575f80fd5b505af1158015611b88573d5f803e3d5ffd5b505050505050565b6008546040516338ed173960e01b81526001600160a01b03909116906338ed173990611bc89085905f90869030904290600401611f5a565b5f604051808303815f875af1158015611be3573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526111509190810190611fdd565b5f805f8060205f8651602088015f8a5af192503d91505f519050828015611c4957508115611c3b5780600114611c49565b5f866001600160a01b03163b115b93505050505b92915050565b828054828255905f5260205f20908101928215611ca6579160200282015b82811115611ca65781546001600160a01b0319166001600160a01b03843516178255602090920191600190910190611c73565b50611cb2929150611cb6565b5090565b5b80821115611cb2575f8155600101611cb7565b6001600160a01b0391909116815260200190565b5f60208284031215611cee575f80fd5b5035919050565b5f60208284031215611d05575f80fd5b81356001600160a01b0381168114611d1b575f80fd5b9392505050565b5f8083601f840112611d32575f80fd5b5081356001600160401b03811115611d48575f80fd5b6020830191508360208260051b8501011115611d62575f80fd5b9250929050565b5f805f805f8060608789031215611d7e575f80fd5b86356001600160401b0380821115611d94575f80fd5b611da08a838b01611d22565b90985096506020890135915080821115611db8575f80fd5b611dc48a838b01611d22565b90965094506040890135915080821115611ddc575f80fd5b50611de989828a01611d22565b979a9699509497509295939492505050565b5f60208284031215611e0b575f80fd5b81358015158114611d1b575f80fd5b5f8060408385031215611e2b575f80fd5b505080516020909101519092909150565b602080825260069082015265085d985d5b1d60d21b604082015260600190565b5f60208284031215611e6c575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b81810381811115611c4f57611c4f611e73565b92835260208301919091526001600160a01b0316604082015260600190565b8082028115828204841417611c4f57611c4f611e73565b5f82611eea57634e487b7160e01b5f52601260045260245ffd5b500490565b80820180821115611c4f57611c4f611e73565b634e487b7160e01b5f52603260045260245ffd5b6001600160a01b03929092168252602082015260400190565b5f805f60608486031215611f41575f80fd5b8351925060208401519150604084015190509250925092565b5f60a082018783526020878185015260a0604085015281875180845260c08601915082890193505f5b81811015611fa85784516001600160a01b031683529383019391830191600101611f83565b50506001600160a01b03969096166060850152505050608001529392505050565b634e487b7160e01b5f52604160045260245ffd5b5f6020808385031215611fee575f80fd5b82516001600160401b0380821115612004575f80fd5b818501915085601f830112612017575f80fd5b81518181111561202957612029611fc9565b8060051b604051601f19603f8301168101818110858211171561204e5761204e611fc9565b60405291825284820192508381018501918883111561206b575f80fd5b938501935b8285101561208957845184529385019392850192612070565b9897505050505050505056fea164736f6c6343000814000a