ETH Price: $3,388.04 (+1.20%)

Token

Staked Aura BAL (stkauraBAL)
 

Overview

Max Total Supply

1,723,748.972244039666053741 stkauraBAL

Holders

256

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Balance
1,515.772470497864201334 stkauraBAL

Value
$0.00
0xec80b5494e873fd9a7c7bf2368d743b38eb0b9ea
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xb78C0D13...A183B12BC
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
AuraBalVault

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 14 : AuraBalVault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

import { GenericUnionVault } from "./GenericVault.sol";

interface IAuraBalStrategy {
    function harvest(uint256 _minAmountOut) external returns (uint256 harvested);
}

/**
 * @title   AuraBalVault
 * @author  llama.airforce
 */
contract AuraBalVault is GenericUnionVault {
    bool public isHarvestPermissioned = true;
    mapping(address => bool) public authorizedHarvesters;

    constructor(address _token, address _virtualRewardFactory) GenericUnionVault(_token, _virtualRewardFactory) {}

    /// @notice Sets whether only whitelisted addresses can harvest
    /// @param _status Whether or not harvests are permissioned
    function setHarvestPermissions(bool _status) external onlyOwner {
        isHarvestPermissioned = _status;
    }

    /// @notice Adds or remove an address from the harvesters' whitelist
    /// @param _harvester address of the authorized harvester
    /// @param _authorized Whether to add or remove harvester
    function updateAuthorizedHarvesters(address _harvester, bool _authorized) external onlyOwner {
        authorizedHarvesters[_harvester] = _authorized;
    }

    /// @notice Claim rewards and swaps them to auraBAL for restaking
    /// @param _minAmountOut - min amount of auraBAL to receive for harvest
    /// @dev Can be called by whitelisted account or anyone against an auraBal incentive
    /// @dev Harvest logic in the strategy contract
    /// @dev Harvest can be called even if permissioned when last staker is
    ///      withdrawing from the vault.
    function harvest(uint256 _minAmountOut) public {
        require(
            !isHarvestPermissioned || authorizedHarvesters[msg.sender] || totalSupply() == 0,
            "permissioned harvest"
        );
        uint256 _harvested = IAuraBalStrategy(strategy).harvest(_minAmountOut);
        emit Harvest(msg.sender, _harvested);
    }

    /// @notice Claim rewards and swaps them to auraBAL for restaking
    /// @dev No slippage protection, swapping for auraBAL
    function harvest() public override {
        harvest(0);
    }
}

File 2 of 14 : GenericVault.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

