ETH Price: $3,870.46 (+6.48%)

Token

ERC-20: WOOFi Super Charger Optimism (weOP)

Overview

Max Total Supply

260,087.516345245466320375 weOP

Holders

12,573

Market

Price

$0.00 @ 0.000000 ETH

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Balance
0.004984915088890205 weOP

Value
$0.00
0x24d9Ad4603a20512D6Ac47a1404aDb130180062d
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
WooSuperChargerVault

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 20000 runs

Other Settings:
default evmVersion
File 1 of 22 : WooSuperChargerVault.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import "../interfaces/IStrategy.sol";
import "../interfaces/IWETH.sol";
import "../interfaces/IWooAccessManager.sol";
import "../interfaces/IVaultV2.sol";
import "../interfaces/IMasterChefWoo.sol";

import "./WooWithdrawManager.sol";
import "./WooLendingManager.sol";

import "../libraries/TransferHelper.sol";

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

contract WooSuperChargerVault is ERC20, Ownable, Pausable, ReentrancyGuard {
    using EnumerableSet for EnumerableSet.AddressSet;

    event Deposit(address indexed user, uint256 assets, uint256 shares);
    event RequestWithdraw(address indexed user, uint256 assets, uint256 shares);
    event InstantWithdraw(address indexed user, uint256 assets, uint256 shares, uint256 fees);
    event WeeklySettleStarted(address indexed caller, uint256 totalRequestedShares, uint256 weeklyRepayAmount);
    event WeeklySettleEnded(
        address indexed caller,
        uint256 totalBalance,
        uint256 lendingBalance,
        uint256 reserveBalance
    );
    event ReserveVaultMigrated(address indexed user, address indexed oldVault, address indexed newVault);

    event LendingManagerUpdated(address formerLendingManager, address newLendingManager);
    event WithdrawManagerUpdated(address formerWithdrawManager, address newWithdrawManager);
    event InstantWithdrawFeeRateUpdated(uint256 formerFeeRate, uint256 newFeeRate);

    /* ----- State Variables ----- */

    address constant ETH_PLACEHOLDER_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    IVaultV2 public reserveVault;
    WooLendingManager public lendingManager;
    WooWithdrawManager public withdrawManager;

    address public immutable want;
    address public immutable weth;
    IWooAccessManager public immutable accessManager;

    mapping(address => uint256) public costSharePrice;
    mapping(address => uint256) public requestedWithdrawShares; // Requested withdrawn amount (in assets, NOT shares)
    uint256 public requestedTotalShares;
    EnumerableSet.AddressSet private requestUsers;

    uint256 public instantWithdrawCap; // Max instant withdraw amount (in assets, per week)
    uint256 public instantWithdrawnAmount; // Withdrawn amout already consumed (in assets, per week)

    bool public isSettling;

    address public treasury = 0x815D4517427Fc940A90A5653cdCEA1544c6283c9;
    uint256 public instantWithdrawFeeRate = 30; // 1 in 10000th. default: 30 -> 0.3%

    address public masterChef;
    uint256 public pid;

    constructor(
        address _weth,
        address _want,
        address _accessManager
    )
        ERC20(
            string(abi.encodePacked("WOOFi Super Charger ", ERC20(_want).name())),
            string(abi.encodePacked("we", ERC20(_want).symbol()))
        )
    {
        require(_weth != address(0), "WooSuperChargerVault: !weth");
        require(_want != address(0), "WooSuperChargerVault: !want");
        require(_accessManager != address(0), "WooSuperChargerVault: !accessManager");

        weth = _weth;
        want = _want;
        accessManager = IWooAccessManager(_accessManager);
    }

    function init(
        address _reserveVault,
        address _lendingManager,
        address payable _withdrawManager
    ) external onlyOwner {
        require(_reserveVault != address(0), "WooSuperChargerVault: !_reserveVault");
        require(_lendingManager != address(0), "WooSuperChargerVault: !_lendingManager");
        require(_withdrawManager != address(0), "WooSuperChargerVault: !_withdrawManager");

        reserveVault = IVaultV2(_reserveVault);
        require(reserveVault.want() == want);
        lendingManager = WooLendingManager(_lendingManager);
        withdrawManager = WooWithdrawManager(_withdrawManager);
    }

    modifier onlyAdmin() {
        require(owner() == msg.sender || accessManager.isVaultAdmin(msg.sender), "WooSuperChargerVault: !ADMIN");
        _;
    }

    modifier onlyLendingManager() {
        require(msg.sender == address(lendingManager), "WooSuperChargerVault: !lendingManager");
        _;
    }

    /* ----- External Functions ----- */

    function setMasterChef(address _masterChef, uint256 _pid) external onlyOwner {
        require(_masterChef != address(0), "!_masterChef");
        masterChef = _masterChef;
        pid = _pid;
        (IERC20 weToken, , , , ) = IMasterChefWoo(masterChef).poolInfo(pid);
        require(address(weToken) == address(this), "!pid");
    }

    function stakedShares(address _user) public view returns (uint256 shares) {
        if (masterChef == address(0)) {
            shares = 0;
        } else {
            (shares, ) = IMasterChefWoo(masterChef).userInfo(pid, _user);
        }
    }

    function deposit(uint256 amount) external payable whenNotPaused nonReentrant {
        // require(amount > 0, 'WooSuperChargerVault: !amount');
        if (amount == 0) {
            return;
        }

        lendingManager.accureInterest();
        uint256 shares = _shares(amount, getPricePerFullShare());
        require(shares > 0, "!shares");

        uint256 sharesBefore = balanceOf(msg.sender) + stakedShares(msg.sender);
        uint256 costBefore = costSharePrice[msg.sender];
        uint256 costAfter = (sharesBefore * costBefore + amount * 1e18) / (sharesBefore + shares);

        costSharePrice[msg.sender] = costAfter;

        if (want == weth) {
            require(msg.value == amount, "WooSuperChargerVault: msg.value_INSUFFICIENT");
            reserveVault.deposit{value: msg.value}(amount);
        } else {
            TransferHelper.safeTransferFrom(want, msg.sender, address(this), amount);
            TransferHelper.safeApprove(want, address(reserveVault), amount);
            reserveVault.deposit(amount);
        }
        _mint(msg.sender, shares);

        instantWithdrawCap = instantWithdrawCap + amount / 10;

        emit Deposit(msg.sender, amount, shares);
    }

    function instantWithdraw(uint256 amount) external whenNotPaused nonReentrant {
        require(amount > 0, "WooSuperChargerVault: !amount");
        require(!isSettling, "WooSuperChargerVault: NOT_ALLOWED_IN_SETTLING");

        if (instantWithdrawnAmount >= instantWithdrawCap) {
            // NOTE: no more instant withdraw quota.
            return;
        }

        require(amount <= instantWithdrawCap - instantWithdrawnAmount, "WooSuperChargerVault: OUT_OF_CAP");
        lendingManager.accureInterest();
        uint256 shares = _sharesUp(amount, getPricePerFullShare());
        _burn(msg.sender, shares);

        uint256 reserveShares = _sharesUp(amount, reserveVault.getPricePerFullShare());
        reserveVault.withdraw(reserveShares);

        uint256 fee = accessManager.isZeroFeeVault(msg.sender) ? 0 : (amount * instantWithdrawFeeRate) / 10000;
        if (want == weth) {
            TransferHelper.safeTransferETH(treasury, fee);
            TransferHelper.safeTransferETH(msg.sender, amount - fee);
        } else {
            TransferHelper.safeTransfer(want, treasury, fee);
            TransferHelper.safeTransfer(want, msg.sender, amount - fee);
        }

        instantWithdrawnAmount = instantWithdrawnAmount + amount;

        emit InstantWithdraw(msg.sender, amount, reserveShares, fee);
    }

    function instantWithdrawAll() external whenNotPaused nonReentrant {
        require(!isSettling, "WooSuperChargerVault: NOT_ALLOWED_IN_SETTLING");

        if (instantWithdrawnAmount >= instantWithdrawCap) {
            // NOTE: no more instant withdraw quota.
            return;
        }

        lendingManager.accureInterest();
        uint256 shares = balanceOf(msg.sender);
        uint256 amount = _assets(shares);
        require(amount <= instantWithdrawCap - instantWithdrawnAmount, "WooSuperChargerVault: OUT_OF_CAP");

        _burn(msg.sender, shares);

        uint256 reserveShares = _sharesUp(amount, reserveVault.getPricePerFullShare());
        reserveVault.withdraw(reserveShares);

        uint256 fee = accessManager.isZeroFeeVault(msg.sender) ? 0 : (amount * instantWithdrawFeeRate) / 10000;
        if (want == weth) {
            TransferHelper.safeTransferETH(treasury, fee);
            TransferHelper.safeTransferETH(msg.sender, amount - fee);
        } else {
            TransferHelper.safeTransfer(want, treasury, fee);
            TransferHelper.safeTransfer(want, msg.sender, amount - fee);
        }

        instantWithdrawnAmount = instantWithdrawnAmount + amount;

        emit InstantWithdraw(msg.sender, amount, reserveShares, fee);
    }

    function requestWithdraw(uint256 amount) external whenNotPaused nonReentrant {
        require(amount > 0, "WooSuperChargerVault: !amount");
        require(!isSettling, "WooSuperChargerVault: CANNOT_WITHDRAW_IN_SETTLING");

        lendingManager.accureInterest();
        uint256 shares = _sharesUp(amount, getPricePerFullShare());
        TransferHelper.safeTransferFrom(address(this), msg.sender, address(this), shares);

        requestedWithdrawShares[msg.sender] = requestedWithdrawShares[msg.sender] + shares;
        requestedTotalShares = requestedTotalShares + shares;
        requestUsers.add(msg.sender);

        emit RequestWithdraw(msg.sender, amount, shares);
    }

    function requestWithdrawAll() external whenNotPaused nonReentrant {
        require(!isSettling, "WooSuperChargerVault: CANNOT_WITHDRAW_IN_SETTLING");

        lendingManager.accureInterest();
        uint256 shares = balanceOf(msg.sender);
        TransferHelper.safeTransferFrom(address(this), msg.sender, address(this), shares);

        requestedWithdrawShares[msg.sender] = requestedWithdrawShares[msg.sender] + shares;
        requestedTotalShares = requestedTotalShares + shares;
        requestUsers.add(msg.sender);

        emit RequestWithdraw(msg.sender, _assets(shares), shares);
    }

    function requestedTotalAmount() public view returns (uint256) {
        return _assets(requestedTotalShares);
    }

    function requestedWithdrawAmount(address user) public view returns (uint256) {
        return _assets(requestedWithdrawShares[user]);
    }

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

    function reserveBalance() public view returns (uint256) {
        return _assets(IERC20(address(reserveVault)).balanceOf(address(this)), reserveVault.getPricePerFullShare());
    }

    function lendingBalance() public view returns (uint256) {
        return lendingManager.debtAfterPerfFee();
    }

    // Returns the total balance (assets), which is avaiable + reserve + lending.
    function balance() public view returns (uint256) {
        return available() + reserveBalance() + lendingBalance();
    }

    function getPricePerFullShare() public view returns (uint256) {
        return totalSupply() == 0 ? 1e18 : (balance() * 1e18) / totalSupply();
    }

    // --- For WooLendingManager --- //

    function maxBorrowableAmount() public view returns (uint256) {
        uint256 resBal = reserveBalance();
        uint256 instWithdrawBal = instantWithdrawCap - instantWithdrawnAmount;
        return resBal > instWithdrawBal ? resBal - instWithdrawBal : 0;
    }

    function borrowFromLendingManager(uint256 amount, address fundAddr) external onlyLendingManager {
        require(!isSettling, "IN SETTLING");
        require(amount <= maxBorrowableAmount(), "INSUFF_AMOUNT_FOR_BORROW");
        uint256 sharesToWithdraw = _sharesUp(amount, reserveVault.getPricePerFullShare());
        reserveVault.withdraw(sharesToWithdraw);
        if (want == weth) {
            IWETH(weth).deposit{value: amount}();
        }
        TransferHelper.safeTransfer(want, fundAddr, amount);
    }

    function repayFromLendingManager(uint256 amount) external onlyLendingManager {
        TransferHelper.safeTransferFrom(want, msg.sender, address(this), amount);
        if (want == weth) {
            IWETH(weth).withdraw(amount);
            reserveVault.deposit{value: amount}(amount);
        } else {
            TransferHelper.safeApprove(want, address(reserveVault), amount);
            reserveVault.deposit(amount);
        }
    }

    // --- Admin operations --- //

    function weeklyNeededAmountForWithdraw() public view returns (uint256) {
        uint256 reserveBal = reserveBalance();
        uint256 requestedAmount = requestedTotalAmount();
        uint256 afterBal = balance() - requestedAmount;

        return reserveBal >= requestedAmount + afterBal / 10 ? 0 : requestedAmount + afterBal / 10 - reserveBal;
    }

    function startWeeklySettle() external onlyAdmin {
        require(!isSettling, "IN_SETTLING");
        isSettling = true;
        lendingManager.accureInterest();
        emit WeeklySettleStarted(msg.sender, requestedTotalShares, weeklyNeededAmountForWithdraw());
    }

    function endWeeklySettle() public onlyAdmin {
        require(isSettling, "!SETTLING");
        require(weeklyNeededAmountForWithdraw() == 0, "WEEKLY_REPAY_NOT_CLEARED");

        uint256 sharePrice = getPricePerFullShare();

        isSettling = false;
        uint256 amount = requestedTotalAmount();

        if (amount != 0) {
            uint256 shares = _sharesUp(amount, reserveVault.getPricePerFullShare());
            reserveVault.withdraw(shares);

            if (want == weth) {
                IWETH(weth).deposit{value: amount}();
            }
            require(available() >= amount);

            TransferHelper.safeApprove(want, address(withdrawManager), amount);
            uint256 length = requestUsers.length();
            for (uint256 i = 0; i < length; i++) {
                address user = requestUsers.at(0);

                withdrawManager.addWithdrawAmount(user, (requestedWithdrawShares[user] * sharePrice) / 1e18);

                requestedWithdrawShares[user] = 0;
                requestUsers.remove(user);
            }

            _burn(address(this), requestedTotalShares);
            requestedTotalShares = 0;
        }

        instantWithdrawnAmount = 0;

        lendingManager.accureInterest();
        uint256 totalBalance = balance();
        instantWithdrawCap = totalBalance / 10;

        emit WeeklySettleEnded(msg.sender, totalBalance, lendingBalance(), reserveBalance());
    }

    function migrateReserveVault(address _vault) external onlyOwner {
        require(_vault != address(0), "!_vault");

        uint256 preBal = (want == weth) ? address(this).balance : available();
        reserveVault.withdraw(IERC20(address(reserveVault)).balanceOf(address(this)));
        uint256 afterBal = (want == weth) ? address(this).balance : available();
        uint256 reserveAmount = afterBal - preBal;

        address oldVault = address(reserveVault);
        reserveVault = IVaultV2(_vault);
        require(reserveVault.want() == want, "INVALID_WANT");
        if (want == weth) {
            reserveVault.deposit{value: reserveAmount}(reserveAmount);
        } else {
            TransferHelper.safeApprove(want, address(reserveVault), reserveAmount);
            reserveVault.deposit(reserveAmount);
        }

        emit ReserveVaultMigrated(msg.sender, oldVault, _vault);
    }

    function inCaseTokenGotStuck(address stuckToken) external onlyOwner {
        if (stuckToken == ETH_PLACEHOLDER_ADDR) {
            TransferHelper.safeTransferETH(msg.sender, address(this).balance);
        } else {
            uint256 amount = IERC20(stuckToken).balanceOf(address(this));
            TransferHelper.safeTransfer(stuckToken, msg.sender, amount);
        }
    }

    function setLendingManager(address _lendingManager) external onlyOwner {
        address formerManager = address(lendingManager);
        lendingManager = WooLendingManager(_lendingManager);
        emit LendingManagerUpdated(formerManager, _lendingManager);
    }

    function setWithdrawManager(address payable _withdrawManager) external onlyOwner {
        address formerManager = address(withdrawManager);
        withdrawManager = WooWithdrawManager(_withdrawManager);
        emit WithdrawManagerUpdated(formerManager, _withdrawManager);
    }

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

    function setInstantWithdrawFeeRate(uint256 _feeRate) external onlyOwner {
        uint256 formerFeeRate = instantWithdrawFeeRate;
        instantWithdrawFeeRate = _feeRate;
        emit InstantWithdrawFeeRateUpdated(formerFeeRate, _feeRate);
    }

    function pause() public onlyAdmin {
        _pause();
    }

    function unpause() external onlyAdmin {
        _unpause();
    }

    receive() external payable {}

    function _assets(uint256 shares) private view returns (uint256) {
        return _assets(shares, getPricePerFullShare());
    }

    function _assets(uint256 shares, uint256 sharePrice) private pure returns (uint256) {
        return (shares * sharePrice) / 1e18;
    }

    function _shares(uint256 assets, uint256 sharePrice) private pure returns (uint256) {
        return (assets * 1e18) / sharePrice;
    }

    function _sharesUp(uint256 assets, uint256 sharePrice) private pure returns (uint256) {
        uint256 shares = (assets * 1e18) / sharePrice;
        return _assets(shares, sharePrice) == assets ? shares : shares + 1;
    }
}

