GLMR Price: $0.018905 (-2.00%)

Contract

0x31dE6442713088493ff32B5E35Ea54f36bA98c30

Overview

GLMR Balance

Moonbeam Chain LogoMoonbeam Chain LogoMoonbeam Chain Logo0 GLMR

GLMR Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Harvest41927722023-08-11 19:06:48903 days ago1691780808IN
0x31dE6442...36bA98c30
0 GLMR0.16185202127.75316868
Harvest41881252023-08-11 3:30:24903 days ago1691724624IN
0x31dE6442...36bA98c30
0 GLMR0.16010018126.37040461
Harvest41835882023-08-10 12:15:30904 days ago1691669730IN
0x31dE6442...36bA98c30
0 GLMR0.15837104125.09718982
Harvest41791612023-08-09 21:18:24905 days ago1691615904IN
0x31dE6442...36bA98c30
0 GLMR0.16094799127.03960347
Harvest41746362023-08-09 6:06:30905 days ago1691561190IN
0x31dE6442...36bA98c30
0 GLMR0.1605756126.7456668
Harvest41703802023-08-08 15:48:48906 days ago1691509728IN
0x31dE6442...36bA98c30
0 GLMR0.08244296126.77058562
Harvest41703782023-08-08 15:48:24906 days ago1691509704IN
0x31dE6442...36bA98c30
0 GLMR0.16060717126.77058562
Harvest41661332023-08-08 1:30:30906 days ago1691458230IN
0x31dE6442...36bA98c30
0 GLMR0.17712276139.80668411
Harvest41617842023-08-07 10:54:30907 days ago1691405670IN
0x31dE6442...36bA98c30
0 GLMR0.11326448149.25
Harvest41587612023-08-07 0:45:24907 days ago1691369124IN
0x31dE6442...36bA98c30
0 GLMR0.09486137125
Harvest41557822023-08-06 14:42:30908 days ago1691332950IN
0x31dE6442...36bA98c30
0 GLMR0.10570319139.2863996
Harvest41527402023-08-06 4:27:54908 days ago1691296074IN
0x31dE6442...36bA98c30
0 GLMR0.09491337125.06851806
Harvest41497672023-08-05 18:27:42909 days ago1691260062IN
0x31dE6442...36bA98c30
0 GLMR0.10417697137.27528452
Harvest41464482023-08-05 7:18:24909 days ago1691219904IN
0x31dE6442...36bA98c30
0 GLMR0.1025094135.0778997
Harvest41433702023-08-04 20:57:36910 days ago1691182656IN
0x31dE6442...36bA98c30
0 GLMR0.09452831126.30602945
Harvest41403612023-08-04 10:51:42910 days ago1691146302IN
0x31dE6442...36bA98c30
0 GLMR0.09824599129.45995712
Harvest41372922023-08-04 0:33:06910 days ago1691109186IN
0x31dE6442...36bA98c30
0 GLMR0.11271395148.52456348
Harvest41343102023-08-03 14:30:18911 days ago1691073018IN
0x31dE6442...36bA98c30
0 GLMR0.09504612125.24344965
Harvest41313452023-08-03 4:24:18911 days ago1691036658IN
0x31dE6442...36bA98c30
0 GLMR0.09486137125
Harvest41284042023-08-02 18:30:06912 days ago1691001006IN
0x31dE6442...36bA98c30
0 GLMR0.10601254139.69403461
Harvest41253442023-08-02 8:12:30912 days ago1690963950IN
0x31dE6442...36bA98c30
0 GLMR0.09601595126.52140569
Harvest41221872023-08-01 21:36:42913 days ago1690925802IN
0x31dE6442...36bA98c30
0 GLMR0.09690026126.5
Harvest41176972023-08-01 6:30:12913 days ago1690871412IN
0x31dE6442...36bA98c30
0 GLMR0.09486137125
Harvest41132512023-07-31 15:36:24914 days ago1690817784IN
0x31dE6442...36bA98c30
0 GLMR0.10218657136.53877233
Harvest41083742023-07-30 23:12:24914 days ago1690758744IN
0x31dE6442...36bA98c30
0 GLMR0.10325938136.06616012
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
42135422023-08-14 17:12:18900 days ago1692033138
0x31dE6442...36bA98c30
6.50516686 GLMR
42135422023-08-14 17:12:18900 days ago1692033138
0x31dE6442...36bA98c30
6.50516686 GLMR
41927722023-08-11 19:06:48903 days ago1691780808
0x31dE6442...36bA98c30
1.44841458 GLMR
41927722023-08-11 19:06:48903 days ago1691780808
0x31dE6442...36bA98c30
1.44841458 GLMR
41881252023-08-11 3:30:24903 days ago1691724624
0x31dE6442...36bA98c30
1.41504012 GLMR
41881252023-08-11 3:30:24903 days ago1691724624
0x31dE6442...36bA98c30
1.41504012 GLMR
41835882023-08-10 12:15:30904 days ago1691669730
0x31dE6442...36bA98c30
1.38722281 GLMR
41835882023-08-10 12:15:30904 days ago1691669730
0x31dE6442...36bA98c30
1.38722281 GLMR
41791612023-08-09 21:18:24905 days ago1691615904
0x31dE6442...36bA98c30
1.41954797 GLMR
41791612023-08-09 21:18:24905 days ago1691615904
0x31dE6442...36bA98c30
1.41954797 GLMR
41746362023-08-09 6:06:30905 days ago1691561190
0x31dE6442...36bA98c30
1.38925125 GLMR
41746362023-08-09 6:06:30905 days ago1691561190
0x31dE6442...36bA98c30
1.38925125 GLMR
41703802023-08-08 15:48:48906 days ago1691509728
0x31dE6442...36bA98c30
0.00064759 GLMR
41703802023-08-08 15:48:48906 days ago1691509728
0x31dE6442...36bA98c30
0.00064759 GLMR
41703782023-08-08 15:48:24906 days ago1691509704
0x31dE6442...36bA98c30
1.38862315 GLMR
41703782023-08-08 15:48:24906 days ago1691509704
0x31dE6442...36bA98c30
1.38862315 GLMR
41661332023-08-08 1:30:30906 days ago1691458230
0x31dE6442...36bA98c30
1.41770429 GLMR
41661332023-08-08 1:30:30906 days ago1691458230
0x31dE6442...36bA98c30
1.41770429 GLMR
41617842023-08-07 10:54:30907 days ago1691405670
0x31dE6442...36bA98c30
0.98574314 GLMR
41617842023-08-07 10:54:30907 days ago1691405670
0x31dE6442...36bA98c30
0.98574314 GLMR
41587612023-08-07 0:45:24907 days ago1691369124
0x31dE6442...36bA98c30
0.97572046 GLMR
41587612023-08-07 0:45:24907 days ago1691369124
0x31dE6442...36bA98c30
0.97572046 GLMR
41557822023-08-06 14:42:30908 days ago1691332950
0x31dE6442...36bA98c30
0.99637429 GLMR
41557822023-08-06 14:42:30908 days ago1691332950
0x31dE6442...36bA98c30
0.99637429 GLMR
41527402023-08-06 4:27:54908 days ago1691296074
0x31dE6442...36bA98c30
0.97288044 GLMR
View All Internal Transactions
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WrappedERC4626StellaswapStable

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license
pragma solidity 0.8.15;

import "HarvestableApyFlowVault.sol";
import "ISwap.sol";
import "IStellaDistributor.sol";
import "SafeERC20.sol";
import "AssetConverter.sol";
import "PricesLibrary.sol";
import "SafeAssetConverter.sol";
import "Utils.sol";