import { Ownable } from "@openzeppelin/contracts-0.8/access/Ownable.sol";
import { SafeERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/utils/SafeERC20.sol";
import { ERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/ERC20.sol";
import { IERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/IERC20.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts-0.8/security/ReentrancyGuard.sol";
import { IERC4626 } from "../interfaces/IERC4626.sol";
import { IStrategy } from "../interfaces/IStrategy.sol";
import { IBasicRewards } from "../interfaces/IBasicRewards.sol";
import { IVirtualRewards, IVirtualRewardFactory } from "../interfaces/IVirtualRewards.sol";

/**
 * @title   GenericUnionVault
 * @author  llama.airforce -> AuraFinance
 * @notice  Changes:
 *          - remove withdraw penalty
 *          - remove platform fee
 *          - add extra rewards logic
 */
contract GenericUnionVault is ERC20, IERC4626, Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    uint256 public withdrawalPenalty = 100;
    uint256 public constant MAX_WITHDRAWAL_PENALTY = 150;
    uint256 public constant FEE_DENOMINATOR = 10000;

    address public immutable underlying;
    address public immutable virtualRewardFactory;
    address public strategy;

    address[] public extraRewards;
    mapping(address => bool) public isExtraReward;

    event WithdrawalPenaltyUpdated(uint256 _penalty);
    event Harvest(address indexed _caller, uint256 _value);
    event CallerIncentiveUpdated(uint256 _incentive);
    event StrategySet(address indexed _strategy);
    event ExtraRewardAdded(address indexed _reward, address extraReward);
    event ExtraRewardCleared(address indexed _reward);

    constructor(address _token, address _virtualRewardFactory)
        ERC20(
            string(abi.encodePacked("Staked ", ERC20(_token).name())),
            string(abi.encodePacked("stk", ERC20(_token).symbol()))
        )
    {
        underlying = _token;
        virtualRewardFactory = _virtualRewardFactory;
    }

    /// @notice Updates the withdrawal penalty
    /// @param _penalty - the amount of the new penalty (in BIPS)
    function setWithdrawalPenalty(uint256 _penalty) external onlyOwner {
        require(_penalty <= MAX_WITHDRAWAL_PENALTY);
        withdrawalPenalty = _penalty;
        emit WithdrawalPenaltyUpdated(_penalty);
    }

    /// @notice Set the address of the strategy contract
    /// @dev Can only be set once
    /// @param _strategy - address of the strategy contract
    function setStrategy(address _strategy) external onlyOwner notToZeroAddress(_strategy) {
        require(strategy == address(0), "Strategy already set");
        strategy = _strategy;
        emit StrategySet(_strategy);
    }

    /// @notice Count of extra rewards
    function extraRewardsLength() external view returns (uint256) {
        return extraRewards.length;
    }

    /// @notice Add extra reward contract
    /// @param _reward VirtualBalanceRewardPool address
    /// @return bool success
    function addExtraReward(address _reward) external onlyOwner notToZeroAddress(_reward) returns (bool) {
        require(extraRewards.length < 12, "too many rewards");
        require(!isExtraReward[_reward], "reward exists");
        require(strategy != address(0), "strategy not set");

        address extraReward = IVirtualRewardFactory(virtualRewardFactory).createVirtualReward(
            address(this),
            _reward,
            strategy
        );
        address reward = IVirtualRewards(extraReward).rewardToken();

        extraRewards.push(extraReward);
        isExtraReward[reward] = true;
        emit ExtraRewardAdded(reward, extraReward);
        return true;
    }

    /// @notice Clear extra rewards array
    function clearExtraRewards() external onlyOwner {
        uint256 len = extraRewards.length;
        for (uint256 i = 0; i < len; i++) {
            address reward = IVirtualRewards(extraRewards[i]).rewardToken();
            isExtraReward[reward] = false;
            emit ExtraRewardCleared(reward);
        }
        delete extraRewards;
    }

    /// @notice Query the amount currently staked
    /// @return total - the total amount of tokens staked
    function totalUnderlying() public view returns (uint256 total) {
        return IStrategy(strategy).totalUnderlying();
    }

    /// @notice Returns the amount of underlying a user can claim
    /// @param user - address whose claimable amount to query
    /// @return amount - claimable amount
    /// @dev Does not account for penalties and fees
    function balanceOfUnderlying(address user) external view returns (uint256 amount) {
        require(totalSupply() > 0, "No users");
        return ((balanceOf(user) * totalUnderlying()) / totalSupply());
    }

    /// @notice Deposit user funds in the autocompounder and mints tokens
    /// representing user's share of the pool in exchange
    /// @param _amount - the amount of underlying to deposit
    /// @return _shares - the amount of shares issued
    function deposit(uint256 _amount, address _receiver)
        public
        notToZeroAddress(_receiver)
        nonReentrant
        returns (uint256 _shares)
    {
        require(_amount > 0, "Deposit too small");

        uint256 _before = totalUnderlying();

        // Issues shares in proportion of deposit to pool amount
        uint256 shares = 0;
        if (totalSupply() == 0) {
            shares = _amount;
        } else {
            shares = (_amount * totalSupply()) / _before;
        }

        // Stake into extra rewards before we update the users
        // balancers and update totalSupply/totalUnderlying
        for (uint256 i = 0; i < extraRewards.length; i++) {
            IBasicRewards(extraRewards[i]).stake(_receiver, shares);
        }

        IERC20(underlying).safeTransferFrom(msg.sender, strategy, _amount);
        IStrategy(strategy).stake(_amount);

        _mint(_receiver, shares);
        emit Deposit(msg.sender, _receiver, _amount, shares);
        return shares;
    }

    /// @notice Unstake underlying in proportion to the amount of shares sent
    /// @param _shares - the number of shares sent
    /// @return _withdrawable - the withdrawable underlying amount
    function _withdraw(address _from, uint256 _shares) internal returns (uint256 _withdrawable) {
        require(totalSupply() > 0);
        // Computes the amount withdrawable based on the number of shares sent
        uint256 amount = (_shares * totalUnderlying()) / totalSupply();
        // Burn the shares before retrieving tokens
        _burn(_from, _shares);
        // If user is last to withdraw, harvest before exit
        if (totalSupply() == 0) {
            harvest();
            IStrategy(strategy).withdraw(totalUnderlying());
            _withdrawable = IERC20(underlying).balanceOf(address(this));
        }
        // Otherwise compute share and unstake
        else {
            _withdrawable = amount;
            // Substract a small withdrawal fee to prevent users "timing"
            // the harvests. The fee stays staked and is therefore
            // redistributed to all remaining participants.
            uint256 _penalty = _getWithdrawalPenalty(_withdrawable);
            _withdrawable = _withdrawable - _penalty;
            IStrategy(strategy).withdraw(_withdrawable);
        }
        return _withdrawable;
    }

    /// @notice Get the withdraw penalty amount
    /// @param _amount Amount of asset
    /// @return penalty amount
    function _getWithdrawalPenalty(uint256 _amount) internal view returns (uint256) {
        return (_amount * withdrawalPenalty) / FEE_DENOMINATOR;
    }

    /// @notice Unstake underlying token in proportion to the amount of shares sent
    /// @param _shares - the number of shares sent
    /// @return withdrawn - the amount of underlying returned to the user
    function redeem(
        uint256 _shares,
        address _receiver,
        address _owner
    ) public notToZeroAddress(_receiver) notToZeroAddress(_owner) nonReentrant returns (uint256 withdrawn) {
        // Check allowance if owner if not sender
        if (msg.sender != _owner) {
            uint256 currentAllowance = allowance(_owner, msg.sender);
            require(currentAllowance >= _shares, "ERC4626: redeem exceeds allowance");
            _approve(_owner, msg.sender, currentAllowance - _shares);
        }

        // Withdraw from extra rewards
        for (uint256 i = 0; i < extraRewards.length; i++) {
            IBasicRewards(extraRewards[i]).withdraw(_owner, _shares);
        }

        // Withdraw requested amount of underlying
        uint256 _withdrawable = _withdraw(_owner, _shares);
        // And sends back underlying to user
        IERC20(underlying).safeTransfer(_receiver, _withdrawable);
        emit Withdraw(msg.sender, _receiver, _owner, _withdrawable, _shares);
        return _withdrawable;
    }

    /// @notice Claim rewards and swaps them to FXS for restaking
    /// @dev Can be called by anyone against an incentive in FXS
    /// @dev Harvest logic in the strategy contract
    function harvest() public virtual {
        uint256 _harvested = IStrategy(strategy).harvest();
        emit Harvest(msg.sender, _harvested);
    }

    modifier notToZeroAddress(address _to) {
        require(_to != address(0), "Invalid address!");
        _;
    }

    /* --------------------------------------------------------------
     * ERC20 hooks 
    ----------------------------------------------------------------- */

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal override {
        // Withdraw extra rewards for the "from" address to update their earned
        // amount when updateReward is called
        for (uint256 i = 0; i < extraRewards.length; i++) {
            IBasicRewards(extraRewards[i]).withdraw(from, amount);
        }

        // Stake extra rewards for the "to" address
        for (uint256 i = 0; i < extraRewards.length; i++) {
            IBasicRewards(extraRewards[i]).stake(to, amount);
        }
    }

    /* --------------------------------------------------------------
     * EIP-4626 functions
    ----------------------------------------------------------------- */

    /// @notice The address of the underlying token used for the Vault for
    /// accounting, depositing, and withdrawing.
    function asset() public view returns (address) {
        return underlying;
    }

    /// @notice Total amount of the underlying asset that is “managed” by Vault.
    function totalAssets() public view returns (uint256) {
        return totalUnderlying();
    }

    /// @notice 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.
    function convertToShares(uint256 _assets) public view returns (uint256) {
        return _convertToShares(_assets, false);
    }

    /// @param _assets The amount of underlying assets to be convert to vault shares.
    /// @param isRoundUp bool to indicate round up the shares
    /// @dev isRoundUp is used to round-up the shares amount for withdraw and previewWithdraw
    function _convertToShares(uint256 _assets, bool isRoundUp) internal view virtual returns (uint256 shares) {
        uint256 totalShares = totalSupply();

        if (totalShares == 0) {
            shares = _assets; // 1:1 value of shares and assets
        } else {
            uint256 totalAssetsMem = totalUnderlying();
            shares = (_assets * totalShares) / totalAssetsMem;

            // Round Up if needed
            if (isRoundUp && mulmod(_assets, totalShares, totalAssetsMem) > 0) {
                shares += 1;
            }
        }
    }

    /// @notice 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.
    function convertToAssets(uint256 _shares) public view returns (uint256) {
        return _convertToAssets(_shares, false);
    }

    /// @param _shares The amount of vault shares to be converted to the underlying assets.
    /// @param isRoundUp bool to indicate round up the assets
    /// @dev isRoundUp is used to round-up the assets amount for mint and previewMint
    function _convertToAssets(uint256 _shares, bool isRoundUp) internal view virtual returns (uint256 assets) {
        uint256 totalShares = totalSupply();

        if (totalShares == 0) {
            assets = _shares; // 1:1 value of shares and assets
        } else {
            uint256 totalAssetsMem = totalUnderlying();
            assets = (_shares * totalAssetsMem) / totalShares;

            // Round Up if needed
            if (isRoundUp && mulmod(_shares, totalAssetsMem, totalShares) > 0) {
                assets += 1;
            }
        }
    }

    /// @notice Maximum amount of the underlying asset that can be deposited into
    /// the Vault for the receiver, through a deposit call.
    function maxDeposit(address) public pure returns (uint256) {
        return type(uint256).max;
    }

    /// @notice Allows an on-chain or off-chain user to simulate the effects of
    /// their deposit at the current block, given current on-chain conditions.
    function previewDeposit(uint256 _assets) public view returns (uint256) {
        return _convertToShares(_assets, false);
    }

    /// @notice Maximum amount of shares that can be minted from the Vault
    /// for the receiver, through a mint call.
    function maxMint(address) public pure returns (uint256) {
        return type(uint256).max;
    }

    /// @notice Allows an on-chain or off-chain user to simulate the effects of
    /// their mint at the current block, given current on-chain conditions.
    function previewMint(uint256 _shares) public view returns (uint256) {
        return _convertToAssets(_shares, true);
    }

    /// @notice Mints exactly shares Vault shares to receiver by depositing
    /// assets of underlying tokens.
    function mint(uint256 _shares, address _receiver) public returns (uint256) {
        uint256 assets = previewMint(_shares);
        return deposit(assets, _receiver);
    }

    /// @notice Maximum amount of the underlying asset that can be withdrawn
    /// from the owner balance in the Vault, through a withdraw call.
    function maxWithdraw(address _owner) public view returns (uint256) {
        return previewRedeem(maxRedeem((_owner)));
    }

    /// @notice Allows an on-chain or off-chain user to simulate the effects
    /// of their withdrawal at the current block, given current on-chain conditions.
    function previewWithdraw(uint256 _assets) public view returns (uint256) {
        _assets = ((FEE_DENOMINATOR * _assets) / (FEE_DENOMINATOR - withdrawalPenalty));
        return _convertToShares(_assets, true);
    }

    /// @notice Burns shares from owner and sends exactly assets of
    /// underlying tokens to receiver.
    function withdraw(
        uint256 _assets,
        address _receiver,
        address _owner
    ) public returns (uint256) {
        uint256 shares = previewWithdraw(_assets);
        return redeem(shares, _receiver, _owner);
    }

    /// @notice Maximum amount of Vault shares that can be redeemed from the
    /// owner balance in the Vault, through a redeem call.
    function maxRedeem(address _owner) public view returns (uint256) {
        return balanceOf(_owner);
    }

    /// @notice Allows an on-chain or off-chain user to simulate the effects of
    /// their redeemption at the current block, given current on-chain conditions.
    function previewRedeem(uint256 _shares) public view returns (uint256) {
        uint256 amount = _convertToAssets(_shares, false);
        uint256 penalty = _getWithdrawalPenalty(amount);
        return amount - penalty;
    }
}

File 3 of 14 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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 4 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

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

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

File 5 of 14 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

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

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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

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

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

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

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

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

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

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, 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}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), 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}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - 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) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][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) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * 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:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