File 2 of 22 : IStrategy.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
interface IStrategy {
    function vault() external view returns (address);

    function want() external view returns (address);

    function beforeDeposit() external;

    function beforeWithdraw() 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 emergencyExit() external;

    function paused() external view returns (bool);

    function inCaseTokensGetStuck(address stuckToken) external;
}

File 3 of 22 : IVaultV2.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

interface IVaultV2 {
    function want() external view returns (address);

    function weth() external view returns (address);

    function deposit(uint256 amount) external payable;

    function withdraw(uint256 shares) external;

    function earn() external;

    function available() external view returns (uint256);

    function balance() external view returns (uint256);

    function getPricePerFullShare() external view returns (uint256);
}

File 4 of 22 : IWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title Wrapped ETH.
interface IWETH {
    /// @dev Deposit ETH into WETH
    function deposit() external payable;

    /// @dev Transfer WETH to receiver
    /// @param to address of WETH receiver
    /// @param value amount of WETH to transfer
    /// @return get true when succeed, else false
    function transfer(address to, uint256 value) external returns (bool);

    /// @dev Withdraw WETH to ETH
    function withdraw(uint256) external;
}

File 5 of 22 : IWooAccessManager.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/// @title Reward manager interface for WooFi Swap.
/// @notice this is for swap rebate or potential incentive program
interface IWooAccessManager {
    /* ----- Events ----- */

    event FeeAdminUpdated(address indexed feeAdmin, bool flag);

    event VaultAdminUpdated(address indexed vaultAdmin, bool flag);

    event RebateAdminUpdated(address indexed rebateAdmin, bool flag);

    event ZeroFeeVaultUpdated(address indexed vault, bool flag);

    /* ----- External Functions ----- */

    function isFeeAdmin(address feeAdmin) external returns (bool);

    function isVaultAdmin(address vaultAdmin) external returns (bool);

    function isRebateAdmin(address rebateAdmin) external returns (bool);

    function isZeroFeeVault(address vault) external returns (bool);

    /* ----- Admin Functions ----- */

    /// @notice Sets feeAdmin
    function setFeeAdmin(address feeAdmin, bool flag) external;

    /// @notice Sets vaultAdmin
    function setVaultAdmin(address vaultAdmin, bool flag) external;

    /// @notice Sets rebateAdmin
    function setRebateAdmin(address rebateAdmin, bool flag) external;

    /// @notice Sets zeroFeeVault
    function setZeroFeeVault(address vault, bool flag) external;
}

File 6 of 22 : IMasterChefWoo.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.14;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./IRewarder.sol";

interface IMasterChefWoo {
    event PoolAdded(uint256 poolId, uint256 allocPoint, IERC20 weToken, IRewarder rewarder);
    event PoolSet(uint256 poolId, uint256 allocPoint, IRewarder rewarder);
    event PoolUpdated(uint256 poolId, uint256 lastRewardBlock, uint256 supply, uint256 accTokenPerShare);
    event XWooPerBlockUpdated(uint256 xWooPerBlock);
    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event Harvest(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);

    struct UserInfo {
        uint256 amount;
        uint256 rewardDebt;
    }

    struct PoolInfo {
        IERC20 weToken;
        uint256 allocPoint;
        uint256 lastRewardBlock;
        uint256 accTokenPerShare;
        IRewarder rewarder;
    }

    // System-level function
    function setXWooPerBlock(uint256 _xWooPerBlock) external;

    // Pool-related functions
    function poolLength() external view returns (uint256);

    function add(
        uint256 allocPoint,
        IERC20 weToken,
        IRewarder rewarder
    ) external;

    function set(
        uint256 pid,
        uint256 allocPoint,
        IRewarder rewarder
    ) external;

    function massUpdatePools() external;

    function updatePool(uint256 pid) external;

    // User-related functions
    function pendingXWoo(uint256 pid, address user) external view returns (uint256, uint256);

    function deposit(uint256 pid, uint256 amount) external;

    function withdraw(uint256 pid, uint256 amount) external;

    function harvest(uint256 pid) external;

    function emergencyWithdraw(uint256 pid) external;

    function userInfo(uint256 pid, address user) external view returns (uint256 amount, uint256 rewardDebt);

    function poolInfo(uint256 pid)
        external
        view
        returns (
            IERC20 weToken,
            uint256 allocPoint,
            uint256 lastRewardBlock,
            uint256 accTokenPerShare,
            IRewarder rewarder
        );
}

File 7 of 22 : WooWithdrawManager.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

import "../interfaces/IWETH.sol";
import "../interfaces/IWooAccessManager.sol";

import "../libraries/TransferHelper.sol";

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

contract WooWithdrawManager is Ownable, ReentrancyGuard {
    // addedAmount: added withdrawal amount for this user
    // totalAmount: total withdrawal amount for this user
    event WithdrawAdded(address indexed user, uint256 addedAmount, uint256 totalAmount);

    event Withdraw(address indexed user, uint256 amount);

    address public want;
    address public weth;
    address public accessManager;
    address public superChargerVault;

    mapping(address => uint256) public withdrawAmount;

    address constant ETH_PLACEHOLDER_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    constructor() {}

    function init(
        address _weth,
        address _want,
        address _accessManager,
        address _superChargerVault
    ) external onlyOwner {
        weth = _weth;
        want = _want;
        accessManager = _accessManager;
        superChargerVault = _superChargerVault;
    }

    modifier onlyAdmin() {
        require(
            owner() == msg.sender || IWooAccessManager(accessManager).isVaultAdmin(msg.sender),
            "WooWithdrawManager: !owner"
        );
        _;
    }

    modifier onlySuperChargerVault() {
        require(superChargerVault == msg.sender, "WooWithdrawManager: !superChargerVault");
        _;
    }

    function setSuperChargerVault(address _superChargerVault) external onlyAdmin {
        superChargerVault = _superChargerVault;
    }

    function addWithdrawAmount(address user, uint256 amount) external onlySuperChargerVault {
        TransferHelper.safeTransferFrom(want, msg.sender, address(this), amount);
        withdrawAmount[user] = withdrawAmount[user] + amount;
        emit WithdrawAdded(user, amount, withdrawAmount[user]);
    }

    function withdraw() external nonReentrant {
        uint256 amount = withdrawAmount[msg.sender];
        if (amount == 0) {
            return;
        }
        withdrawAmount[msg.sender] = 0;
        if (want == weth) {
            IWETH(weth).withdraw(amount);
            TransferHelper.safeTransferETH(msg.sender, amount);
        } else {
            TransferHelper.safeTransfer(want, msg.sender, amount);
        }
        emit Withdraw(msg.sender, amount);
    }

    function inCaseTokenGotStuck(address stuckToken) external onlyOwner {
        require(stuckToken != want);
        if (stuckToken == ETH_PLACEHOLDER_ADDR) {
            TransferHelper.safeTransferETH(msg.sender, address(this).balance);
        } else {
            uint256 amount = IERC20(stuckToken).balanceOf(address(this));
            TransferHelper.safeTransfer(stuckToken, msg.sender, amount);
        }
    }

    receive() external payable {}
}

File 8 of 22 : WooLendingManager.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

import "./WooSuperChargerVault.sol";
import "../interfaces/IWETH.sol";
import "../interfaces/IWooAccessManager.sol";
import "../interfaces/IWooPPV2.sol";