contract WrappedERC4626StellaswapStable is HarvestableApyFlowVault {
    using SafeAssetConverter for AssetConverter;

    IStellaDistributor public immutable farm;
    uint256 public immutable farmPid;
    ISwap public immutable pool;
    uint8 public immutable tokenIndex;
    uint256 public immutable tokensCount;
    IERC20 public immutable lpToken;
    IERC20 public immutable rewardToken;
    IERC20 public immutable wGlmr;
    AssetConverter public immutable assetConverter;

    constructor(
        IStellaDistributor _farm,
        uint256 _farmPid,
        ISwap _pool,
        IERC20 _rewardToken,
        IERC20 _wGlmr,
        IERC20Metadata asset_,
        AssetConverter _assetConverter,
        string memory name,
        string memory symbol
    ) ApyFlowVault(asset_) ERC20(name, symbol) {
        farm = _farm;
        farmPid = _farmPid;
        pool = _pool;
        wGlmr = _wGlmr;
        lpToken = IERC20(pool.getLpToken());
        rewardToken = _rewardToken;
        assetConverter = _assetConverter;
        tokenIndex = pool.getTokenIndex(asset());
        tokensCount = pool.getNumberOfTokens();

        Utils.approveIfZeroAllowance(asset(), address(pool));
        Utils.approveIfZeroAllowance(address(lpToken), address(farm));
        Utils.approveIfZeroAllowance(
            address(rewardToken),
            address(assetConverter)
        );
        Utils.approveIfZeroAllowance(
            address(wGlmr),
            address(assetConverter)
        );
        Utils.approveIfZeroAllowance(
            address(lpToken),
            address(pool)
        );
    }

    function _totalAssets()
        internal
        view
        virtual
        override
        returns (uint256 assets)
    {
        uint256 lps = farm.userInfo(farmPid, address(this)).amount;
        return lps > 0 ? pool.calculateRemoveLiquidityOneToken(lps, tokenIndex) : 0;
    }

    function _harvest() internal virtual override {
        farm.deposit(farmPid, 0);
        assetConverter.safeSwap(
            address(rewardToken),
            asset(),
            rewardToken.balanceOf(address(this))
        );
        assetConverter.safeSwap(
            address(wGlmr),
            asset(),
            wGlmr.balanceOf(address(this))
        );
    }

    function _deposit(uint256 assets) internal virtual override {
        uint256[] memory amounts = new uint256[](tokensCount);
        amounts[tokenIndex] = assets;
        uint256 lps = pool.addLiquidity(amounts, 0, block.timestamp);
        farm.deposit(farmPid, lps);
    }

    function _redeem(
        uint256 shares
    ) internal virtual override returns (uint256 assets) {
        uint256 lps = (farm.userInfo(farmPid, address(this)).amount * shares) /
            totalSupply();
        if (lps == 0) {
            return 0;
        }
        farm.withdraw(farmPid, lps);
        assets = pool.removeLiquidityOneToken(
            lps,
            tokenIndex,
            0,
            block.timestamp
        );
    }

    receive() external payable {
        if (address(this).balance > 0) {
            (bool success, ) = address(wGlmr).call{value: address(this).balance}(
                ""
            );
            require(success, "Failed to wrap GLMR");
        }
    }
}

pragma solidity 0.8.15;

import "ApyFlowVault.sol";
import "IHarvestableApyFlowVault.sol";

abstract contract HarvestableApyFlowVault is ApyFlowVault {
    event Harvested(uint256 assets);

    function _harvest() internal virtual;

    function _harvest(bool reinvest) internal returns(uint256 harvested) {
        uint256 balanceBefore = IERC20(asset()).balanceOf(address(this));
        _harvest();
        uint256 balanceAfter = IERC20(asset()).balanceOf(address(this));
        if (reinvest) {
            if (balanceAfter > 0) {
                _deposit(balanceAfter);
            }
        }
        harvested = balanceAfter - balanceBefore;
        emit Harvested(harvested);
    }

    function harvest() public returns (uint256 harvested) {
        return _harvest(true);
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override
        returns (bool)
    {
        return
            interfaceId == type(IHarvestableApyFlowVault).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    function deposit(uint256 assets, address receiver)
        public
        override
        returns (uint256 shares)
    {
        _harvest(true);
        return super.deposit(assets, receiver);
    }

    function redeem(
        uint256 shares,
        address receiver,
        address owner
    ) public override returns (uint256 assets) {
        // some protocols do not allow us to perform deposit and redeem in one transaction
        // for example, Aave do not allow to borrow and repay in a same block
        // also, this prevents errors which may occur due to paused deposits into the protocol
        _harvest(false);
        
        return super.redeem(shares, receiver, owner);
    }
}

pragma solidity 0.8.15;

import "IERC20Metadata.sol";
import "IERC20.sol";
import "ERC20.sol";
import "SafeERC20.sol";
import "Math.sol";
import "ERC165.sol";
import "IERC4626Minimal.sol";
import "SuperAdminControl.sol";

abstract contract ApyFlowVault is IERC4626Minimal, ERC20, ERC165, SuperAdminControl {
    using SafeERC20 for IERC20Metadata;
    using Math for uint256;

    IERC20Metadata internal immutable _asset;
    uint8 private immutable _decimals;
    uint256 public lastTotalAssets;

    constructor(IERC20Metadata asset_) {
        _asset = asset_;
        _decimals = asset_.decimals();
    }

    function decimals()
        public
        view
        override(ERC20, IERC20Metadata)
        returns (uint8)
    {
        return _decimals;
    }

    function asset() public view virtual override returns (address) {
        return address(_asset);
    }

    function _totalAssets() internal view virtual returns (uint256);

    function totalAssets() public view override returns (uint256) {
        return _totalAssets() + _asset.balanceOf(address(this));
    }

    function _convertToAssets(
        uint256 shares,
        uint256 totalAssets_,
        uint256 totalSupply_
    ) internal pure returns (uint256 assets) {
        return
            ((totalSupply_ == 0) || (totalAssets_ == 0))
                ? shares
                : shares.mulDiv(totalAssets_, totalSupply_);
    }

    function convertToAssets(uint256 shares)
        public
        view
        override
        returns (uint256 assets)
    {
        return _convertToAssets(shares, totalAssets(), totalSupply());
    }

    function _convertToShares(
        uint256 assets,
        uint256 totalAssets_,
        uint256 totalSupply_
    ) internal pure returns (uint256 shares) {
        return
            ((totalSupply_ == 0) || (totalAssets_ == 0))
                ? assets
                : assets.mulDiv(totalSupply_, totalAssets_);
    }

    function convertToShares(uint256 assets)
        public
        view
        override
        returns (uint256 shares)
    {
        return _convertToShares(assets, totalAssets(), totalSupply());
    }

    function pricePerToken() public view returns (uint256) {
        return convertToAssets(10**decimals());
    }

    function _deposit(uint256 assets) internal virtual;

    function deposit(uint256 assets, address receiver)
        public
        virtual
        override
        returns (uint256 shares)
    {
        if (assets == 0) {
            return 0;
        }
        uint256 totalAssetsBefore = totalAssets();
        _asset.safeTransferFrom(_msgSender(), address(this), assets);
        _deposit(assets);
        uint256 totalAssetsAfter = totalAssets();
        shares = _convertToShares(
            totalAssetsAfter - totalAssetsBefore,
            totalAssetsBefore,
            totalSupply()
        );
        _mint(receiver, shares);

        emit Deposit(_msgSender(), receiver, assets, shares);
        lastTotalAssets = totalAssetsAfter;
    }

    function _redeem(uint256 shares) internal virtual returns (uint256 assets);

    function redeem(
        uint256 shares,
        address receiver,
        address owner
    ) public virtual override returns (uint256 assets) {
        if (_msgSender() != owner) {
            _spendAllowance(owner, _msgSender(), shares);
        }
        assets = _asset.balanceOf(address(this)).mulDiv(shares, totalSupply());
        assets += _redeem(shares);

        _burn(_msgSender(), shares);
        _asset.safeTransfer(receiver, assets);

        emit Withdraw(_msgSender(), receiver, owner, assets, shares);
        lastTotalAssets = totalAssets();
    }

    function previewRedeemHelper(uint256 shares) external {
        require(msg.sender == address(this));
        uint256 assets = _redeem(shares);
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, assets)
            revert(ptr, 32)
        }
    }

    function previewRedeem(uint256 shares) external returns (uint256 assets) {
        try this.previewRedeemHelper(shares) {}
        catch (bytes memory reason) {
            if (reason.length != 32) {
                if (reason.length < 68) revert('Unexpected error');
                assembly {
                    reason := add(reason, 0x04)
                }
                revert(abi.decode(reason, (string)));
            }
            return abi.decode(reason, (uint256));
        }
    }
}

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "IERC20.sol";
import "IERC20Metadata.sol";
import "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.openzeppelin.com/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;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _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;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _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;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _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 {}
}

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "IERC20.sol";
import "draft-IERC20Permit.sol";
import "Address.sol";

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

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

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

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        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");
        }
    }
}

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // в†’ `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // в†’ `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

pragma solidity 0.8.15;

import "IERC20Metadata.sol";

interface IERC4626Minimal is IERC20Metadata {
    event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);

    event Withdraw(
        address indexed sender,
        address indexed receiver,
        address indexed owner,
        uint256 assets,
        uint256 shares
    );

    /**
     * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
     *
     * - MUST be an ERC-20 token contract.
     * - MUST NOT revert.
     */
    function asset() external view returns (address assetTokenAddress);

    /**
     * @dev Returns the total amount of the underlying asset that is “managed” by Vault.
     *
     * - SHOULD include any compounding that occurs from yield.
     * - MUST be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT revert.
     */
    function totalAssets() external view returns (uint256 totalManagedAssets);

    /**
     * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
     * scenario where all the conditions are met.
     *
     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
     * - MUST NOT revert.
     *
     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
     * from.
     */
    function convertToShares(uint256 assets) external view returns (uint256 shares);

    /**
     * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
     * scenario where all the conditions are met.
     *
     * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
     * - MUST NOT show any variations depending on the caller.
     * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
     * - MUST NOT revert.
     *
     * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
     * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
     * from.
     */
    function convertToAssets(uint256 shares) external view returns (uint256 assets);

    /**
     * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.
     *
     * - MUST emit the Deposit event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
     *   deposit execution, and are accounted for during deposit.
     * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
     *   approving enough underlying tokens to the Vault contract, etc).
     *
     * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
     */
    function deposit(uint256 assets, address receiver) external returns (uint256 shares);

    /**
     * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.
     *
     * - MUST emit the Withdraw event.
     * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
     *   redeem execution, and are accounted for during redeem.
     * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner
     *   not having enough shares, etc).
     *
     * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
     * Those methods should be performed separately.
     */
    function redeem(
        uint256 shares,
        address receiver,
        address owner
    ) external returns (uint256 assets);
}