File 6 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

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

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 8 of 14 : IERC4626.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

import { IERC20 } from "@openzeppelin/contracts-0.8/token/ERC20/IERC20.sol";
import { IERC20Metadata } from "@openzeppelin/contracts-0.8/token/ERC20/extensions/IERC20Metadata.sol";

/**
 * @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in
 * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
 * @author OpenZeppelin
 * Fork of  OpenZeppelin Contracts (last updated v4.8.0) (interfaces/IERC4626.sol)
 */
interface IERC4626 is IERC20, 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 Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
     * through a deposit call.
     *
     * - MUST return a limited value if receiver is subject to some deposit limit.
     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
     * - MUST NOT revert.
     */
    function maxDeposit(address receiver) external view returns (uint256 maxAssets);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
     * current on-chain conditions.
     *
     * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
     *   call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
     *   in the same transaction.
     * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
     *   deposit would be accepted, regardless if the user has enough tokens approved, etc.
     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by depositing.
     */
    function previewDeposit(uint256 assets) external view returns (uint256 shares);

    /**
     * @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 Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
     * - MUST return a limited value if receiver is subject to some mint limit.
     * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
     * - MUST NOT revert.
     */
    function maxMint(address receiver) external view returns (uint256 maxShares);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
     * current on-chain conditions.
     *
     * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
     *   in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
     *   same transaction.
     * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
     *   would be accepted, regardless if the user has enough tokens approved, etc.
     * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by minting.
     */
    function previewMint(uint256 shares) external view returns (uint256 assets);

    /**
     * @dev Mints exactly shares Vault shares to receiver by depositing 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 mint
     *   execution, and are accounted for during mint.
     * - MUST revert if all of shares cannot be minted (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 mint(uint256 shares, address receiver) external returns (uint256 assets);

    /**
     * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
     * Vault, through a withdraw call.
     *
     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
     * - MUST NOT revert.
     */
    function maxWithdraw(address owner) external view returns (uint256 maxAssets);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
     * given current on-chain conditions.
     *
     * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
     *   call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
     *   called
     *   in the same transaction.
     * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
     *   the withdrawal would be accepted, regardless if the user has enough shares, etc.
     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by depositing.
     */
    function previewWithdraw(uint256 assets) external view returns (uint256 shares);

    /**
     * @dev Burns shares from owner and sends exactly 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
     *   withdraw execution, and are accounted for during withdraw.
     * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
     *   not having enough shares, etc).
     *
     * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
     * Those methods should be performed separately.
     */
    function withdraw(
        uint256 assets,
        address receiver,
        address owner
    ) external returns (uint256 shares);

    /**
     * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
     * through a redeem call.
     *
     * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
     * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
     * - MUST NOT revert.
     */
    function maxRedeem(address owner) external view returns (uint256 maxShares);

    /**
     * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,
     * given current on-chain conditions.
     *
     * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
     *   in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
     *   same transaction.
     * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
     *   redemption would be accepted, regardless if the user has enough shares, etc.
     * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
     * - MUST NOT revert.
     *
     * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in
     * share price or some other type of condition, meaning the depositor will lose assets by redeeming.
     */
    function previewRedeem(uint256 shares) external view returns (uint256 assets);

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

File 9 of 14 : IStrategy.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

interface IStrategy {
    function harvest() external returns (uint256 harvested);

    function harvest(uint256 _minAmountOut) external returns (uint256 harvested);

    function totalUnderlying() external view returns (uint256 total);

    function stake(uint256 _amount) external;

    function withdraw(uint256 _amount) external;

    function setApprovals() external;
}

File 10 of 14 : IBasicRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

interface IBasicRewards {
    function stakeFor(address, uint256) external returns (bool);

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

    function totalSupply() external view returns (uint256);

    function earned(address) external view returns (uint256);

    function withdrawAll(bool) external returns (bool);

    function withdraw(uint256, bool) external returns (bool);

    function withdraw(address, uint256) external;

    function withdrawAndUnwrap(uint256 amount, bool claim) external returns (bool);

    function getReward() external returns (bool);

    function stake(uint256) external returns (bool);

    function stake(address, uint256) external;

    function extraRewards(uint256) external view returns (address);

    function exit() external returns (bool);
}

File 11 of 14 : IVirtualRewards.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

interface IVirtualRewardFactory {
    function createVirtualReward(
        address,
        address,
        address
    ) external returns (address);
}

interface IVirtualRewards {
    function queueNewRewards(uint256) external;

    function rewardToken() external view returns (address);
}

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

pragma solidity ^0.8.0;

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

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

File 13 of 14 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