import "../libraries/TransferHelper.sol";

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract WooLendingManager is Ownable, ReentrancyGuard {
    event Borrow(address indexed user, uint256 assets);
    event Repay(address indexed user, uint256 assets, uint256 perfFee);
    event InterestRateUpdated(address indexed user, uint256 oldInterest, uint256 newInterest);

    address public weth;
    address public want;
    address public accessManager;
    address public wooPP;
    WooSuperChargerVault public superChargerVault;

    uint256 public borrowedPrincipal;
    uint256 public borrowedInterest;

    uint256 public perfRate = 1000; // 1 in 10000th. 1000 = 10%
    address public treasury;

    uint256 public interestRate; // 1 in 10000th. 1 = 0.01% (1 bp), 10 = 0.1% (10 bps)
    uint256 public lastAccuredTs; // Timestamp of last accured interests

    mapping(address => bool) public isBorrower;

    address constant ETH_PLACEHOLDER_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    constructor() {}

    function init(
        address _weth,
        address _want,
        address _accessManager,
        address _wooPP,
        address payable _superChargerVault
    ) external onlyOwner {
        weth = _weth;
        want = _want;
        accessManager = _accessManager;
        wooPP = _wooPP;
        superChargerVault = WooSuperChargerVault(_superChargerVault);
        lastAccuredTs = block.timestamp;
        treasury = 0x4094D7A17a387795838c7aba4687387B0d32BCf3;
    }

    modifier onlyAdmin() {
        require(
            owner() == msg.sender || IWooAccessManager(accessManager).isVaultAdmin(msg.sender),
            "WooLendingManager: !ADMIN"
        );
        _;
    }

    modifier onlyBorrower() {
        require(isBorrower[msg.sender], "WooLendingManager: !borrower");
        _;
    }

    modifier onlySuperChargerVault() {
        require(msg.sender == address(superChargerVault), "WooLendingManager: !superChargerVault");
        _;
    }

    function setSuperChargerVault(address payable _wooSuperCharger) external onlyOwner {
        superChargerVault = WooSuperChargerVault(_wooSuperCharger);
    }

    function setWooPP(address _wooPP) external onlyOwner {
        wooPP = _wooPP;
    }

    function setBorrower(address _borrower, bool _isBorrower) external onlyOwner {
        isBorrower[_borrower] = _isBorrower;
    }

    function setPerfRate(uint256 _rate) external onlyAdmin {
        require(_rate < 10000);
        perfRate = _rate;
    }

    function debt() public view returns (uint256 assets) {
        return borrowedPrincipal + borrowedInterest;
    }

    function debtAfterPerfFee() public view returns (uint256 assets) {
        uint256 perfFee = (borrowedInterest * perfRate) / 10000;
        return borrowedPrincipal + borrowedInterest - perfFee;
    }

    function borrowState()
        external
        view
        returns (
            uint256 total,
            uint256 principal,
            uint256 interest,
            uint256 borrowable
        )
    {
        total = debt();
        principal = borrowedPrincipal;
        interest = borrowedInterest;
        borrowable = superChargerVault.maxBorrowableAmount();
    }

    function accureInterest() public {
        uint256 currentTs = block.timestamp;

        // CAUTION: block.timestamp may be out of order
        if (currentTs <= lastAccuredTs) {
            return;
        }

        uint256 duration = currentTs - lastAccuredTs;

        // interestRate is in 10000th.
        // 31536000 = 365 * 24 * 3600 (1 year of seconds)
        uint256 interest = (borrowedPrincipal * interestRate * duration) / 31536000 / 10000;

        borrowedInterest = borrowedInterest + interest;
        lastAccuredTs = currentTs;
    }

    function setInterestRate(uint256 _rate) external onlyAdmin {
        require(_rate <= 50000, "RATE_INVALID"); // NOTE: rate < 500%
        accureInterest();
        uint256 oldInterest = interestRate;
        interestRate = _rate;
        emit InterestRateUpdated(msg.sender, oldInterest, _rate);
    }

    function setTreasury(address _treasury) external onlyAdmin {
        require(_treasury != address(0), "WooLendingManager: !_treasury");
        treasury = _treasury;
    }

    function maxBorrowableAmount() external view returns (uint256) {
        return superChargerVault.maxBorrowableAmount();
    }

    /// @dev Borrow the fund from super charger and then deposit directly into WooPP.
    /// @param amount the borrowing amount
    function borrow(uint256 amount) external onlyBorrower {
        require(amount > 0, "!AMOUNT");

        accureInterest();
        borrowedPrincipal = borrowedPrincipal + amount;

        uint256 preBalance = IERC20(want).balanceOf(address(this));
        superChargerVault.borrowFromLendingManager(amount, address(this));
        uint256 afterBalance = IERC20(want).balanceOf(address(this));
        require(afterBalance - preBalance == amount, "WooLendingManager: BORROW_AMOUNT_ERROR");

        TransferHelper.safeApprove(want, wooPP, amount);
        IWooPPV2(wooPP).deposit(want, amount);

        emit Borrow(msg.sender, amount);
    }

    // NOTE: this is the view functiono;
    // Remember to call the accureInterest to ensure the latest repayment state.
    function weeklyRepayment() public view returns (uint256 repayAmount) {
        uint256 neededAmount = superChargerVault.weeklyNeededAmountForWithdraw();
        if (neededAmount == 0) {
            return 0;
        }
        if (neededAmount <= borrowedInterest) {
            repayAmount = (neededAmount * 10000) / (uint256(10000) - perfRate);
        } else {
            repayAmount = neededAmount - borrowedInterest + ((borrowedInterest * 10000) / (uint256(10000) - perfRate));
        }
        repayAmount = repayAmount + 1;
    }

    function weeklyRepaymentBreakdown()
        public
        view
        returns (
            uint256 repayAmount,
            uint256 principal,
            uint256 interest,
            uint256 perfFee
        )
    {
        uint256 neededAmount = superChargerVault.weeklyNeededAmountForWithdraw();
        if (neededAmount == 0) {
            return (0, 0, 0, 0);
        }
        if (neededAmount <= borrowedInterest) {
            repayAmount = (neededAmount * 10000) / (uint256(10000) - perfRate);
            principal = 0;
            interest = neededAmount;
        } else {
            repayAmount = neededAmount - borrowedInterest + ((borrowedInterest * 10000) / (uint256(10000) - perfRate));
            principal = neededAmount - borrowedInterest;
            interest = borrowedInterest;
        }
        repayAmount = repayAmount + 1;
        perfFee = repayAmount - neededAmount;
    }

    function repayWeekly() external onlyBorrower returns (uint256 repaidAmount) {
        accureInterest();
        repaidAmount = weeklyRepayment();
        if (repaidAmount != 0) {
            repay(repaidAmount);
        } else {
            emit Repay(msg.sender, 0, 0);
        }
    }

    function repayAll() external onlyBorrower returns (uint256 repaidAmount) {
        accureInterest();
        repaidAmount = debt();
        if (repaidAmount != 0) {
            repay(repaidAmount);
        } else {
            emit Repay(msg.sender, 0, 0);
        }
    }

    function repay(uint256 amount) public onlyBorrower {
        require(amount > 0);

        accureInterest();

        TransferHelper.safeTransferFrom(want, msg.sender, address(this), amount);

        require(IERC20(want).balanceOf(address(this)) >= amount);

        uint256 perfFee;
        if (borrowedInterest >= amount) {
            borrowedInterest = borrowedInterest - amount;
            perfFee = (amount * perfRate) / 10000;
        } else {
            perfFee = (borrowedInterest * perfRate) / 10000;
            borrowedPrincipal = borrowedPrincipal - (amount - borrowedInterest);
            borrowedInterest = 0;
        }
        TransferHelper.safeTransfer(want, treasury, perfFee);
        uint256 amountRepaid = amount - perfFee;

        TransferHelper.safeApprove(want, address(superChargerVault), amountRepaid);
        uint256 beforeBalance = IERC20(want).balanceOf(address(this));
        superChargerVault.repayFromLendingManager(amountRepaid);
        uint256 afterBalance = IERC20(want).balanceOf(address(this));
        require(beforeBalance - afterBalance == amountRepaid, "WooLendingManager: REPAY_AMOUNT_ERROR");

        emit Repay(msg.sender, amount, perfFee);
    }

    function inCaseTokenGotStuck(address stuckToken) external onlyOwner {
        if (stuckToken == ETH_PLACEHOLDER_ADDR) {
            TransferHelper.safeTransferETH(msg.sender, address(this).balance);
        } else {
            uint256 amount = IERC20(stuckToken).balanceOf(address(this));
            TransferHelper.safeTransfer(stuckToken, msg.sender, amount);
        }
    }
}

File 9 of 22 : TransferHelper.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
    function safeApprove(
        address token,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            'TransferHelper::safeApprove: approve failed'
        );
    }

    function safeTransfer(
        address token,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            'TransferHelper::safeTransfer: transfer failed'
        );
    }

    function safeTransferFrom(
        address token,
        address from,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            'TransferHelper::transferFrom: transferFrom failed'
        );
    }

    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
    }
}

File 10 of 22 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../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.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

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

