ETH Price: $3,528.23 (+5.46%)

Token

StakeDAO ETH Covered Call Strategy (sdETHCoveredCall)
 

Overview

Max Total Supply

137.461563393170350861 sdETHCoveredCall

Holders

63

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Filtered by Token Holder
snuggster.eth
Balance
0.000987674658943645 sdETHCoveredCall

Value
$0.00
0x483b613641720bdd7848f4d90a01883141b753db
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
OpynPerpVault

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 12 : OpynPerpVault.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.2;
pragma experimental ABIEncoderV2;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import { SafeMath } from '@openzeppelin/contracts/math/SafeMath.sol';
import { IERC20 } from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import { SafeERC20 } from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';

import { IAction } from '../interfaces/IAction.sol';
import { ICurve } from '../interfaces/ICurve.sol';
import { IStakeDao } from '../interfaces/IStakeDao.sol';

/**
 * Error Codes
 * O1: actions for the vault have not been initialized
 * O2: cannot execute transaction, vault is in emergency state
 * O3: cannot call setActions, actions have already been initialized
 * O4: action being set is using an invalid address
 * O5: action being set is a duplicated action
 * O6: deposited ETH (msg.value) must be greater than 0
 * O7: cannot accept ETH deposit, total sdecrv controlled by the vault would exceed vault cap
 * O8: unable to withdraw ETH, sdecrv to withdraw would exceed or be equal to the current vault sdecrv balance
 * O9: unable to withdraw ETH, ETH fee transfer to fee recipient (feeRecipient) failed
 * O10: unable to withdraw ETH, ETH withdrawal to user (msg.sender) failed
 * O11: cannot close vault positions, vault is not in locked state (VaultState.Locked)
 * O12: unable to rollover vault, length of allocation percentages (_allocationPercentages) passed is not equal to the initialized actions length
 * O13: unable to rollover vault, vault is not in unlocked state (VaultState.Unlocked)
 * O14: unable to rollover vault, the calculated percentage sum (sumPercentage) is greater than the base (BASE)
 * O15: unable to rollover vault, the calculated percentage sum (sumPercentage) is not equal to the base (BASE)
 * O16: withdraw reserve percentage must be less than 50% (5000)
 * O17: cannot call emergencyPause, vault is already in emergency state
 * O18: cannot call resumeFromPause, vault is not in emergency state
 * O19: cannot receive ETH from any address other than the curve pool address (curvePool)
 */

/** 
 * @title OpynPerpVault
 * @author Opyn Team
 * @dev implementation of the Opyn Perp Vault contract that works with stakedao's ETH strategy. 
 * Note that this implementation is meant to only specifically work for the stakedao ETH strategy and is not 
 * a generalized contract. Stakedao's ETH strategy currently accepts curvePool LP tokens called ecrv from the 
 * sETH-ETH curvePool pool. This strategy allows users to convert their ETH into yield earning sdecrv tokens
 * and use the sdecrv tokens as collateral to sell ETH call options on Opyn. 
 */