import "../IERC20.sol";

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_virtualRewardFactory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_incentive","type":"uint256"}],"name":"CallerIncentiveUpdated","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":true,"internalType":"address","name":"_reward","type":"address"},{"indexed":false,"internalType":"address","name":"extraReward","type":"address"}],"name":"ExtraRewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_reward","type":"address"}],"name":"ExtraRewardCleared","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Harvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_strategy","type":"address"}],"name":"StrategySet","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_penalty","type":"uint256"}],"name":"WithdrawalPenaltyUpdated","type":"event"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_WITHDRAWAL_PENALTY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_reward","type":"address"}],"name":"addExtraReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"authorizedHarvesters","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"balanceOfUnderlying","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"clearExtraRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"extraRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"extraRewardsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minAmountOut","type":"uint256"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isExtraReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isHarvestPermissioned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assets","type":"uint256"}],"name":"previewWithdraw","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":"withdrawn","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"setHarvestPermissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_penalty","type":"uint256"}],"name":"setWithdrawalPenalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"strategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[],"name":"totalUnderlying","outputs":[{"internalType":"uint256","name":"total","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","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":"underlying","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_harvester","type":"address"},{"internalType":"bool","name":"_authorized","type":"bool"}],"name":"updateAuthorizedHarvesters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"virtualRewardFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_assets","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawalPenalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60c06040526064600755600b805460ff191660011790553480156200002357600080fd5b50604051620030fd380380620030fd8339810160408190526200004691620002de565b8181816001600160a01b03166306fdde036040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000087573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052620000b191908101906200035f565b604051602001620000c3919062000417565b604051602081830303815290604052826001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa15801562000111573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200013b91908101906200035f565b6040516020016200014d919062000448565b60408051601f198184030181529190528151620001729060039060208501906200021b565b508051620001889060049060208401906200021b565b505050620001a56200019f620001c560201b60201c565b620001c9565b60016006556001600160a01b039182166080521660a05250620004b29050565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620002299062000475565b90600052602060002090601f0160209004810192826200024d576000855562000298565b82601f106200026857805160ff191683800117855562000298565b8280016001018555821562000298579182015b82811115620002985782518255916020019190600101906200027b565b50620002a6929150620002aa565b5090565b5b80821115620002a65760008155600101620002ab565b80516001600160a01b0381168114620002d957600080fd5b919050565b60008060408385031215620002f257600080fd5b620002fd83620002c1565b91506200030d60208401620002c1565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620003495781810151838201526020016200032f565b8381111562000359576000848401525b50505050565b6000602082840312156200037257600080fd5b81516001600160401b03808211156200038a57600080fd5b818401915084601f8301126200039f57600080fd5b815181811115620003b457620003b462000316565b604051601f8201601f19908116603f01168101908382118183101715620003df57620003df62000316565b81604052828152876020848701011115620003f957600080fd5b6200040c8360208301602088016200032c565b979650505050505050565b66029ba30b5b2b2160cd1b8152600082516200043b8160078501602087016200032c565b9190910160070192915050565b6273746b60e81b815260008251620004688160038501602087016200032c565b9190910160030192915050565b600181811c908216806200048a57607f821691505b60208210811415620004ac57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a051612c02620004fb600039600081816104e60152610f5501526000818161044001528181610546015281816112c80152818161188201526122810152612c026000f3fe608060405234801561001057600080fd5b50600436106103415760003560e01c806370a08231116101bd578063ba087652116100f9578063d73792a9116100a2578063ddc632621161007c578063ddc63262146106f1578063ef8b30f714610666578063f2fde38b14610704578063f7ff67a01461071757600080fd5b8063d73792a91461069c578063d905777e146106a5578063dd62ed3e146106b857600080fd5b8063c70920bc116100d3578063c70920bc14610679578063ce96cb7714610681578063d55a23f41461069457600080fd5b8063ba08765214610653578063c63d75b6146104b1578063c6e6f5921461066657600080fd5b806395d89b4111610166578063a8c62e7611610140578063a8c62e7614610607578063a9059cbb1461061a578063b3d7f6b91461062d578063b460af941461064057600080fd5b806395d89b41146105e3578063a2468c19146105eb578063a457c2d7146105f457600080fd5b8063809c95cc11610197578063809c95cc146105ac5780638da5cb5b146105bf57806394bf804d146105d057600080fd5b806370a0823114610568578063715018a6146105915780637faaa6c11461059957600080fd5b806333a100ca1161028c57806340c35446116102355780634cdad5061161020f5780634cdad506146105085780635e43c47b1461051b5780636e553f651461052e5780636f307dc31461054157600080fd5b806340c35446146104c65780634641257d146104d95780634653aaa1146104e157600080fd5b80633af9e669116102665780633af9e6691461048b5780633dc31d191461049e578063402d267d146104b157600080fd5b806333a100ca1461042b57806338d52e0f1461043e578063395093511461047857600080fd5b806318160ddd116102ee578063252c37fa116102c8578063252c37fa146103ec578063313ce567146103f957806333393d371461040857600080fd5b806318160ddd146103c95780632060176b146103d157806323b872dd146103d957600080fd5b806307a2d13a1161031f57806307a2d13a14610380578063095ea7b3146103935780630a28a477146103b657600080fd5b806301e1d114146103465780630569d3881461036157806306fdde031461036b575b600080fd5b61034e61073a565b6040519081526020015b60405180910390f35b610369610749565b005b6103736108ab565b60405161035891906128a0565b61034e61038e3660046128d3565b61093d565b6103a66103a1366004612901565b610950565b6040519015158152602001610358565b61034e6103c43660046128d3565b610966565b60025461034e565b61034e609681565b6103a66103e736600461292d565b61099b565b600b546103a69060ff1681565b60405160128152602001610358565b6103a661041636600461296e565b600a6020526000908152604090205460ff1681565b61036961043936600461296e565b610a5c565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610358565b6103a6610486366004612901565b610bb1565b61034e61049936600461296e565b610bed565b6103696104ac366004612999565b610c7e565b61034e6104bf36600461296e565b5060001990565b6104606104d43660046128d3565b610d03565b610369610d2d565b6104607f000000000000000000000000000000000000000000000000000000000000000081565b61034e6105163660046128d3565b610d39565b6103a661052936600461296e565b610d68565b61034e61053c3660046129d2565b6110e0565b6104607f000000000000000000000000000000000000000000000000000000000000000081565b61034e61057636600461296e565b6001600160a01b031660009081526020819052604090205490565b6103696113af565b6103696105a73660046128d3565b611413565b6103696105ba3660046129f7565b6114b6565b6005546001600160a01b0316610460565b61034e6105de3660046129d2565b611523565b61037361153b565b61034e60075481565b6103a6610602366004612901565b61154a565b600854610460906001600160a01b031681565b6103a6610628366004612901565b6115fb565b61034e61063b3660046128d3565b611608565b61034e61064e366004612a14565b611615565b61034e610661366004612a14565b611637565b61034e6106743660046128d3565b611903565b61034e611910565b61034e61068f36600461296e565b61197e565b60095461034e565b61034e61271081565b61034e6106b336600461296e565b611988565b61034e6106c6366004612a56565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6103696106ff3660046128d3565b6119a6565b61036961071236600461296e565b611aca565b6103a661072536600461296e565b600c6020526000908152604090205460ff1681565b6000610744611910565b905090565b6005546001600160a01b031633146107a85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60095460005b8181101561089b576000600982815481106107cb576107cb612a84565b600091825260209182902001546040805163f7c618c160e01b815290516001600160a01b039092169263f7c618c1926004808401938290030181865afa158015610819573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083d9190612a9a565b6001600160a01b0381166000818152600a6020526040808220805460ff191690555192935090917f34304d78213ed24f75e323bc823dc4883b456fbe135029e6ae3c1597e6c7d4369190a2508061089381612acd565b9150506107ae565b506108a860096000612842565b50565b6060600380546108ba90612ae8565b80601f01602080910402602001604051908101604052809291908181526020018280546108e690612ae8565b80156109335780601f1061090857610100808354040283529160200191610933565b820191906000526020600020905b81548152906001019060200180831161091657829003601f168201915b5050505050905090565b600061094a826000611ba9565b92915050565b600061095d338484611c20565b50600192915050565b60006007546127106109789190612b1d565b61098483612710612b34565b61098e9190612b69565b915061094a826001611d44565b60006109a8848484611dae565b6001600160a01b038416600090815260016020908152604080832033845290915290205482811015610a425760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000606482015260840161079f565b610a4f8533858403611c20565b60019150505b9392505050565b6005546001600160a01b03163314610ab65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b806001600160a01b038116610b005760405162461bcd60e51b815260206004820152601060248201526f496e76616c696420616464726573732160801b604482015260640161079f565b6008546001600160a01b031615610b595760405162461bcd60e51b815260206004820152601460248201527f537472617465677920616c726561647920736574000000000000000000000000604482015260640161079f565b6008805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040517fe70d79dad95c835bdd87e9cf4665651c9e5abb3b756e4fd2bf45f29c95c3aa4090600090a25050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161095d918590610be8908690612b8b565b611c20565b600080610bf960025490565b11610c465760405162461bcd60e51b815260206004820152600860248201527f4e6f207573657273000000000000000000000000000000000000000000000000604482015260640161079f565b600254610c51611910565b6001600160a01b038416600090815260208190526040902054610c749190612b34565b61094a9190612b69565b6005546001600160a01b03163314610cd85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b6001600160a01b03919091166000908152600c60205260409020805460ff1916911515919091179055565b60098181548110610d1357600080fd5b6000918252602090912001546001600160a01b0316905081565b610d3760006119a6565b565b600080610d47836000611ba9565b90506000610d5482611fb8565b9050610d608183612b1d565b949350505050565b6005546000906001600160a01b03163314610dc55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b816001600160a01b038116610e0f5760405162461bcd60e51b815260206004820152601060248201526f496e76616c696420616464726573732160801b604482015260640161079f565b600954600c11610e615760405162461bcd60e51b815260206004820152601060248201527f746f6f206d616e79207265776172647300000000000000000000000000000000604482015260640161079f565b6001600160a01b0383166000908152600a602052604090205460ff1615610eca5760405162461bcd60e51b815260206004820152600d60248201527f7265776172642065786973747300000000000000000000000000000000000000604482015260640161079f565b6008546001600160a01b0316610f225760405162461bcd60e51b815260206004820152601060248201527f7374726174656779206e6f742073657400000000000000000000000000000000604482015260640161079f565b600854604051638e88bbdd60e01b81523060048201526001600160a01b03858116602483015291821660448201526000917f00000000000000000000000000000000000000000000000000000000000000001690638e88bbdd906064016020604051808303816000875af1158015610f9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc29190612a9a565b90506000816001600160a01b031663f7c618c16040518163ffffffff1660e01b8152600401602060405180830381865afa158015611004573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110289190612a9a565b6009805460018082019092557f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038681169182179092559083166000818152600a6020908152604091829020805460ff1916909517909455519182529293507fbf7c7e98b1c9a807d31de793918fb6b650367d4d4264f0098ba904699ba878fc910160405180910390a26001935050505b50919050565b6000816001600160a01b03811661112c5760405162461bcd60e51b815260206004820152601060248201526f496e76616c696420616464726573732160801b604482015260640161079f565b6002600654141561117f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161079f565b6002600655836111d15760405162461bcd60e51b815260206004820152601160248201527f4465706f73697420746f6f20736d616c6c000000000000000000000000000000604482015260640161079f565b60006111db611910565b905060006111e860025490565b6111f3575084611214565b816111fd60025490565b6112079088612b34565b6112119190612b69565b90505b60005b6009548110156112b6576009818154811061123457611234612a84565b6000918252602090912001546040516356e4bb9760e11b81526001600160a01b038881166004830152602482018590529091169063adc9772e90604401600060405180830381600087803b15801561128b57600080fd5b505af115801561129f573d6000803e3d6000fd5b5050505080806112ae90612acd565b915050611217565b506008546112f3906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169133911689611fcb565b60085460405163534a7e1d60e11b8152600481018890526001600160a01b039091169063a694fc3a90602401600060405180830381600087803b15801561133957600080fd5b505af115801561134d573d6000803e3d6000fd5b5050505061135b8582612063565b60408051878152602081018390526001600160a01b0387169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a3600160065595945050505050565b6005546001600160a01b031633146114095760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b610d37600061214e565b6005546001600160a01b0316331461146d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b609681111561147b57600080fd5b60078190556040518181527f9d5ddc6fdb90a6647fe4981fdf08b45a5f9ef6d8ea960de27bef48fb481325929060200160405180910390a150565b6005546001600160a01b031633146115105760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b600b805460ff1916911515919091179055565b60008061152f84611608565b9050610d6081846110e0565b6060600480546108ba90612ae8565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156115e45760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f000000000000000000000000000000000000000000000000000000606482015260840161079f565b6115f13385858403611c20565b5060019392505050565b600061095d338484611dae565b600061094a826001611ba9565b60008061162185610966565b905061162e818585611637565b95945050505050565b6000826001600160a01b0381166116835760405162461bcd60e51b815260206004820152601060248201526f496e76616c696420616464726573732160801b604482015260640161079f565b826001600160a01b0381166116cd5760405162461bcd60e51b815260206004820152601060248201526f496e76616c696420616464726573732160801b604482015260640161079f565b600260065414156117205760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161079f565b6002600655336001600160a01b038516146117c4576001600160a01b0384166000908152600160209081526040808320338452909152902054868110156117b35760405162461bcd60e51b815260206004820152602160248201527f455243343632363a2072656465656d206578636565647320616c6c6f77616e636044820152606560f81b606482015260840161079f565b6117c28533610be88a85612b1d565b505b60005b60095481101561186657600981815481106117e4576117e4612a84565b60009182526020909120015460405163f3fef3a360e01b81526001600160a01b038781166004830152602482018a90529091169063f3fef3a390604401600060405180830381600087803b15801561183b57600080fd5b505af115801561184f573d6000803e3d6000fd5b50505050808061185e90612acd565b9150506117c7565b50600061187385886121ad565b90506118a96001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016878361237e565b60408051828152602081018990526001600160a01b03808816929089169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a460016006559695505050505050565b600061094a826000611d44565b600854604080516331c2482f60e21b815290516000926001600160a01b03169163c70920bc9160048083019260209291908290030181865afa15801561195a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107449190612ba3565b600061094a610516835b6001600160a01b03811660009081526020819052604081205461094a565b600b5460ff1615806119c75750336000908152600c602052604090205460ff165b806119d25750600254155b611a1e5760405162461bcd60e51b815260206004820152601460248201527f7065726d697373696f6e65642068617276657374000000000000000000000000604482015260640161079f565b600854604051636ee3193160e11b8152600481018390526000916001600160a01b03169063ddc63262906024016020604051808303816000875af1158015611a6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a8e9190612ba3565b60405181815290915033907fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba9060200160405180910390a25050565b6005546001600160a01b03163314611b245760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b6001600160a01b038116611ba05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161079f565b6108a88161214e565b600080611bb560025490565b905080611bc457839150611c19565b6000611bce611910565b905081611bdb8287612b34565b611be59190612b69565b9250838015611c04575060008280611bff57611bff612b53565b828709115b15611c1757611c14600184612b8b565b92505b505b5092915050565b6001600160a01b038316611c825760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161079f565b6001600160a01b038216611ce35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161079f565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600080611d5060025490565b905080611d5f57839150611c19565b6000611d69611910565b905080611d768387612b34565b611d809190612b69565b9250838015611c04575060008180611d9a57611d9a612b53565b8387091115611c1757611c14600184612b8b565b6001600160a01b038316611e2a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161079f565b6001600160a01b038216611e8c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161079f565b611e978383836123b3565b6001600160a01b03831660009081526020819052604090205481811015611f265760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161079f565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290611f5d908490612b8b565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611fa991815260200190565b60405180910390a35b50505050565b600061271060075483610c749190612b34565b6040516001600160a01b0380851660248301528316604482015260648101829052611fb29085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526124f8565b6001600160a01b0382166120b95760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161079f565b6120c5600083836123b3565b80600260008282546120d79190612b8b565b90915550506001600160a01b03821660009081526020819052604081208054839290612104908490612b8b565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000806121b960025490565b116121c357600080fd5b60006121ce60025490565b6121d6611910565b6121e09085612b34565b6121ea9190612b69565b90506121f684846125dd565b6002546122fd57612205610d2d565b6008546001600160a01b0316632e1a7d4d61221e611910565b6040518263ffffffff1660e01b815260040161223c91815260200190565b600060405180830381600087803b15801561225657600080fd5b505af115801561226a573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692506370a082319150602401602060405180830381865afa1580156122d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f69190612ba3565b9150611c19565b809150600061230b83611fb8565b90506123178184612b1d565b600854604051632e1a7d4d60e01b8152600481018390529194506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561235e57600080fd5b505af1158015612372573d6000803e3d6000fd5b50505050505092915050565b6040516001600160a01b0383166024820152604481018290526123ae90849063a9059cbb60e01b90606401611fff565b505050565b60005b60095481101561245557600981815481106123d3576123d3612a84565b60009182526020909120015460405163f3fef3a360e01b81526001600160a01b038681166004830152602482018590529091169063f3fef3a390604401600060405180830381600087803b15801561242a57600080fd5b505af115801561243e573d6000803e3d6000fd5b50505050808061244d90612acd565b9150506123b6565b5060005b600954811015611fb2576009818154811061247657612476612a84565b6000918252602090912001546040516356e4bb9760e11b81526001600160a01b038581166004830152602482018590529091169063adc9772e90604401600060405180830381600087803b1580156124cd57600080fd5b505af11580156124e1573d6000803e3d6000fd5b5050505080806124f090612acd565b915050612459565b600061254d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166127379092919063ffffffff16565b8051909150156123ae578080602001905181019061256b9190612bbc565b6123ae5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161079f565b6001600160a01b03821661263d5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161079f565b612649826000836123b3565b6001600160a01b038216600090815260208190526040902054818110156126bd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161079f565b6001600160a01b03831660009081526020819052604081208383039055600280548492906126ec908490612b1d565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b6060610d60848460008585843b6127905760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161079f565b600080866001600160a01b031685876040516127ac9190612bd9565b60006040518083038185875af1925050503d80600081146127e9576040519150601f19603f3d011682016040523d82523d6000602084013e6127ee565b606091505b50915091506127fe828286612809565b979650505050505050565b60608315612818575081610a55565b8251156128285782518084602001fd5b8160405162461bcd60e51b815260040161079f91906128a0565b50805460008255906000526020600020908101906108a891905b80821115612870576000815560010161285c565b5090565b60005b8381101561288f578181015183820152602001612877565b83811115611fb25750506000910152565b60208152600082518060208401526128bf816040850160208701612874565b601f01601f19169190910160400192915050565b6000602082840312156128e557600080fd5b5035919050565b6001600160a01b03811681146108a857600080fd5b6000806040838503121561291457600080fd5b823561291f816128ec565b946020939093013593505050565b60008060006060848603121561294257600080fd5b833561294d816128ec565b9250602084013561295d816128ec565b929592945050506040919091013590565b60006020828403121561298057600080fd5b8135610a55816128ec565b80151581146108a857600080fd5b600080604083850312156129ac57600080fd5b82356129b7816128ec565b915060208301356129c78161298b565b809150509250929050565b600080604083850312156129e557600080fd5b8235915060208301356129c7816128ec565b600060208284031215612a0957600080fd5b8135610a558161298b565b600080600060608486031215612a2957600080fd5b833592506020840135612a3b816128ec565b91506040840135612a4b816128ec565b809150509250925092565b60008060408385031215612a6957600080fd5b8235612a74816128ec565b915060208301356129c7816128ec565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612aac57600080fd5b8151610a55816128ec565b634e487b7160e01b600052601160045260246000fd5b6000600019821415612ae157612ae1612ab7565b5060010190565b600181811c90821680612afc57607f821691505b602082108114156110da57634e487b7160e01b600052602260045260246000fd5b600082821015612b2f57612b2f612ab7565b500390565b6000816000190483118215151615612b4e57612b4e612ab7565b500290565b634e487b7160e01b600052601260045260246000fd5b600082612b8657634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115612b9e57612b9e612ab7565b500190565b600060208284031215612bb557600080fd5b5051919050565b600060208284031215612bce57600080fd5b8151610a558161298b565b60008251612beb818460208701612874565b919091019291505056fea164736f6c634300080b000a000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d00000000000000000000000064e2df8e5463f8c14e1c28c9782f7b4b6062b2c3

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103415760003560e01c806370a08231116101bd578063ba087652116100f9578063d73792a9116100a2578063ddc632621161007c578063ddc63262146106f1578063ef8b30f714610666578063f2fde38b14610704578063f7ff67a01461071757600080fd5b8063d73792a91461069c578063d905777e146106a5578063dd62ed3e146106b857600080fd5b8063c70920bc116100d3578063c70920bc14610679578063ce96cb7714610681578063d55a23f41461069457600080fd5b8063ba08765214610653578063c63d75b6146104b1578063c6e6f5921461066657600080fd5b806395d89b4111610166578063a8c62e7611610140578063a8c62e7614610607578063a9059cbb1461061a578063b3d7f6b91461062d578063b460af941461064057600080fd5b806395d89b41146105e3578063a2468c19146105eb578063a457c2d7146105f457600080fd5b8063809c95cc11610197578063809c95cc146105ac5780638da5cb5b146105bf57806394bf804d146105d057600080fd5b806370a0823114610568578063715018a6146105915780637faaa6c11461059957600080fd5b806333a100ca1161028c57806340c35446116102355780634cdad5061161020f5780634cdad506146105085780635e43c47b1461051b5780636e553f651461052e5780636f307dc31461054157600080fd5b806340c35446146104c65780634641257d146104d95780634653aaa1146104e157600080fd5b80633af9e669116102665780633af9e6691461048b5780633dc31d191461049e578063402d267d146104b157600080fd5b806333a100ca1461042b57806338d52e0f1461043e578063395093511461047857600080fd5b806318160ddd116102ee578063252c37fa116102c8578063252c37fa146103ec578063313ce567146103f957806333393d371461040857600080fd5b806318160ddd146103c95780632060176b146103d157806323b872dd146103d957600080fd5b806307a2d13a1161031f57806307a2d13a14610380578063095ea7b3146103935780630a28a477146103b657600080fd5b806301e1d114146103465780630569d3881461036157806306fdde031461036b575b600080fd5b61034e61073a565b6040519081526020015b60405180910390f35b610369610749565b005b6103736108ab565b60405161035891906128a0565b61034e61038e3660046128d3565b61093d565b6103a66103a1366004612901565b610950565b6040519015158152602001610358565b61034e6103c43660046128d3565b610966565b60025461034e565b61034e609681565b6103a66103e736600461292d565b61099b565b600b546103a69060ff1681565b60405160128152602001610358565b6103a661041636600461296e565b600a6020526000908152604090205460ff1681565b61036961043936600461296e565b610a5c565b7f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d5b6040516001600160a01b039091168152602001610358565b6103a6610486366004612901565b610bb1565b61034e61049936600461296e565b610bed565b6103696104ac366004612999565b610c7e565b61034e6104bf36600461296e565b5060001990565b6104606104d43660046128d3565b610d03565b610369610d2d565b6104607f00000000000000000000000064e2df8e5463f8c14e1c28c9782f7b4b6062b2c381565b61034e6105163660046128d3565b610d39565b6103a661052936600461296e565b610d68565b61034e61053c3660046129d2565b6110e0565b6104607f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d81565b61034e61057636600461296e565b6001600160a01b031660009081526020819052604090205490565b6103696113af565b6103696105a73660046128d3565b611413565b6103696105ba3660046129f7565b6114b6565b6005546001600160a01b0316610460565b61034e6105de3660046129d2565b611523565b61037361153b565b61034e60075481565b6103a6610602366004612901565b61154a565b600854610460906001600160a01b031681565b6103a6610628366004612901565b6115fb565b61034e61063b3660046128d3565b611608565b61034e61064e366004612a14565b611615565b61034e610661366004612a14565b611637565b61034e6106743660046128d3565b611903565b61034e611910565b61034e61068f36600461296e565b61197e565b60095461034e565b61034e61271081565b61034e6106b336600461296e565b611988565b61034e6106c6366004612a56565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6103696106ff3660046128d3565b6119a6565b61036961071236600461296e565b611aca565b6103a661072536600461296e565b600c6020526000908152604090205460ff1681565b6000610744611910565b905090565b6005546001600160a01b031633146107a85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60095460005b8181101561089b576000600982815481106107cb576107cb612a84565b600091825260209182902001546040805163f7c618c160e01b815290516001600160a01b039092169263f7c618c1926004808401938290030181865afa158015610819573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083d9190612a9a565b6001600160a01b0381166000818152600a6020526040808220805460ff191690555192935090917f34304d78213ed24f75e323bc823dc4883b456fbe135029e6ae3c1597e6c7d4369190a2508061089381612acd565b9150506107ae565b506108a860096000612842565b50565b6060600380546108ba90612ae8565b80601f01602080910402602001604051908101604052809291908181526020018280546108e690612ae8565b80156109335780601f1061090857610100808354040283529160200191610933565b820191906000526020600020905b81548152906001019060200180831161091657829003601f168201915b5050505050905090565b600061094a826000611ba9565b92915050565b600061095d338484611c20565b50600192915050565b60006007546127106109789190612b1d565b61098483612710612b34565b61098e9190612b69565b915061094a826001611d44565b60006109a8848484611dae565b6001600160a01b038416600090815260016020908152604080832033845290915290205482811015610a425760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000606482015260840161079f565b610a4f8533858403611c20565b60019150505b9392505050565b6005546001600160a01b03163314610ab65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b806001600160a01b038116610b005760405162461bcd60e51b815260206004820152601060248201526f496e76616c696420616464726573732160801b604482015260640161079f565b6008546001600160a01b031615610b595760405162461bcd60e51b815260206004820152601460248201527f537472617465677920616c726561647920736574000000000000000000000000604482015260640161079f565b6008805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091556040517fe70d79dad95c835bdd87e9cf4665651c9e5abb3b756e4fd2bf45f29c95c3aa4090600090a25050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161095d918590610be8908690612b8b565b611c20565b600080610bf960025490565b11610c465760405162461bcd60e51b815260206004820152600860248201527f4e6f207573657273000000000000000000000000000000000000000000000000604482015260640161079f565b600254610c51611910565b6001600160a01b038416600090815260208190526040902054610c749190612b34565b61094a9190612b69565b6005546001600160a01b03163314610cd85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b6001600160a01b03919091166000908152600c60205260409020805460ff1916911515919091179055565b60098181548110610d1357600080fd5b6000918252602090912001546001600160a01b0316905081565b610d3760006119a6565b565b600080610d47836000611ba9565b90506000610d5482611fb8565b9050610d608183612b1d565b949350505050565b6005546000906001600160a01b03163314610dc55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b816001600160a01b038116610e0f5760405162461bcd60e51b815260206004820152601060248201526f496e76616c696420616464726573732160801b604482015260640161079f565b600954600c11610e615760405162461bcd60e51b815260206004820152601060248201527f746f6f206d616e79207265776172647300000000000000000000000000000000604482015260640161079f565b6001600160a01b0383166000908152600a602052604090205460ff1615610eca5760405162461bcd60e51b815260206004820152600d60248201527f7265776172642065786973747300000000000000000000000000000000000000604482015260640161079f565b6008546001600160a01b0316610f225760405162461bcd60e51b815260206004820152601060248201527f7374726174656779206e6f742073657400000000000000000000000000000000604482015260640161079f565b600854604051638e88bbdd60e01b81523060048201526001600160a01b03858116602483015291821660448201526000917f00000000000000000000000064e2df8e5463f8c14e1c28c9782f7b4b6062b2c31690638e88bbdd906064016020604051808303816000875af1158015610f9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc29190612a9a565b90506000816001600160a01b031663f7c618c16040518163ffffffff1660e01b8152600401602060405180830381865afa158015611004573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110289190612a9a565b6009805460018082019092557f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038681169182179092559083166000818152600a6020908152604091829020805460ff1916909517909455519182529293507fbf7c7e98b1c9a807d31de793918fb6b650367d4d4264f0098ba904699ba878fc910160405180910390a26001935050505b50919050565b6000816001600160a01b03811661112c5760405162461bcd60e51b815260206004820152601060248201526f496e76616c696420616464726573732160801b604482015260640161079f565b6002600654141561117f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161079f565b6002600655836111d15760405162461bcd60e51b815260206004820152601160248201527f4465706f73697420746f6f20736d616c6c000000000000000000000000000000604482015260640161079f565b60006111db611910565b905060006111e860025490565b6111f3575084611214565b816111fd60025490565b6112079088612b34565b6112119190612b69565b90505b60005b6009548110156112b6576009818154811061123457611234612a84565b6000918252602090912001546040516356e4bb9760e11b81526001600160a01b038881166004830152602482018590529091169063adc9772e90604401600060405180830381600087803b15801561128b57600080fd5b505af115801561129f573d6000803e3d6000fd5b5050505080806112ae90612acd565b915050611217565b506008546112f3906001600160a01b037f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d81169133911689611fcb565b60085460405163534a7e1d60e11b8152600481018890526001600160a01b039091169063a694fc3a90602401600060405180830381600087803b15801561133957600080fd5b505af115801561134d573d6000803e3d6000fd5b5050505061135b8582612063565b60408051878152602081018390526001600160a01b0387169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a3600160065595945050505050565b6005546001600160a01b031633146114095760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b610d37600061214e565b6005546001600160a01b0316331461146d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b609681111561147b57600080fd5b60078190556040518181527f9d5ddc6fdb90a6647fe4981fdf08b45a5f9ef6d8ea960de27bef48fb481325929060200160405180910390a150565b6005546001600160a01b031633146115105760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b600b805460ff1916911515919091179055565b60008061152f84611608565b9050610d6081846110e0565b6060600480546108ba90612ae8565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156115e45760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f000000000000000000000000000000000000000000000000000000606482015260840161079f565b6115f13385858403611c20565b5060019392505050565b600061095d338484611dae565b600061094a826001611ba9565b60008061162185610966565b905061162e818585611637565b95945050505050565b6000826001600160a01b0381166116835760405162461bcd60e51b815260206004820152601060248201526f496e76616c696420616464726573732160801b604482015260640161079f565b826001600160a01b0381166116cd5760405162461bcd60e51b815260206004820152601060248201526f496e76616c696420616464726573732160801b604482015260640161079f565b600260065414156117205760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161079f565b6002600655336001600160a01b038516146117c4576001600160a01b0384166000908152600160209081526040808320338452909152902054868110156117b35760405162461bcd60e51b815260206004820152602160248201527f455243343632363a2072656465656d206578636565647320616c6c6f77616e636044820152606560f81b606482015260840161079f565b6117c28533610be88a85612b1d565b505b60005b60095481101561186657600981815481106117e4576117e4612a84565b60009182526020909120015460405163f3fef3a360e01b81526001600160a01b038781166004830152602482018a90529091169063f3fef3a390604401600060405180830381600087803b15801561183b57600080fd5b505af115801561184f573d6000803e3d6000fd5b50505050808061185e90612acd565b9150506117c7565b50600061187385886121ad565b90506118a96001600160a01b037f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d16878361237e565b60408051828152602081018990526001600160a01b03808816929089169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a460016006559695505050505050565b600061094a826000611d44565b600854604080516331c2482f60e21b815290516000926001600160a01b03169163c70920bc9160048083019260209291908290030181865afa15801561195a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107449190612ba3565b600061094a610516835b6001600160a01b03811660009081526020819052604081205461094a565b600b5460ff1615806119c75750336000908152600c602052604090205460ff165b806119d25750600254155b611a1e5760405162461bcd60e51b815260206004820152601460248201527f7065726d697373696f6e65642068617276657374000000000000000000000000604482015260640161079f565b600854604051636ee3193160e11b8152600481018390526000916001600160a01b03169063ddc63262906024016020604051808303816000875af1158015611a6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a8e9190612ba3565b60405181815290915033907fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba9060200160405180910390a25050565b6005546001600160a01b03163314611b245760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079f565b6001600160a01b038116611ba05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161079f565b6108a88161214e565b600080611bb560025490565b905080611bc457839150611c19565b6000611bce611910565b905081611bdb8287612b34565b611be59190612b69565b9250838015611c04575060008280611bff57611bff612b53565b828709115b15611c1757611c14600184612b8b565b92505b505b5092915050565b6001600160a01b038316611c825760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161079f565b6001600160a01b038216611ce35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161079f565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600080611d5060025490565b905080611d5f57839150611c19565b6000611d69611910565b905080611d768387612b34565b611d809190612b69565b9250838015611c04575060008180611d9a57611d9a612b53565b8387091115611c1757611c14600184612b8b565b6001600160a01b038316611e2a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161079f565b6001600160a01b038216611e8c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161079f565b611e978383836123b3565b6001600160a01b03831660009081526020819052604090205481811015611f265760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161079f565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290611f5d908490612b8b565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611fa991815260200190565b60405180910390a35b50505050565b600061271060075483610c749190612b34565b6040516001600160a01b0380851660248301528316604482015260648101829052611fb29085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526124f8565b6001600160a01b0382166120b95760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161079f565b6120c5600083836123b3565b80600260008282546120d79190612b8b565b90915550506001600160a01b03821660009081526020819052604081208054839290612104908490612b8b565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000806121b960025490565b116121c357600080fd5b60006121ce60025490565b6121d6611910565b6121e09085612b34565b6121ea9190612b69565b90506121f684846125dd565b6002546122fd57612205610d2d565b6008546001600160a01b0316632e1a7d4d61221e611910565b6040518263ffffffff1660e01b815260040161223c91815260200190565b600060405180830381600087803b15801561225657600080fd5b505af115801561226a573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201527f000000000000000000000000616e8bfa43f920657b3497dbf40d6b1a02d4608d6001600160a01b031692506370a082319150602401602060405180830381865afa1580156122d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122f69190612ba3565b9150611c19565b809150600061230b83611fb8565b90506123178184612b1d565b600854604051632e1a7d4d60e01b8152600481018390529194506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561235e57600080fd5b505af1158015612372573d6000803e3d6000fd5b50505050505092915050565b6040516001600160a01b0383166024820152604481018290526123ae90849063a9059cbb60e01b90606401611fff565b505050565b60005b60095481101561245557600981815481106123d3576123d3612a84565b60009182526020909120015460405163f3fef3a360e01b81526001600160a01b038681166004830152602482018590529091169063f3fef3a390604401600060405180830381600087803b15801561242a57600080fd5b505af115801561243e573d6000803e3d6000fd5b50505050808061244d90612acd565b9150506123b6565b5060005b600954811015611fb2576009818154811061247657612476612a84565b6000918252602090912001546040516356e4bb9760e11b81526001600160a01b038581166004830152602482018590529091169063adc9772e90604401600060405180830381600087803b1580156124cd57600080fd5b505af11580156124e1573d6000803e3d6000fd5b5050505080806124f090612acd565b915050612459565b600061254d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166127379092919063ffffffff16565b8051909150156123ae578080602001905181019061256b9190612bbc565b6123ae5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161079f565b6001600160a01b03821661263d5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161079f565b612649826000836123b3565b6001600160a01b038216600090815260208190526040902054818110156126bd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161079f565b6001600160a01b03831660009081526020819052604081208383039055600280548492906126ec908490612b1d565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b6060610d60848460008585843b6127905760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161079f565b600080866001600160a01b031685876040516127ac9190612bd9565b60006040518083038185875af1925050503d80600081146127e9576040519150601f19603f3d011682016040523d82523d6000602084013e6127ee565b606091505b50915091506127fe828286612809565b979650505050505050565b60608315612818575081610a55565b8251156128285782518084602001fd5b8160405162461bcd60e51b815260040161079f91906128a0565b50805460008255906000526020600020908101906108a891905b80821115612870576000815560010161285c565b5090565b60005b8381101561288f578181015183820152602001612877565b83811115611fb25750506000910152565b60208152600082518060208401526128bf816040850160208701612874565b601f01601f19169190910160400192915050565b6000602082840312156128e557600080fd5b5035919050565b6001600160a01b03811681146108a857600080fd5b6000806040838503121561291457600080fd5b823561291f816128ec565b946020939093013593505050565b60008060006060848603121561294257600080fd5b833561294d816128ec565b9250602084013561295d816128ec565b929592945050506040919091013590565b60006020828403121561298057600080fd5b8135610a55816128ec565b80151581146108a857600080fd5b600080604083850312156129ac57600080fd5b82356129b7816128ec565b915060208301356129c78161298b565b809150509250929050565b600080604083850312156129e557600080fd5b8235915060208301356129c7816128ec565b600060208284031215612a0957600080fd5b8135610a558161298b565b600080600060608486031215612a2957600080fd5b833592506020840135612a3b816128ec565b91506040840135612a4b816128ec565b809150509250925092565b60008060408385031215612a6957600080fd5b8235612a74816128ec565b915060208301356129c7816128ec565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612aac57600080fd5b8151610a55816128ec565b634e487b7160e01b600052601160045260246000fd5b6000600019821415612ae157612ae1612ab7565b5060010190565b600181811c90821680612afc57607f821691505b602082108114156110da57634e487b7160e01b600052602260045260246000fd5b600082821015612b2f57612b2f612ab7565b500390565b6000816000190483118215151615612b4e57612b4e612ab7565b500290565b634e487b7160e01b600052601260045260246000fd5b600082612b8657634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115612b9e57612b9e612ab7565b500190565b600060208284031215612bb557600080fd5b5051919050565b600060208284031215612bce57600080fd5b8151610a558161298b565b60008251612beb818460208701612874565b919091019291505056fea164736f6c634300080b000a

Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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