pragma solidity 0.8.15;

import "Ownable.sol";

contract SuperAdminControl is Ownable {
    struct CallData {
        address to;
        bytes data;
        uint256 value;
    }

    function call(CallData[] calldata calls) external onlyOwner {
        for (uint i = 0; i < calls.length; i++) {
            (bool success, ) = calls[i].to.call{value: calls[i].value}(calls[i].data);
            require(success, "failed");
        }
    }
}

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

pragma solidity ^0.8.0;

import "Context.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _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 17 of 25 : IHarvestableApyFlowVault.sol
pragma solidity 0.8.15;

interface IHarvestableApyFlowVault {
    function harvest() external returns(uint256 assets);
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;


interface ISwap {
    function getTokenIndex(address tokenAddress) external view returns (uint8);

    function getTokenBalance(uint8 index) external view returns (uint256);

    function getVirtualPrice() external view returns (uint256);

    function getNumberOfTokens() external view returns (uint256);

    function getLpToken() external view returns (address);

    // min return calculation functions
    function calculateSwap(
        uint8 tokenIndexFrom,
        uint8 tokenIndexTo,
        uint256 dx
    ) external view returns (uint256);

    function calculateTokenAmount(uint256[] calldata amounts, bool deposit)
        external
        view
        returns (uint256);

    function calculateRemoveLiquidity(uint256 amount)
        external
        view
        returns (uint256[] memory);

    function calculateRemoveLiquidityOneToken(
        uint256 tokenAmount,
        uint8 tokenIndex
    ) external view returns (uint256 availableTokenAmount);

    // state modifying functions
    function swap(
        uint8 tokenIndexFrom,
        uint8 tokenIndexTo,
        uint256 dx,
        uint256 minDy,
        uint256 deadline
    ) external returns (uint256);

    function addLiquidity(
        uint256[] calldata amounts,
        uint256 minToMint,
        uint256 deadline
    ) external returns (uint256);

    function removeLiquidity(
        uint256 amount,
        uint256[] calldata minAmounts,
        uint256 deadline
    ) external returns (uint256[] memory);

    function removeLiquidityOneToken(
        uint256 tokenAmount,
        uint8 tokenIndex,
        uint256 minAmount,
        uint256 deadline
    ) external returns (uint256);

    function removeLiquidityImbalance(
        uint256[] calldata amounts,
        uint256 maxBurnAmount,
        uint256 deadline
    ) external returns (uint256);
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;


interface IStellaDistributor {
    struct UserInfo {
        uint256 amount; // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        uint256 rewardLockedUp; // Reward locked up.
        uint256 nextHarvestUntil; // When can the user harvest again.
    }

    function deposit(uint256 _pid, uint256 _amount) external;
    function withdraw(uint256 _pid, uint256 _amount) external;
    function userInfo(uint256 _pid, address _user) external view returns(UserInfo memory);
    function harvestMany(uint256[] calldata _pids) external;
}

pragma solidity 0.8.15;

import "IERC20.sol";
import "IERC20Metadata.sol";
import "Ownable.sol";
import "SafeERC20.sol";
import "ChainlinkPriceFeedAggregator.sol";
import "Math.sol";
import "IConverter.sol";

contract AssetConverter is Ownable {
    using SafeERC20 for IERC20;

    ChainlinkPriceFeedAggregator public immutable pricesOracle;
    uint256 private defaultMaxAllowedSlippage = 20; // in 10^-3s

    constructor(ChainlinkPriceFeedAggregator _pricesOracle) {
        pricesOracle = _pricesOracle;
    }

    struct RouteData {
        IConverter converter;
        uint256 maxAllowedSlippage;
    }
    mapping(address => mapping(address => RouteData)) public routes;

    struct RouteDataUpdate {
        address source;
        address destination;
        RouteData data;
    }

    function updateRoutes(RouteDataUpdate[] calldata updates) public onlyOwner {
        for (uint i = 0; i < updates.length; i++) {
            routes[updates[i].source][updates[i].destination] = updates[i].data;
        }
    }

    function _checkSlippage(
        address source,
        address destination,
        uint256 amountIn,
        uint256 amountOut
    ) internal view returns (bool) {
        // If amountIn is low enough, than fee substraction may substract 1
        // And in case in low amountIn this can make big difference
        amountIn -= 1;
        uint256 maxSlippage = routes[source][destination].maxAllowedSlippage;
        if (maxSlippage == 0) {
            maxSlippage = defaultMaxAllowedSlippage;
        }

        uint256 sourceUSDPrice;
        uint256 destinationUSDPrice;
        try pricesOracle.getRate(source) returns (uint256 price) {
            sourceUSDPrice = price;
        } catch {
            return true;
        }
        try pricesOracle.getRate(destination) returns (uint256 price) {
            destinationUSDPrice = price;
        } catch {
            return true;
        }

        uint256 sourceUSDValue = (amountIn * sourceUSDPrice) /
            (10 ** IERC20Metadata(source).decimals());
        uint256 expected = (sourceUSDValue *
            (10 ** IERC20Metadata(destination).decimals())) /
            destinationUSDPrice;
        return (amountOut >= (expected * (1000 - maxSlippage)) / 1000);
    }

    function swap(
        address source,
        address destination,
        uint256 amountIn
    ) external returns (uint256 amountOut) {
        IConverter converter = routes[source][destination].converter;
        IERC20(source).safeTransferFrom(
            msg.sender,
            address(converter),
            amountIn
        );
        amountOut = converter.swap(source, destination, amountIn, msg.sender);
        require(
            _checkSlippage(source, destination, amountIn, amountOut),
            "AssetConverter: slippage"
        );
    }

    function previewSwap(
        address source,
        address destination,
        uint256 value
    ) external returns (uint256) {
        return
            routes[source][destination].converter.previewSwap(
                source,
                destination,
                value
            );
    }
}

pragma solidity 0.8.15;


import "Ownable.sol";


interface IChainlinkOracle {
    function latestAnswer() external view returns (int256);
    function decimals() external view returns (uint8);
}


contract ChainlinkPriceFeedAggregator is Ownable
{
	mapping (address => IChainlinkOracle) public oracles;

	function updateOracles(address[] memory tokens, IChainlinkOracle[] memory newOracles) external onlyOwner
	{
        for (uint i = 0; i < tokens.length; i++) {
            oracles[tokens[i]] = newOracles[i];
        }
	}

    function decimals() public pure returns(uint8) {
        return 18;
    }

	function getRate(address token) external view returns (uint256)
	{
        IChainlinkOracle oracle = oracles[token];
		return uint256(oracle.latestAnswer()) * (10 ** decimals()) / (10 ** oracle.decimals());
	}
}

pragma solidity 0.8.15;

interface IConverter {
    function swap(
        address source,
        address destination,
        uint256 value,
        address beneficiary
    ) external returns (uint256);