contract OpynPerpVault is ERC20, ReentrancyGuard, Ownable {
  using SafeERC20 for IERC20;
  using SafeMath for uint256;

  enum VaultState {
    Emergency,
    Locked,
    Unlocked
  }

  /// @dev actions that build up this strategy (vault)
  address[] public actions;

  /// @dev address to which all fees are sent
  address public feeRecipient;

  /// @dev stake dao sdecrvAddress
  address public sdecrvAddress;

  uint256 public constant BASE = 10000; // 100%

  /// @dev Cap for the vault. hardcoded at 1000 for initial release
  uint256 public cap = 1000 ether;

  /// @dev withdrawal fee percentage. 50 being 0.5%
  uint256 public withdrawalFeePercentage = 50;

  /// @dev how many percentage should be reserved in vault for withdraw. 1000 being 10%
  uint256 public withdrawReserve = 0;

  /// @dev curvePool ETH/sETH stableswap 
  ICurve public curvePool;

  VaultState public state;
  VaultState public stateBeforePause;

  /*=====================
   *       Events       *
   *====================*/

  event CapUpdated(uint256 newCap);

  event Deposit(address account, uint256 amountDeposited, uint256 shareMinted);

  event Rollover(uint256[] allocations);

  event StateUpdated(VaultState state);

  event Withdraw(address account, uint256 amountWithdrawn, uint256 fee, uint256 shareBurned);

  /*=====================
   *     Modifiers      *
   *====================*/

  /** 
   * @dev can only be called if actions are initialized 
   */
  function actionsInitialized() private view {
    require(actions.length > 0, "O1");
  }
  
  /**
   * @dev can only be executed if vault is not in emergency state
   */
  function notEmergency() private view {
    require(state != VaultState.Emergency, "O2");
  }

  /*=====================
   * external function *
   *====================*/

  constructor (
    address _sdecrvAddress,
    address _curvePool,
    address _feeRecipient,
    string memory _tokenName,
    string memory _tokenSymbol
    ) ERC20(_tokenName, _tokenSymbol) {
    sdecrvAddress = _sdecrvAddress;
    feeRecipient = _feeRecipient;
    curvePool = ICurve(_curvePool);
    state = VaultState.Unlocked;
  }

  function setActions(address[] memory _actions) external onlyOwner {
    require(actions.length == 0, "O3");

    // assign actions
    for(uint256 i = 0 ; i < _actions.length; i++ ) {
      // check all items before actions[i], does not equal to action[i]
      require(_actions[i] != address(0), "O4");

      for(uint256 j = 0; j < i; j++) {
        require(_actions[i] != _actions[j], "O5");
      }

      actions.push(_actions[i]);
    }
  }

  /** 
   * @notice allows owner to change the cap
   */
   function setCap(uint256 _newCap) external onlyOwner {
     cap = _newCap;

     emit CapUpdated(_newCap);
   }

  /**
   * @notice total sdecrv controlled by this vault
   */
  function totalStakedaoAsset() public view returns (uint256) {
    uint256 debt = 0;
    uint256 length = actions.length;

    for (uint256 i = 0; i < length; i++) {
      debt = debt.add(IAction(actions[i]).currentValue());
    }

    return _balance().add(debt);
  }

  /**
   * total eth value of the sdecrv controlled by this vault
   */
  function totalETHControlled() external view returns (uint256) { 
    IStakeDao sdecrv = IStakeDao(sdecrvAddress);
    // hard coded to 36 because ecrv and sdecrv are both 18 decimals. 
    return totalStakedaoAsset().mul(sdecrv.getPricePerFullShare()).mul(curvePool.get_virtual_price()).div(10**36);
  }

  /**
   * @dev return how many sdecrv you can get if you burn the number of shares, after charging the fee.
   */
  function getWithdrawAmountByShares(uint256 _shares) external view returns (uint256) {
    uint256 withdrawAmount = _getWithdrawAmountByShares(_shares);
    return withdrawAmount.sub(_getWithdrawFee(withdrawAmount));
  }

  /**
   * @notice Deposits ETH into the contract and mint vault shares. 
   * @dev deposit into the curvePool, then into stakedao, then mint the shares to depositor, and emit the deposit event
   * @param minEcrv minimum amount of ecrv to get out from adding liquidity. 
   */
  function depositETH(uint256 minEcrv) external payable nonReentrant {
    notEmergency();
    actionsInitialized();
    uint256 amount = msg.value;
    require(amount > 0, 'O6');

    // the sdecrv is already deposited into the contract at this point, need to substract it from total
    uint256[2] memory amounts;
    amounts[0] = amount;
    amounts[1] = 0; // not depositing any seth

    // deposit ETH to curvePool
    curvePool.add_liquidity{value:amount}(amounts, minEcrv);

    // keep track of balance before
    uint256 totalSdecrvBalanceBeforeDeposit = totalStakedaoAsset();

    // deposit ecrv to stakedao
    address cacheSdecrvAddress = sdecrvAddress;
    IStakeDao sdecrv = IStakeDao(cacheSdecrvAddress);
    IERC20 ecrv = sdecrv.token();
    uint256 ecrvToDeposit = ecrv.balanceOf(address(this));

    ecrv.safeIncreaseAllowance(cacheSdecrvAddress, ecrvToDeposit);
    sdecrv.deposit(ecrvToDeposit);

    // mint shares and emit event 
    uint256 totalWithDepositedAmount = totalStakedaoAsset();
    require(totalWithDepositedAmount < cap, 'O7');
    uint256 sdecrvDeposited = totalWithDepositedAmount.sub(totalSdecrvBalanceBeforeDeposit);
    uint256 share = _getSharesByDepositAmount(sdecrvDeposited, totalSdecrvBalanceBeforeDeposit);

    emit Deposit(msg.sender, amount, share);

    _mint(msg.sender, share);
  }

  /**
   * @notice Withdraws ETH from vault using vault shares
   * @dev burns shares, withdraws ecrv from stakdao, withdraws ETH from curvePool
   * @param _share is the number of vault shares to be burned
   */
  function withdrawETH(uint256 _share, uint256 minEth) external nonReentrant {
    notEmergency();
    actionsInitialized();
    uint256 currentSdecrvBalance = _balance();
    uint256 sdecrvToWithdraw = _getWithdrawAmountByShares(_share);
    require(sdecrvToWithdraw <= currentSdecrvBalance, 'O8');

    _burn(msg.sender, _share);

    // withdraw from stakedao and curvePool
    IStakeDao sdecrv = IStakeDao(sdecrvAddress);
    sdecrv.withdraw(sdecrvToWithdraw);
    uint256 ecrvBalance = sdecrv.token().balanceOf(address(this));
    uint256 ethReceived = curvePool.remove_liquidity_one_coin(ecrvBalance, 0, minEth);

    // calculate fees
    uint256 fee = _getWithdrawFee(ethReceived);
    uint256 ethOwedToUser = ethReceived.sub(fee);

    // send fee to recipient 
    (bool success1, ) = feeRecipient.call{ value: fee }('');
    require(success1, 'O9');

    // send ETH to user
    (bool success2, ) = msg.sender.call{ value: ethOwedToUser }('');
    require(success2, 'O10');

    emit Withdraw(msg.sender, ethOwedToUser, fee, _share);
  }

  /**
   * @notice anyone can call this to close out the previous round by calling "closePositions" on all actions. 
   * @dev iterrate through each action, close position and withdraw funds
   */
  function closePositions() public {
    actionsInitialized();
    require(state == VaultState.Locked, "O11");
    state = VaultState.Unlocked;

    address cacheAddress = sdecrvAddress;
    for (uint8 i = 0; i < actions.length; i = i + 1) {
      // 1. close position. this should revert if any position is not ready to be closed.
      IAction(actions[i]).closePosition();

      // 2. withdraw sdecrv
      uint256 actionBalance = IERC20(cacheAddress).balanceOf(actions[i]);
      if (actionBalance > 0)
        IERC20(cacheAddress).safeTransferFrom(actions[i], address(this), actionBalance);
    }

    emit StateUpdated(VaultState.Unlocked);
  }

  /**
   * @notice can only be called when the vault is unlocked. It sets the state to locked and distributes funds to each action.
   */
  function rollOver(uint256[] calldata _allocationPercentages) external onlyOwner nonReentrant {
    actionsInitialized();
    require(_allocationPercentages.length == actions.length, 'O12');
    require(state == VaultState.Unlocked, "O13");
    state = VaultState.Locked;

    uint256 cacheTotalAsset = totalStakedaoAsset();
    uint256 cacheBase = BASE;

    // keep track of total percentage to make sure we're summing up to 100%
    uint256 sumPercentage = withdrawReserve;
    address cacheAddress = sdecrvAddress;

    for (uint8 i = 0; i < _allocationPercentages.length; i = i + 1) {
      sumPercentage = sumPercentage.add(_allocationPercentages[i]);
      require(sumPercentage <= cacheBase, 'O14');

      uint256 newAmount = cacheTotalAsset.mul(_allocationPercentages[i]).div(cacheBase);

      if (newAmount > 0) IERC20(cacheAddress).safeTransfer(actions[i], newAmount);
      IAction(actions[i]).rolloverPosition();
    }

    require(sumPercentage == cacheBase, 'O15');

    emit Rollover(_allocationPercentages);
    emit StateUpdated(VaultState.Locked);
  }

  /**
   * @dev set the vault withdrawal fee recipient
   */
  function setWithdrawalFeeRecipient(address _newWithdrawalFeeRecipient) external onlyOwner {
    feeRecipient = _newWithdrawalFeeRecipient;
  }

  /**
   * @dev set the percentage that should be reserved in vault for withdraw
   */
  function setWithdrawalFeePercentage(uint256 _newWithdrawalFeePercentage) external onlyOwner {
    withdrawalFeePercentage = _newWithdrawalFeePercentage;
  }

  /**
   * @dev set the percentage that should be reserved in vault for withdraw
   */
  function setWithdrawReserve(uint256 _reserve) external onlyOwner {
    require(_reserve < 5000, "O16");
    withdrawReserve = _reserve;
  }

  /**
   * @dev set the state to "Emergency", which disable all withdraw and deposit
   */
  function emergencyPause() external onlyOwner {
    require(state != VaultState.Emergency, "O17");

    stateBeforePause = state;
    state = VaultState.Emergency;

    emit StateUpdated(VaultState.Emergency);
  }

  /**
   * @dev set the state from "Emergency", which disable all withdraw and deposit
   */
  function resumeFromPause() external onlyOwner {
    require(state == VaultState.Emergency, "O18");

    state = stateBeforePause;

    emit StateUpdated(stateBeforePause);
  }

   /**
   * @dev return how many shares you can get if you deposit {_amount} sdecrv
   * @param _amount amount of token depositing
   */
  function getSharesByDepositAmount(uint256 _amount) external view returns (uint256) {
    return _getSharesByDepositAmount(_amount, totalStakedaoAsset());
  }

  /*=====================
   * Internal functions *
   *====================*/

  /**
   * @dev returns remaining sdecrv balance in the vault.
   */
  function _balance() internal view returns (uint256) {
    return IERC20(sdecrvAddress).balanceOf(address(this));
  }

  /**
   * @dev return how many shares you can get if you deposit {_amount} sdecrv
   * @param _amount amount of token depositing
   * @param _totalAssetAmount amont of sdecrv already in the pool before deposit
   */
  function _getSharesByDepositAmount(uint256 _amount, uint256 _totalAssetAmount) internal view returns (uint256) {
    uint256 shareSupply = totalSupply();

    // share amount
    return shareSupply == 0 ? _amount : _amount.mul(shareSupply).div(_totalAssetAmount);
  }

  /**
   * @dev return how many sdecrv you can get if you burn the number of shares
   */
  function _getWithdrawAmountByShares(uint256 _share) internal view returns (uint256) {
    // withdrawal amount
    return _share.mul(totalStakedaoAsset()).div(totalSupply());
  }

  /**
   * @dev get amount of fee charged based on total amount of weth withdrawing.
   */
  function _getWithdrawFee(uint256 _withdrawAmount) internal view returns (uint256) {
    return _withdrawAmount.mul(withdrawalFeePercentage).div(BASE);
  }

  /**
    * @notice the receive ether function is called whenever the call data is empty
    */
  receive() external payable {
    require(msg.sender == address(curvePool), "O19");
  }
}

File 2 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 3 of 12 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../utils/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.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 guidelines: functions revert instead
 * of 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 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) public {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

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

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual 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 {_setupDecimals} is
     * called.
     *
     * 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 returns (uint8) {
        return _decimals;
    }

    /**
     * @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);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        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].add(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) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is 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);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(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:
     *
     * - `to` 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 = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(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);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(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 Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal virtual {
        _decimals = decimals_;
    }

    /**
     * @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 to 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 { }
}

File 4 of 12 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        _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 make 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 5 of 12 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 6 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.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 SafeMath for uint256;
    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'
        // solhint-disable-next-line max-line-length
        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).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _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
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 8 of 12 : IAction.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.2;

interface IAction {
  /**
   * The function used to determin how much asset the current action is controlling.
   * this will impact the withdraw and deposit amount calculated from the vault.
   */
  function currentValue() external view returns (uint256);

  /**
   * The function for the vault to call at the end of each vault's round.
   * after calling this function, the vault will try to pull assets back from the action and enable withdraw.
   */
  function closePosition() external;

  /**
   * The function for the vault to call when the vault is ready to start the next round.
   * the vault will push assets to action before calling this function, but the amount can change compare to 
   * the last round. So each action should check their asset balance instead of using any cached balance.
   *
   * Each action can also add additional checks and revert the `rolloverPosition` call if the action 
   * is not ready to go into the next round.
   */
  function rolloverPosition() external;
}