File 11 of 22 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 12 of 22 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../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 {
    /**
     * @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);

    bool private _paused;

    /**
     * @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 {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

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

File 13 of 22 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

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

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

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

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

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

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

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

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

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

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

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 14 of 22 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 15 of 22 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

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

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

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

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 16 of 22 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

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

File 17 of 22 : IRewarder.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.14;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IRewarder {
    event OnRewarded(address indexed user, uint256 amount);
    event RewardRateUpdated(uint256 oldRate, uint256 newRate);

    struct UserInfo {
        uint256 amount;
        uint256 rewardDebt;
        uint256 unpaidRewards;
    }

    struct PoolInfo {
        uint256 accTokenPerShare;
        uint256 lastRewardBlock;
    }

    function onRewarded(address user, uint256 amount) external;

    function pendingTokens(address user) external view returns (uint256);
}

File 18 of 22 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

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

File 19 of 22 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 20 of 22 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 21 of 22 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 22 of 22 : IWooPPV2.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/// @title Woo private pool for swap.
/// @notice Use this contract to directly interfact with woo's synthetic proactive
///         marketing making pool.
/// @author woo.network
interface IWooPPV2 {
    /* ----- Events ----- */

    event Deposit(address indexed token, address indexed sender, uint256 amount);
    event Withdraw(address indexed token, address indexed receiver, uint256 amount);
    event Migrate(address indexed token, address indexed receiver, uint256 amount);
    event AdminUpdated(address indexed addr, bool flag);
    event FeeAddrUpdated(address indexed newFeeAddr);
    event WooracleUpdated(address indexed newWooracle);
    event WooSwap(
        address indexed fromToken,
        address indexed toToken,
        uint256 fromAmount,
        uint256 toAmount,
        address from,
        address indexed to,
        address rebateTo,
        uint256 swapVol,
        uint256 swapFee
    );

    /* ----- External Functions ----- */

    /// @notice The quote token address (immutable).
    /// @return address of quote token
    function quoteToken() external view returns (address);

    /// @notice Gets the pool size of the specified token (swap liquidity).
    /// @param token the token address
    /// @return the pool size
    function poolSize(address token) external view returns (uint256);

    /// @notice Query the amount to swap `fromToken` to `toToken`, without checking the pool reserve balance.
    /// @param fromToken the from token
    /// @param toToken the to token
    /// @param fromAmount the amount of `fromToken` to swap
    /// @return toAmount the swapped amount of `toToken`
    function tryQuery(
        address fromToken,
        address toToken,
        uint256 fromAmount
    ) external view returns (uint256 toAmount);

    /// @notice Query the amount to swap `fromToken` to `toToken`, with checking the pool reserve balance.
    /// @dev tx reverts when 'toToken' balance is insufficient.
    /// @param fromToken the from token
    /// @param toToken the to token
    /// @param fromAmount the amount of `fromToken` to swap
    /// @return toAmount the swapped amount of `toToken`
    function query(
        address fromToken,
        address toToken,
        uint256 fromAmount
    ) external view returns (uint256 toAmount);

    /// @notice Swap `fromToken` to `toToken`.
    /// @param fromToken the from token
    /// @param toToken the to token
    /// @param fromAmount the amount of `fromToken` to swap
    /// @param minToAmount the minimum amount of `toToken` to receive
    /// @param to the destination address
    /// @param rebateTo the rebate address (optional, can be address ZERO)
    /// @return realToAmount the amount of toToken to receive
    function swap(
        address fromToken,
        address toToken,
        uint256 fromAmount,
        uint256 minToAmount,
        address to,
        address rebateTo
    ) external returns (uint256 realToAmount);

    /// @notice Deposit the specified token into the liquidity pool of WooPPV2.
    /// @param token the token to deposit
    /// @param amount the deposit amount
    function deposit(address token, uint256 amount) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_want","type":"address"},{"internalType":"address","name":"_accessManager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fees","type":"uint256"}],"name":"InstantWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"formerFeeRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newFeeRate","type":"uint256"}],"name":"InstantWithdrawFeeRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"formerLendingManager","type":"address"},{"indexed":false,"internalType":"address","name":"newLendingManager","type":"address"}],"name":"LendingManagerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"RequestWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"oldVault","type":"address"},{"indexed":true,"internalType":"address","name":"newVault","type":"address"}],"name":"ReserveVaultMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lendingBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reserveBalance","type":"uint256"}],"name":"WeeklySettleEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalRequestedShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"weeklyRepayAmount","type":"uint256"}],"name":"WeeklySettleStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"formerWithdrawManager","type":"address"},{"indexed":false,"internalType":"address","name":"newWithdrawManager","type":"address"}],"name":"WithdrawManagerUpdated","type":"event"},{"inputs":[],"name":"accessManager","outputs":[{"internalType":"contract IWooAccessManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"available","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"fundAddr","type":"address"}],"name":"borrowFromLendingManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"costSharePrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"endWeeklySettle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPricePerFullShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stuckToken","type":"address"}],"name":"inCaseTokenGotStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_reserveVault","type":"address"},{"internalType":"address","name":"_lendingManager","type":"address"},{"internalType":"address payable","name":"_withdrawManager","type":"address"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"instantWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"instantWithdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"instantWithdrawCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"instantWithdrawFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"instantWithdrawnAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSettling","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lendingBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lendingManager","outputs":[{"internalType":"contract WooLendingManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"masterChef","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxBorrowableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"migrateReserveVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"repayFromLendingManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"requestWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestWithdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestedTotalAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"requestedTotalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"requestedWithdrawAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"requestedWithdrawShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reserveBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reserveVault","outputs":[{"internalType":"contract IVaultV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeRate","type":"uint256"}],"name":"setInstantWithdrawFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lendingManager","type":"address"}],"name":"setLendingManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_masterChef","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"setMasterChef","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_withdrawManager","type":"address"}],"name":"setWithdrawManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"stakedShares","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startWeeklySettle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"want","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weeklyNeededAmountForWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawManager","outputs":[{"internalType":"contract WooWithdrawManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e060405260118054610100600160a81b03191674815d4517427fc940a90a5653cdcea1544c6283c900179055601e6012553480156200003e57600080fd5b5060405162005c7f38038062005c7f83398101604081905262000061916200041f565b816001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa158015620000a0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620000ca9190810190620004b2565b604051602001620000dc91906200056a565b604051602081830303815290604052826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156200012a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620001549190810190620004b2565b604051602001620001669190620005b1565b60408051601f1981840301815291905281516200018b9060039060208501906200035c565b508051620001a19060049060208401906200035c565b505050620001be620001b86200030660201b60201c565b6200030a565b6005805460ff60a01b1916905560016006556001600160a01b0383166200022c5760405162461bcd60e51b815260206004820152601b60248201527f576f6f5375706572436861726765725661756c743a202177657468000000000060448201526064015b60405180910390fd5b6001600160a01b038216620002845760405162461bcd60e51b815260206004820152601b60248201527f576f6f5375706572436861726765725661756c743a202177616e740000000000604482015260640162000223565b6001600160a01b038116620002e85760405162461bcd60e51b8152602060048201526024808201527f576f6f5375706572436861726765725661756c743a20216163636573734d616e60448201526330b3b2b960e11b606482015260840162000223565b6001600160a01b0392831660a0529082166080521660c05262000619565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200036a90620005dd565b90600052602060002090601f0160209004810192826200038e5760008555620003d9565b82601f10620003a957805160ff1916838001178555620003d9565b82800160010185558215620003d9579182015b82811115620003d9578251825591602001919060010190620003bc565b50620003e7929150620003eb565b5090565b5b80821115620003e75760008155600101620003ec565b80516001600160a01b03811681146200041a57600080fd5b919050565b6000806000606084860312156200043557600080fd5b620004408462000402565b9250620004506020850162000402565b9150620004606040850162000402565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200049c57818101518382015260200162000482565b83811115620004ac576000848401525b50505050565b600060208284031215620004c557600080fd5b81516001600160401b0380821115620004dd57600080fd5b818401915084601f830112620004f257600080fd5b81518181111562000507576200050762000469565b604051601f8201601f19908116603f0116810190838211818310171562000532576200053262000469565b816040528281528760208487010111156200054c57600080fd5b6200055f8360208301602088016200047f565b979650505050505050565b7f574f4f4669205375706572204368617267657220000000000000000000000000815260008251620005a48160148501602087016200047f565b9190910160140192915050565b61776560f01b815260008251620005d08160028501602087016200047f565b9190910160020192915050565b600181811c90821680620005f257607f821691505b6020821081036200061357634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c0516155176200076860003960008181610ae9015281816115a60152818161244e0152818161269c015281816127b60152818161354b0152613e120152600081816105ab015281816111e40152818161123d015281816116d30152818161181b015281816119c2015281816124ef01528181612c3901528181612cbf01528181613042015281816137cc015281816138250152613eb301526000818161049901528181610ece0152818161120e015281816112b5015281816116fd01528181611845015281816118f8015281816119ec01528181611aa001528181611bba0152818161251901528181612582015281816125bb01528181612c1001528181612c6301528181612da80152818161306501528181613184015281816131b4015281816137f6015281816138b501528181613edd01528181613f410152613f7a01526155176000f3fe60806040526004361061039b5760003560e01c806377c7b8fc116101dc578063b6b55f2511610102578063e1a4e72a116100a0578063f2fde38b1161006f578063f2fde38b14610a82578063fac6182f14610aa2578063fd92bff214610ab7578063fdcb606814610ad757600080fd5b8063e1a4e72a14610a0c578063ec3e9da514610a2c578063f0f4426014610a4c578063f106845414610a6c57600080fd5b8063cef062fc116100dc578063cef062fc1461097b578063dadb6c1d1461099b578063dd62ed3e146109b0578063e14224f3146109f657600080fd5b8063b6b55f2514610932578063c869d0ed14610945578063cecdb9611461096557600080fd5b806395d89b411161017a578063a457c2d711610149578063a457c2d7146108bd578063a9059cbb146108dd578063b5589fad146108fd578063b69ef8a81461091d57600080fd5b806395d89b411461085957806396f25d421461086e5780639e3b77af14610888578063a10954fe146108a857600080fd5b8063864a897f116101b6578063864a897f146107e3578063882c127e146107f95780638da5cb5b146108265780638e4005701461084457600080fd5b806377c7b8fc146107a45780637ab7cbb1146107b95780638456cb59146107ce57600080fd5b80634069ab68116102c157806361d027b31161025f5780636aa9eda21161022e5780636aa9eda21461072457806370a0823114610739578063715018a61461076f578063745400c91461078457600080fd5b806361d027b31461069c57806362263991146106c1578063672f1490146106ee5780636a7855fd1461070e57600080fd5b80634d9b48941161029b5780634d9b489414610617578063575a86b21461062c5780635c975abb1461064c57806360773a2c1461067c57600080fd5b80634069ab68146105cd57806348a0d754146105ed5780634bb2dcea1461060257600080fd5b806323b872dd11610339578063395093511161030857806339509351146105445780633bfb5c14146105645780633f4ba83a146105845780633fc8cef31461059957600080fd5b806323b872dd146104d35780632ea9239e146104f3578063313ce5671461051357806336ea43441461052f57600080fd5b806317e3e2e81161037557806317e3e2e81461043057806318160ddd14610452578063184b9559146104675780631f1fcd511461048757600080fd5b806306fdde03146103a7578063095ea7b3146103d25780630eb0c8f31461040257600080fd5b366103a257005b600080fd5b3480156103b357600080fd5b506103bc610b0b565b6040516103c99190615080565b60405180910390f35b3480156103de57600080fd5b506103f26103ed3660046150e6565b610b9d565b60405190151581526020016103c9565b34801561040e57600080fd5b5061042261041d366004615112565b610bb7565b6040519081526020016103c9565b34801561043c57600080fd5b5061045061044b366004615112565b610c6a565b005b34801561045e57600080fd5b50600254610422565b34801561047357600080fd5b5061045061048236600461512f565b610cec565b34801561049357600080fd5b506104bb7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016103c9565b3480156104df57600080fd5b506103f26104ee36600461517a565b610f9a565b3480156104ff57600080fd5b5061045061050e3660046151bb565b610fbe565b34801561051f57600080fd5b50604051601281526020016103c9565b34801561053b57600080fd5b506104506112e0565b34801561055057600080fd5b506103f261055f3660046150e6565b6114d0565b34801561057057600080fd5b5061045061057f3660046151eb565b61150f565b34801561059057600080fd5b50610450611555565b3480156105a557600080fd5b506104bb7f000000000000000000000000000000000000000000000000000000000000000081565b3480156105d957600080fd5b506104506105e8366004615112565b611671565b3480156105f957600080fd5b50610422611b89565b34801561060e57600080fd5b50610422611c32565b34801561062357600080fd5b50610422611c72565b34801561063857600080fd5b506013546104bb906001600160a01b031681565b34801561065857600080fd5b5060055474010000000000000000000000000000000000000000900460ff166103f2565b34801561068857600080fd5b50610422610697366004615112565b611cd5565b3480156106a857600080fd5b506011546104bb9061010090046001600160a01b031681565b3480156106cd57600080fd5b506104226106dc366004615112565b600a6020526000908152604090205481565b3480156106fa57600080fd5b506104506107093660046150e6565b611cf7565b34801561071a57600080fd5b5061042260105481565b34801561073057600080fd5b50610422611e74565b34801561074557600080fd5b50610422610754366004615112565b6001600160a01b031660009081526020819052604090205490565b34801561077b57600080fd5b50610450611ef0565b34801561079057600080fd5b5061045061079f3660046151eb565b611f02565b3480156107b057600080fd5b50610422612137565b3480156107c557600080fd5b5061045061217b565b3480156107da57600080fd5b5061045061264b565b3480156107ef57600080fd5b50610422600f5481565b34801561080557600080fd5b50610422610814366004615112565b600b6020526000908152604090205481565b34801561083257600080fd5b506005546001600160a01b03166104bb565b34801561085057600080fd5b50610450612765565b34801561086557600080fd5b506103bc6129bc565b34801561087a57600080fd5b506011546103f29060ff1681565b34801561089457600080fd5b506008546104bb906001600160a01b031681565b3480156108b457600080fd5b506104226129cb565b3480156108c957600080fd5b506103f26108d83660046150e6565b612ad3565b3480156108e957600080fd5b506103f26108f83660046150e6565b612b7d565b34801561090957600080fd5b506104506109183660046151eb565b612b8b565b34801561092957600080fd5b50610422612e52565b6104506109403660046151eb565b612e80565b34801561095157600080fd5b50610450610960366004615112565b6132c8565b34801561097157600080fd5b5061042260125481565b34801561098757600080fd5b506007546104bb906001600160a01b031681565b3480156109a757600080fd5b50610422613342565b3480156109bc57600080fd5b506104226109cb366004615204565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b348015610a0257600080fd5b50610422600c5481565b348015610a1857600080fd5b50610450610a27366004615112565b61334f565b348015610a3857600080fd5b506009546104bb906001600160a01b031681565b348015610a5857600080fd5b50610450610a67366004615112565b613426565b348015610a7857600080fd5b5061042260145481565b348015610a8e57600080fd5b50610450610a9d366004615112565b61346d565b348015610aae57600080fd5b506104506134fa565b348015610ac357600080fd5b50610450610ad23660046151eb565b613aff565b348015610ae357600080fd5b506104bb7f000000000000000000000000000000000000000000000000000000000000000081565b606060038054610b1a90615232565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4690615232565b8015610b935780601f10610b6857610100808354040283529160200191610b93565b820191906000526020600020905b815481529060010190602001808311610b7657829003601f168201915b5050505050905090565b600033610bab818585613ff5565b60019150505b92915050565b6013546000906001600160a01b0316610bd257506000919050565b6013546014546040517f93f1a40b00000000000000000000000000000000000000000000000000000000815260048101919091526001600160a01b038481166024830152909116906393f1a40b906044016040805180830381865afa158015610c3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c639190615285565b5092915050565b610c7261414d565b600980546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f68b42fcf63f2d28ae477b4539c3101ade5142acdcc91191a106d867f3554f28a91015b60405180910390a15050565b610cf461414d565b6001600160a01b038316610d745760405162461bcd60e51b8152602060048201526024808201527f576f6f5375706572436861726765725661756c743a20215f726573657276655660448201527f61756c740000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b038216610df05760405162461bcd60e51b815260206004820152602660248201527f576f6f5375706572436861726765725661756c743a20215f6c656e64696e674d60448201527f616e6167657200000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b038116610e6c5760405162461bcd60e51b815260206004820152602760248201527f576f6f5375706572436861726765725661756c743a20215f776974686472617760448201527f4d616e61676572000000000000000000000000000000000000000000000000006064820152608401610d6b565b600780547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03858116918217909255604080517f1f1fcd5100000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000000000000000000000000000000000000000000090931692631f1fcd51916004808201926020929091908290030181865afa158015610f1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4091906152a9565b6001600160a01b031614610f5357600080fd5b600880546001600160a01b039384167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556009805492909316911617905550565b600033610fa88582856141a7565b610fb3858585614257565b506001949350505050565b6008546001600160a01b0316331461103e5760405162461bcd60e51b815260206004820152602560248201527f576f6f5375706572436861726765725661756c743a20216c656e64696e674d6160448201527f6e616765720000000000000000000000000000000000000000000000000000006064820152608401610d6b565b60115460ff16156110915760405162461bcd60e51b815260206004820152600b60248201527f494e20534554544c494e470000000000000000000000000000000000000000006044820152606401610d6b565b611099611c32565b8211156110e85760405162461bcd60e51b815260206004820152601860248201527f494e535546465f414d4f554e545f464f525f424f52524f5700000000000000006044820152606401610d6b565b600061116a83600760009054906101000a90046001600160a01b03166001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611141573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116591906152c6565b61446e565b6007546040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156111ca57600080fd5b505af11580156111de573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316036112b0577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b15801561129657600080fd5b505af11580156112aa573d6000803e3d6000fd5b50505050505b6112db7f000000000000000000000000000000000000000000000000000000000000000083856144ba565b505050565b6112e8614622565b60026006540361133a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d6b565b600260065560115460ff16156113b85760405162461bcd60e51b815260206004820152603160248201527f576f6f5375706572436861726765725661756c743a2043414e4e4f545f57495460448201527f48445241575f494e5f534554544c494e470000000000000000000000000000006064820152608401610d6b565b600860009054906101000a90046001600160a01b03166001600160a01b031663a373ed4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561140857600080fd5b505af115801561141c573d6000803e3d6000fd5b505033600081815260208190526040902054925061143e91503090818461468d565b336000908152600b602052604090205461145990829061530e565b336000908152600b6020526040902055600c5461147790829061530e565b600c55611485600d336147fd565b50337febeaa8785285a4f7c37a305351997dceebabc3c357dab98023dc37514a1b6ed66114b183614819565b60408051918252602082018590520160405180910390a2506001600655565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190610bab908290869061150a90879061530e565b613ff5565b61151761414d565b601280549082905560408051828152602081018490527f2f0bfd95e6bf57fab22ace02a57c77bdabde00f81ccf61034ae4a915d3a47f4d9101610ce0565b336115686005546001600160a01b031690565b6001600160a01b0316148061161b57506040517faf5b052b0000000000000000000000000000000000000000000000000000000081523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063af5b052b906024016020604051808303816000875af11580156115f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161b9190615326565b6116675760405162461bcd60e51b815260206004820152601c60248201527f576f6f5375706572436861726765725661756c743a202141444d494e000000006044820152606401610d6b565b61166f614827565b565b61167961414d565b6001600160a01b0381166116cf5760405162461bcd60e51b815260206004820152600760248201527f215f7661756c74000000000000000000000000000000000000000000000000006044820152606401610d6b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161461173757611732611b89565b611739565b475b6007546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529192506001600160a01b031690632e1a7d4d9082906370a0823190602401602060405180830381865afa1580156117a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c791906152c6565b6040518263ffffffff1660e01b81526004016117e591815260200190565b600060405180830381600087803b1580156117ff57600080fd5b505af1158015611813573d6000803e3d6000fd5b5050505060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161461187f5761187a611b89565b611881565b475b9050600061188f8383615348565b600780546001600160a01b038781167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080517f1f1fcd510000000000000000000000000000000000000000000000000000000081529051949550918116937f00000000000000000000000000000000000000000000000000000000000000009091169291631f1fcd519160048083019260209291908290030181865afa158015611946573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061196a91906152a9565b6001600160a01b0316146119c05760405162461bcd60e51b815260206004820152600c60248201527f494e56414c49445f57414e5400000000000000000000000000000000000000006044820152606401610d6b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031603611a97576007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b039091169063b6b55f259084906024016000604051808303818588803b158015611a7957600080fd5b505af1158015611a8d573d6000803e3d6000fd5b5050505050611b47565b600754611acf907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b031684614897565b6007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b039091169063b6b55f2590602401600060405180830381600087803b158015611b2e57600080fd5b505af1158015611b42573d6000803e3d6000fd5b505050505b6040516001600160a01b03808716919083169033907f548fe255eb14d86b43af1c165d3a356a85be79136670fa5ff20aa3e0284afde790600090a45050505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2d91906152c6565b905090565b600080611c3d6129cb565b90506000601054600f54611c519190615348565b9050808211611c61576000611c6b565b611c6b8183615348565b9250505090565b600854604080517fd83e6b3800000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163d83e6b389160048083019260209291908290030181865afa158015611c09573d6000803e3d6000fd5b6001600160a01b0381166000908152600b6020526040812054610bb190614819565b611cff61414d565b6001600160a01b038216611d555760405162461bcd60e51b815260206004820152600c60248201527f215f6d61737465724368656600000000000000000000000000000000000000006044820152606401610d6b565b601380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03841690811790915560148290556040517f1526fe270000000000000000000000000000000000000000000000000000000081526004810183905260009190631526fe279060240160a060405180830381865afa158015611de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e0b919061535f565b505050509050306001600160a01b0316816001600160a01b0316146112db5760405162461bcd60e51b8152600401610d6b9060208082526004908201527f2170696400000000000000000000000000000000000000000000000000000000604082015260600190565b600080611e7f6129cb565b90506000611e8b613342565b9050600081611e98612e52565b611ea29190615348565b9050611eaf600a826153b7565b611eb9908361530e565b831015611ee55782611ecc600a836153b7565b611ed6908461530e565b611ee09190615348565b611ee8565b60005b935050505090565b611ef861414d565b61166f60006149ff565b611f0a614622565b600260065403611f5c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d6b565b600260065580611fae5760405162461bcd60e51b815260206004820152601d60248201527f576f6f5375706572436861726765725661756c743a2021616d6f756e740000006044820152606401610d6b565b60115460ff16156120275760405162461bcd60e51b815260206004820152603160248201527f576f6f5375706572436861726765725661756c743a2043414e4e4f545f57495460448201527f48445241575f494e5f534554544c494e470000000000000000000000000000006064820152608401610d6b565b600860009054906101000a90046001600160a01b03166001600160a01b031663a373ed4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561207757600080fd5b505af115801561208b573d6000803e3d6000fd5b50505050600061209d82611165612137565b90506120ab3033308461468d565b336000908152600b60205260409020546120c690829061530e565b336000908152600b6020526040902055600c546120e490829061530e565b600c556120f2600d336147fd565b50604080518381526020810183905233917febeaa8785285a4f7c37a305351997dceebabc3c357dab98023dc37514a1b6ed6910160405180910390a250506001600655565b600061214260025490565b1561216e57600254612152612e52565b61216490670de0b6b3a76400006153f2565b611c2d91906153b7565b50670de0b6b3a764000090565b612183614622565b6002600654036121d55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d6b565b600260065560115460ff16156122535760405162461bcd60e51b815260206004820152602d60248201527f576f6f5375706572436861726765725661756c743a204e4f545f414c4c4f574560448201527f445f494e5f534554544c494e47000000000000000000000000000000000000006064820152608401610d6b565b600f54601054101561264457600860009054906101000a90046001600160a01b03166001600160a01b031663a373ed4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156122af57600080fd5b505af11580156122c3573d6000803e3d6000fd5b505033600090815260208190526040812054925090506122e282614819565b9050601054600f546122f49190615348565b8111156123435760405162461bcd60e51b815260206004820181905260248201527f576f6f5375706572436861726765725661756c743a204f55545f4f465f4341506044820152606401610d6b565b61234d3383614a69565b60006123a682600760009054906101000a90046001600160a01b03166001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611141573d6000803e3d6000fd5b6007546040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561240657600080fd5b505af115801561241a573d6000803e3d6000fd5b50506040517f871e6ca6000000000000000000000000000000000000000000000000000000008152336004820152600092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063871e6ca6906024016020604051808303816000875af11580156124a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c49190615326565b6124e857612710601254846124d991906153f2565b6124e391906153b7565b6124eb565b60005b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031603612579576011546125619061010090046001600160a01b031682614bee565b6125743361256f8386615348565b614bee565b6125ea565b6011546125b6907f00000000000000000000000000000000000000000000000000000000000000009061010090046001600160a01b0316836144ba565b6125ea7f0000000000000000000000000000000000000000000000000000000000000000336125e58487615348565b6144ba565b826010546125f8919061530e565b601055604080518481526020810184905290810182905233907f672004d35ad2124f90299371ade95cf5594500e40705a7cf6eaf7c00b55a07ac906060015b60405180910390a2505050505b6001600655565b3361265e6005546001600160a01b031690565b6001600160a01b0316148061271157506040517faf5b052b0000000000000000000000000000000000000000000000000000000081523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063af5b052b906024016020604051808303816000875af11580156126ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127119190615326565b61275d5760405162461bcd60e51b815260206004820152601c60248201527f576f6f5375706572436861726765725661756c743a202141444d494e000000006044820152606401610d6b565b61166f614cd1565b336127786005546001600160a01b031690565b6001600160a01b0316148061282b57506040517faf5b052b0000000000000000000000000000000000000000000000000000000081523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063af5b052b906024016020604051808303816000875af1158015612807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061282b9190615326565b6128775760405162461bcd60e51b815260206004820152601c60248201527f576f6f5375706572436861726765725661756c743a202141444d494e000000006044820152606401610d6b565b60115460ff16156128ca5760405162461bcd60e51b815260206004820152600b60248201527f494e5f534554544c494e470000000000000000000000000000000000000000006044820152606401610d6b565b601180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055600854604080517fa373ed4e00000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169163a373ed4e9160048082019260009290919082900301818387803b15801561295457600080fd5b505af1158015612968573d6000803e3d6000fd5b50505050336001600160a01b03167ffce7d682dc90b7cc945fb8cfff947668bcf6d304aa58823b24d2c06dec38df6e600c546129a2611e74565b6040805192835260208301919091520160405180910390a2565b606060048054610b1a90615232565b6007546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600091611c2d916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612a33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a5791906152c6565b600760009054906101000a90046001600160a01b03166001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612aaa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ace91906152c6565b614d40565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919083811015612b705760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610d6b565b610fb38286868403613ff5565b600033610bab818585614257565b6008546001600160a01b03163314612c0b5760405162461bcd60e51b815260206004820152602560248201527f576f6f5375706572436861726765725661756c743a20216c656e64696e674d6160448201527f6e616765720000000000000000000000000000000000000000000000000000006064820152608401610d6b565b612c377f000000000000000000000000000000000000000000000000000000000000000033308461468d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031603612d9f576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015612d0b57600080fd5b505af1158015612d1f573d6000803e3d6000fd5b50506007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b03909116925063b6b55f25915083906024016000604051808303818588803b158015612d8357600080fd5b505af1158015612d97573d6000803e3d6000fd5b505050505050565b600754612dd7907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b031683614897565b6007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b039091169063b6b55f2590602401600060405180830381600087803b158015612e3657600080fd5b505af1158015612e4a573d6000803e3d6000fd5b505050505b50565b6000612e5c611c72565b612e646129cb565b612e6c611b89565b612e76919061530e565b611c2d919061530e565b612e88614622565b600260065403612eda5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d6b565b600260065580156132c057600860009054906101000a90046001600160a01b03166001600160a01b031663a373ed4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612f3557600080fd5b505af1158015612f49573d6000803e3d6000fd5b505050506000612f6082612f5b612137565b614d5f565b905060008111612fb25760405162461bcd60e51b815260206004820152600760248201527f21736861726573000000000000000000000000000000000000000000000000006044820152606401610d6b565b6000612fbd33610bb7565b33600090815260208190526040902054612fd7919061530e565b336000908152600a6020526040812054919250612ff4848461530e565b61300686670de0b6b3a76400006153f2565b61301084866153f2565b61301a919061530e565b61302491906153b7565b336000908152600a6020526040902081905590506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081167f00000000000000000000000000000000000000000000000000000000000000009091160361317f578434146131015760405162461bcd60e51b815260206004820152602c60248201527f576f6f5375706572436861726765725661756c743a206d73672e76616c75655f60448201527f494e53554646494349454e5400000000000000000000000000000000000000006064820152608401610d6b565b6007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b039091169063b6b55f259034906024016000604051808303818588803b15801561316157600080fd5b505af1158015613175573d6000803e3d6000fd5b505050505061325b565b6131ab7f000000000000000000000000000000000000000000000000000000000000000033308861468d565b6007546131e3907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b031687614897565b6007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b039091169063b6b55f2590602401600060405180830381600087803b15801561324257600080fd5b505af1158015613256573d6000803e3d6000fd5b505050505b6132653385614d74565b613270600a866153b7565b600f5461327d919061530e565b600f55604080518681526020810186905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15910160405180910390a2505050505b506001600655565b6132d061414d565b600880546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f9ed29eb74f1356c602e59670cf82bfe8b0f564216ce091e163fbf7f0376aa1979101610ce0565b6000611c2d600c54614819565b61335761414d565b7fffffffffffffffffffffffff11111111111111111111111111111111111111126001600160a01b0382160161339157612e4f3347614bee565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156133f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061341591906152c6565b90506134228233836144ba565b5050565b61342e61414d565b601180546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b61347561414d565b6001600160a01b0381166134f15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d6b565b612e4f816149ff565b3361350d6005546001600160a01b031690565b6001600160a01b031614806135c057506040517faf5b052b0000000000000000000000000000000000000000000000000000000081523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063af5b052b906024016020604051808303816000875af115801561359c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135c09190615326565b61360c5760405162461bcd60e51b815260206004820152601c60248201527f576f6f5375706572436861726765725661756c743a202141444d494e000000006044820152606401610d6b565b60115460ff1661365e5760405162461bcd60e51b815260206004820152600960248201527f21534554544c494e4700000000000000000000000000000000000000000000006044820152606401610d6b565b613666611e74565b156136b35760405162461bcd60e51b815260206004820152601860248201527f5745454b4c595f52455041595f4e4f545f434c454152454400000000000000006044820152606401610d6b565b60006136bd612137565b601180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055905060006136f1613342565b90508015613a1757600061375282600760009054906101000a90046001600160a01b03166001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611141573d6000803e3d6000fd5b6007546040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156137b257600080fd5b505af11580156137c6573d6000803e3d6000fd5b505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031603613898577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561387e57600080fd5b505af1158015613892573d6000803e3d6000fd5b50505050505b816138a1611b89565b10156138ac57600080fd5b6009546138e4907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b031684614897565b60006138f0600d614e53565b905060005b81811015613a0257600061390a600d82614e5d565b6009546001600160a01b038083166000908152600b60205260409020549293501690639b927a91908390670de0b6b3a764000090613949908b906153f2565b61395391906153b7565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156139b157600080fd5b505af11580156139c5573d6000803e3d6000fd5b5050506001600160a01b0382166000908152600b6020526040812055506139ed600d82614e69565b505080806139fa9061542f565b9150506138f5565b50613a0f30600c54614a69565b50506000600c555b60006010819055600854604080517fa373ed4e00000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169263a373ed4e9260048084019382900301818387803b158015613a7757600080fd5b505af1158015613a8b573d6000803e3d6000fd5b505050506000613a99612e52565b9050613aa6600a826153b7565b600f55337f805ee433ea4242be6315bc317b1bf10e767ad8beb03ee547773b3ee1f842c20682613ad4611c72565b613adc6129cb565b6040805193845260208401929092529082015260600160405180910390a2505050565b613b07614622565b600260065403613b595760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d6b565b600260065580613bab5760405162461bcd60e51b815260206004820152601d60248201527f576f6f5375706572436861726765725661756c743a2021616d6f756e740000006044820152606401610d6b565b60115460ff1615613c245760405162461bcd60e51b815260206004820152602d60248201527f576f6f5375706572436861726765725661756c743a204e4f545f414c4c4f574560448201527f445f494e5f534554544c494e47000000000000000000000000000000000000006064820152608401610d6b565b600f5460105410156132c057601054600f54613c409190615348565b811115613c8f5760405162461bcd60e51b815260206004820181905260248201527f576f6f5375706572436861726765725661756c743a204f55545f4f465f4341506044820152606401610d6b565b600860009054906101000a90046001600160a01b03166001600160a01b031663a373ed4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015613cdf57600080fd5b505af1158015613cf3573d6000803e3d6000fd5b505050506000613d0582611165612137565b9050613d113382614a69565b6000613d6a83600760009054906101000a90046001600160a01b03166001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611141573d6000803e3d6000fd5b6007546040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015613dca57600080fd5b505af1158015613dde573d6000803e3d6000fd5b50506040517f871e6ca6000000000000000000000000000000000000000000000000000000008152336004820152600092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316915063871e6ca6906024016020604051808303816000875af1158015613e64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e889190615326565b613eac5761271060125485613e9d91906153f2565b613ea791906153b7565b613eaf565b60005b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031603613f3857601154613f259061010090046001600160a01b031682614bee565b613f333361256f8387615348565b613fa4565b601154613f75907f00000000000000000000000000000000000000000000000000000000000000009061010090046001600160a01b0316836144ba565b613fa47f0000000000000000000000000000000000000000000000000000000000000000336125e58488615348565b83601054613fb2919061530e565b601055604080518581526020810184905290810182905233907f672004d35ad2124f90299371ade95cf5594500e40705a7cf6eaf7c00b55a07ac90606001612637565b6001600160a01b0383166140705760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b0382166140ec5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6005546001600160a01b0316331461166f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d6b565b6001600160a01b038381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461425157818110156142445760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610d6b565b6142518484848403613ff5565b50505050565b6001600160a01b0383166142d35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b03821661434f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b038316600090815260208190526040902054818110156143de5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061441590849061530e565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161446191815260200190565b60405180910390a3614251565b6000808261448485670de0b6b3a76400006153f2565b61448e91906153b7565b90508361449b8285614d40565b146144b0576144ab81600161530e565b6144b2565b805b949350505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905291516000928392908716916145449190615467565b6000604051808303816000865af19150503d8060008114614581576040519150601f19603f3d011682016040523d82523d6000602084013e614586565b606091505b50915091508180156145b05750805115806145b05750808060200190518101906145b09190615326565b612e4a5760405162461bcd60e51b815260206004820152602d60248201527f5472616e7366657248656c7065723a3a736166655472616e736665723a20747260448201527f616e73666572206661696c6564000000000000000000000000000000000000006064820152608401610d6b565b60055474010000000000000000000000000000000000000000900460ff161561166f5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610d6b565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052915160009283929088169161471f9190615467565b6000604051808303816000865af19150503d806000811461475c576040519150601f19603f3d011682016040523d82523d6000602084013e614761565b606091505b509150915081801561478b57508051158061478b57508080602001905181019061478b9190615326565b612d975760405162461bcd60e51b815260206004820152603160248201527f5472616e7366657248656c7065723a3a7472616e7366657246726f6d3a20747260448201527f616e7366657246726f6d206661696c65640000000000000000000000000000006064820152608401610d6b565b6000614812836001600160a01b038416614e7e565b9392505050565b6000610bb182612ace612137565b61482f614ecd565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b30000000000000000000000000000000000000000000000000000000017905291516000928392908716916149219190615467565b6000604051808303816000865af19150503d806000811461495e576040519150601f19603f3d011682016040523d82523d6000602084013e614963565b606091505b509150915081801561498d57508051158061498d57508080602001905181019061498d9190615326565b612e4a5760405162461bcd60e51b815260206004820152602b60248201527f5472616e7366657248656c7065723a3a73616665417070726f76653a2061707060448201527f726f7665206661696c65640000000000000000000000000000000000000000006064820152608401610d6b565b600580546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216614ae55760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b03821660009081526020819052604090205481811015614b745760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b0383166000908152602081905260408120838303905560028054849290614ba3908490615348565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b604080516000808252602082019092526001600160a01b038416908390604051614c189190615467565b60006040518083038185875af1925050503d8060008114614c55576040519150601f19603f3d011682016040523d82523d6000602084013e614c5a565b606091505b50509050806112db5760405162461bcd60e51b815260206004820152603460248201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60448201527f20455448207472616e73666572206661696c65640000000000000000000000006064820152608401610d6b565b614cd9614622565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861487a3390565b6000670de0b6b3a7640000614d5583856153f2565b61481291906153b7565b600081614d5584670de0b6b3a76400006153f2565b6001600160a01b038216614dca5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610d6b565b8060026000828254614ddc919061530e565b90915550506001600160a01b03821660009081526020819052604081208054839290614e0990849061530e565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6000610bb1825490565b60006148128383614f37565b6000614812836001600160a01b038416614f61565b6000818152600183016020526040812054614ec557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610bb1565b506000610bb1565b60055474010000000000000000000000000000000000000000900460ff1661166f5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610d6b565b6000826000018281548110614f4e57614f4e615483565b9060005260206000200154905092915050565b6000818152600183016020526040812054801561504a576000614f85600183615348565b8554909150600090614f9990600190615348565b9050818114614ffe576000866000018281548110614fb957614fb9615483565b9060005260206000200154905080876000018481548110614fdc57614fdc615483565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061500f5761500f6154b2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610bb1565b6000915050610bb1565b60005b8381101561506f578181015183820152602001615057565b838111156142515750506000910152565b602081526000825180602084015261509f816040850160208701615054565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6001600160a01b0381168114612e4f57600080fd5b600080604083850312156150f957600080fd5b8235615104816150d1565b946020939093013593505050565b60006020828403121561512457600080fd5b81356144b0816150d1565b60008060006060848603121561514457600080fd5b833561514f816150d1565b9250602084013561515f816150d1565b9150604084013561516f816150d1565b809150509250925092565b60008060006060848603121561518f57600080fd5b833561519a816150d1565b925060208401356151aa816150d1565b929592945050506040919091013590565b600080604083850312156151ce57600080fd5b8235915060208301356151e0816150d1565b809150509250929050565b6000602082840312156151fd57600080fd5b5035919050565b6000806040838503121561521757600080fd5b8235615222816150d1565b915060208301356151e0816150d1565b600181811c9082168061524657607f821691505b60208210810361527f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b6000806040838503121561529857600080fd5b505080516020909101519092909150565b6000602082840312156152bb57600080fd5b81516144b0816150d1565b6000602082840312156152d857600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115615321576153216152df565b500190565b60006020828403121561533857600080fd5b815180151581146144b057600080fd5b60008282101561535a5761535a6152df565b500390565b600080600080600060a0868803121561537757600080fd5b8551615382816150d1565b8095505060208601519350604086015192506060860151915060808601516153a9816150d1565b809150509295509295909350565b6000826153ed577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561542a5761542a6152df565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615460576154606152df565b5060010190565b60008251615479818460208701615054565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220f38c526fc87b027f7c52f5d17fc1f8b589c3e53f1328ab5c9485c632fa4da49d64736f6c634300080e0033000000000000000000000000420000000000000000000000000000000000000600000000000000000000000042000000000000000000000000000000000000420000000000000000000000008a68849c8a61225964d2cae170fdd19ec46bf246