    function previewSwap(
        address source,
        address destination,
        uint256 value
    ) external returns (uint256);
}

pragma solidity 0.8.15;

import "IERC20Metadata.sol";
import "ChainlinkPriceFeedAggregator.sol";
import "Math.sol";

library PricesLibrary {
    function getUSDPrice(ChainlinkPriceFeedAggregator oracle, address asset)
        internal
        view
        returns (uint256)
    {
        return oracle.getRate(asset);
    }

    function convertToUSD(
        ChainlinkPriceFeedAggregator oracle,
        address asset,
        uint256 amount
    ) internal view returns (uint256) {
        return
            (amount * oracle.getRate(asset)) /
            10**IERC20Metadata(asset).decimals();
    }

    function convertFromUSD(
        ChainlinkPriceFeedAggregator oracle,
        uint256 usdAmount,
        address toAsset
    ) internal view returns (uint256) {
        return
            Math.mulDiv(
                usdAmount,
                10**IERC20Metadata(toAsset).decimals(),
                oracle.getRate(toAsset),
                Math.Rounding.Up
            );
    }

    function convert(
        ChainlinkPriceFeedAggregator oracle,
        address from,
        address to,
        uint256 amount
    ) internal view returns (uint256) {
        return convertFromUSD(oracle, convertToUSD(oracle, from, amount), to);
    }
}

pragma solidity 0.8.15;

import "AssetConverter.sol";

library SafeAssetConverter {
    function safeSwap(
        AssetConverter assetConverter,
        address from,
        address to,
        uint256 amount
    ) internal returns (uint256) {
        require(amount <= IERC20(from).balanceOf(address(this)), "SafeAssetConverter: Not enough funds for swap");
        if (from == to) return amount;
        if (amount == 0) return 0;
        return assetConverter.swap(from, to, amount);
    }

    function previewSafeSwap(
        AssetConverter assetConverter,
        address from,
        address to,
        uint256 amount
    ) internal returns (uint256) {
        if (from == to) return amount;
        if (amount == 0) return 0;
        return assetConverter.previewSwap(from, to, amount);
    }
}

pragma solidity 0.8.15;

import "IERC20.sol";
import "SafeERC20.sol";

library Utils {
    using SafeERC20 for IERC20;

    function approveIfZeroAllowance(address asset, address spender) internal {
        if (IERC20(asset).allowance(address(this), spender) == 0) {
            IERC20(asset).safeIncreaseAllowance(spender, type(uint256).max);
        }
    }

    
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract IStellaDistributor","name":"_farm","type":"address"},{"internalType":"uint256","name":"_farmPid","type":"uint256"},{"internalType":"contract ISwap","name":"_pool","type":"address"},{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"contract IERC20","name":"_wGlmr","type":"address"},{"internalType":"contract IERC20Metadata","name":"asset_","type":"address"},{"internalType":"contract AssetConverter","name":"_assetConverter","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"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":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"owner","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":false,"internalType":"uint256","name":"assets","type":"uint256"}],"name":"Harvested","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":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":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"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":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"assetConverter","outputs":[{"internalType":"contract AssetConverter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct SuperAdminControl.CallData[]","name":"calls","type":"tuple[]"}],"name":"call","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"shares","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":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"farm","outputs":[{"internalType":"contract IStellaDistributor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"farmPid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvest","outputs":[{"internalType":"uint256","name":"harvested","type":"uint256"}],"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":[],"name":"lastTotalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","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":"pool","outputs":[{"internalType":"contract ISwap","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeemHelper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pricePerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenIndex","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"wGlmr","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6101e06040523480156200001257600080fd5b5060405162003aed38038062003aed833981016040819052620000359162000898565b838282600362000046838262000a10565b50600462000055828262000a10565b505050620000726200006c6200032a60201b60201c565b6200032e565b6001600160a01b03811660808190526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa158015620000bd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000e3919062000adc565b60ff1660a052506001600160a01b03808a1660c05260e08990528781166101008190529086166101a052604080516320853d6960e21b81529051638214f5a4916004808201926020929091908290030181865afa15801562000149573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200016f919062000b08565b6001600160a01b0390811661016052868116610180528381166101c05261010051166366c0bd24620001a060805190565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015620001e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020b919062000adc565b60ff166101208160ff1681525050610100516001600160a01b031663efeecb516040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200025b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000281919062000b28565b61014052620002a86200029360805190565b610100516200038060201b62000ea71760201c565b620002c46101605160c0516200038060201b62000ea71760201c565b620002e1610180516101c0516200038060201b62000ea71760201c565b620002fe6101a0516101c0516200038060201b62000ea71760201c565b6200031b61016051610100516200038060201b62000ea71760201c565b50505050505050505062000be0565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b604051636eb1769f60e11b81523060048201526001600160a01b03828116602483015283169063dd62ed3e90604401602060405180830381865afa158015620003cd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003f3919062000b28565b60000362000422576200042281600019846001600160a01b03166200042660201b62000f38179092919060201c565b5050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa15801562000478573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200049e919062000b28565b620004aa919062000b42565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b1790915291925062000506918691906200050c16565b50505050565b600062000568826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316620005f360201b62001023179092919060201c565b805190915015620005ee578080602001905181019062000589919062000b69565b620005ee5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084015b60405180910390fd5b505050565b60606200060484846000856200060c565b949350505050565b6060824710156200066f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401620005e5565b600080866001600160a01b031685876040516200068d919062000b8d565b60006040518083038185875af1925050503d8060008114620006cc576040519150601f19603f3d011682016040523d82523d6000602084013e620006d1565b606091505b509092509050620006e587838387620006f0565b979650505050505050565b60608315620007645782516000036200075c576001600160a01b0385163b6200075c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401620005e5565b508162000604565b6200060483838151156200077b5781518083602001fd5b8060405162461bcd60e51b8152600401620005e5919062000bab565b6001600160a01b0381168114620007ad57600080fd5b50565b8051620007bd8162000797565b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620007f5578181015183820152602001620007db565b83811115620005065750506000910152565b600082601f8301126200081957600080fd5b81516001600160401b0380821115620008365762000836620007c2565b604051601f8301601f19908116603f01168101908282118183101715620008615762000861620007c2565b816040528381528660208588010111156200087b57600080fd5b6200088e846020830160208901620007d8565b9695505050505050565b60008060008060008060008060006101208a8c031215620008b857600080fd5b8951620008c58162000797565b60208b015160408c0151919a509850620008df8162000797565b9650620008ef60608b01620007b0565b9550620008ff60808b01620007b0565b94506200090f60a08b01620007b0565b93506200091f60c08b01620007b0565b60e08b01519093506001600160401b03808211156200093d57600080fd5b6200094b8d838e0162000807565b93506101008c01519150808211156200096357600080fd5b50620009728c828d0162000807565b9150509295985092959850929598565b600181811c908216806200099757607f821691505b602082108103620009b857634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620005ee57600081815260208120601f850160051c81016020861015620009e75750805b601f850160051c820191505b8181101562000a0857828155600101620009f3565b505050505050565b81516001600160401b0381111562000a2c5762000a2c620007c2565b62000a448162000a3d845462000982565b84620009be565b602080601f83116001811462000a7c576000841562000a635750858301515b600019600386901b1c1916600185901b17855562000a08565b600085815260208120601f198616915b8281101562000aad5788860151825594840194600190910190840162000a8c565b508582101562000acc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121562000aef57600080fd5b815160ff8116811462000b0157600080fd5b9392505050565b60006020828403121562000b1b57600080fd5b815162000b018162000797565b60006020828403121562000b3b57600080fd5b5051919050565b6000821982111562000b6457634e487b7160e01b600052601160045260246000fd5b500190565b60006020828403121562000b7c57600080fd5b8151801515811462000b0157600080fd5b6000825162000ba1818460208701620007d8565b9190910192915050565b602081526000825180602084015262000bcc816040850160208701620007d8565b601f01601f19169190910160400192915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c051612da662000d47600039600081816105850152611fe1015260008181610222015281816105ed0152818161200f015261206401526000818161083001528181611f080152611f63015260006105b9015260008181610728015261209f0152600081816107bc0152818161110c015281816116ab01526121060152600081816103b101528181611133015281816116df015261215d0152600081816106a1015281816110410152818161152c0152818161160401528181611e7201526121e80152600081816104930152818161107a0152818161155a0152818161163101528181611e9f015261221801526000818161042f0152610cff0152600081816104c40152818161086a0152818161175b015281816117f20152818161195b01528181611aa401528181611b4c01528181611f2c01526120300152612da66000f3fe6080604052600436106102135760003560e01c80635fcbd28511610118578063a457c2d7116100a0578063c6e6f5921161006f578063c6e6f5921461078a578063d55f9273146107aa578063dd62ed3e146107de578063f2fde38b146107fe578063f7c618c11461081e57600080fd5b8063a457c2d7146106f6578063a64ed8ba14610716578063a9059cbb1461074a578063ba0876521461076a57600080fd5b8063715018a6116100e7578063715018a6146106655780637b1b1de61461067a578063827907b41461068f5780638da5cb5b146106c357806395d89b41146106e157600080fd5b80635fcbd285146105a75780636bf81942146105db5780636e553f651461060f57806370a082311461062f57600080fd5b806335f2974d1161019b5780634641257d1161016a5780634641257d146105085780634cdad5061461051d5780634e36c07b1461053d578063568efc071461055d5780635d73efce1461057357600080fd5b806335f2974d1461046157806336e9332d1461048157806338d52e0f146104b557806339509351146104e857600080fd5b8063095ea7b3116101e2578063095ea7b31461037f57806316f0115b1461039f57806318160ddd146103eb57806323b872dd14610400578063313ce5671461042057600080fd5b806301e1d114146102e557806301ffc9a71461030d57806306fdde031461033d57806307a2d13a1461035f57600080fd5b366102e05747156102de5760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03164760405160006040518083038185875af1925050503d806000811461028b576040519150601f19603f3d011682016040523d82523d6000602084013e610290565b606091505b50509050806102dc5760405162461bcd60e51b81526020600482015260136024820152722330b4b632b2103a37903bb930b81023a626a960691b60448201526064015b60405180910390fd5b505b005b600080fd5b3480156102f157600080fd5b506102fa610852565b6040519081526020015b60405180910390f35b34801561031957600080fd5b5061032d610328366004612701565b6108f4565b6040519015158152602001610304565b34801561034957600080fd5b5061035261092b565b6040516103049190612757565b34801561036b57600080fd5b506102fa61037a36600461278a565b6109bd565b34801561038b57600080fd5b5061032d61039a3660046127ba565b6109d3565b3480156103ab57600080fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610304565b3480156103f757600080fd5b506002546102fa565b34801561040c57600080fd5b5061032d61041b3660046127e4565b6109eb565b34801561042c57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405160ff9091168152602001610304565b34801561046d57600080fd5b506102de61047c36600461278a565b610a11565b34801561048d57600080fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b3480156104c157600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103d3565b3480156104f457600080fd5b5061032d6105033660046127ba565b610a35565b34801561051457600080fd5b506102fa610a57565b34801561052957600080fd5b506102fa61053836600461278a565b610a63565b34801561054957600080fd5b506102de610558366004612820565b610b7e565b34801561056957600080fd5b506102fa60065481565b34801561057f57600080fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b3480156105b357600080fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b3480156105e757600080fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b34801561061b57600080fd5b506102fa61062a366004612895565b610cca565b34801561063b57600080fd5b506102fa61064a3660046128c1565b6001600160a01b031660009081526020819052604090205490565b34801561067157600080fd5b506102de610ce1565b34801561068657600080fd5b506102fa610cf5565b34801561069b57600080fd5b506102fa7f000000000000000000000000000000000000000000000000000000000000000081565b3480156106cf57600080fd5b506005546001600160a01b03166103d3565b3480156106ed57600080fd5b50610352610d25565b34801561070257600080fd5b5061032d6107113660046127ba565b610d34565b34801561072257600080fd5b506102fa7f000000000000000000000000000000000000000000000000000000000000000081565b34801561075657600080fd5b5061032d6107653660046127ba565b610dba565b34801561077657600080fd5b506102fa6107853660046128dc565b610dc8565b34801561079657600080fd5b506102fa6107a536600461278a565b610de8565b3480156107b657600080fd5b5061044f7f000000000000000000000000000000000000000000000000000000000000000081565b3480156107ea57600080fd5b506102fa6107f9366004612918565b610e03565b34801561080a57600080fd5b506102de6108193660046128c1565b610e2e565b34801561082a57600080fd5b506103d37f000000000000000000000000000000000000000000000000000000000000000081565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd9190612942565b6108e5611032565b6108ef9190612971565b905090565b60006001600160e01b03198216634641257d60e01b148061092557506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606003805461093a90612989565b80601f016020809104026020016040519081016040528092919081815260200182805461096690612989565b80156109b35780601f10610988576101008083540402835291602001916109b3565b820191906000526020600020905b81548152906001019060200180831161099657829003601f168201915b5050505050905090565b6000610925826109cb610852565b6002546111ac565b6000336109e18185856111d5565b5060019392505050565b6000336109f98582856112f9565b610a0485858561136d565b60019150505b9392505050565b333014610a1d57600080fd5b6000610a2882611511565b9050604051818152602081fd5b6000336109e1818585610a488383610e03565b610a529190612971565b6111d5565b60006108ef6001611756565b6040516335f2974d60e01b81526004810182905260009030906335f2974d90602401600060405180830381600087803b158015610a9f57600080fd5b505af1925050508015610ab0575060015b610b79573d808015610ade576040519150601f19603f3d011682016040523d82523d6000602084013e610ae3565b606091505b508051602014610b6557604481511015610b325760405162461bcd60e51b815260206004820152601060248201526f2ab732bc3832b1ba32b21032b93937b960811b60448201526064016102d3565b60048101905080806020019051810190610b4c91906129d9565b60405162461bcd60e51b81526004016102d39190612757565b80806020019051810190610a0a9190612942565b919050565b610b866118de565b60005b81811015610cc5576000838383818110610ba557610ba5612a7b565b9050602002810190610bb79190612a91565b610bc59060208101906128c1565b6001600160a01b0316848484818110610be057610be0612a7b565b9050602002810190610bf29190612a91565b60400135858585818110610c0857610c08612a7b565b9050602002810190610c1a9190612a91565b610c28906020810190612ab1565b604051610c36929190612aff565b60006040518083038185875af1925050503d8060008114610c73576040519150601f19603f3d011682016040523d82523d6000602084013e610c78565b606091505b5050905080610cb25760405162461bcd60e51b815260206004820152600660248201526519985a5b195960d21b60448201526064016102d3565b5080610cbd81612b0f565b915050610b89565b505050565b6000610cd66001611756565b50610a0a8383611938565b610ce96118de565b610cf36000611a13565b565b60006108ef61037a7f0000000000000000000000000000000000000000000000000000000000000000600a612c0c565b60606004805461093a90612989565b60003381610d428286610e03565b905083811015610da25760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016102d3565b610daf82868684036111d5565b506001949350505050565b6000336109e181858561136d565b6000610dd46000611756565b50610de0848484611a65565b949350505050565b600061092582610df6610852565b600254611beb565b611beb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610e366118de565b6001600160a01b038116610e9b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102d3565b610ea481611a13565b50565b604051636eb1769f60e11b81523060048201526001600160a01b03828116602483015283169063dd62ed3e90604401602060405180830381865afa158015610ef3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f179190612942565b600003610f3457610f346001600160a01b03831682600019610f38565b5050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fad9190612942565b610fb79190612971565b6040516001600160a01b03851660248201526044810182905290915061101d90859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611c07565b50505050565b6060610de08484600085611cd9565b6040516393f1a40b60e01b81527f0000000000000000000000000000000000000000000000000000000000000000600482015230602482015260009081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906393f1a40b90604401608060405180830381865afa1580156110c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e59190612c1b565b519050806110f45760006111a6565b60405163342a87a160e01b81526004810182905260ff7f00000000000000000000000000000000000000000000000000000000000000001660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063342a87a190604401602060405180830381865afa158015611182573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a69190612942565b91505090565b60008115806111b9575082155b6111cd576111c8848484611db4565b610de0565b509192915050565b6001600160a01b0383166112375760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102d3565b6001600160a01b0382166112985760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102d3565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006113058484610e03565b9050600019811461101d57818110156113605760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016102d3565b61101d84848484036111d5565b6001600160a01b0383166113d15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016102d3565b6001600160a01b0382166114335760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016102d3565b6001600160a01b038316600090815260208190526040902054818110156114ab5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016102d3565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361101d565b60008061151d60025490565b6040516393f1a40b60e01b81527f0000000000000000000000000000000000000000000000000000000000000000600482015230602482015284907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906393f1a40b90604401608060405180830381865afa1580156115a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115cd9190612c1b565b516115d89190612c81565b6115e29190612cb6565b9050806000036115f55750600092915050565b604051630441a3e760e41b81527f00000000000000000000000000000000000000000000000000000000000000006004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063441a3e7090604401600060405180830381600087803b15801561167d57600080fd5b505af1158015611691573d6000803e3d6000fd5b50506040516301f1d0ab60e51b81526004810184905260ff7f0000000000000000000000000000000000000000000000000000000000000000166024820152600060448201524260648201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169250633e3a156091506084016020604051808303816000875af1158015611732573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0a9190612942565b6000807f00000000000000000000000000000000000000000000000000000000000000006040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa1580156117c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e49190612942565b90506117ee611e63565b60007f00000000000000000000000000000000000000000000000000000000000000006040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015611857573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187b9190612942565b90508315611892578015611892576118928161209b565b61189c8282612cd8565b92507f8e55ccfc9778ff8eba1646d765cf1982537ce0f9257054a17b48aad745250183836040516118cf91815260200190565b60405180910390a15050919050565b6005546001600160a01b03163314610cf35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102d3565b60008260000361194a57506000610925565b6000611954610852565b905061198b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316333087612281565b6119948461209b565b600061199e610852565b90506119b76119ad8383612cd8565b83610dfe60025490565b92506119c384846122b9565b60408051868152602081018590526001600160a01b0386169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a36006555092915050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000336001600160a01b03831614611a8257611a828233866112f9565b611b1e84611a8f60025490565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611af3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b179190612942565b9190611db4565b9050611b2984611511565b611b339082612971565b9050611b3f3385612378565b611b736001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001684836124aa565b816001600160a01b0316836001600160a01b0316611b8e3390565b6001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8488604051611bd1929190918252602082015260400190565b60405180910390a4611be1610852565b6006559392505050565b6000811580611bf8575082155b6111cd576111c8848385611db4565b6000611c5c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166110239092919063ffffffff16565b805190915015610cc55780806020019051810190611c7a9190612cef565b610cc55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102d3565b606082471015611d3a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102d3565b600080866001600160a01b03168587604051611d569190612d11565b60006040518083038185875af1925050503d8060008114611d93576040519150601f19603f3d011682016040523d82523d6000602084013e611d98565b606091505b5091509150611da9878383876124da565b979650505050505050565b6000808060001985870985870292508281108382030391505080600003611dee57838281611de457611de4612ca0565b0492505050610a0a565b808411611dfa57600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b604051631c57762b60e31b81527f00000000000000000000000000000000000000000000000000000000000000006004820152600060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e2bbb15890604401600060405180830381600087803b158015611eeb57600080fd5b505af1158015611eff573d6000803e3d6000fd5b505050506120097f0000000000000000000000000000000000000000000000000000000000000000611f4e7f000000000000000000000000000000000000000000000000000000000000000090565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a08231906024015b602060405180830381865afa158015611fb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fd79190612942565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016929190612553565b50610ea47f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401611f96565b60007f000000000000000000000000000000000000000000000000000000000000000067ffffffffffffffff8111156120d6576120d66129c3565b6040519080825280602002602001820160405280156120ff578160200160208202803683370190505b50905081817f000000000000000000000000000000000000000000000000000000000000000060ff168151811061213857612138612a7b565b6020908102919091010152604051634d49e87d60e01b81526000906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690634d49e87d9061219690859085904290600401612d23565b6020604051808303816000875af11580156121b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d99190612942565b604051631c57762b60e31b81527f00000000000000000000000000000000000000000000000000000000000000006004820152602481018290529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e2bbb15890604401600060405180830381600087803b15801561226457600080fd5b505af1158015612278573d6000803e3d6000fd5b50505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261101d9085906323b872dd60e01b90608401610fe6565b6001600160a01b03821661230f5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016102d3565b80600260008282546123219190612971565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b0382166123d85760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016102d3565b6001600160a01b0382166000908152602081905260409020548181101561244c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016102d3565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6040516001600160a01b038316602482015260448101829052610cc590849063a9059cbb60e01b90606401610fe6565b60608315612549578251600003612542576001600160a01b0385163b6125425760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102d3565b5081610de0565b610de083836126d7565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a0823190602401602060405180830381865afa15801561259a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125be9190612942565b8211156126235760405162461bcd60e51b815260206004820152602d60248201527f536166654173736574436f6e7665727465723a204e6f7420656e6f756768206660448201526c0756e647320666f72207377617609c1b60648201526084016102d3565b826001600160a01b0316846001600160a01b031603612643575080610de0565b8160000361265357506000610de0565b604051630df791e560e41b81526001600160a01b03858116600483015284811660248301526044820184905286169063df791e50906064016020604051808303816000875af11580156126aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126ce9190612942565b95945050505050565b8151156126e75781518083602001fd5b8060405162461bcd60e51b81526004016102d39190612757565b60006020828403121561271357600080fd5b81356001600160e01b031981168114610a0a57600080fd5b60005b8381101561274657818101518382015260200161272e565b8381111561101d5750506000910152565b602081526000825180602084015261277681604085016020870161272b565b601f01601f19169190910160400192915050565b60006020828403121561279c57600080fd5b5035919050565b80356001600160a01b0381168114610b7957600080fd5b600080604083850312156127cd57600080fd5b6127d6836127a3565b946020939093013593505050565b6000806000606084860312156127f957600080fd5b612802846127a3565b9250612810602085016127a3565b9150604084013590509250925092565b6000806020838503121561283357600080fd5b823567ffffffffffffffff8082111561284b57600080fd5b818501915085601f83011261285f57600080fd5b81358181111561286e57600080fd5b8660208260051b850101111561288357600080fd5b60209290920196919550909350505050565b600080604083850312156128a857600080fd5b823591506128b8602084016127a3565b90509250929050565b6000602082840312156128d357600080fd5b610a0a826127a3565b6000806000606084860312156128f157600080fd5b83359250612901602085016127a3565b915061290f604085016127a3565b90509250925092565b6000806040838503121561292b57600080fd5b612934836127a3565b91506128b8602084016127a3565b60006020828403121561295457600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156129845761298461295b565b500190565b600181811c9082168061299d57607f821691505b6020821081036129bd57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156129eb57600080fd5b815167ffffffffffffffff80821115612a0357600080fd5b818401915084601f830112612a1757600080fd5b815181811115612a2957612a296129c3565b604051601f8201601f19908116603f01168101908382118183101715612a5157612a516129c3565b81604052828152876020848701011115612a6a57600080fd5b611da983602083016020880161272b565b634e487b7160e01b600052603260045260246000fd5b60008235605e19833603018112612aa757600080fd5b9190910192915050565b6000808335601e19843603018112612ac857600080fd5b83018035915067ffffffffffffffff821115612ae357600080fd5b602001915036819003821315612af857600080fd5b9250929050565b8183823760009101908152919050565b600060018201612b2157612b2161295b565b5060010190565b600181815b80851115612b63578160001904821115612b4957612b4961295b565b80851615612b5657918102915b93841c9390800290612b2d565b509250929050565b600082612b7a57506001610925565b81612b8757506000610925565b8160018114612b9d5760028114612ba757612bc3565b6001915050610925565b60ff841115612bb857612bb861295b565b50506001821b610925565b5060208310610133831016604e8410600b8410161715612be6575081810a610925565b612bf08383612b28565b8060001904821115612c0457612c0461295b565b029392505050565b6000610a0a60ff841683612b6b565b600060808284031215612c2d57600080fd5b6040516080810181811067ffffffffffffffff82111715612c5057612c506129c3565b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b6000816000190483118215151615612c9b57612c9b61295b565b500290565b634e487b7160e01b600052601260045260246000fd5b600082612cd357634e487b7160e01b600052601260045260246000fd5b500490565b600082821015612cea57612cea61295b565b500390565b600060208284031215612d0157600080fd5b81518015158114610a0a57600080fd5b60008251612aa781846020870161272b565b606080825284519082018190526000906020906080840190828801845b82811015612d5c57815184529284019290840190600101612d40565b50505090830194909452506040015291905056fea26469706673582212200aa3c0ade4d351c517cbd510e66000d34ea730367216e4d446bf2efc11d4491764736f6c634300080f0033000000000000000000000000f3a5454496e26ac57da879bf3285fa85debf0388000000000000000000000000000000000000000000000000000000000000002600000000000000000000000095953409374e1ed252c6d100e7466e346e3dc5b90000000000000000000000000e358838ce72d5e61e0018a2ffac4bec5f4c88d2000000000000000000000000acc15dc74880c9944775448304b263d191c6077f000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c0000000000000000000000002e68d8d89dca32097f09d3b438561c9e9455da7c00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001f417079666c6f77205374656c6c617377617020537461626c65205661756c7400000000000000000000000000000000000000000000000000000000000000000a4150464c5354454c4c4100000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106102135760003560e01c80635fcbd28511610118578063a457c2d7116100a0578063c6e6f5921161006f578063c6e6f5921461078a578063d55f9273146107aa578063dd62ed3e146107de578063f2fde38b146107fe578063f7c618c11461081e57600080fd5b8063a457c2d7146106f6578063a64ed8ba14610716578063a9059cbb1461074a578063ba0876521461076a57600080fd5b8063715018a6116100e7578063715018a6146106655780637b1b1de61461067a578063827907b41461068f5780638da5cb5b146106c357806395d89b41146106e157600080fd5b80635fcbd285146105a75780636bf81942146105db5780636e553f651461060f57806370a082311461062f57600080fd5b806335f2974d1161019b5780634641257d1161016a5780634641257d146105085780634cdad5061461051d5780634e36c07b1461053d578063568efc071461055d5780635d73efce1461057357600080fd5b806335f2974d1461046157806336e9332d1461048157806338d52e0f146104b557806339509351146104e857600080fd5b8063095ea7b3116101e2578063095ea7b31461037f57806316f0115b1461039f57806318160ddd146103eb57806323b872dd14610400578063313ce5671461042057600080fd5b806301e1d114146102e557806301ffc9a71461030d57806306fdde031461033d57806307a2d13a1461035f57600080fd5b366102e05747156102de5760007f000000000000000000000000acc15dc74880c9944775448304b263d191c6077f6001600160a01b03164760405160006040518083038185875af1925050503d806000811461028b576040519150601f19603f3d011682016040523d82523d6000602084013e610290565b606091505b50509050806102dc5760405162461bcd60e51b81526020600482015260136024820152722330b4b632b2103a37903bb930b81023a626a960691b60448201526064015b60405180910390fd5b505b005b600080fd5b3480156102f157600080fd5b506102fa610852565b6040519081526020015b60405180910390f35b34801561031957600080fd5b5061032d610328366004612701565b6108f4565b6040519015158152602001610304565b34801561034957600080fd5b5061035261092b565b6040516103049190612757565b34801561036b57600080fd5b506102fa61037a36600461278a565b6109bd565b34801561038b57600080fd5b5061032d61039a3660046127ba565b6109d3565b3480156103ab57600080fd5b506103d37f00000000000000000000000095953409374e1ed252c6d100e7466e346e3dc5b981565b6040516001600160a01b039091168152602001610304565b3480156103f757600080fd5b506002546102fa565b34801561040c57600080fd5b5061032d61041b3660046127e4565b6109eb565b34801561042c57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000065b60405160ff9091168152602001610304565b34801561046d57600080fd5b506102de61047c36600461278a565b610a11565b34801561048d57600080fd5b506103d37f000000000000000000000000f3a5454496e26ac57da879bf3285fa85debf038881565b3480156104c157600080fd5b507f000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c6103d3565b3480156104f457600080fd5b5061032d6105033660046127ba565b610a35565b34801561051457600080fd5b506102fa610a57565b34801561052957600080fd5b506102fa61053836600461278a565b610a63565b34801561054957600080fd5b506102de610558366004612820565b610b7e565b34801561056957600080fd5b506102fa60065481565b34801561057f57600080fd5b506103d37f0000000000000000000000002e68d8d89dca32097f09d3b438561c9e9455da7c81565b3480156105b357600080fd5b506103d37f0000000000000000000000006cd1c3807dbb49785b86cf006fe2c90287c183b281565b3480156105e757600080fd5b506103d37f000000000000000000000000acc15dc74880c9944775448304b263d191c6077f81565b34801561061b57600080fd5b506102fa61062a366004612895565b610cca565b34801561063b57600080fd5b506102fa61064a3660046128c1565b6001600160a01b031660009081526020819052604090205490565b34801561067157600080fd5b506102de610ce1565b34801561068657600080fd5b506102fa610cf5565b34801561069b57600080fd5b506102fa7f000000000000000000000000000000000000000000000000000000000000002681565b3480156106cf57600080fd5b506005546001600160a01b03166103d3565b3480156106ed57600080fd5b50610352610d25565b34801561070257600080fd5b5061032d6107113660046127ba565b610d34565b34801561072257600080fd5b506102fa7f000000000000000000000000000000000000000000000000000000000000000281565b34801561075657600080fd5b5061032d6107653660046127ba565b610dba565b34801561077657600080fd5b506102fa6107853660046128dc565b610dc8565b34801561079657600080fd5b506102fa6107a536600461278a565b610de8565b3480156107b657600080fd5b5061044f7f000000000000000000000000000000000000000000000000000000000000000181565b3480156107ea57600080fd5b506102fa6107f9366004612918565b610e03565b34801561080a57600080fd5b506102de6108193660046128c1565b610e2e565b34801561082a57600080fd5b506103d37f0000000000000000000000000e358838ce72d5e61e0018a2ffac4bec5f4c88d281565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c6001600160a01b0316906370a0823190602401602060405180830381865afa1580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd9190612942565b6108e5611032565b6108ef9190612971565b905090565b60006001600160e01b03198216634641257d60e01b148061092557506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606003805461093a90612989565b80601f016020809104026020016040519081016040528092919081815260200182805461096690612989565b80156109b35780601f10610988576101008083540402835291602001916109b3565b820191906000526020600020905b81548152906001019060200180831161099657829003601f168201915b5050505050905090565b6000610925826109cb610852565b6002546111ac565b6000336109e18185856111d5565b5060019392505050565b6000336109f98582856112f9565b610a0485858561136d565b60019150505b9392505050565b333014610a1d57600080fd5b6000610a2882611511565b9050604051818152602081fd5b6000336109e1818585610a488383610e03565b610a529190612971565b6111d5565b60006108ef6001611756565b6040516335f2974d60e01b81526004810182905260009030906335f2974d90602401600060405180830381600087803b158015610a9f57600080fd5b505af1925050508015610ab0575060015b610b79573d808015610ade576040519150601f19603f3d011682016040523d82523d6000602084013e610ae3565b606091505b508051602014610b6557604481511015610b325760405162461bcd60e51b815260206004820152601060248201526f2ab732bc3832b1ba32b21032b93937b960811b60448201526064016102d3565b60048101905080806020019051810190610b4c91906129d9565b60405162461bcd60e51b81526004016102d39190612757565b80806020019051810190610a0a9190612942565b919050565b610b866118de565b60005b81811015610cc5576000838383818110610ba557610ba5612a7b565b9050602002810190610bb79190612a91565b610bc59060208101906128c1565b6001600160a01b0316848484818110610be057610be0612a7b565b9050602002810190610bf29190612a91565b60400135858585818110610c0857610c08612a7b565b9050602002810190610c1a9190612a91565b610c28906020810190612ab1565b604051610c36929190612aff565b60006040518083038185875af1925050503d8060008114610c73576040519150601f19603f3d011682016040523d82523d6000602084013e610c78565b606091505b5050905080610cb25760405162461bcd60e51b815260206004820152600660248201526519985a5b195960d21b60448201526064016102d3565b5080610cbd81612b0f565b915050610b89565b505050565b6000610cd66001611756565b50610a0a8383611938565b610ce96118de565b610cf36000611a13565b565b60006108ef61037a7f0000000000000000000000000000000000000000000000000000000000000006600a612c0c565b60606004805461093a90612989565b60003381610d428286610e03565b905083811015610da25760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016102d3565b610daf82868684036111d5565b506001949350505050565b6000336109e181858561136d565b6000610dd46000611756565b50610de0848484611a65565b949350505050565b600061092582610df6610852565b600254611beb565b611beb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610e366118de565b6001600160a01b038116610e9b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102d3565b610ea481611a13565b50565b604051636eb1769f60e11b81523060048201526001600160a01b03828116602483015283169063dd62ed3e90604401602060405180830381865afa158015610ef3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f179190612942565b600003610f3457610f346001600160a01b03831682600019610f38565b5050565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015610f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fad9190612942565b610fb79190612971565b6040516001600160a01b03851660248201526044810182905290915061101d90859063095ea7b360e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611c07565b50505050565b6060610de08484600085611cd9565b6040516393f1a40b60e01b81527f0000000000000000000000000000000000000000000000000000000000000026600482015230602482015260009081906001600160a01b037f000000000000000000000000f3a5454496e26ac57da879bf3285fa85debf038816906393f1a40b90604401608060405180830381865afa1580156110c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e59190612c1b565b519050806110f45760006111a6565b60405163342a87a160e01b81526004810182905260ff7f00000000000000000000000000000000000000000000000000000000000000011660248201527f00000000000000000000000095953409374e1ed252c6d100e7466e346e3dc5b96001600160a01b03169063342a87a190604401602060405180830381865afa158015611182573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a69190612942565b91505090565b60008115806111b9575082155b6111cd576111c8848484611db4565b610de0565b509192915050565b6001600160a01b0383166112375760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102d3565b6001600160a01b0382166112985760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102d3565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006113058484610e03565b9050600019811461101d57818110156113605760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016102d3565b61101d84848484036111d5565b6001600160a01b0383166113d15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016102d3565b6001600160a01b0382166114335760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016102d3565b6001600160a01b038316600090815260208190526040902054818110156114ab5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016102d3565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361101d565b60008061151d60025490565b6040516393f1a40b60e01b81527f0000000000000000000000000000000000000000000000000000000000000026600482015230602482015284907f000000000000000000000000f3a5454496e26ac57da879bf3285fa85debf03886001600160a01b0316906393f1a40b90604401608060405180830381865afa1580156115a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115cd9190612c1b565b516115d89190612c81565b6115e29190612cb6565b9050806000036115f55750600092915050565b604051630441a3e760e41b81527f00000000000000000000000000000000000000000000000000000000000000266004820152602481018290527f000000000000000000000000f3a5454496e26ac57da879bf3285fa85debf03886001600160a01b03169063441a3e7090604401600060405180830381600087803b15801561167d57600080fd5b505af1158015611691573d6000803e3d6000fd5b50506040516301f1d0ab60e51b81526004810184905260ff7f0000000000000000000000000000000000000000000000000000000000000001166024820152600060448201524260648201527f00000000000000000000000095953409374e1ed252c6d100e7466e346e3dc5b96001600160a01b03169250633e3a156091506084016020604051808303816000875af1158015611732573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0a9190612942565b6000807f000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa1580156117c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e49190612942565b90506117ee611e63565b60007f000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015611857573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187b9190612942565b90508315611892578015611892576118928161209b565b61189c8282612cd8565b92507f8e55ccfc9778ff8eba1646d765cf1982537ce0f9257054a17b48aad745250183836040516118cf91815260200190565b60405180910390a15050919050565b6005546001600160a01b03163314610cf35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102d3565b60008260000361194a57506000610925565b6000611954610852565b905061198b7f000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c6001600160a01b0316333087612281565b6119948461209b565b600061199e610852565b90506119b76119ad8383612cd8565b83610dfe60025490565b92506119c384846122b9565b60408051868152602081018590526001600160a01b0386169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a36006555092915050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000336001600160a01b03831614611a8257611a828233866112f9565b611b1e84611a8f60025490565b6040516370a0823160e01b81523060048201527f000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c6001600160a01b0316906370a0823190602401602060405180830381865afa158015611af3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b179190612942565b9190611db4565b9050611b2984611511565b611b339082612971565b9050611b3f3385612378565b611b736001600160a01b037f000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c1684836124aa565b816001600160a01b0316836001600160a01b0316611b8e3390565b6001600160a01b03167ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db8488604051611bd1929190918252602082015260400190565b60405180910390a4611be1610852565b6006559392505050565b6000811580611bf8575082155b6111cd576111c8848385611db4565b6000611c5c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166110239092919063ffffffff16565b805190915015610cc55780806020019051810190611c7a9190612cef565b610cc55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102d3565b606082471015611d3a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102d3565b600080866001600160a01b03168587604051611d569190612d11565b60006040518083038185875af1925050503d8060008114611d93576040519150601f19603f3d011682016040523d82523d6000602084013e611d98565b606091505b5091509150611da9878383876124da565b979650505050505050565b6000808060001985870985870292508281108382030391505080600003611dee57838281611de457611de4612ca0565b0492505050610a0a565b808411611dfa57600080fd5b60008486880960026001871981018816978890046003810283188082028403028082028403028082028403028082028403028082028403029081029092039091026000889003889004909101858311909403939093029303949094049190911702949350505050565b604051631c57762b60e31b81527f00000000000000000000000000000000000000000000000000000000000000266004820152600060248201527f000000000000000000000000f3a5454496e26ac57da879bf3285fa85debf03886001600160a01b03169063e2bbb15890604401600060405180830381600087803b158015611eeb57600080fd5b505af1158015611eff573d6000803e3d6000fd5b505050506120097f0000000000000000000000000e358838ce72d5e61e0018a2ffac4bec5f4c88d2611f4e7f000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c90565b6040516370a0823160e01b81523060048201527f0000000000000000000000000e358838ce72d5e61e0018a2ffac4bec5f4c88d26001600160a01b0316906370a08231906024015b602060405180830381865afa158015611fb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fd79190612942565b6001600160a01b037f0000000000000000000000002e68d8d89dca32097f09d3b438561c9e9455da7c16929190612553565b50610ea47f000000000000000000000000acc15dc74880c9944775448304b263d191c6077f7f000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c6040516370a0823160e01b81523060048201527f000000000000000000000000acc15dc74880c9944775448304b263d191c6077f6001600160a01b0316906370a0823190602401611f96565b60007f000000000000000000000000000000000000000000000000000000000000000267ffffffffffffffff8111156120d6576120d66129c3565b6040519080825280602002602001820160405280156120ff578160200160208202803683370190505b50905081817f000000000000000000000000000000000000000000000000000000000000000160ff168151811061213857612138612a7b565b6020908102919091010152604051634d49e87d60e01b81526000906001600160a01b037f00000000000000000000000095953409374e1ed252c6d100e7466e346e3dc5b91690634d49e87d9061219690859085904290600401612d23565b6020604051808303816000875af11580156121b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d99190612942565b604051631c57762b60e31b81527f00000000000000000000000000000000000000000000000000000000000000266004820152602481018290529091507f000000000000000000000000f3a5454496e26ac57da879bf3285fa85debf03886001600160a01b03169063e2bbb15890604401600060405180830381600087803b15801561226457600080fd5b505af1158015612278573d6000803e3d6000fd5b50505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261101d9085906323b872dd60e01b90608401610fe6565b6001600160a01b03821661230f5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016102d3565b80600260008282546123219190612971565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b0382166123d85760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016102d3565b6001600160a01b0382166000908152602081905260409020548181101561244c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016102d3565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b6040516001600160a01b038316602482015260448101829052610cc590849063a9059cbb60e01b90606401610fe6565b60608315612549578251600003612542576001600160a01b0385163b6125425760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102d3565b5081610de0565b610de083836126d7565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a0823190602401602060405180830381865afa15801561259a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125be9190612942565b8211156126235760405162461bcd60e51b815260206004820152602d60248201527f536166654173736574436f6e7665727465723a204e6f7420656e6f756768206660448201526c0756e647320666f72207377617609c1b60648201526084016102d3565b826001600160a01b0316846001600160a01b031603612643575080610de0565b8160000361265357506000610de0565b604051630df791e560e41b81526001600160a01b03858116600483015284811660248301526044820184905286169063df791e50906064016020604051808303816000875af11580156126aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126ce9190612942565b95945050505050565b8151156126e75781518083602001fd5b8060405162461bcd60e51b81526004016102d39190612757565b60006020828403121561271357600080fd5b81356001600160e01b031981168114610a0a57600080fd5b60005b8381101561274657818101518382015260200161272e565b8381111561101d5750506000910152565b602081526000825180602084015261277681604085016020870161272b565b601f01601f19169190910160400192915050565b60006020828403121561279c57600080fd5b5035919050565b80356001600160a01b0381168114610b7957600080fd5b600080604083850312156127cd57600080fd5b6127d6836127a3565b946020939093013593505050565b6000806000606084860312156127f957600080fd5b612802846127a3565b9250612810602085016127a3565b9150604084013590509250925092565b6000806020838503121561283357600080fd5b823567ffffffffffffffff8082111561284b57600080fd5b818501915085601f83011261285f57600080fd5b81358181111561286e57600080fd5b8660208260051b850101111561288357600080fd5b60209290920196919550909350505050565b600080604083850312156128a857600080fd5b823591506128b8602084016127a3565b90509250929050565b6000602082840312156128d357600080fd5b610a0a826127a3565b6000806000606084860312156128f157600080fd5b83359250612901602085016127a3565b915061290f604085016127a3565b90509250925092565b6000806040838503121561292b57600080fd5b612934836127a3565b91506128b8602084016127a3565b60006020828403121561295457600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600082198211156129845761298461295b565b500190565b600181811c9082168061299d57607f821691505b6020821081036129bd57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156129eb57600080fd5b815167ffffffffffffffff80821115612a0357600080fd5b818401915084601f830112612a1757600080fd5b815181811115612a2957612a296129c3565b604051601f8201601f19908116603f01168101908382118183101715612a5157612a516129c3565b81604052828152876020848701011115612a6a57600080fd5b611da983602083016020880161272b565b634e487b7160e01b600052603260045260246000fd5b60008235605e19833603018112612aa757600080fd5b9190910192915050565b6000808335601e19843603018112612ac857600080fd5b83018035915067ffffffffffffffff821115612ae357600080fd5b602001915036819003821315612af857600080fd5b9250929050565b8183823760009101908152919050565b600060018201612b2157612b2161295b565b5060010190565b600181815b80851115612b63578160001904821115612b4957612b4961295b565b80851615612b5657918102915b93841c9390800290612b2d565b509250929050565b600082612b7a57506001610925565b81612b8757506000610925565b8160018114612b9d5760028114612ba757612bc3565b6001915050610925565b60ff841115612bb857612bb861295b565b50506001821b610925565b5060208310610133831016604e8410600b8410161715612be6575081810a610925565b612bf08383612b28565b8060001904821115612c0457612c0461295b565b029392505050565b6000610a0a60ff841683612b6b565b600060808284031215612c2d57600080fd5b6040516080810181811067ffffffffffffffff82111715612c5057612c506129c3565b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b6000816000190483118215151615612c9b57612c9b61295b565b500290565b634e487b7160e01b600052601260045260246000fd5b600082612cd357634e487b7160e01b600052601260045260246000fd5b500490565b600082821015612cea57612cea61295b565b500390565b600060208284031215612d0157600080fd5b81518015158114610a0a57600080fd5b60008251612aa781846020870161272b565b606080825284519082018190526000906020906080840190828801845b82811015612d5c57815184529284019290840190600101612d40565b50505090830194909452506040015291905056fea26469706673582212200aa3c0ade4d351c517cbd510e66000d34ea730367216e4d446bf2efc11d4491764736f6c634300080f0033

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

000000000000000000000000f3a5454496e26ac57da879bf3285fa85debf0388000000000000000000000000000000000000000000000000000000000000002600000000000000000000000095953409374e1ed252c6d100e7466e346e3dc5b90000000000000000000000000e358838ce72d5e61e0018a2ffac4bec5f4c88d2000000000000000000000000acc15dc74880c9944775448304b263d191c6077f000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c0000000000000000000000002e68d8d89dca32097f09d3b438561c9e9455da7c00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000001f417079666c6f77205374656c6c617377617020537461626c65205661756c7400000000000000000000000000000000000000000000000000000000000000000a4150464c5354454c4c4100000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _farm (address): 0xF3a5454496E26ac57da879bf3285Fa85DEBF0388
Arg [1] : _farmPid (uint256): 38
Arg [2] : _pool (address): 0x95953409374e1ed252c6D100E7466E346E3dC5b9
Arg [3] : _rewardToken (address): 0x0E358838ce72d5e61E0018a2ffaC4bEC5F4c88d2
Arg [4] : _wGlmr (address): 0xAcc15dC74880C9944775448304B263D191c6077F
Arg [5] : asset_ (address): 0x931715FEE2d06333043d11F658C8CE934aC61D0c
Arg [6] : _assetConverter (address): 0x2E68d8D89DcA32097f09d3b438561c9E9455Da7c
Arg [7] : name (string): Apyflow Stellaswap Stable Vault
Arg [8] : symbol (string): APFLSTELLA

-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 000000000000000000000000f3a5454496e26ac57da879bf3285fa85debf0388
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000026
Arg [2] : 00000000000000000000000095953409374e1ed252c6d100e7466e346e3dc5b9
Arg [3] : 0000000000000000000000000e358838ce72d5e61e0018a2ffac4bec5f4c88d2
Arg [4] : 000000000000000000000000acc15dc74880c9944775448304b263d191c6077f
Arg [5] : 000000000000000000000000931715fee2d06333043d11f658c8ce934ac61d0c
Arg [6] : 0000000000000000000000002e68d8d89dca32097f09d3b438561c9e9455da7c
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [9] : 000000000000000000000000000000000000000000000000000000000000001f
Arg [10] : 417079666c6f77205374656c6c617377617020537461626c65205661756c7400
Arg [11] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [12] : 4150464c5354454c4c4100000000000000000000000000000000000000000000


Block Transaction Gas Used Reward
view all blocks collator

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.