File 9 of 12 : ICurve.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.2;
pragma experimental ABIEncoderV2;

interface ICurve {
  function add_liquidity(uint256[2] memory amounts, uint256 minAmount) external payable returns (uint256);

  function remove_liquidity_one_coin(uint256 _token_amount, int128 i, uint256 _minAmount) external returns (uint256);

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

File 10 of 12 : IStakeDao.sol
// SPDX-License-Identifier: MIT

import { IERC20 } from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

pragma solidity ^0.7.2;
pragma experimental ABIEncoderV2;

interface IStakeDao {
  function depositAll() external;

  function deposit(uint256 amount) external;

  function withdrawAll() external;

  function withdraw(uint256 _shares) external;

  function token() external returns (IERC20);

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

  function approve(address spender, uint256 amount) external returns (bool);

  function transfer(address recipient, uint256 amount) external returns (bool);

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

File 11 of 12 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 12 of 12 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <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;
        // solhint-disable-next-line no-inline-assembly
        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");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (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");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_sdecrvAddress","type":"address"},{"internalType":"address","name":"_curvePool","type":"address"},{"internalType":"address","name":"_feeRecipient","type":"address"},{"internalType":"string","name":"_tokenName","type":"string"},{"internalType":"string","name":"_tokenSymbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newCap","type":"uint256"}],"name":"CapUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountDeposited","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shareMinted","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"allocations","type":"uint256[]"}],"name":"Rollover","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum OpynPerpVault.VaultState","name":"state","type":"uint8"}],"name":"StateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountWithdrawn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shareBurned","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"actions","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closePositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"curvePool","outputs":[{"internalType":"contract ICurve","name":"","type":"address"}],"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":"minEcrv","type":"uint256"}],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"emergencyPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"getSharesByDepositAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"getWithdrawAmountByShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resumeFromPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_allocationPercentages","type":"uint256[]"}],"name":"rollOver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sdecrvAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_actions","type":"address[]"}],"name":"setActions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newCap","type":"uint256"}],"name":"setCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_reserve","type":"uint256"}],"name":"setWithdrawReserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newWithdrawalFeePercentage","type":"uint256"}],"name":"setWithdrawalFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newWithdrawalFeeRecipient","type":"address"}],"name":"setWithdrawalFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"state","outputs":[{"internalType":"enum OpynPerpVault.VaultState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stateBeforePause","outputs":[{"internalType":"enum OpynPerpVault.VaultState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalETHControlled","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStakedaoAsset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"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":[{"internalType":"uint256","name":"_share","type":"uint256"},{"internalType":"uint256","name":"minEth","type":"uint256"}],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawalFeePercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052683635c9adc5dea00000600b556032600c556000600d553480156200002857600080fd5b50604051620036f7380380620036f78339810160408190526200004b91620002a3565b815182908290620000649060039060208501906200013f565b5080516200007a9060049060208401906200013f565b50506005805460ff1916601217905550600160065560006200009b6200013b565b600780546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35050600a80546001600160a01b039586166001600160a01b031991821617909155600980549386169382169390931790925550600e80549290931691161760ff60a01b1916600160a11b17905562000343565b3390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620001775760008555620001c2565b82601f106200019257805160ff1916838001178555620001c2565b82800160010185558215620001c2579182015b82811115620001c2578251825591602001919060010190620001a5565b50620001d0929150620001d4565b5090565b5b80821115620001d05760008155600101620001d5565b80516001600160a01b03811681146200020357600080fd5b919050565b600082601f83011262000219578081fd5b81516001600160401b03808211156200022e57fe5b6040516020601f8401601f19168201810183811183821017156200024e57fe5b604052838252858401810187101562000265578485fd5b8492505b8383101562000288578583018101518284018201529182019162000269565b838311156200029957848185840101525b5095945050505050565b600080600080600060a08688031215620002bb578081fd5b620002c686620001eb565b9450620002d660208701620001eb565b9350620002e660408701620001eb565b60608701519093506001600160401b038082111562000303578283fd5b6200031189838a0162000208565b9350608088015191508082111562000327578283fd5b50620003368882890162000208565b9150509295509295909350565b6133a480620003536000396000f3fe6080604052600436106102345760003560e01c80635fb0ea901161012e578063a457c2d7116100ab578063cd3666921161006f578063cd3666921461062c578063dd62ed3e1461064c578063ec342ad01461066c578063f2fde38b14610681578063f90ae81c146106a15761026e565b8063a457c2d7146105a2578063a9059cbb146105c2578063ace1fab1146105e2578063c19d93fb146105f7578063c7cdea371461060c5761026e565b806383240f83116100f257806383240f83146105215780638d64fd60146105415780638da5cb5b1461056357806395d89b411461057857806397859a311461058d5761026e565b80635fb0ea901461049757806370a08231146104b757806370cf046e146104d7578063715018a6146104f757806378922c8f1461050c5761026e565b8063313ce567116101bc57806347786d371161018057806347786d371461041a57806351858e271461043a5780635358fbda1461044f57806356b97299146104625780635a5d6dae146104825761026e565b8063313ce56714610399578063355274ea146103bb57806339509351146103d05780633efe82d9146103f057806346904840146104055761026e565b80631c36f8bc116102035780631c36f8bc1461030d578063218751b21461032257806323b872dd146103445780632c507048146103645780632c98e25d146103845761026e565b806306fdde0314610273578063095ea7b31461029e57806313edaab4146102cb57806318160ddd146102f85761026e565b3661026e57600e546001600160a01b0316331461026c5760405162461bcd60e51b815260040161026390612f4c565b60405180910390fd5b005b600080fd5b34801561027f57600080fd5b506102886106c1565b6040516102959190612ec0565b60405180910390f35b3480156102aa57600080fd5b506102be6102b9366004612c15565b610757565b6040516102959190612ea1565b3480156102d757600080fd5b506102eb6102e6366004612d80565b610775565b6040516102959190613131565b34801561030457600080fd5b506102eb610790565b34801561031957600080fd5b506102eb610796565b34801561032e57600080fd5b50610337610864565b6040516102959190612dd4565b34801561035057600080fd5b506102be61035f366004612bd5565b610873565b34801561037057600080fd5b5061026c61037f366004612cf5565b6108fb565b34801561039057600080fd5b5061026c610c1b565b3480156103a557600080fd5b506103ae610d17565b6040516102959190613153565b3480156103c757600080fd5b506102eb610d20565b3480156103dc57600080fd5b506102be6103eb366004612c15565b610d26565b3480156103fc57600080fd5b50610337610d74565b34801561041157600080fd5b50610337610d83565b34801561042657600080fd5b5061026c610435366004612d80565b610d92565b34801561044657600080fd5b5061026c610e34565b61026c61045d366004612d80565b610f27565b34801561046e57600080fd5b5061026c61047d366004612d80565b611270565b34801561048e57600080fd5b506102eb6112f8565b3480156104a357600080fd5b5061026c6104b2366004612d80565b611420565b3480156104c357600080fd5b506102eb6104d2366004612b81565b611487565b3480156104e357600080fd5b506102eb6104f2366004612d80565b6114a2565b34801561050357600080fd5b5061026c6114c3565b34801561051857600080fd5b506102eb61156f565b34801561052d57600080fd5b5061033761053c366004612d80565b611575565b34801561054d57600080fd5b5061055661159f565b6040516102959190612eac565b34801561056f57600080fd5b506103376115af565b34801561058457600080fd5b506102886115be565b34801561059957600080fd5b5061026c61161f565b3480156105ae57600080fd5b506102be6105bd366004612c15565b611807565b3480156105ce57600080fd5b506102be6105dd366004612c15565b61186f565b3480156105ee57600080fd5b506102eb611883565b34801561060357600080fd5b50610556611889565b34801561061857600080fd5b5061026c610627366004612db0565b611899565b34801561063857600080fd5b5061026c610647366004612c40565b611c95565b34801561065857600080fd5b506102eb610667366004612b9d565b611e2c565b34801561067857600080fd5b506102eb611e57565b34801561068d57600080fd5b5061026c61069c366004612b81565b611e5d565b3480156106ad57600080fd5b5061026c6106bc366004612b81565b611f60565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561074d5780601f106107225761010080835404028352916020019161074d565b820191906000526020600020905b81548152906001019060200180831161073057829003601f168201915b5050505050905090565b600061076b610764611fe4565b8484611fe8565b5060015b92915050565b600061078882610783610796565b6120d4565b90505b919050565b60025490565b6008546000908190815b8181101561084a57610840600882815481106107b857fe5b6000918252602091829020015460408051630d3132df60e31b815290516001600160a01b039092169263698996f892600480840193829003018186803b15801561080157600080fd5b505afa158015610815573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108399190612d98565b8490612104565b92506001016107a0565b5061085d8261085761215e565b90612104565b9250505090565b600e546001600160a01b031681565b60006108808484846121e4565b6108f08461088c611fe4565b6108eb8560405180606001604052806028815260200161326e602891396001600160a01b038a166000908152600160205260408120906108ca611fe4565b6001600160a01b03168152602081019190915260400160002054919061233f565b611fe8565b5060015b9392505050565b610903611fe4565b6001600160a01b03166109146115af565b6001600160a01b03161461095d576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b600260065414156109b5576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026006556109c26123d6565b60085481146109e35760405162461bcd60e51b8152600401610263906130a2565b6002600e54600160a01b900460ff1660028111156109fd57fe5b14610a1a5760405162461bcd60e51b8152600401610263906130bf565b600e805460ff60a01b1916600160a01b1790556000610a37610796565b600d54600a54919250612710916001600160a01b031660005b60ff8116861115610b8f57610a8387878360ff16818110610a6d57fe5b905060200201358461210490919063ffffffff16565b925083831115610aa55760405162461bcd60e51b8152600401610263906130dc565b6000610ad985610ad38a8a8660ff16818110610abd57fe5b90506020020135896123f790919063ffffffff16565b90612450565b90508015610b1357610b1360088360ff1681548110610af457fe5b6000918252602090912001546001600160a01b038581169116836124b7565b60088260ff1681548110610b2357fe5b600091825260208220015460408051630fcbbccb60e41b815290516001600160a01b039092169263fcbbccb09260048084019382900301818387803b158015610b6b57600080fd5b505af1158015610b7f573d6000803e3d6000fd5b5050505050806001019050610a50565b50828214610baf5760405162461bcd60e51b815260040161026390612f85565b7f208d5f48745fe6e322f9885ee63d75875a3325c8c80eb378c080dff1659989cd8686604051610be0929190612e67565b60405180910390a160008051602061322d8339815191526001604051610c069190612eac565b60405180910390a15050600160065550505050565b610c23611fe4565b6001600160a01b0316610c346115af565b6001600160a01b031614610c7d576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b6000600e54600160a01b900460ff166002811115610c9757fe5b14610cb45760405162461bcd60e51b81526004016102639061302f565b600e805460ff600160a81b820416919060ff60a01b1916600160a01b836002811115610cdc57fe5b021790555060008051602061322d833981519152600e60159054906101000a900460ff16604051610d0d9190612eac565b60405180910390a1565b60055460ff1690565b600b5481565b600061076b610d33611fe4565b846108eb8560016000610d44611fe4565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612104565b600a546001600160a01b031681565b6009546001600160a01b031681565b610d9a611fe4565b6001600160a01b0316610dab6115af565b6001600160a01b031614610df4576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b600b8190556040517f3c8eb7c49d332f4c1e4d92a27cda93c31cc9452f7a408e0c6109fcddbc9946ea90610e29908390613131565b60405180910390a150565b610e3c611fe4565b6001600160a01b0316610e4d6115af565b6001600160a01b031614610e96576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b6000600e54600160a01b900460ff166002811115610eb057fe5b1415610ece5760405162461bcd60e51b815260040161026390613012565b600e805460ff600160a01b820416919060ff60a81b1916600160a81b836002811115610ef657fe5b0217905550600e805460ff60a01b1916905560405160008051602061322d83398151915290610d0d90600090612eac565b60026006541415610f7f576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600655610f8c61250e565b610f946123d6565b3480610fb25760405162461bcd60e51b815260040161026390612fbe565b610fba612b58565b81815260006020820152600e54604051630b4c7e4d60e01b81526001600160a01b0390911690630b4c7e4d908490610ff89085908890600401612e2f565b6020604051808303818588803b15801561101157600080fd5b505af1158015611025573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061104a9190612d98565b506000611055610796565b600a5460408051637e062a3560e11b815290519293506001600160a01b03909116918291600091839163fc0c546a91600480830192602092919082900301818787803b1580156110a457600080fd5b505af11580156110b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dc9190612d64565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161110c9190612dd4565b60206040518083038186803b15801561112457600080fd5b505afa158015611138573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115c9190612d98565b90506111726001600160a01b0383168583612546565b60405163b6b55f2560e01b81526001600160a01b0384169063b6b55f259061119e908490600401613131565b600060405180830381600087803b1580156111b857600080fd5b505af11580156111cc573d6000803e3d6000fd5b5050505060006111da610796565b9050600b5481106111fd5760405162461bcd60e51b815260040161026390612ff6565b60006112098288612637565b9050600061121782896120d4565b90507f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15338b8360405161124c93929190612de8565b60405180910390a161125e3382612694565b50506001600655505050505050505050565b611278611fe4565b6001600160a01b03166112896115af565b6001600160a01b0316146112d2576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b61138881106112f35760405162461bcd60e51b815260040161026390613068565b600d55565b600a54600e5460408051630176f71760e71b815290516000936001600160a01b039081169361141a936ec097ce7bc90715b34b9f100000000093610ad3939092169163bb7b8b8091600480820192602092909190829003018186803b15801561136057600080fd5b505afa158015611374573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113989190612d98565b611414856001600160a01b03166377c7b8fc6040518163ffffffff1660e01b815260040160206040518083038186803b1580156113d457600080fd5b505afa1580156113e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140c9190612d98565b611414610796565b906123f7565b91505090565b611428611fe4565b6001600160a01b03166114396115af565b6001600160a01b031614611482576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b600c55565b6001600160a01b031660009081526020819052604090205490565b6000806114ae83612784565b90506108f46114bc826127a3565b8290612637565b6114cb611fe4565b6001600160a01b03166114dc6115af565b6001600160a01b031614611525576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b6007546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600780546001600160a01b0319169055565b600c5481565b6008818154811061158557600080fd5b6000918252602090912001546001600160a01b0316905081565b600e54600160a81b900460ff1681565b6007546001600160a01b031690565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561074d5780601f106107225761010080835404028352916020019161074d565b6116276123d6565b6001600e54600160a01b900460ff16600281111561164157fe5b1461165e5760405162461bcd60e51b815260040161026390612f2f565b600e805460ff60a01b1916600160a11b179055600a546001600160a01b031660005b60085460ff821610156117e85760088160ff168154811061169d57fe5b60009182526020822001546040805163c393d0e360e01b815290516001600160a01b039092169263c393d0e39260048084019382900301818387803b1580156116e557600080fd5b505af11580156116f9573d6000803e3d6000fd5b505050506000826001600160a01b03166370a0823160088460ff168154811061171e57fe5b6000918252602090912001546040516001600160e01b031960e084901b168152611754916001600160a01b031690600401612dd4565b60206040518083038186803b15801561176c57600080fd5b505afa158015611780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a49190612d98565b905080156117df576117df60088360ff16815481106117bf57fe5b6000918252602090912001546001600160a01b03858116911630846127c0565b50600101611680565b5060008051602061322d8339815191526002604051610e299190612eac565b600061076b611814611fe4565b846108eb8560405180606001604052806025815260200161334a602591396001600061183e611fe4565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061233f565b600061076b61187c611fe4565b84846121e4565b600d5481565b600e54600160a01b900460ff1681565b600260065414156118f1576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026006556118fe61250e565b6119066123d6565b600061191061215e565b9050600061191d84612784565b90508181111561193f5760405162461bcd60e51b815260040161026390612fda565b611949338561281a565b600a54604051632e1a7d4d60e01b81526001600160a01b03909116908190632e1a7d4d9061197b908590600401613131565b600060405180830381600087803b15801561199557600080fd5b505af11580156119a9573d6000803e3d6000fd5b505050506000816001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156119ea57600080fd5b505af11580156119fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a229190612d64565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401611a4d9190612dd4565b60206040518083038186803b158015611a6557600080fd5b505afa158015611a79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9d9190612d98565b600e54604051630d2680e960e11b81529192506000916001600160a01b0390911690631a4d01d290611ad790859085908b9060040161313a565b602060405180830381600087803b158015611af157600080fd5b505af1158015611b05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b299190612d98565b90506000611b36826127a3565b90506000611b448383612637565b6009546040519192506000916001600160a01b03909116908490611b6790612dd1565b60006040518083038185875af1925050503d8060008114611ba4576040519150601f19603f3d011682016040523d82523d6000602084013e611ba9565b606091505b5050905080611bca5760405162461bcd60e51b815260040161026390612f13565b6000336001600160a01b031683604051611be390612dd1565b60006040518083038185875af1925050503d8060008114611c20576040519150601f19603f3d011682016040523d82523d6000602084013e611c25565b606091505b5050905080611c465760405162461bcd60e51b815260040161026390613085565b7f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca943384868e604051611c7b9493929190612e09565b60405180910390a150506001600655505050505050505050565b611c9d611fe4565b6001600160a01b0316611cae6115af565b6001600160a01b031614611cf7576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b60085415611d175760405162461bcd60e51b815260040161026390612fa2565b60005b8151811015611e285760006001600160a01b0316828281518110611d3a57fe5b60200260200101516001600160a01b03161415611d695760405162461bcd60e51b815260040161026390613115565b60005b81811015611dd457828181518110611d8057fe5b60200260200101516001600160a01b0316838381518110611d9d57fe5b60200260200101516001600160a01b03161415611dcc5760405162461bcd60e51b815260040161026390612f69565b600101611d6c565b506008828281518110611de357fe5b60209081029190910181015182546001808201855560009485529290932090920180546001600160a01b0319166001600160a01b039093169290921790915501611d1a565b5050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61271081565b611e65611fe4565b6001600160a01b0316611e766115af565b6001600160a01b031614611ebf576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b6001600160a01b038116611f045760405162461bcd60e51b81526004018080602001828103825260268152602001806131bf6026913960400191505060405180910390fd5b6007546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600780546001600160a01b0319166001600160a01b0392909216919091179055565b611f68611fe4565b6001600160a01b0316611f796115af565b6001600160a01b031614611fc2576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6001600160a01b03831661202d5760405162461bcd60e51b81526004018080602001828103825260248152602001806132fc6024913960400191505060405180910390fd5b6001600160a01b0382166120725760405162461bcd60e51b81526004018080602001828103825260228152602001806131e56022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6000806120df610790565b905080156120fa576120f583610ad386846123f7565b6120fc565b835b949350505050565b6000828201838110156108f4576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600a546040516370a0823160e01b81526000916001600160a01b0316906370a082319061218f903090600401612dd4565b60206040518083038186803b1580156121a757600080fd5b505afa1580156121bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121df9190612d98565b905090565b6001600160a01b0383166122295760405162461bcd60e51b81526004018080602001828103825260258152602001806132d76025913960400191505060405180910390fd5b6001600160a01b03821661226e5760405162461bcd60e51b815260040180806020018281038252602381526020018061317a6023913960400191505060405180910390fd5b612279838383612509565b6122b681604051806060016040528060268152602001613207602691396001600160a01b038616600090815260208190526040902054919061233f565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546122e59082612104565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156123ce5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561239357818101518382015260200161237b565b50505050905090810190601f1680156123c05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6008546123f55760405162461bcd60e51b8152600401610263906130f9565b565b6000826124065750600061076f565b8282028284828161241357fe5b04146108f45760405162461bcd60e51b815260040180806020018281038252602181526020018061324d6021913960400191505060405180910390fd5b60008082116124a6576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816124af57fe5b049392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612509908490612916565b505050565b6000600e54600160a01b900460ff16600281111561252857fe5b14156123f55760405162461bcd60e51b81526004016102639061304c565b60006125dc82856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b1580156125aa57600080fd5b505afa1580156125be573d6000803e3d6000fd5b505050506040513d60208110156125d457600080fd5b505190612104565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052909150612631908590612916565b50505050565b60008282111561268e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b0382166126ef576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6126fb60008383612509565b6002546127089082612104565b6002556001600160a01b03821660009081526020819052604090205461272e9082612104565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000610788612791610790565b610ad361279c610796565b85906123f7565b6000610788612710610ad3600c54856123f790919063ffffffff16565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612631908590612916565b6001600160a01b03821661285f5760405162461bcd60e51b81526004018080602001828103825260218152602001806132b66021913960400191505060405180910390fd5b61286b82600083612509565b6128a88160405180606001604052806022815260200161319d602291396001600160a01b038516600090815260208190526040902054919061233f565b6001600160a01b0383166000908152602081905260409020556002546128ce9082612637565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600061296b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129c79092919063ffffffff16565b8051909150156125095780806020019051602081101561298a57600080fd5b50516125095760405162461bcd60e51b815260040180806020018281038252602a815260200180613320602a913960400191505060405180910390fd5b60606120fc8484600085856129db85612aec565b612a2c576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310612a6a5780518252601f199092019160209182019101612a4b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612acc576040519150601f19603f3d011682016040523d82523d6000602084013e612ad1565b606091505b5091509150612ae1828286612af2565b979650505050505050565b3b151590565b60608315612b015750816108f4565b825115612b115782518084602001fd5b60405162461bcd60e51b815260206004820181815284516024840152845185939192839260440191908501908083836000831561239357818101518382015260200161237b565b60405180604001604052806002906020820280368337509192915050565b803561078b81613161565b600060208284031215612b92578081fd5b81356108f481613161565b60008060408385031215612baf578081fd5b8235612bba81613161565b91506020830135612bca81613161565b809150509250929050565b600080600060608486031215612be9578081fd5b8335612bf481613161565b92506020840135612c0481613161565b929592945050506040919091013590565b60008060408385031215612c27578182fd5b8235612c3281613161565b946020939093013593505050565b60006020808385031215612c52578182fd5b823567ffffffffffffffff80821115612c69578384fd5b818501915085601f830112612c7c578384fd5b813581811115612c8857fe5b83810260405185828201018181108582111715612ca157fe5b604052828152858101935084860182860187018a1015612cbf578788fd5b8795505b83861015612ce857612cd481612b76565b855260019590950194938601938601612cc3565b5098975050505050505050565b60008060208385031215612d07578182fd5b823567ffffffffffffffff80821115612d1e578384fd5b818501915085601f830112612d31578384fd5b813581811115612d3f578485fd5b8660208083028501011115612d52578485fd5b60209290920196919550909350505050565b600060208284031215612d75578081fd5b81516108f481613161565b600060208284031215612d91578081fd5b5035919050565b600060208284031215612da9578081fd5b5051919050565b60008060408385031215612dc2578182fd5b50508035926020909101359150565b90565b6001600160a01b0391909116815260200190565b6001600160a01b039390931683526020830191909152604082015260600190565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b60608101818460005b6002811015612e57578151835260209283019290910190600101612e38565b5050508260408301529392505050565b6020808252810182905260006001600160fb1b03831115612e86578081fd5b60208302808560408501379190910160400190815292915050565b901515815260200190565b6020810160038310612eba57fe5b91905290565b6000602080835283518082850152825b81811015612eec57858101830151858201604001528201612ed0565b81811115612efd5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600290820152614f3960f01b604082015260600190565b6020808252600390820152624f313160e81b604082015260600190565b6020808252600390820152624f313960e81b604082015260600190565b6020808252600290820152614f3560f01b604082015260600190565b6020808252600390820152624f313560e81b604082015260600190565b6020808252600290820152614f3360f01b604082015260600190565b602080825260029082015261279b60f11b604082015260600190565b60208082526002908201526109e760f31b604082015260600190565b6020808252600290820152614f3760f01b604082015260600190565b6020808252600390820152624f313760e81b604082015260600190565b60208082526003908201526209e62760eb1b604082015260600190565b602080825260029082015261279960f11b604082015260600190565b60208082526003908201526227989b60e91b604082015260600190565b60208082526003908201526204f31360ec1b604082015260600190565b60208082526003908201526227989960e91b604082015260600190565b6020808252600390820152624f313360e81b604082015260600190565b60208082526003908201526213cc4d60ea1b604082015260600190565b6020808252600290820152614f3160f01b604082015260600190565b60208082526002908201526113cd60f21b604082015260600190565b90815260200190565b928352600f9190910b6020830152604082015260600190565b60ff91909116815260200190565b6001600160a01b038116811461317657600080fd5b5056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636523ad33ab6a13a00aa7d06cd167b2abd03dec86af3cf3cc91759dcd3ae8411887536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f48ad6399e605c910d0d220b20c62570b7e07f974dc000586015bb61a7b03af964736f6c63430007060033000000000000000000000000a2761b0539374eb7af2155f76eb09864af075250000000000000000000000000c5424b857f758e906013f3555dad202e4bdb4567000000000000000000000000b36a0671b3d49587236d7833b01e79798175875f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000225374616b6544414f2045544820436f76657265642043616c6c20537472617465677900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000107364455448436f766572656443616c6c00000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106102345760003560e01c80635fb0ea901161012e578063a457c2d7116100ab578063cd3666921161006f578063cd3666921461062c578063dd62ed3e1461064c578063ec342ad01461066c578063f2fde38b14610681578063f90ae81c146106a15761026e565b8063a457c2d7146105a2578063a9059cbb146105c2578063ace1fab1146105e2578063c19d93fb146105f7578063c7cdea371461060c5761026e565b806383240f83116100f257806383240f83146105215780638d64fd60146105415780638da5cb5b1461056357806395d89b411461057857806397859a311461058d5761026e565b80635fb0ea901461049757806370a08231146104b757806370cf046e146104d7578063715018a6146104f757806378922c8f1461050c5761026e565b8063313ce567116101bc57806347786d371161018057806347786d371461041a57806351858e271461043a5780635358fbda1461044f57806356b97299146104625780635a5d6dae146104825761026e565b8063313ce56714610399578063355274ea146103bb57806339509351146103d05780633efe82d9146103f057806346904840146104055761026e565b80631c36f8bc116102035780631c36f8bc1461030d578063218751b21461032257806323b872dd146103445780632c507048146103645780632c98e25d146103845761026e565b806306fdde0314610273578063095ea7b31461029e57806313edaab4146102cb57806318160ddd146102f85761026e565b3661026e57600e546001600160a01b0316331461026c5760405162461bcd60e51b815260040161026390612f4c565b60405180910390fd5b005b600080fd5b34801561027f57600080fd5b506102886106c1565b6040516102959190612ec0565b60405180910390f35b3480156102aa57600080fd5b506102be6102b9366004612c15565b610757565b6040516102959190612ea1565b3480156102d757600080fd5b506102eb6102e6366004612d80565b610775565b6040516102959190613131565b34801561030457600080fd5b506102eb610790565b34801561031957600080fd5b506102eb610796565b34801561032e57600080fd5b50610337610864565b6040516102959190612dd4565b34801561035057600080fd5b506102be61035f366004612bd5565b610873565b34801561037057600080fd5b5061026c61037f366004612cf5565b6108fb565b34801561039057600080fd5b5061026c610c1b565b3480156103a557600080fd5b506103ae610d17565b6040516102959190613153565b3480156103c757600080fd5b506102eb610d20565b3480156103dc57600080fd5b506102be6103eb366004612c15565b610d26565b3480156103fc57600080fd5b50610337610d74565b34801561041157600080fd5b50610337610d83565b34801561042657600080fd5b5061026c610435366004612d80565b610d92565b34801561044657600080fd5b5061026c610e34565b61026c61045d366004612d80565b610f27565b34801561046e57600080fd5b5061026c61047d366004612d80565b611270565b34801561048e57600080fd5b506102eb6112f8565b3480156104a357600080fd5b5061026c6104b2366004612d80565b611420565b3480156104c357600080fd5b506102eb6104d2366004612b81565b611487565b3480156104e357600080fd5b506102eb6104f2366004612d80565b6114a2565b34801561050357600080fd5b5061026c6114c3565b34801561051857600080fd5b506102eb61156f565b34801561052d57600080fd5b5061033761053c366004612d80565b611575565b34801561054d57600080fd5b5061055661159f565b6040516102959190612eac565b34801561056f57600080fd5b506103376115af565b34801561058457600080fd5b506102886115be565b34801561059957600080fd5b5061026c61161f565b3480156105ae57600080fd5b506102be6105bd366004612c15565b611807565b3480156105ce57600080fd5b506102be6105dd366004612c15565b61186f565b3480156105ee57600080fd5b506102eb611883565b34801561060357600080fd5b50610556611889565b34801561061857600080fd5b5061026c610627366004612db0565b611899565b34801561063857600080fd5b5061026c610647366004612c40565b611c95565b34801561065857600080fd5b506102eb610667366004612b9d565b611e2c565b34801561067857600080fd5b506102eb611e57565b34801561068d57600080fd5b5061026c61069c366004612b81565b611e5d565b3480156106ad57600080fd5b5061026c6106bc366004612b81565b611f60565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561074d5780601f106107225761010080835404028352916020019161074d565b820191906000526020600020905b81548152906001019060200180831161073057829003601f168201915b5050505050905090565b600061076b610764611fe4565b8484611fe8565b5060015b92915050565b600061078882610783610796565b6120d4565b90505b919050565b60025490565b6008546000908190815b8181101561084a57610840600882815481106107b857fe5b6000918252602091829020015460408051630d3132df60e31b815290516001600160a01b039092169263698996f892600480840193829003018186803b15801561080157600080fd5b505afa158015610815573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108399190612d98565b8490612104565b92506001016107a0565b5061085d8261085761215e565b90612104565b9250505090565b600e546001600160a01b031681565b60006108808484846121e4565b6108f08461088c611fe4565b6108eb8560405180606001604052806028815260200161326e602891396001600160a01b038a166000908152600160205260408120906108ca611fe4565b6001600160a01b03168152602081019190915260400160002054919061233f565b611fe8565b5060015b9392505050565b610903611fe4565b6001600160a01b03166109146115af565b6001600160a01b03161461095d576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b600260065414156109b5576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026006556109c26123d6565b60085481146109e35760405162461bcd60e51b8152600401610263906130a2565b6002600e54600160a01b900460ff1660028111156109fd57fe5b14610a1a5760405162461bcd60e51b8152600401610263906130bf565b600e805460ff60a01b1916600160a01b1790556000610a37610796565b600d54600a54919250612710916001600160a01b031660005b60ff8116861115610b8f57610a8387878360ff16818110610a6d57fe5b905060200201358461210490919063ffffffff16565b925083831115610aa55760405162461bcd60e51b8152600401610263906130dc565b6000610ad985610ad38a8a8660ff16818110610abd57fe5b90506020020135896123f790919063ffffffff16565b90612450565b90508015610b1357610b1360088360ff1681548110610af457fe5b6000918252602090912001546001600160a01b038581169116836124b7565b60088260ff1681548110610b2357fe5b600091825260208220015460408051630fcbbccb60e41b815290516001600160a01b039092169263fcbbccb09260048084019382900301818387803b158015610b6b57600080fd5b505af1158015610b7f573d6000803e3d6000fd5b5050505050806001019050610a50565b50828214610baf5760405162461bcd60e51b815260040161026390612f85565b7f208d5f48745fe6e322f9885ee63d75875a3325c8c80eb378c080dff1659989cd8686604051610be0929190612e67565b60405180910390a160008051602061322d8339815191526001604051610c069190612eac565b60405180910390a15050600160065550505050565b610c23611fe4565b6001600160a01b0316610c346115af565b6001600160a01b031614610c7d576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b6000600e54600160a01b900460ff166002811115610c9757fe5b14610cb45760405162461bcd60e51b81526004016102639061302f565b600e805460ff600160a81b820416919060ff60a01b1916600160a01b836002811115610cdc57fe5b021790555060008051602061322d833981519152600e60159054906101000a900460ff16604051610d0d9190612eac565b60405180910390a1565b60055460ff1690565b600b5481565b600061076b610d33611fe4565b846108eb8560016000610d44611fe4565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612104565b600a546001600160a01b031681565b6009546001600160a01b031681565b610d9a611fe4565b6001600160a01b0316610dab6115af565b6001600160a01b031614610df4576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b600b8190556040517f3c8eb7c49d332f4c1e4d92a27cda93c31cc9452f7a408e0c6109fcddbc9946ea90610e29908390613131565b60405180910390a150565b610e3c611fe4565b6001600160a01b0316610e4d6115af565b6001600160a01b031614610e96576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b6000600e54600160a01b900460ff166002811115610eb057fe5b1415610ece5760405162461bcd60e51b815260040161026390613012565b600e805460ff600160a01b820416919060ff60a81b1916600160a81b836002811115610ef657fe5b0217905550600e805460ff60a01b1916905560405160008051602061322d83398151915290610d0d90600090612eac565b60026006541415610f7f576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600655610f8c61250e565b610f946123d6565b3480610fb25760405162461bcd60e51b815260040161026390612fbe565b610fba612b58565b81815260006020820152600e54604051630b4c7e4d60e01b81526001600160a01b0390911690630b4c7e4d908490610ff89085908890600401612e2f565b6020604051808303818588803b15801561101157600080fd5b505af1158015611025573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061104a9190612d98565b506000611055610796565b600a5460408051637e062a3560e11b815290519293506001600160a01b03909116918291600091839163fc0c546a91600480830192602092919082900301818787803b1580156110a457600080fd5b505af11580156110b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110dc9190612d64565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161110c9190612dd4565b60206040518083038186803b15801561112457600080fd5b505afa158015611138573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115c9190612d98565b90506111726001600160a01b0383168583612546565b60405163b6b55f2560e01b81526001600160a01b0384169063b6b55f259061119e908490600401613131565b600060405180830381600087803b1580156111b857600080fd5b505af11580156111cc573d6000803e3d6000fd5b5050505060006111da610796565b9050600b5481106111fd5760405162461bcd60e51b815260040161026390612ff6565b60006112098288612637565b9050600061121782896120d4565b90507f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15338b8360405161124c93929190612de8565b60405180910390a161125e3382612694565b50506001600655505050505050505050565b611278611fe4565b6001600160a01b03166112896115af565b6001600160a01b0316146112d2576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b61138881106112f35760405162461bcd60e51b815260040161026390613068565b600d55565b600a54600e5460408051630176f71760e71b815290516000936001600160a01b039081169361141a936ec097ce7bc90715b34b9f100000000093610ad3939092169163bb7b8b8091600480820192602092909190829003018186803b15801561136057600080fd5b505afa158015611374573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113989190612d98565b611414856001600160a01b03166377c7b8fc6040518163ffffffff1660e01b815260040160206040518083038186803b1580156113d457600080fd5b505afa1580156113e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140c9190612d98565b611414610796565b906123f7565b91505090565b611428611fe4565b6001600160a01b03166114396115af565b6001600160a01b031614611482576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b600c55565b6001600160a01b031660009081526020819052604090205490565b6000806114ae83612784565b90506108f46114bc826127a3565b8290612637565b6114cb611fe4565b6001600160a01b03166114dc6115af565b6001600160a01b031614611525576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b6007546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600780546001600160a01b0319169055565b600c5481565b6008818154811061158557600080fd5b6000918252602090912001546001600160a01b0316905081565b600e54600160a81b900460ff1681565b6007546001600160a01b031690565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561074d5780601f106107225761010080835404028352916020019161074d565b6116276123d6565b6001600e54600160a01b900460ff16600281111561164157fe5b1461165e5760405162461bcd60e51b815260040161026390612f2f565b600e805460ff60a01b1916600160a11b179055600a546001600160a01b031660005b60085460ff821610156117e85760088160ff168154811061169d57fe5b60009182526020822001546040805163c393d0e360e01b815290516001600160a01b039092169263c393d0e39260048084019382900301818387803b1580156116e557600080fd5b505af11580156116f9573d6000803e3d6000fd5b505050506000826001600160a01b03166370a0823160088460ff168154811061171e57fe5b6000918252602090912001546040516001600160e01b031960e084901b168152611754916001600160a01b031690600401612dd4565b60206040518083038186803b15801561176c57600080fd5b505afa158015611780573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a49190612d98565b905080156117df576117df60088360ff16815481106117bf57fe5b6000918252602090912001546001600160a01b03858116911630846127c0565b50600101611680565b5060008051602061322d8339815191526002604051610e299190612eac565b600061076b611814611fe4565b846108eb8560405180606001604052806025815260200161334a602591396001600061183e611fe4565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061233f565b600061076b61187c611fe4565b84846121e4565b600d5481565b600e54600160a01b900460ff1681565b600260065414156118f1576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026006556118fe61250e565b6119066123d6565b600061191061215e565b9050600061191d84612784565b90508181111561193f5760405162461bcd60e51b815260040161026390612fda565b611949338561281a565b600a54604051632e1a7d4d60e01b81526001600160a01b03909116908190632e1a7d4d9061197b908590600401613131565b600060405180830381600087803b15801561199557600080fd5b505af11580156119a9573d6000803e3d6000fd5b505050506000816001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156119ea57600080fd5b505af11580156119fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a229190612d64565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401611a4d9190612dd4565b60206040518083038186803b158015611a6557600080fd5b505afa158015611a79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a9d9190612d98565b600e54604051630d2680e960e11b81529192506000916001600160a01b0390911690631a4d01d290611ad790859085908b9060040161313a565b602060405180830381600087803b158015611af157600080fd5b505af1158015611b05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b299190612d98565b90506000611b36826127a3565b90506000611b448383612637565b6009546040519192506000916001600160a01b03909116908490611b6790612dd1565b60006040518083038185875af1925050503d8060008114611ba4576040519150601f19603f3d011682016040523d82523d6000602084013e611ba9565b606091505b5050905080611bca5760405162461bcd60e51b815260040161026390612f13565b6000336001600160a01b031683604051611be390612dd1565b60006040518083038185875af1925050503d8060008114611c20576040519150601f19603f3d011682016040523d82523d6000602084013e611c25565b606091505b5050905080611c465760405162461bcd60e51b815260040161026390613085565b7f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca943384868e604051611c7b9493929190612e09565b60405180910390a150506001600655505050505050505050565b611c9d611fe4565b6001600160a01b0316611cae6115af565b6001600160a01b031614611cf7576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b60085415611d175760405162461bcd60e51b815260040161026390612fa2565b60005b8151811015611e285760006001600160a01b0316828281518110611d3a57fe5b60200260200101516001600160a01b03161415611d695760405162461bcd60e51b815260040161026390613115565b60005b81811015611dd457828181518110611d8057fe5b60200260200101516001600160a01b0316838381518110611d9d57fe5b60200260200101516001600160a01b03161415611dcc5760405162461bcd60e51b815260040161026390612f69565b600101611d6c565b506008828281518110611de357fe5b60209081029190910181015182546001808201855560009485529290932090920180546001600160a01b0319166001600160a01b039093169290921790915501611d1a565b5050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61271081565b611e65611fe4565b6001600160a01b0316611e766115af565b6001600160a01b031614611ebf576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b6001600160a01b038116611f045760405162461bcd60e51b81526004018080602001828103825260268152602001806131bf6026913960400191505060405180910390fd5b6007546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600780546001600160a01b0319166001600160a01b0392909216919091179055565b611f68611fe4565b6001600160a01b0316611f796115af565b6001600160a01b031614611fc2576040805162461bcd60e51b81526020600482018190526024820152600080516020613296833981519152604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6001600160a01b03831661202d5760405162461bcd60e51b81526004018080602001828103825260248152602001806132fc6024913960400191505060405180910390fd5b6001600160a01b0382166120725760405162461bcd60e51b81526004018080602001828103825260228152602001806131e56022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6000806120df610790565b905080156120fa576120f583610ad386846123f7565b6120fc565b835b949350505050565b6000828201838110156108f4576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600a546040516370a0823160e01b81526000916001600160a01b0316906370a082319061218f903090600401612dd4565b60206040518083038186803b1580156121a757600080fd5b505afa1580156121bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121df9190612d98565b905090565b6001600160a01b0383166122295760405162461bcd60e51b81526004018080602001828103825260258152602001806132d76025913960400191505060405180910390fd5b6001600160a01b03821661226e5760405162461bcd60e51b815260040180806020018281038252602381526020018061317a6023913960400191505060405180910390fd5b612279838383612509565b6122b681604051806060016040528060268152602001613207602691396001600160a01b038616600090815260208190526040902054919061233f565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546122e59082612104565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156123ce5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561239357818101518382015260200161237b565b50505050905090810190601f1680156123c05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6008546123f55760405162461bcd60e51b8152600401610263906130f9565b565b6000826124065750600061076f565b8282028284828161241357fe5b04146108f45760405162461bcd60e51b815260040180806020018281038252602181526020018061324d6021913960400191505060405180910390fd5b60008082116124a6576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816124af57fe5b049392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052612509908490612916565b505050565b6000600e54600160a01b900460ff16600281111561252857fe5b14156123f55760405162461bcd60e51b81526004016102639061304c565b60006125dc82856001600160a01b031663dd62ed3e30876040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b1580156125aa57600080fd5b505afa1580156125be573d6000803e3d6000fd5b505050506040513d60208110156125d457600080fd5b505190612104565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b179052909150612631908590612916565b50505050565b60008282111561268e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6001600160a01b0382166126ef576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6126fb60008383612509565b6002546127089082612104565b6002556001600160a01b03821660009081526020819052604090205461272e9082612104565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000610788612791610790565b610ad361279c610796565b85906123f7565b6000610788612710610ad3600c54856123f790919063ffffffff16565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052612631908590612916565b6001600160a01b03821661285f5760405162461bcd60e51b81526004018080602001828103825260218152602001806132b66021913960400191505060405180910390fd5b61286b82600083612509565b6128a88160405180606001604052806022815260200161319d602291396001600160a01b038516600090815260208190526040902054919061233f565b6001600160a01b0383166000908152602081905260409020556002546128ce9082612637565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600061296b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129c79092919063ffffffff16565b8051909150156125095780806020019051602081101561298a57600080fd5b50516125095760405162461bcd60e51b815260040180806020018281038252602a815260200180613320602a913960400191505060405180910390fd5b60606120fc8484600085856129db85612aec565b612a2c576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310612a6a5780518252601f199092019160209182019101612a4b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612acc576040519150601f19603f3d011682016040523d82523d6000602084013e612ad1565b606091505b5091509150612ae1828286612af2565b979650505050505050565b3b151590565b60608315612b015750816108f4565b825115612b115782518084602001fd5b60405162461bcd60e51b815260206004820181815284516024840152845185939192839260440191908501908083836000831561239357818101518382015260200161237b565b60405180604001604052806002906020820280368337509192915050565b803561078b81613161565b600060208284031215612b92578081fd5b81356108f481613161565b60008060408385031215612baf578081fd5b8235612bba81613161565b91506020830135612bca81613161565b809150509250929050565b600080600060608486031215612be9578081fd5b8335612bf481613161565b92506020840135612c0481613161565b929592945050506040919091013590565b60008060408385031215612c27578182fd5b8235612c3281613161565b946020939093013593505050565b60006020808385031215612c52578182fd5b823567ffffffffffffffff80821115612c69578384fd5b818501915085601f830112612c7c578384fd5b813581811115612c8857fe5b83810260405185828201018181108582111715612ca157fe5b604052828152858101935084860182860187018a1015612cbf578788fd5b8795505b83861015612ce857612cd481612b76565b855260019590950194938601938601612cc3565b5098975050505050505050565b60008060208385031215612d07578182fd5b823567ffffffffffffffff80821115612d1e578384fd5b818501915085601f830112612d31578384fd5b813581811115612d3f578485fd5b8660208083028501011115612d52578485fd5b60209290920196919550909350505050565b600060208284031215612d75578081fd5b81516108f481613161565b600060208284031215612d91578081fd5b5035919050565b600060208284031215612da9578081fd5b5051919050565b60008060408385031215612dc2578182fd5b50508035926020909101359150565b90565b6001600160a01b0391909116815260200190565b6001600160a01b039390931683526020830191909152604082015260600190565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b60608101818460005b6002811015612e57578151835260209283019290910190600101612e38565b5050508260408301529392505050565b6020808252810182905260006001600160fb1b03831115612e86578081fd5b60208302808560408501379190910160400190815292915050565b901515815260200190565b6020810160038310612eba57fe5b91905290565b6000602080835283518082850152825b81811015612eec57858101830151858201604001528201612ed0565b81811115612efd5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600290820152614f3960f01b604082015260600190565b6020808252600390820152624f313160e81b604082015260600190565b6020808252600390820152624f313960e81b604082015260600190565b6020808252600290820152614f3560f01b604082015260600190565b6020808252600390820152624f313560e81b604082015260600190565b6020808252600290820152614f3360f01b604082015260600190565b602080825260029082015261279b60f11b604082015260600190565b60208082526002908201526109e760f31b604082015260600190565b6020808252600290820152614f3760f01b604082015260600190565b6020808252600390820152624f313760e81b604082015260600190565b60208082526003908201526209e62760eb1b604082015260600190565b602080825260029082015261279960f11b604082015260600190565b60208082526003908201526227989b60e91b604082015260600190565b60208082526003908201526204f31360ec1b604082015260600190565b60208082526003908201526227989960e91b604082015260600190565b6020808252600390820152624f313360e81b604082015260600190565b60208082526003908201526213cc4d60ea1b604082015260600190565b6020808252600290820152614f3160f01b604082015260600190565b60208082526002908201526113cd60f21b604082015260600190565b90815260200190565b928352600f9190910b6020830152604082015260600190565b60ff91909116815260200190565b6001600160a01b038116811461317657600080fd5b5056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636523ad33ab6a13a00aa7d06cd167b2abd03dec86af3cf3cc91759dcd3ae8411887536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f48ad6399e605c910d0d220b20c62570b7e07f974dc000586015bb61a7b03af964736f6c63430007060033

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

