Address Details
contract
token

0x0ea231fc89A7D3D5Bf75e3ac423FD340EC155c7c

Token
acUbeCeloSourceMcusd (acSrcMcusd)
Creator
0xad3018–0630fc at 0x4bca1a–26f9d8
Balance
0 CELO ( )
Locked CELO Balance
0.00 CELO
Voting CELO Balance
0.00 CELO
Pending Unlocked Gold
0.00 CELO
Tokens
Fetching tokens...
Transactions
51 Transactions
Transfers
100 Transfers
Gas Used
28,846,908
Last Balance Update
23239483
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
AutocompVaultV1




Optimization enabled
true
Compiler version
v0.8.4+commit.c7e474f2




Optimization runs
200
EVM Version
istanbul




Verified at
2021-12-19T02:17:43.609265Z

contracts/ACFI/vaults/AutocompVaultV1.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

import "../interfaces/autocomp/IStrategy.sol";

/**
 * @dev Implementation of a vault to deposit funds for yield optimizing.
 * This is the contract that receives funds and that users interface with.
 * The yield optimizing strategy itself is implemented in a separate 'Strategy.sol' contract.
 */
contract AutocompVaultV1 is ERC20, Ownable, ReentrancyGuard {
  using SafeERC20 for IERC20;
  using SafeMath for uint256;

  struct StratCandidate {
    address implementation;
    uint256 proposedTime;
  }

  address public strategy;

  // The last proposed strategy to switch to.
  StratCandidate public stratCandidate;
  // The minimum time it has to pass before a strat candidate can be approved.
  uint256 public immutable approvalDelay;

  event NewStratCandidate(address implementation);
  event UpgradeStrat(address implementation);

  /**
   * @dev Sets the value of {token} to the token that the vault will
   * hold as underlying value. It initializes the vault's own 'moo' token.
   * This token is minted when someone does a deposit. It is burned in order
   * to withdraw the corresponding portion of the underlying assets.
   * @param _strategy the address of the strategy.
   * @param _name the name of the vault token.
   * @param _symbol the symbol of the vault token.
   * @param _approvalDelay the delay before a new strat can be approved.
   */

  constructor(
    address _strategy,
    string memory _name,
    string memory _symbol,
    uint256 _approvalDelay
  ) public ERC20(_name, _symbol) {
    strategy = _strategy;
    approvalDelay = _approvalDelay;
  }

  function want() public view returns (IERC20) {
    return IStrategy(strategy).want();
  }

  /**
   * @dev It calculates the total underlying value of {token} held by the system.
   * It takes into account the vault contract balance, the strategy contract balance
   *  and the balance deployed in other contracts as part of the strategy.
   */

  function balance() public view returns (uint256) {
    return want().balanceOf(address(this)).add(IStrategy(strategy).balanceOf());
  }

  /**
   * @dev Custom logic in here for how much the vault allows to be borrowed.
   * We return 100% of tokens for now. Under certain conditions we might
   * want to keep some of the system funds at hand in the vault, instead
   * of putting them to work.
   */
  function available() public view returns (uint256) {
    return want().balanceOf(address(this));
  }

  /**
   * @dev Function for various UIs to display the current value of one of our yield tokens.
   * Returns an uint256 with 18 decimals of how much underlying asset one vault share represents.
   */
  function getPricePerFullShare() public view returns (uint256) {
    return totalSupply() == 0 ? 1e18 : balance().mul(1e18).div(totalSupply());
  }

  /**
   * @dev A helper function to call deposit() with all the sender's funds.
   */
  function depositAll() external {
    deposit(want().balanceOf(msg.sender));
  }

  /**
   * @dev The entrypoint of funds into the system. People deposit with this function
   * into the vault. The vault is then in charge of sending funds into the strategy.
   */
  function deposit(uint256 _amount) public nonReentrant {
    IStrategy(strategy).beforeDeposit();

    uint256 _pool = balance();
    want().safeTransferFrom(msg.sender, address(this), _amount);
    earn();
    uint256 _after = balance();
    _amount = _after.sub(_pool); // Additional check for deflationary tokens
    uint256 shares = 0;
    if (totalSupply() == 0) {
      shares = _amount;
    } else {
      shares = (_amount.mul(totalSupply())).div(_pool);
    }
    _mint(msg.sender, shares);
  }

  /**
   * @dev Function to send funds into the strategy and put them to work. It's primarily called
   * by the vault's deposit() function.
   */
  function earn() public {
    uint256 _bal = available();
    want().safeTransfer(address(strategy), _bal);
    IStrategy(strategy).deposit();
  }

  /**
   * @dev A helper function to call withdraw() with all the sender's funds.
   */
  function withdrawAll() external {
    withdraw(balanceOf(msg.sender));
  }

  /**
   * @dev Function to exit the system. The vault will withdraw the required tokens
   * from the strategy and pay up the token holder. A proportional number of IOU
   * tokens are burned in the process.
   */
  function withdraw(uint256 _shares) public {
    uint256 r = (balance().mul(_shares)).div(totalSupply());
    _burn(msg.sender, _shares);

    uint256 b = want().balanceOf(address(this));
    if (b < r) {
      uint256 _withdraw = r.sub(b);
      IStrategy(strategy).withdraw(_withdraw);
      uint256 _after = want().balanceOf(address(this));
      uint256 _diff = _after.sub(b);
      if (_diff < _withdraw) {
        r = b.add(_diff);
      }
    }

    want().safeTransfer(msg.sender, r);
  }

  /**
   * @dev Sets the candidate for the new strat to use with this vault.
   * @param _implementation The address of the candidate strategy.
   */
  function proposeStrat(address _implementation) public onlyOwner {
    require(
      address(this) == IStrategy(_implementation).vault(),
      "Proposal not valid for this Vault"
    );
    stratCandidate = StratCandidate({
      implementation: _implementation,
      proposedTime: block.timestamp
    });

    emit NewStratCandidate(_implementation);
  }

  /**
   * @dev It switches the active strat for the strat candidate. After upgrading, the
   * candidate implementation is set to the 0x00 address, and proposedTime to a time
   * happening in +100 years for safety.
   */

  function upgradeStrat() public onlyOwner {
    require(
      stratCandidate.implementation != address(0),
      "There is no candidate"
    );
    require(
      stratCandidate.proposedTime.add(approvalDelay) < block.timestamp,
      "Delay has not passed"
    );

    emit UpgradeStrat(stratCandidate.implementation);

    IStrategy(strategy).retireStrat();
    strategy = stratCandidate.implementation;
    stratCandidate.implementation = address(0);
    stratCandidate.proposedTime = 5000000000;

    earn();
  }

  /**
   * @dev Rescues random funds stuck that the strat can't handle.
   * @param _token address of the token to rescue.
   */
  function inCaseTokensGetStuck(address _token) external onlyOwner {
    require(_token != address(want()), "!token");

    uint256 amount = IERC20(_token).balanceOf(address(this));
    IERC20(_token).safeTransfer(msg.sender, amount);
  }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_strategy","internalType":"address"},{"type":"string","name":"_name","internalType":"string"},{"type":"string","name":"_symbol","internalType":"string"},{"type":"uint256","name":"_approvalDelay","internalType":"uint256"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"NewStratCandidate","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"UpgradeStrat","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"approvalDelay","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"available","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balance","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"depositAll","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"earn","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getPricePerFullShare","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"inCaseTokensGetStuck","inputs":[{"type":"address","name":"_token","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"proposeStrat","inputs":[{"type":"address","name":"_implementation","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"implementation","internalType":"address"},{"type":"uint256","name":"proposedTime","internalType":"uint256"}],"name":"stratCandidate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"strategy","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"sender","internalType":"address"},{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeStrat","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"want","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_shares","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawAll","inputs":[]}]
              

Contract Creation Code

0x60a06040523480156200001157600080fd5b506040516200212138038062002121833981016040819052620000349162000260565b8251839083906200004d90600390602085019062000107565b5080516200006390600490602084019062000107565b505050620000806200007a620000b160201b60201c565b620000b5565b6001600655600780546001600160a01b0319166001600160a01b039590951694909417909355505060805262000341565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200011590620002ee565b90600052602060002090601f01602090048101928262000139576000855562000184565b82601f106200015457805160ff191683800117855562000184565b8280016001018555821562000184579182015b828111156200018457825182559160200191906001019062000167565b506200019292915062000196565b5090565b5b8082111562000192576000815560010162000197565b600082601f830112620001be578081fd5b81516001600160401b0380821115620001db57620001db6200032b565b604051601f8301601f19908116603f011681019082821181831017156200020657620002066200032b565b8160405283815260209250868385880101111562000222578485fd5b8491505b8382101562000245578582018301518183018401529082019062000226565b838211156200025657848385830101525b9695505050505050565b6000806000806080858703121562000276578384fd5b84516001600160a01b03811681146200028d578485fd5b60208601519094506001600160401b0380821115620002aa578485fd5b620002b888838901620001ad565b94506040870151915080821115620002ce578384fd5b50620002dd87828801620001ad565b606096909601519497939650505050565b600181811c908216806200030357607f821691505b602082108114156200032557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b608051611dbd62000364600039600081816103f1015261106f0152611dbd6000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c8063853828b611610104578063b6b55f25116100a2578063def68a9c11610071578063def68a9c146103d9578063e2d1e75c146103ec578063e668524414610413578063f2fde38b1461041b57600080fd5b8063b6b55f251461037d578063d389800f14610390578063dd62ed3e14610398578063de5f6268146103d157600080fd5b8063a457c2d7116100de578063a457c2d71461033c578063a8c62e761461034f578063a9059cbb14610362578063b69ef8a81461037557600080fd5b8063853828b61461031b5780638da5cb5b1461032357806395d89b411461033457600080fd5b8063395093511161017157806370a082311161014b57806370a08231146102ac578063715018a6146102d557806376dfabb8146102dd57806377c7b8fc1461031357600080fd5b8063395093511461027e57806348a0d754146102915780635b12ff9b1461029957600080fd5b80631f1fcd51116101ad5780631f1fcd511461022757806323b872dd146102475780632e1a7d4d1461025a578063313ce5671461026f57600080fd5b806306fdde03146101d4578063095ea7b3146101f257806318160ddd14610215575b600080fd5b6101dc61042e565b6040516101e99190611c1f565b60405180910390f35b610205610200366004611b88565b6104c0565b60405190151581526020016101e9565b6002545b6040519081526020016101e9565b61022f6104d6565b6040516001600160a01b0390911681526020016101e9565b610205610255366004611b48565b610558565b61026d610268366004611bd3565b610609565b005b604051601281526020016101e9565b61020561028c366004611b88565b610801565b61021961083d565b61026d6102a7366004611ad8565b6108c0565b6102196102ba366004611ad8565b6001600160a01b031660009081526020819052604090205490565b61026d610a2c565b6008546009546102f4916001600160a01b03169082565b604080516001600160a01b0390931683526020830191909152016101e9565b610219610a62565b61026d610a9f565b6005546001600160a01b031661022f565b6101dc610ab8565b61020561034a366004611b88565b610ac7565b60075461022f906001600160a01b031681565b610205610370366004611b88565b610b60565b610219610b6d565b61026d61038b366004611bd3565b610c7f565b61026d610dc5565b6102196103a6366004611b10565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61026d610e56565b61026d6103e7366004611ad8565b610eda565b6102197f000000000000000000000000000000000000000000000000000000000000000081565b61026d610fea565b61026d610429366004611ad8565b6111b5565b60606003805461043d90611d21565b80601f016020809104026020016040519081016040528092919081815260200182805461046990611d21565b80156104b65780601f1061048b576101008083540402835291602001916104b6565b820191906000526020600020905b81548152906001019060200180831161049957829003601f168201915b5050505050905090565b60006104cd338484611250565b50600192915050565b60075460408051631f1fcd5160e01b815290516000926001600160a01b031691631f1fcd51916004808301926020929190829003018186803b15801561051b57600080fd5b505afa15801561052f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105539190611af4565b905090565b6000610565848484611374565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156105ef5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6105fc8533858403611250565b60019150505b9392505050565b600061062f61061760025490565b61062984610623610b6d565b90611544565b90611550565b905061063b338361155c565b60006106456104d6565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b15801561068657600080fd5b505afa15801561069a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106be9190611beb565b9050818110156107df5760006106d483836116aa565b600754604051632e1a7d4d60e01b8152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561071b57600080fd5b505af115801561072f573d6000803e3d6000fd5b50505050600061073d6104d6565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b15801561077e57600080fd5b505afa158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190611beb565b905060006107c482856116aa565b9050828110156107db576107d884826116b6565b94505b5050505b6107fc33836107ec6104d6565b6001600160a01b031691906116c2565b505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916104cd918590610838908690611c87565b611250565b60006108476104d6565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b15801561088857600080fd5b505afa15801561089c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105539190611beb565b6005546001600160a01b031633146108ea5760405162461bcd60e51b81526004016105e690611c52565b806001600160a01b031663fbfa77cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561092357600080fd5b505afa158015610937573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095b9190611af4565b6001600160a01b0316306001600160a01b0316146109c55760405162461bcd60e51b815260206004820152602160248201527f50726f706f73616c206e6f742076616c696420666f722074686973205661756c6044820152601d60fa1b60648201526084016105e6565b6040805180820182526001600160a01b038316808252426020928301819052600880546001600160a01b0319168317905560095591519182527f1aae2ec5647db56da2d513de40528ba3565c6057525637050660c4323bbac7df910160405180910390a150565b6005546001600160a01b03163314610a565760405162461bcd60e51b81526004016105e690611c52565b610a606000611725565b565b6000610a6d60025490565b15610a9257610553610a7e60025490565b610629670de0b6b3a7640000610623610b6d565b50670de0b6b3a764000090565b33600090815260208190526040902054610a6090610609565b60606004805461043d90611d21565b3360009081526001602090815260408083206001600160a01b038616845290915281205482811015610b495760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105e6565b610b563385858403611250565b5060019392505050565b60006104cd338484611374565b6000610553600760009054906101000a90046001600160a01b03166001600160a01b031663722713f76040518163ffffffff1660e01b815260040160206040518083038186803b158015610bc057600080fd5b505afa158015610bd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf89190611beb565b610c006104d6565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b158015610c4157600080fd5b505afa158015610c55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c799190611beb565b906116b6565b60026006541415610cd25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105e6565b600260065560075460408051632b9ff78560e11b815290516001600160a01b039092169163573fef0a9160048082019260009290919082900301818387803b158015610d1d57600080fd5b505af1158015610d31573d6000803e3d6000fd5b505050506000610d3f610b6d565b9050610d60333084610d4f6104d6565b6001600160a01b0316929190611777565b610d68610dc5565b6000610d72610b6d565b9050610d7e81836116aa565b92506000610d8b60025490565b610d96575082610db0565b610dad83610629610da660025490565b8790611544565b90505b610dba33826117af565b505060016006555050565b6000610dcf61083d565b600754909150610deb906001600160a01b0316826107ec6104d6565b600760009054906101000a90046001600160a01b03166001600160a01b031663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e3b57600080fd5b505af1158015610e4f573d6000803e3d6000fd5b5050505050565b610a60610e616104d6565b6040516370a0823160e01b81523360048201526001600160a01b0391909116906370a082319060240160206040518083038186803b158015610ea257600080fd5b505afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038b9190611beb565b6005546001600160a01b03163314610f045760405162461bcd60e51b81526004016105e690611c52565b610f0c6104d6565b6001600160a01b0316816001600160a01b03161415610f565760405162461bcd60e51b815260206004820152600660248201526510ba37b5b2b760d11b60448201526064016105e6565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b158015610f9857600080fd5b505afa158015610fac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd09190611beb565b9050610fe66001600160a01b03831633836116c2565b5050565b6005546001600160a01b031633146110145760405162461bcd60e51b81526004016105e690611c52565b6008546001600160a01b03166110645760405162461bcd60e51b81526020600482015260156024820152745468657265206973206e6f2063616e64696461746560581b60448201526064016105e6565b6009544290611093907f00000000000000000000000000000000000000000000000000000000000000006116b6565b106110d75760405162461bcd60e51b815260206004820152601460248201527311195b185e481a185cc81b9bdd081c185cdcd95960621b60448201526064016105e6565b6008546040516001600160a01b0390911681527f7f37d440e85aba7fbf641c4bda5ca4ef669a80bffaacde2aa8d9feb1b048c82c9060200160405180910390a1600760009054906101000a90046001600160a01b03166001600160a01b031663fb6177876040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561116757600080fd5b505af115801561117b573d6000803e3d6000fd5b505060088054600780546001600160a01b03199081166001600160a01b03841617909155169055505064012a05f200600955610a60610dc5565b6005546001600160a01b031633146111df5760405162461bcd60e51b81526004016105e690611c52565b6001600160a01b0381166112445760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105e6565b61124d81611725565b50565b6001600160a01b0383166112b25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105e6565b6001600160a01b0382166113135760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105e6565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166113d85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105e6565b6001600160a01b03821661143a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105e6565b6001600160a01b038316600090815260208190526040902054818110156114b25760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105e6565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906114e9908490611c87565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161153591815260200190565b60405180910390a35b50505050565b60006106028284611cbf565b60006106028284611c9f565b6001600160a01b0382166115bc5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016105e6565b6001600160a01b038216600090815260208190526040902054818110156116305760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016105e6565b6001600160a01b038316600090815260208190526040812083830390556002805484929061165f908490611cde565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60006106028284611cde565b60006106028284611c87565b6040516001600160a01b0383166024820152604481018290526107fc90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261188e565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516001600160a01b038085166024830152831660448201526064810182905261153e9085906323b872dd60e01b906084016116ee565b6001600160a01b0382166118055760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105e6565b80600260008282546118179190611c87565b90915550506001600160a01b03821660009081526020819052604081208054839290611844908490611c87565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b60006118e3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166119609092919063ffffffff16565b8051909150156107fc57808060200190518101906119019190611bb3565b6107fc5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105e6565b606061196f8484600085611977565b949350505050565b6060824710156119d85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105e6565b843b611a265760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105e6565b600080866001600160a01b03168587604051611a429190611c03565b60006040518083038185875af1925050503d8060008114611a7f576040519150601f19603f3d011682016040523d82523d6000602084013e611a84565b606091505b5091509150611a94828286611a9f565b979650505050505050565b60608315611aae575081610602565b825115611abe5782518084602001fd5b8160405162461bcd60e51b81526004016105e69190611c1f565b600060208284031215611ae9578081fd5b813561060281611d72565b600060208284031215611b05578081fd5b815161060281611d72565b60008060408385031215611b22578081fd5b8235611b2d81611d72565b91506020830135611b3d81611d72565b809150509250929050565b600080600060608486031215611b5c578081fd5b8335611b6781611d72565b92506020840135611b7781611d72565b929592945050506040919091013590565b60008060408385031215611b9a578182fd5b8235611ba581611d72565b946020939093013593505050565b600060208284031215611bc4578081fd5b81518015158114610602578182fd5b600060208284031215611be4578081fd5b5035919050565b600060208284031215611bfc578081fd5b5051919050565b60008251611c15818460208701611cf5565b9190910192915050565b6020815260008251806020840152611c3e816040850160208701611cf5565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115611c9a57611c9a611d5c565b500190565b600082611cba57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611cd957611cd9611d5c565b500290565b600082821015611cf057611cf0611d5c565b500390565b60005b83811015611d10578181015183820152602001611cf8565b8381111561153e5750506000910152565b600181811c90821680611d3557607f821691505b60208210811415611d5657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461124d57600080fdfea2646970667358221220321fdc4f10df371a5a4277214d2780bc4834ec69277c5e30d845eb48da83145d64736f6c6343000804003300000000000000000000000097ab3ea0437dccfedeb40d223918388943db2c8f000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000054600000000000000000000000000000000000000000000000000000000000000014616355626543656c6f536f757263654d63757364000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a61635372634d6375736400000000000000000000000000000000000000000000

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c8063853828b611610104578063b6b55f25116100a2578063def68a9c11610071578063def68a9c146103d9578063e2d1e75c146103ec578063e668524414610413578063f2fde38b1461041b57600080fd5b8063b6b55f251461037d578063d389800f14610390578063dd62ed3e14610398578063de5f6268146103d157600080fd5b8063a457c2d7116100de578063a457c2d71461033c578063a8c62e761461034f578063a9059cbb14610362578063b69ef8a81461037557600080fd5b8063853828b61461031b5780638da5cb5b1461032357806395d89b411461033457600080fd5b8063395093511161017157806370a082311161014b57806370a08231146102ac578063715018a6146102d557806376dfabb8146102dd57806377c7b8fc1461031357600080fd5b8063395093511461027e57806348a0d754146102915780635b12ff9b1461029957600080fd5b80631f1fcd51116101ad5780631f1fcd511461022757806323b872dd146102475780632e1a7d4d1461025a578063313ce5671461026f57600080fd5b806306fdde03146101d4578063095ea7b3146101f257806318160ddd14610215575b600080fd5b6101dc61042e565b6040516101e99190611c1f565b60405180910390f35b610205610200366004611b88565b6104c0565b60405190151581526020016101e9565b6002545b6040519081526020016101e9565b61022f6104d6565b6040516001600160a01b0390911681526020016101e9565b610205610255366004611b48565b610558565b61026d610268366004611bd3565b610609565b005b604051601281526020016101e9565b61020561028c366004611b88565b610801565b61021961083d565b61026d6102a7366004611ad8565b6108c0565b6102196102ba366004611ad8565b6001600160a01b031660009081526020819052604090205490565b61026d610a2c565b6008546009546102f4916001600160a01b03169082565b604080516001600160a01b0390931683526020830191909152016101e9565b610219610a62565b61026d610a9f565b6005546001600160a01b031661022f565b6101dc610ab8565b61020561034a366004611b88565b610ac7565b60075461022f906001600160a01b031681565b610205610370366004611b88565b610b60565b610219610b6d565b61026d61038b366004611bd3565b610c7f565b61026d610dc5565b6102196103a6366004611b10565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61026d610e56565b61026d6103e7366004611ad8565b610eda565b6102197f000000000000000000000000000000000000000000000000000000000000546081565b61026d610fea565b61026d610429366004611ad8565b6111b5565b60606003805461043d90611d21565b80601f016020809104026020016040519081016040528092919081815260200182805461046990611d21565b80156104b65780601f1061048b576101008083540402835291602001916104b6565b820191906000526020600020905b81548152906001019060200180831161049957829003601f168201915b5050505050905090565b60006104cd338484611250565b50600192915050565b60075460408051631f1fcd5160e01b815290516000926001600160a01b031691631f1fcd51916004808301926020929190829003018186803b15801561051b57600080fd5b505afa15801561052f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105539190611af4565b905090565b6000610565848484611374565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156105ef5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6105fc8533858403611250565b60019150505b9392505050565b600061062f61061760025490565b61062984610623610b6d565b90611544565b90611550565b905061063b338361155c565b60006106456104d6565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b15801561068657600080fd5b505afa15801561069a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106be9190611beb565b9050818110156107df5760006106d483836116aa565b600754604051632e1a7d4d60e01b8152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561071b57600080fd5b505af115801561072f573d6000803e3d6000fd5b50505050600061073d6104d6565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b15801561077e57600080fd5b505afa158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190611beb565b905060006107c482856116aa565b9050828110156107db576107d884826116b6565b94505b5050505b6107fc33836107ec6104d6565b6001600160a01b031691906116c2565b505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916104cd918590610838908690611c87565b611250565b60006108476104d6565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b15801561088857600080fd5b505afa15801561089c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105539190611beb565b6005546001600160a01b031633146108ea5760405162461bcd60e51b81526004016105e690611c52565b806001600160a01b031663fbfa77cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561092357600080fd5b505afa158015610937573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095b9190611af4565b6001600160a01b0316306001600160a01b0316146109c55760405162461bcd60e51b815260206004820152602160248201527f50726f706f73616c206e6f742076616c696420666f722074686973205661756c6044820152601d60fa1b60648201526084016105e6565b6040805180820182526001600160a01b038316808252426020928301819052600880546001600160a01b0319168317905560095591519182527f1aae2ec5647db56da2d513de40528ba3565c6057525637050660c4323bbac7df910160405180910390a150565b6005546001600160a01b03163314610a565760405162461bcd60e51b81526004016105e690611c52565b610a606000611725565b565b6000610a6d60025490565b15610a9257610553610a7e60025490565b610629670de0b6b3a7640000610623610b6d565b50670de0b6b3a764000090565b33600090815260208190526040902054610a6090610609565b60606004805461043d90611d21565b3360009081526001602090815260408083206001600160a01b038616845290915281205482811015610b495760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016105e6565b610b563385858403611250565b5060019392505050565b60006104cd338484611374565b6000610553600760009054906101000a90046001600160a01b03166001600160a01b031663722713f76040518163ffffffff1660e01b815260040160206040518083038186803b158015610bc057600080fd5b505afa158015610bd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf89190611beb565b610c006104d6565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b158015610c4157600080fd5b505afa158015610c55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c799190611beb565b906116b6565b60026006541415610cd25760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105e6565b600260065560075460408051632b9ff78560e11b815290516001600160a01b039092169163573fef0a9160048082019260009290919082900301818387803b158015610d1d57600080fd5b505af1158015610d31573d6000803e3d6000fd5b505050506000610d3f610b6d565b9050610d60333084610d4f6104d6565b6001600160a01b0316929190611777565b610d68610dc5565b6000610d72610b6d565b9050610d7e81836116aa565b92506000610d8b60025490565b610d96575082610db0565b610dad83610629610da660025490565b8790611544565b90505b610dba33826117af565b505060016006555050565b6000610dcf61083d565b600754909150610deb906001600160a01b0316826107ec6104d6565b600760009054906101000a90046001600160a01b03166001600160a01b031663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e3b57600080fd5b505af1158015610e4f573d6000803e3d6000fd5b5050505050565b610a60610e616104d6565b6040516370a0823160e01b81523360048201526001600160a01b0391909116906370a082319060240160206040518083038186803b158015610ea257600080fd5b505afa158015610eb6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038b9190611beb565b6005546001600160a01b03163314610f045760405162461bcd60e51b81526004016105e690611c52565b610f0c6104d6565b6001600160a01b0316816001600160a01b03161415610f565760405162461bcd60e51b815260206004820152600660248201526510ba37b5b2b760d11b60448201526064016105e6565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b158015610f9857600080fd5b505afa158015610fac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd09190611beb565b9050610fe66001600160a01b03831633836116c2565b5050565b6005546001600160a01b031633146110145760405162461bcd60e51b81526004016105e690611c52565b6008546001600160a01b03166110645760405162461bcd60e51b81526020600482015260156024820152745468657265206973206e6f2063616e64696461746560581b60448201526064016105e6565b6009544290611093907f00000000000000000000000000000000000000000000000000000000000054606116b6565b106110d75760405162461bcd60e51b815260206004820152601460248201527311195b185e481a185cc81b9bdd081c185cdcd95960621b60448201526064016105e6565b6008546040516001600160a01b0390911681527f7f37d440e85aba7fbf641c4bda5ca4ef669a80bffaacde2aa8d9feb1b048c82c9060200160405180910390a1600760009054906101000a90046001600160a01b03166001600160a01b031663fb6177876040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561116757600080fd5b505af115801561117b573d6000803e3d6000fd5b505060088054600780546001600160a01b03199081166001600160a01b03841617909155169055505064012a05f200600955610a60610dc5565b6005546001600160a01b031633146111df5760405162461bcd60e51b81526004016105e690611c52565b6001600160a01b0381166112445760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105e6565b61124d81611725565b50565b6001600160a01b0383166112b25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105e6565b6001600160a01b0382166113135760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105e6565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166113d85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105e6565b6001600160a01b03821661143a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105e6565b6001600160a01b038316600090815260208190526040902054818110156114b25760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105e6565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906114e9908490611c87565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161153591815260200190565b60405180910390a35b50505050565b60006106028284611cbf565b60006106028284611c9f565b6001600160a01b0382166115bc5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016105e6565b6001600160a01b038216600090815260208190526040902054818110156116305760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016105e6565b6001600160a01b038316600090815260208190526040812083830390556002805484929061165f908490611cde565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60006106028284611cde565b60006106028284611c87565b6040516001600160a01b0383166024820152604481018290526107fc90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261188e565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516001600160a01b038085166024830152831660448201526064810182905261153e9085906323b872dd60e01b906084016116ee565b6001600160a01b0382166118055760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105e6565b80600260008282546118179190611c87565b90915550506001600160a01b03821660009081526020819052604081208054839290611844908490611c87565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b60006118e3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166119609092919063ffffffff16565b8051909150156107fc57808060200190518101906119019190611bb3565b6107fc5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105e6565b606061196f8484600085611977565b949350505050565b6060824710156119d85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105e6565b843b611a265760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105e6565b600080866001600160a01b03168587604051611a429190611c03565b60006040518083038185875af1925050503d8060008114611a7f576040519150601f19603f3d011682016040523d82523d6000602084013e611a84565b606091505b5091509150611a94828286611a9f565b979650505050505050565b60608315611aae575081610602565b825115611abe5782518084602001fd5b8160405162461bcd60e51b81526004016105e69190611c1f565b600060208284031215611ae9578081fd5b813561060281611d72565b600060208284031215611b05578081fd5b815161060281611d72565b60008060408385031215611b22578081fd5b8235611b2d81611d72565b91506020830135611b3d81611d72565b809150509250929050565b600080600060608486031215611b5c578081fd5b8335611b6781611d72565b92506020840135611b7781611d72565b929592945050506040919091013590565b60008060408385031215611b9a578182fd5b8235611ba581611d72565b946020939093013593505050565b600060208284031215611bc4578081fd5b81518015158114610602578182fd5b600060208284031215611be4578081fd5b5035919050565b600060208284031215611bfc578081fd5b5051919050565b60008251611c15818460208701611cf5565b9190910192915050565b6020815260008251806020840152611c3e816040850160208701611cf5565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115611c9a57611c9a611d5c565b500190565b600082611cba57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611cd957611cd9611d5c565b500290565b600082821015611cf057611cf0611d5c565b500390565b60005b83811015611d10578181015183820152602001611cf8565b8381111561153e5750506000910152565b600181811c90821680611d3557607f821691505b60208210811415611d5657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461124d57600080fdfea2646970667358221220321fdc4f10df371a5a4277214d2780bc4834ec69277c5e30d845eb48da83145d64736f6c63430008040033