Deployed Bytecode

0x60806040526004361061039b5760003560e01c806377c7b8fc116101dc578063b6b55f2511610102578063e1a4e72a116100a0578063f2fde38b1161006f578063f2fde38b14610a82578063fac6182f14610aa2578063fd92bff214610ab7578063fdcb606814610ad757600080fd5b8063e1a4e72a14610a0c578063ec3e9da514610a2c578063f0f4426014610a4c578063f106845414610a6c57600080fd5b8063cef062fc116100dc578063cef062fc1461097b578063dadb6c1d1461099b578063dd62ed3e146109b0578063e14224f3146109f657600080fd5b8063b6b55f2514610932578063c869d0ed14610945578063cecdb9611461096557600080fd5b806395d89b411161017a578063a457c2d711610149578063a457c2d7146108bd578063a9059cbb146108dd578063b5589fad146108fd578063b69ef8a81461091d57600080fd5b806395d89b411461085957806396f25d421461086e5780639e3b77af14610888578063a10954fe146108a857600080fd5b8063864a897f116101b6578063864a897f146107e3578063882c127e146107f95780638da5cb5b146108265780638e4005701461084457600080fd5b806377c7b8fc146107a45780637ab7cbb1146107b95780638456cb59146107ce57600080fd5b80634069ab68116102c157806361d027b31161025f5780636aa9eda21161022e5780636aa9eda21461072457806370a0823114610739578063715018a61461076f578063745400c91461078457600080fd5b806361d027b31461069c57806362263991146106c1578063672f1490146106ee5780636a7855fd1461070e57600080fd5b80634d9b48941161029b5780634d9b489414610617578063575a86b21461062c5780635c975abb1461064c57806360773a2c1461067c57600080fd5b80634069ab68146105cd57806348a0d754146105ed5780634bb2dcea1461060257600080fd5b806323b872dd11610339578063395093511161030857806339509351146105445780633bfb5c14146105645780633f4ba83a146105845780633fc8cef31461059957600080fd5b806323b872dd146104d35780632ea9239e146104f3578063313ce5671461051357806336ea43441461052f57600080fd5b806317e3e2e81161037557806317e3e2e81461043057806318160ddd14610452578063184b9559146104675780631f1fcd511461048757600080fd5b806306fdde03146103a7578063095ea7b3146103d25780630eb0c8f31461040257600080fd5b366103a257005b600080fd5b3480156103b357600080fd5b506103bc610b0b565b6040516103c99190615080565b60405180910390f35b3480156103de57600080fd5b506103f26103ed3660046150e6565b610b9d565b60405190151581526020016103c9565b34801561040e57600080fd5b5061042261041d366004615112565b610bb7565b6040519081526020016103c9565b34801561043c57600080fd5b5061045061044b366004615112565b610c6a565b005b34801561045e57600080fd5b50600254610422565b34801561047357600080fd5b5061045061048236600461512f565b610cec565b34801561049357600080fd5b506104bb7f000000000000000000000000420000000000000000000000000000000000004281565b6040516001600160a01b0390911681526020016103c9565b3480156104df57600080fd5b506103f26104ee36600461517a565b610f9a565b3480156104ff57600080fd5b5061045061050e3660046151bb565b610fbe565b34801561051f57600080fd5b50604051601281526020016103c9565b34801561053b57600080fd5b506104506112e0565b34801561055057600080fd5b506103f261055f3660046150e6565b6114d0565b34801561057057600080fd5b5061045061057f3660046151eb565b61150f565b34801561059057600080fd5b50610450611555565b3480156105a557600080fd5b506104bb7f000000000000000000000000420000000000000000000000000000000000000681565b3480156105d957600080fd5b506104506105e8366004615112565b611671565b3480156105f957600080fd5b50610422611b89565b34801561060e57600080fd5b50610422611c32565b34801561062357600080fd5b50610422611c72565b34801561063857600080fd5b506013546104bb906001600160a01b031681565b34801561065857600080fd5b5060055474010000000000000000000000000000000000000000900460ff166103f2565b34801561068857600080fd5b50610422610697366004615112565b611cd5565b3480156106a857600080fd5b506011546104bb9061010090046001600160a01b031681565b3480156106cd57600080fd5b506104226106dc366004615112565b600a6020526000908152604090205481565b3480156106fa57600080fd5b506104506107093660046150e6565b611cf7565b34801561071a57600080fd5b5061042260105481565b34801561073057600080fd5b50610422611e74565b34801561074557600080fd5b50610422610754366004615112565b6001600160a01b031660009081526020819052604090205490565b34801561077b57600080fd5b50610450611ef0565b34801561079057600080fd5b5061045061079f3660046151eb565b611f02565b3480156107b057600080fd5b50610422612137565b3480156107c557600080fd5b5061045061217b565b3480156107da57600080fd5b5061045061264b565b3480156107ef57600080fd5b50610422600f5481565b34801561080557600080fd5b50610422610814366004615112565b600b6020526000908152604090205481565b34801561083257600080fd5b506005546001600160a01b03166104bb565b34801561085057600080fd5b50610450612765565b34801561086557600080fd5b506103bc6129bc565b34801561087a57600080fd5b506011546103f29060ff1681565b34801561089457600080fd5b506008546104bb906001600160a01b031681565b3480156108b457600080fd5b506104226129cb565b3480156108c957600080fd5b506103f26108d83660046150e6565b612ad3565b3480156108e957600080fd5b506103f26108f83660046150e6565b612b7d565b34801561090957600080fd5b506104506109183660046151eb565b612b8b565b34801561092957600080fd5b50610422612e52565b6104506109403660046151eb565b612e80565b34801561095157600080fd5b50610450610960366004615112565b6132c8565b34801561097157600080fd5b5061042260125481565b34801561098757600080fd5b506007546104bb906001600160a01b031681565b3480156109a757600080fd5b50610422613342565b3480156109bc57600080fd5b506104226109cb366004615204565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b348015610a0257600080fd5b50610422600c5481565b348015610a1857600080fd5b50610450610a27366004615112565b61334f565b348015610a3857600080fd5b506009546104bb906001600160a01b031681565b348015610a5857600080fd5b50610450610a67366004615112565b613426565b348015610a7857600080fd5b5061042260145481565b348015610a8e57600080fd5b50610450610a9d366004615112565b61346d565b348015610aae57600080fd5b506104506134fa565b348015610ac357600080fd5b50610450610ad23660046151eb565b613aff565b348015610ae357600080fd5b506104bb7f0000000000000000000000008a68849c8a61225964d2cae170fdd19ec46bf24681565b606060038054610b1a90615232565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4690615232565b8015610b935780601f10610b6857610100808354040283529160200191610b93565b820191906000526020600020905b815481529060010190602001808311610b7657829003601f168201915b5050505050905090565b600033610bab818585613ff5565b60019150505b92915050565b6013546000906001600160a01b0316610bd257506000919050565b6013546014546040517f93f1a40b00000000000000000000000000000000000000000000000000000000815260048101919091526001600160a01b038481166024830152909116906393f1a40b906044016040805180830381865afa158015610c3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c639190615285565b5092915050565b610c7261414d565b600980546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f68b42fcf63f2d28ae477b4539c3101ade5142acdcc91191a106d867f3554f28a91015b60405180910390a15050565b610cf461414d565b6001600160a01b038316610d745760405162461bcd60e51b8152602060048201526024808201527f576f6f5375706572436861726765725661756c743a20215f726573657276655660448201527f61756c740000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b038216610df05760405162461bcd60e51b815260206004820152602660248201527f576f6f5375706572436861726765725661756c743a20215f6c656e64696e674d60448201527f616e6167657200000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b038116610e6c5760405162461bcd60e51b815260206004820152602760248201527f576f6f5375706572436861726765725661756c743a20215f776974686472617760448201527f4d616e61676572000000000000000000000000000000000000000000000000006064820152608401610d6b565b600780547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03858116918217909255604080517f1f1fcd5100000000000000000000000000000000000000000000000000000000815290517f000000000000000000000000420000000000000000000000000000000000004290931692631f1fcd51916004808201926020929091908290030181865afa158015610f1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4091906152a9565b6001600160a01b031614610f5357600080fd5b600880546001600160a01b039384167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216179091556009805492909316911617905550565b600033610fa88582856141a7565b610fb3858585614257565b506001949350505050565b6008546001600160a01b0316331461103e5760405162461bcd60e51b815260206004820152602560248201527f576f6f5375706572436861726765725661756c743a20216c656e64696e674d6160448201527f6e616765720000000000000000000000000000000000000000000000000000006064820152608401610d6b565b60115460ff16156110915760405162461bcd60e51b815260206004820152600b60248201527f494e20534554544c494e470000000000000000000000000000000000000000006044820152606401610d6b565b611099611c32565b8211156110e85760405162461bcd60e51b815260206004820152601860248201527f494e535546465f414d4f554e545f464f525f424f52524f5700000000000000006044820152606401610d6b565b600061116a83600760009054906101000a90046001600160a01b03166001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611141573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116591906152c6565b61446e565b6007546040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156111ca57600080fd5b505af11580156111de573d6000803e3d6000fd5b505050507f00000000000000000000000042000000000000000000000000000000000000066001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000426001600160a01b0316036112b0577f00000000000000000000000042000000000000000000000000000000000000066001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b15801561129657600080fd5b505af11580156112aa573d6000803e3d6000fd5b50505050505b6112db7f000000000000000000000000420000000000000000000000000000000000004283856144ba565b505050565b6112e8614622565b60026006540361133a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d6b565b600260065560115460ff16156113b85760405162461bcd60e51b815260206004820152603160248201527f576f6f5375706572436861726765725661756c743a2043414e4e4f545f57495460448201527f48445241575f494e5f534554544c494e470000000000000000000000000000006064820152608401610d6b565b600860009054906101000a90046001600160a01b03166001600160a01b031663a373ed4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561140857600080fd5b505af115801561141c573d6000803e3d6000fd5b505033600081815260208190526040902054925061143e91503090818461468d565b336000908152600b602052604090205461145990829061530e565b336000908152600b6020526040902055600c5461147790829061530e565b600c55611485600d336147fd565b50337febeaa8785285a4f7c37a305351997dceebabc3c357dab98023dc37514a1b6ed66114b183614819565b60408051918252602082018590520160405180910390a2506001600655565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190610bab908290869061150a90879061530e565b613ff5565b61151761414d565b601280549082905560408051828152602081018490527f2f0bfd95e6bf57fab22ace02a57c77bdabde00f81ccf61034ae4a915d3a47f4d9101610ce0565b336115686005546001600160a01b031690565b6001600160a01b0316148061161b57506040517faf5b052b0000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000008a68849c8a61225964d2cae170fdd19ec46bf2466001600160a01b03169063af5b052b906024016020604051808303816000875af11580156115f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161b9190615326565b6116675760405162461bcd60e51b815260206004820152601c60248201527f576f6f5375706572436861726765725661756c743a202141444d494e000000006044820152606401610d6b565b61166f614827565b565b61167961414d565b6001600160a01b0381166116cf5760405162461bcd60e51b815260206004820152600760248201527f215f7661756c74000000000000000000000000000000000000000000000000006044820152606401610d6b565b60007f00000000000000000000000042000000000000000000000000000000000000066001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000426001600160a01b03161461173757611732611b89565b611739565b475b6007546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529192506001600160a01b031690632e1a7d4d9082906370a0823190602401602060405180830381865afa1580156117a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c791906152c6565b6040518263ffffffff1660e01b81526004016117e591815260200190565b600060405180830381600087803b1580156117ff57600080fd5b505af1158015611813573d6000803e3d6000fd5b5050505060007f00000000000000000000000042000000000000000000000000000000000000066001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000426001600160a01b03161461187f5761187a611b89565b611881565b475b9050600061188f8383615348565b600780546001600160a01b038781167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080517f1f1fcd510000000000000000000000000000000000000000000000000000000081529051949550918116937f00000000000000000000000042000000000000000000000000000000000000429091169291631f1fcd519160048083019260209291908290030181865afa158015611946573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061196a91906152a9565b6001600160a01b0316146119c05760405162461bcd60e51b815260206004820152600c60248201527f494e56414c49445f57414e5400000000000000000000000000000000000000006044820152606401610d6b565b7f00000000000000000000000042000000000000000000000000000000000000066001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000426001600160a01b031603611a97576007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b039091169063b6b55f259084906024016000604051808303818588803b158015611a7957600080fd5b505af1158015611a8d573d6000803e3d6000fd5b5050505050611b47565b600754611acf907f0000000000000000000000004200000000000000000000000000000000000042906001600160a01b031684614897565b6007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018490526001600160a01b039091169063b6b55f2590602401600060405180830381600087803b158015611b2e57600080fd5b505af1158015611b42573d6000803e3d6000fd5b505050505b6040516001600160a01b03808716919083169033907f548fe255eb14d86b43af1c165d3a356a85be79136670fa5ff20aa3e0284afde790600090a45050505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f00000000000000000000000042000000000000000000000000000000000000426001600160a01b0316906370a0823190602401602060405180830381865afa158015611c09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2d91906152c6565b905090565b600080611c3d6129cb565b90506000601054600f54611c519190615348565b9050808211611c61576000611c6b565b611c6b8183615348565b9250505090565b600854604080517fd83e6b3800000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163d83e6b389160048083019260209291908290030181865afa158015611c09573d6000803e3d6000fd5b6001600160a01b0381166000908152600b6020526040812054610bb190614819565b611cff61414d565b6001600160a01b038216611d555760405162461bcd60e51b815260206004820152600c60248201527f215f6d61737465724368656600000000000000000000000000000000000000006044820152606401610d6b565b601380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03841690811790915560148290556040517f1526fe270000000000000000000000000000000000000000000000000000000081526004810183905260009190631526fe279060240160a060405180830381865afa158015611de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e0b919061535f565b505050509050306001600160a01b0316816001600160a01b0316146112db5760405162461bcd60e51b8152600401610d6b9060208082526004908201527f2170696400000000000000000000000000000000000000000000000000000000604082015260600190565b600080611e7f6129cb565b90506000611e8b613342565b9050600081611e98612e52565b611ea29190615348565b9050611eaf600a826153b7565b611eb9908361530e565b831015611ee55782611ecc600a836153b7565b611ed6908461530e565b611ee09190615348565b611ee8565b60005b935050505090565b611ef861414d565b61166f60006149ff565b611f0a614622565b600260065403611f5c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d6b565b600260065580611fae5760405162461bcd60e51b815260206004820152601d60248201527f576f6f5375706572436861726765725661756c743a2021616d6f756e740000006044820152606401610d6b565b60115460ff16156120275760405162461bcd60e51b815260206004820152603160248201527f576f6f5375706572436861726765725661756c743a2043414e4e4f545f57495460448201527f48445241575f494e5f534554544c494e470000000000000000000000000000006064820152608401610d6b565b600860009054906101000a90046001600160a01b03166001600160a01b031663a373ed4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561207757600080fd5b505af115801561208b573d6000803e3d6000fd5b50505050600061209d82611165612137565b90506120ab3033308461468d565b336000908152600b60205260409020546120c690829061530e565b336000908152600b6020526040902055600c546120e490829061530e565b600c556120f2600d336147fd565b50604080518381526020810183905233917febeaa8785285a4f7c37a305351997dceebabc3c357dab98023dc37514a1b6ed6910160405180910390a250506001600655565b600061214260025490565b1561216e57600254612152612e52565b61216490670de0b6b3a76400006153f2565b611c2d91906153b7565b50670de0b6b3a764000090565b612183614622565b6002600654036121d55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d6b565b600260065560115460ff16156122535760405162461bcd60e51b815260206004820152602d60248201527f576f6f5375706572436861726765725661756c743a204e4f545f414c4c4f574560448201527f445f494e5f534554544c494e47000000000000000000000000000000000000006064820152608401610d6b565b600f54601054101561264457600860009054906101000a90046001600160a01b03166001600160a01b031663a373ed4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156122af57600080fd5b505af11580156122c3573d6000803e3d6000fd5b505033600090815260208190526040812054925090506122e282614819565b9050601054600f546122f49190615348565b8111156123435760405162461bcd60e51b815260206004820181905260248201527f576f6f5375706572436861726765725661756c743a204f55545f4f465f4341506044820152606401610d6b565b61234d3383614a69565b60006123a682600760009054906101000a90046001600160a01b03166001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611141573d6000803e3d6000fd5b6007546040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561240657600080fd5b505af115801561241a573d6000803e3d6000fd5b50506040517f871e6ca6000000000000000000000000000000000000000000000000000000008152336004820152600092507f0000000000000000000000008a68849c8a61225964d2cae170fdd19ec46bf2466001600160a01b0316915063871e6ca6906024016020604051808303816000875af11580156124a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c49190615326565b6124e857612710601254846124d991906153f2565b6124e391906153b7565b6124eb565b60005b90507f00000000000000000000000042000000000000000000000000000000000000066001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000426001600160a01b031603612579576011546125619061010090046001600160a01b031682614bee565b6125743361256f8386615348565b614bee565b6125ea565b6011546125b6907f00000000000000000000000042000000000000000000000000000000000000429061010090046001600160a01b0316836144ba565b6125ea7f0000000000000000000000004200000000000000000000000000000000000042336125e58487615348565b6144ba565b826010546125f8919061530e565b601055604080518481526020810184905290810182905233907f672004d35ad2124f90299371ade95cf5594500e40705a7cf6eaf7c00b55a07ac906060015b60405180910390a2505050505b6001600655565b3361265e6005546001600160a01b031690565b6001600160a01b0316148061271157506040517faf5b052b0000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000008a68849c8a61225964d2cae170fdd19ec46bf2466001600160a01b03169063af5b052b906024016020604051808303816000875af11580156126ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127119190615326565b61275d5760405162461bcd60e51b815260206004820152601c60248201527f576f6f5375706572436861726765725661756c743a202141444d494e000000006044820152606401610d6b565b61166f614cd1565b336127786005546001600160a01b031690565b6001600160a01b0316148061282b57506040517faf5b052b0000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000008a68849c8a61225964d2cae170fdd19ec46bf2466001600160a01b03169063af5b052b906024016020604051808303816000875af1158015612807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061282b9190615326565b6128775760405162461bcd60e51b815260206004820152601c60248201527f576f6f5375706572436861726765725661756c743a202141444d494e000000006044820152606401610d6b565b60115460ff16156128ca5760405162461bcd60e51b815260206004820152600b60248201527f494e5f534554544c494e470000000000000000000000000000000000000000006044820152606401610d6b565b601180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055600854604080517fa373ed4e00000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169163a373ed4e9160048082019260009290919082900301818387803b15801561295457600080fd5b505af1158015612968573d6000803e3d6000fd5b50505050336001600160a01b03167ffce7d682dc90b7cc945fb8cfff947668bcf6d304aa58823b24d2c06dec38df6e600c546129a2611e74565b6040805192835260208301919091520160405180910390a2565b606060048054610b1a90615232565b6007546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600091611c2d916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612a33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a5791906152c6565b600760009054906101000a90046001600160a01b03166001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612aaa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ace91906152c6565b614d40565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919083811015612b705760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610d6b565b610fb38286868403613ff5565b600033610bab818585614257565b6008546001600160a01b03163314612c0b5760405162461bcd60e51b815260206004820152602560248201527f576f6f5375706572436861726765725661756c743a20216c656e64696e674d6160448201527f6e616765720000000000000000000000000000000000000000000000000000006064820152608401610d6b565b612c377f000000000000000000000000420000000000000000000000000000000000004233308461468d565b7f00000000000000000000000042000000000000000000000000000000000000066001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000426001600160a01b031603612d9f576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000042000000000000000000000000000000000000066001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015612d0b57600080fd5b505af1158015612d1f573d6000803e3d6000fd5b50506007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b03909116925063b6b55f25915083906024016000604051808303818588803b158015612d8357600080fd5b505af1158015612d97573d6000803e3d6000fd5b505050505050565b600754612dd7907f0000000000000000000000004200000000000000000000000000000000000042906001600160a01b031683614897565b6007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b039091169063b6b55f2590602401600060405180830381600087803b158015612e3657600080fd5b505af1158015612e4a573d6000803e3d6000fd5b505050505b50565b6000612e5c611c72565b612e646129cb565b612e6c611b89565b612e76919061530e565b611c2d919061530e565b612e88614622565b600260065403612eda5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d6b565b600260065580156132c057600860009054906101000a90046001600160a01b03166001600160a01b031663a373ed4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612f3557600080fd5b505af1158015612f49573d6000803e3d6000fd5b505050506000612f6082612f5b612137565b614d5f565b905060008111612fb25760405162461bcd60e51b815260206004820152600760248201527f21736861726573000000000000000000000000000000000000000000000000006044820152606401610d6b565b6000612fbd33610bb7565b33600090815260208190526040902054612fd7919061530e565b336000908152600a6020526040812054919250612ff4848461530e565b61300686670de0b6b3a76400006153f2565b61301084866153f2565b61301a919061530e565b61302491906153b7565b336000908152600a6020526040902081905590506001600160a01b037f000000000000000000000000420000000000000000000000000000000000000681167f00000000000000000000000042000000000000000000000000000000000000429091160361317f578434146131015760405162461bcd60e51b815260206004820152602c60248201527f576f6f5375706572436861726765725661756c743a206d73672e76616c75655f60448201527f494e53554646494349454e5400000000000000000000000000000000000000006064820152608401610d6b565b6007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b039091169063b6b55f259034906024016000604051808303818588803b15801561316157600080fd5b505af1158015613175573d6000803e3d6000fd5b505050505061325b565b6131ab7f000000000000000000000000420000000000000000000000000000000000004233308861468d565b6007546131e3907f0000000000000000000000004200000000000000000000000000000000000042906001600160a01b031687614897565b6007546040517fb6b55f25000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b039091169063b6b55f2590602401600060405180830381600087803b15801561324257600080fd5b505af1158015613256573d6000803e3d6000fd5b505050505b6132653385614d74565b613270600a866153b7565b600f5461327d919061530e565b600f55604080518681526020810186905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15910160405180910390a2505050505b506001600655565b6132d061414d565b600880546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f9ed29eb74f1356c602e59670cf82bfe8b0f564216ce091e163fbf7f0376aa1979101610ce0565b6000611c2d600c54614819565b61335761414d565b7fffffffffffffffffffffffff11111111111111111111111111111111111111126001600160a01b0382160161339157612e4f3347614bee565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156133f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061341591906152c6565b90506134228233836144ba565b5050565b61342e61414d565b601180546001600160a01b03909216610100027fffffffffffffffffffffff0000000000000000000000000000000000000000ff909216919091179055565b61347561414d565b6001600160a01b0381166134f15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610d6b565b612e4f816149ff565b3361350d6005546001600160a01b031690565b6001600160a01b031614806135c057506040517faf5b052b0000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000008a68849c8a61225964d2cae170fdd19ec46bf2466001600160a01b03169063af5b052b906024016020604051808303816000875af115801561359c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135c09190615326565b61360c5760405162461bcd60e51b815260206004820152601c60248201527f576f6f5375706572436861726765725661756c743a202141444d494e000000006044820152606401610d6b565b60115460ff1661365e5760405162461bcd60e51b815260206004820152600960248201527f21534554544c494e4700000000000000000000000000000000000000000000006044820152606401610d6b565b613666611e74565b156136b35760405162461bcd60e51b815260206004820152601860248201527f5745454b4c595f52455041595f4e4f545f434c454152454400000000000000006044820152606401610d6b565b60006136bd612137565b601180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055905060006136f1613342565b90508015613a1757600061375282600760009054906101000a90046001600160a01b03166001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611141573d6000803e3d6000fd5b6007546040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156137b257600080fd5b505af11580156137c6573d6000803e3d6000fd5b505050507f00000000000000000000000042000000000000000000000000000000000000066001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000426001600160a01b031603613898577f00000000000000000000000042000000000000000000000000000000000000066001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561387e57600080fd5b505af1158015613892573d6000803e3d6000fd5b50505050505b816138a1611b89565b10156138ac57600080fd5b6009546138e4907f0000000000000000000000004200000000000000000000000000000000000042906001600160a01b031684614897565b60006138f0600d614e53565b905060005b81811015613a0257600061390a600d82614e5d565b6009546001600160a01b038083166000908152600b60205260409020549293501690639b927a91908390670de0b6b3a764000090613949908b906153f2565b61395391906153b7565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b1580156139b157600080fd5b505af11580156139c5573d6000803e3d6000fd5b5050506001600160a01b0382166000908152600b6020526040812055506139ed600d82614e69565b505080806139fa9061542f565b9150506138f5565b50613a0f30600c54614a69565b50506000600c555b60006010819055600854604080517fa373ed4e00000000000000000000000000000000000000000000000000000000815290516001600160a01b039092169263a373ed4e9260048084019382900301818387803b158015613a7757600080fd5b505af1158015613a8b573d6000803e3d6000fd5b505050506000613a99612e52565b9050613aa6600a826153b7565b600f55337f805ee433ea4242be6315bc317b1bf10e767ad8beb03ee547773b3ee1f842c20682613ad4611c72565b613adc6129cb565b6040805193845260208401929092529082015260600160405180910390a2505050565b613b07614622565b600260065403613b595760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d6b565b600260065580613bab5760405162461bcd60e51b815260206004820152601d60248201527f576f6f5375706572436861726765725661756c743a2021616d6f756e740000006044820152606401610d6b565b60115460ff1615613c245760405162461bcd60e51b815260206004820152602d60248201527f576f6f5375706572436861726765725661756c743a204e4f545f414c4c4f574560448201527f445f494e5f534554544c494e47000000000000000000000000000000000000006064820152608401610d6b565b600f5460105410156132c057601054600f54613c409190615348565b811115613c8f5760405162461bcd60e51b815260206004820181905260248201527f576f6f5375706572436861726765725661756c743a204f55545f4f465f4341506044820152606401610d6b565b600860009054906101000a90046001600160a01b03166001600160a01b031663a373ed4e6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015613cdf57600080fd5b505af1158015613cf3573d6000803e3d6000fd5b505050506000613d0582611165612137565b9050613d113382614a69565b6000613d6a83600760009054906101000a90046001600160a01b03166001600160a01b03166377c7b8fc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611141573d6000803e3d6000fd5b6007546040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015613dca57600080fd5b505af1158015613dde573d6000803e3d6000fd5b50506040517f871e6ca6000000000000000000000000000000000000000000000000000000008152336004820152600092507f0000000000000000000000008a68849c8a61225964d2cae170fdd19ec46bf2466001600160a01b0316915063871e6ca6906024016020604051808303816000875af1158015613e64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e889190615326565b613eac5761271060125485613e9d91906153f2565b613ea791906153b7565b613eaf565b60005b90507f00000000000000000000000042000000000000000000000000000000000000066001600160a01b03167f00000000000000000000000042000000000000000000000000000000000000426001600160a01b031603613f3857601154613f259061010090046001600160a01b031682614bee565b613f333361256f8387615348565b613fa4565b601154613f75907f00000000000000000000000042000000000000000000000000000000000000429061010090046001600160a01b0316836144ba565b613fa47f0000000000000000000000004200000000000000000000000000000000000042336125e58488615348565b83601054613fb2919061530e565b601055604080518581526020810184905290810182905233907f672004d35ad2124f90299371ade95cf5594500e40705a7cf6eaf7c00b55a07ac90606001612637565b6001600160a01b0383166140705760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b0382166140ec5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6005546001600160a01b0316331461166f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d6b565b6001600160a01b038381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461425157818110156142445760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610d6b565b6142518484848403613ff5565b50505050565b6001600160a01b0383166142d35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b03821661434f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b038316600090815260208190526040902054818110156143de5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061441590849061530e565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161446191815260200190565b60405180910390a3614251565b6000808261448485670de0b6b3a76400006153f2565b61448e91906153b7565b90508361449b8285614d40565b146144b0576144ab81600161530e565b6144b2565b805b949350505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905291516000928392908716916145449190615467565b6000604051808303816000865af19150503d8060008114614581576040519150601f19603f3d011682016040523d82523d6000602084013e614586565b606091505b50915091508180156145b05750805115806145b05750808060200190518101906145b09190615326565b612e4a5760405162461bcd60e51b815260206004820152602d60248201527f5472616e7366657248656c7065723a3a736166655472616e736665723a20747260448201527f616e73666572206661696c6564000000000000000000000000000000000000006064820152608401610d6b565b60055474010000000000000000000000000000000000000000900460ff161561166f5760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610d6b565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052915160009283929088169161471f9190615467565b6000604051808303816000865af19150503d806000811461475c576040519150601f19603f3d011682016040523d82523d6000602084013e614761565b606091505b509150915081801561478b57508051158061478b57508080602001905181019061478b9190615326565b612d975760405162461bcd60e51b815260206004820152603160248201527f5472616e7366657248656c7065723a3a7472616e7366657246726f6d3a20747260448201527f616e7366657246726f6d206661696c65640000000000000000000000000000006064820152608401610d6b565b6000614812836001600160a01b038416614e7e565b9392505050565b6000610bb182612ace612137565b61482f614ecd565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b30000000000000000000000000000000000000000000000000000000017905291516000928392908716916149219190615467565b6000604051808303816000865af19150503d806000811461495e576040519150601f19603f3d011682016040523d82523d6000602084013e614963565b606091505b509150915081801561498d57508051158061498d57508080602001905181019061498d9190615326565b612e4a5760405162461bcd60e51b815260206004820152602b60248201527f5472616e7366657248656c7065723a3a73616665417070726f76653a2061707060448201527f726f7665206661696c65640000000000000000000000000000000000000000006064820152608401610d6b565b600580546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216614ae55760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b03821660009081526020819052604090205481811015614b745760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610d6b565b6001600160a01b0383166000908152602081905260408120838303905560028054849290614ba3908490615348565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b604080516000808252602082019092526001600160a01b038416908390604051614c189190615467565b60006040518083038185875af1925050503d8060008114614c55576040519150601f19603f3d011682016040523d82523d6000602084013e614c5a565b606091505b50509050806112db5760405162461bcd60e51b815260206004820152603460248201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60448201527f20455448207472616e73666572206661696c65640000000000000000000000006064820152608401610d6b565b614cd9614622565b600580547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861487a3390565b6000670de0b6b3a7640000614d5583856153f2565b61481291906153b7565b600081614d5584670de0b6b3a76400006153f2565b6001600160a01b038216614dca5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610d6b565b8060026000828254614ddc919061530e565b90915550506001600160a01b03821660009081526020819052604081208054839290614e0990849061530e565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6000610bb1825490565b60006148128383614f37565b6000614812836001600160a01b038416614f61565b6000818152600183016020526040812054614ec557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610bb1565b506000610bb1565b60055474010000000000000000000000000000000000000000900460ff1661166f5760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610d6b565b6000826000018281548110614f4e57614f4e615483565b9060005260206000200154905092915050565b6000818152600183016020526040812054801561504a576000614f85600183615348565b8554909150600090614f9990600190615348565b9050818114614ffe576000866000018281548110614fb957614fb9615483565b9060005260206000200154905080876000018481548110614fdc57614fdc615483565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061500f5761500f6154b2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610bb1565b6000915050610bb1565b60005b8381101561506f578181015183820152602001615057565b838111156142515750506000910152565b602081526000825180602084015261509f816040850160208701615054565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6001600160a01b0381168114612e4f57600080fd5b600080604083850312156150f957600080fd5b8235615104816150d1565b946020939093013593505050565b60006020828403121561512457600080fd5b81356144b0816150d1565b60008060006060848603121561514457600080fd5b833561514f816150d1565b9250602084013561515f816150d1565b9150604084013561516f816150d1565b809150509250925092565b60008060006060848603121561518f57600080fd5b833561519a816150d1565b925060208401356151aa816150d1565b929592945050506040919091013590565b600080604083850312156151ce57600080fd5b8235915060208301356151e0816150d1565b809150509250929050565b6000602082840312156151fd57600080fd5b5035919050565b6000806040838503121561521757600080fd5b8235615222816150d1565b915060208301356151e0816150d1565b600181811c9082168061524657607f821691505b60208210810361527f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b6000806040838503121561529857600080fd5b505080516020909101519092909150565b6000602082840312156152bb57600080fd5b81516144b0816150d1565b6000602082840312156152d857600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115615321576153216152df565b500190565b60006020828403121561533857600080fd5b815180151581146144b057600080fd5b60008282101561535a5761535a6152df565b500390565b600080600080600060a0868803121561537757600080fd5b8551615382816150d1565b8095505060208601519350604086015192506060860151915060808601516153a9816150d1565b809150509295509295909350565b6000826153ed577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561542a5761542a6152df565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203615460576154606152df565b5060010190565b60008251615479818460208701615054565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220f38c526fc87b027f7c52f5d17fc1f8b589c3e53f1328ab5c9485c632fa4da49d64736f6c634300080e0033

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

000000000000000000000000420000000000000000000000000000000000000600000000000000000000000042000000000000000000000000000000000000420000000000000000000000008a68849c8a61225964d2cae170fdd19ec46bf246

-----Decoded View---------------
Arg [0] : _weth (address): 0x4200000000000000000000000000000000000006
Arg [1] : _want (address): 0x4200000000000000000000000000000000000042
Arg [2] : _accessManager (address): 0x8A68849c8a61225964d2caE170fDD19eC46bf246

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000004200000000000000000000000000000000000006
Arg [1] : 0000000000000000000000004200000000000000000000000000000000000042
Arg [2] : 0000000000000000000000008a68849c8a61225964d2cae170fdd19ec46bf246


[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.