000000000000000000000000a2761b0539374eb7af2155f76eb09864af075250000000000000000000000000c5424b857f758e906013f3555dad202e4bdb4567000000000000000000000000b36a0671b3d49587236d7833b01e79798175875f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000225374616b6544414f2045544820436f76657265642043616c6c20537472617465677900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000107364455448436f766572656443616c6c00000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _sdecrvAddress (address): 0xa2761B0539374EB7AF2155f76eb09864af075250
Arg [1] : _curvePool (address): 0xc5424B857f758E906013F3555Dad202e4bdB4567
Arg [2] : _feeRecipient (address): 0xb36a0671B3D49587236d7833B01E79798175875f
Arg [3] : _tokenName (string): StakeDAO ETH Covered Call Strategy
Arg [4] : _tokenSymbol (string): sdETHCoveredCall

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000a2761b0539374eb7af2155f76eb09864af075250
Arg [1] : 000000000000000000000000c5424b857f758e906013f3555dad202e4bdb4567
Arg [2] : 000000000000000000000000b36a0671b3d49587236d7833b01e79798175875f
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000022
Arg [6] : 5374616b6544414f2045544820436f76657265642043616c6c20537472617465
Arg [7] : 6779000000000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000010
Arg [9] : 7364455448436f766572656443616c6c00000000000000000000000000000000


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.