MATIC Price: $0.529766 (-2.21%)
Gas: 30.1 GWei
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
0x60806040160159112021-06-22 12:12:451119 days ago1624363965IN
 Create: BunnyLauncher
0 MATIC0.019681328

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BunnyLauncher

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : RocketBunny.sol
/*
  ___                      _   _
 | _ )_  _ _ _  _ _ _  _  | | | |
 | _ \ || | ' \| ' \ || | |_| |_|
 |___/\_,_|_||_|_||_\_, | (_) (_)
                    |__/

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

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

import "./IBunnyLauncher.sol";
import "./IPolyBunnyDistributor.sol";
import "./interfaces/IBunnyMinterV2.sol";
import "./library/SafeToken.sol";

contract BunnyLauncher is IBunnyLauncher, ReentrancyGuardUpgradeable, OwnableUpgradeable {
    using SafeERC20 for IERC20;
    using Address for address;
    using SafeMath for uint256;
    using SafeToken for address;

    /* ========== CONSTANT ========== */

    address public constant WETH = 0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619;

    /* ========== STATE VARIABLES ========== */

    uint8 public constant ALLOWED_MAX_DECIMALS = 18;

    uint public constant swapBase = 10000;
    uint public constant swapMin = 1;

    uint public constant ALLOWED_MAX_SERVICE_FEE = 10000;

    address public governance;
    address public minter;

    uint public auctionCount;
    AuctionInfo[] public auctions;
    mapping(uint => mapping(address => UserInfo)) public users;

    /* ========== EVENTS ========== */

    event Create(uint indexed id, address indexed token);
    event Archive(uint indexed id, address indexed token, uint amount);
    event Engage(uint indexed id, address indexed participant, uint amount);
    event Claim(uint indexed id, address indexed participant, uint amount);

    /* ========== MODIFIERS ========== */

    modifier onlyGovernance {
        require(msg.sender == governance, "onlyGovernance");
        _;
    }

    /* ========== INITIALIZER ========== */

    function initialize(address _governance) external initializer {
        governance = _governance;
        __Ownable_init();
        __ReentrancyGuard_init();
    }

    /* ========== RESTRICTED ========== */

    function setGovernance(address _governance) public onlyGovernance {
        require(_governance != address(0), "!governance");
        governance = _governance;
    }

    function setMinter(address _minter) external onlyOwner {
        require(_minter != address(0), "!minter");
        minter = _minter;
    }

    /* ========== VIEWS ========== */

    function swapTokenAmount(uint id, uint amount) override public view returns (uint) {
        AuctionInfo memory auction = auctions[id];
        uint decimals = ERC20(auction.token).decimals();
        uint decimalCompensation = 10 ** (ALLOWED_MAX_DECIMALS - decimals);
        return amount.mul(auction.swapRatio).div(swapBase).div(decimalCompensation);
    }

    function getAuctions(uint page, uint resultPerPage) external view returns (AuctionInfo[] memory, uint) {
        uint index = page.mul(resultPerPage);
        uint limit = page.add(1).mul(resultPerPage);
        uint next = page.add(1);

        if (limit > auctionCount) {
            limit = auctionCount;
            next = 0;
        }

        if (auctionCount == 0 || index > auctionCount - 1) {
            return (new AuctionInfo[](0), 0);
        }

        uint cursor = 0;
        AuctionInfo[] memory segment = new AuctionInfo[](limit.sub(index));
        for (index; index < limit; index++) {
            if (index < auctionCount) {
                segment[cursor] = auctions[index];
            }
            cursor++;
        }

        return (segment, next);
    }

    function getAuction(uint id) override external view returns (AuctionInfo memory) {
        return auctions[id];
    }

    function getUserInfo(uint id, address user) override external view returns (UserInfo memory) {
        return users[id][user];
    }

    /* ========== FOR BENEFICIARIES ========== */

    function create(AuctionInfo memory request) external onlyOwner {
        require(request.deadline > now, "!deadline");
        require(request.beneficiary != address(0), "!beneficiary");
        require(request.token != address(0), "!token");

        uint decimals = ERC20(request.token).decimals();
        require(decimals <= ALLOWED_MAX_DECIMALS, "!decimals");

        request.engaged = 0;
        auctions.push(request);
        auctionCount++;

        IPolyBunnyDistributor(request.beneficiary).notifyCreate(auctionCount, request.token);
        emit Create(auctionCount, request.token);
    }

    function archive(uint id) external nonReentrant onlyOwner {
        AuctionInfo memory auction = auctions[id];
        require(!auction.archived, "!archived");
        require(now >= auction.deadline, "!deadline");

        uint totalTokenAmount = swapTokenAmount(id, IERC20(WETH).balanceOf(address(this)));
        IBunnyMinterV2(minter).mintForBunnyLauncher(totalTokenAmount.mul(3).div(2), auction.beneficiary);

        uint totalEngaged = auction.engaged;
        auction.archived = true;
        auctions[id] = auction;

        if (totalEngaged > 0) {
            IERC20(WETH).safeTransfer(auction.beneficiary, totalEngaged);
        }

        IPolyBunnyDistributor(auction.beneficiary).notifyArchive(id, auction.token, totalEngaged);
        emit Archive(id, auction.token, totalEngaged);
    }

    /* ========== FOR USERS ========== */

    function engage(uint id, uint amount) external {
        AuctionInfo memory auction = auctions[id];
        require(!auction.archived, "!archived");
        require(now < auction.deadline, "!deadline");

        IERC20(WETH).safeTransferFrom(msg.sender, address(this), amount);

        UserInfo memory user = users[id][msg.sender];

        user.engaged = user.engaged.add(amount);
        users[id][msg.sender] = user;

        auction.engaged = auction.engaged.add(amount);
        auctions[id] = auction;

        IPolyBunnyDistributor(auction.beneficiary).notifyEngage(id, msg.sender, amount);
        emit Engage(id, msg.sender, amount);
    }
}

File 2 of 16 : 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 3 of 16 : 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);
            }
        }
    }
}

File 4 of 16 : 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 5 of 16 : 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 6 of 16 : 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 7 of 16 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";

/**
 * @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 ReentrancyGuardUpgradeable is Initializable {
    // 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;

    function __ReentrancyGuard_init() internal initializer {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal initializer {
        _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;
    }
    uint256[49] private __gap;
}

File 8 of 16 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal initializer {
        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;
    }
    uint256[49] private __gap;
}

File 9 of 16 : IBunnyLauncher.sol
/*
  ___                      _   _
 | _ )_  _ _ _  _ _ _  _  | | | |
 | _ \ || | ' \| ' \ || | |_| |_|
 |___/\_,_|_||_|_||_\_, | (_) (_)
                    |__/

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

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;


interface IBunnyLauncher {

    // Swap for simple auction and Callback for delegate contract
    enum AuctionOpts {
        Swap, Callback
    }

    struct AuctionInfo {
        string name;                    // auction name
        uint deadline;                  // auction deadline
        uint swapRatio;                 // swap ratio [1-100000000]
        uint allocation;                // allocation per wallet
        uint tokenSupply;               // amount of the token
        uint tokenRemain;               // remain of the token
        uint capacity;                  // total value of token in ETH or BNB (calculated by BunnyLauncher)
        uint engaged;                   // total raised fund value ()
        address token;                  // address of the token
        address payable beneficiary;    // auction host (use contract address for AuctionOpts.Callback)
        bool archived;                  // flag to determine archived
        AuctionOpts option;             // options [Swap, Callback]
    }

    struct UserInfo {
        uint engaged;
        bool claim;
    }

    function getAuction(uint id) external view returns (AuctionInfo memory);

    /**
     * @dev User's amount and boolean flag for claim
     * @param id Auction ID
     * @param user User's address
     * @return True for already claimed
     */
    function getUserInfo(uint id, address user) external view returns (UserInfo memory);

    /**
     * @dev Calculate the amount of tokens for the funds raised.
     * @param id Auction ID
     * @param amount Raised amount (ETH/BNB)
     * @return The amount of tokens swapped
     */
    function swapTokenAmount(uint id, uint amount) external view returns (uint);
}

File 10 of 16 : IPolyBunnyDistributor.sol
/*
  ___                      _   _
 | _ )_  _ _ _  _ _ _  _  | | | |
 | _ \ || | ' \| ' \ || | |_| |_|
 |___/\_,_|_||_|_||_\_, | (_) (_)
                    |__/

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

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;


interface IPolyBunnyDistributor {
    /**
     * @dev Executed when the auction is created.
     * @param auctionId Index of auctions array
     * @param token The address of token registered for auction
     */
    function notifyCreate(uint256 auctionId, address token) external;

    /**
     * @notice Keep user data as you like.
     * @dev Executed whenever a participant invokes an engage.
     * @param auctionId Index of auctions array
     * @param user The address of the user invoked the engage
     * @param amount The amount the user participated in the auction (ETH/BNB)
     */
    function notifyEngage(uint256 auctionId, address user, uint256 amount) external;

    /**
     * @notice Token and funds raised will be transferred before the call.
     * @dev Executed when the auction is archived.
     * @param auctionId Index of auctions array
     * @param token The address of token registered for auction
     * @param amount The amount raised in auction (ETH/BNB)
     */
    function notifyArchive(uint256 auctionId, address token, uint256 amount) external;

    /**
     * @notice You are responsible for distributing rewards to users.
     * @dev Executed whenever a participant invokes a claim.
     * @param auctionId Index of auctions array
     * @param user The address of the user invoked the claim
     * @param amount The amount the user participated in the auction (ETH/BNB)
     */
    function notifyClaim(uint256 auctionId, address user, uint256 amount) external;
}

File 11 of 16 : IBunnyMinterV2.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;

interface IBunnyMinterV2 {
    function isMinter(address) view external returns(bool);
    function amountBunnyToMint(uint bnbProfit) view external returns(uint);
    function withdrawalFee(uint amount, uint depositedAt) view external returns(uint);
    function performanceFee(uint profit) view external returns(uint);
    function mintFor(address flip, uint _withdrawalFee, uint _performanceFee, address to, uint depositedAt) external payable;
    function mintForV2(address flip, uint _withdrawalFee, uint _performanceFee, address to, uint depositedAt) external payable;
    function mintForBunnyLauncher(uint amount, address to) external;

    function bunnyPerProfitBNB() view external returns(uint);
    function WITHDRAWAL_FEE_FREE_PERIOD() view external returns(uint);
    function WITHDRAWAL_FEE() view external returns(uint);

    function setMinter(address minter, bool canMint) external;

    // V2 functions
    function mint(uint amount) external;
    function safeBunnyTransfer(address to, uint256 amount) external;
    function mintGov(uint amount) external;
}

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

pragma solidity ^0.6.12;

interface ERC20Interface {
    function balanceOf(address user) external view returns (uint256);
}

library SafeToken {
    function myBalance(address token) internal view returns (uint256) {
        return ERC20Interface(token).balanceOf(address(this));
    }

    function balanceOf(address token, address user) internal view returns (uint256) {
        return ERC20Interface(token).balanceOf(user);
    }

    function safeApprove(address token, address to, uint256 value) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), "!safeApprove");
    }

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

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

    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{ value: value }(new bytes(0));
        require(success, "!safeTransferETH");
    }
}

File 13 of 16 : 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 14 of 16 : Initializable.sol
// SPDX-License-Identifier: MIT

// solhint-disable-next-line compiler-version
pragma solidity >=0.4.24 <0.8.0;

import "../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 */
abstract contract Initializable {

    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /// @dev Returns true if and only if the function is running in the constructor
    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 15 of 16 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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);
    }

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

File 16 of 16 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;
import "../proxy/Initializable.sol";

/*
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal initializer {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal initializer {
    }
    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;
    }
    uint256[50] private __gap;
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Archive","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"participant","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"Create","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"participant","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Engage","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"},{"inputs":[],"name":"ALLOWED_MAX_DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ALLOWED_MAX_SERVICE_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"archive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"auctionCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"auctions","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"swapRatio","type":"uint256"},{"internalType":"uint256","name":"allocation","type":"uint256"},{"internalType":"uint256","name":"tokenSupply","type":"uint256"},{"internalType":"uint256","name":"tokenRemain","type":"uint256"},{"internalType":"uint256","name":"capacity","type":"uint256"},{"internalType":"uint256","name":"engaged","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"internalType":"bool","name":"archived","type":"bool"},{"internalType":"enum IBunnyLauncher.AuctionOpts","name":"option","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"swapRatio","type":"uint256"},{"internalType":"uint256","name":"allocation","type":"uint256"},{"internalType":"uint256","name":"tokenSupply","type":"uint256"},{"internalType":"uint256","name":"tokenRemain","type":"uint256"},{"internalType":"uint256","name":"capacity","type":"uint256"},{"internalType":"uint256","name":"engaged","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"internalType":"bool","name":"archived","type":"bool"},{"internalType":"enum IBunnyLauncher.AuctionOpts","name":"option","type":"uint8"}],"internalType":"struct IBunnyLauncher.AuctionInfo","name":"request","type":"tuple"}],"name":"create","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"engage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getAuction","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"swapRatio","type":"uint256"},{"internalType":"uint256","name":"allocation","type":"uint256"},{"internalType":"uint256","name":"tokenSupply","type":"uint256"},{"internalType":"uint256","name":"tokenRemain","type":"uint256"},{"internalType":"uint256","name":"capacity","type":"uint256"},{"internalType":"uint256","name":"engaged","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"internalType":"bool","name":"archived","type":"bool"},{"internalType":"enum IBunnyLauncher.AuctionOpts","name":"option","type":"uint8"}],"internalType":"struct IBunnyLauncher.AuctionInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"page","type":"uint256"},{"internalType":"uint256","name":"resultPerPage","type":"uint256"}],"name":"getAuctions","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"swapRatio","type":"uint256"},{"internalType":"uint256","name":"allocation","type":"uint256"},{"internalType":"uint256","name":"tokenSupply","type":"uint256"},{"internalType":"uint256","name":"tokenRemain","type":"uint256"},{"internalType":"uint256","name":"capacity","type":"uint256"},{"internalType":"uint256","name":"engaged","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address payable","name":"beneficiary","type":"address"},{"internalType":"bool","name":"archived","type":"bool"},{"internalType":"enum IBunnyLauncher.AuctionOpts","name":"option","type":"uint8"}],"internalType":"struct IBunnyLauncher.AuctionInfo[]","name":"","type":"tuple[]"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"getUserInfo","outputs":[{"components":[{"internalType":"uint256","name":"engaged","type":"uint256"},{"internalType":"bool","name":"claim","type":"bool"}],"internalType":"struct IBunnyLauncher.UserInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governance","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_governance","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[{"internalType":"address","name":"_governance","type":"address"}],"name":"setGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_minter","type":"address"}],"name":"setMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapBase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapMin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"swapTokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"users","outputs":[{"internalType":"uint256","name":"engaged","type":"uint256"},{"internalType":"bool","name":"claim","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50612b89806100206000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c806393c829fc116100c3578063ceb6a22f1161007c578063ceb6a22f1461028f578063ee41f0bc146102b0578063f2fde38b146102c3578063f7d2deb0146102d6578063fca3b5aa146102eb578063fd41c9c7146102fe5761014d565b806393c829fc14610225578063ab033ea914610238578063ad5c46481461024b578063b3de9b5d14610253578063b9d02df41461025b578063c4d66de81461027c5761014d565b8063571a26a011610115578063571a26a0146101c2578063579e526c146101905780635aa6e675146101ed578063715018a6146101f557806378bd7935146101fd5780638da5cb5b1461021d5761014d565b806307546172146101525780631069f3b514610170578063121aee991461019057806323336892146101a55780632ad71573146101ba575b600080fd5b61015a610311565b604051610167919061253c565b60405180910390f35b61018361017e3660046123a7565b610320565b6040516101679190612a67565b61019861036c565b6040516101679190612a80565b6101b86101b336600461226c565b610372565b005b6101986106a5565b6101d56101d0366004612377565b6106ab565b6040516101679c9b9a99989796959493929190612607565b61015a6107b9565b6101b86107c8565b61021061020b366004612377565b610851565b6040516101679190612a54565b61015a6109bf565b6101b8610233366004612377565b6109ce565b6101b8610246366004612234565b610ef3565b61015a610f65565b610198610f7d565b61026e6102693660046123a7565b610f82565b604051610167929190612abf565b6101b861028a366004612234565b610fa9565b6102a261029d3660046123d6565b611058565b60405161016792919061258d565b6101986102be3660046123d6565b611307565b6101b86102d1366004612234565b61152a565b6102de6115eb565b6040516101679190612acf565b6101b86102f9366004612234565b6115f0565b6101b861030c3660046123d6565b611677565b6098546001600160a01b031681565b61032861207d565b506000828152609b602090815260408083206001600160a01b03851684528252918290208251808401909352805483526001015460ff161515908201525b92915050565b61271081565b61037a611a96565b6001600160a01b031661038b6109bf565b6001600160a01b0316146103ba5760405162461bcd60e51b81526004016103b1906128f9565b60405180910390fd5b428160200151116103dd5760405162461bcd60e51b81526004016103b190612965565b6101208101516001600160a01b03166104085760405162461bcd60e51b81526004016103b1906126ab565b6101008101516001600160a01b03166104335760405162461bcd60e51b81526004016103b190612827565b60008161010001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561047357600080fd5b505afa158015610487573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ab91906123f7565b60ff16905060128111156104d15760405162461bcd60e51b81526004016103b190612895565b600060e08301819052609a80546001810182559152825180518492600a027f44da158ba27f9252712a74ff6a55c5d531f69609f1f6e7f17c4443a8e2089be4019161052191839160200190612094565b50602082015160018281019190915560408301516002830155606083015160038301556080830151600483015560a0830151600583015560c0830151600683015560e083015160078301556101008301516008830180546001600160a01b03199081166001600160a01b03938416179091556101208501516009850180546101408801519316919093161760ff60a01b1916600160a01b91151591909102178082556101608501519260ff60a81b1990911690600160a81b9084908111156105e557fe5b0217905550506099805460010190819055610120840151610100850151604051630d3f117f60e21b81526001600160a01b0390921693506334fc45fc9261063192909190600401612a89565b600060405180830381600087803b15801561064b57600080fd5b505af115801561065f573d6000803e3d6000fd5b505050508161010001516001600160a01b03166099547f748fd6a01f0f0df2e8354235caf8fdf83654b5a47b2358be7e7bffb16b726ceb60405160405180910390a35050565b60995481565b609a81815481106106b857fe5b6000918252602091829020600a919091020180546040805160026001841615610100026000190190931692909204601f8101859004850283018501909152808252919350918391908301828280156107515780601f1061072657610100808354040283529160200191610751565b820191906000526020600020905b81548152906001019060200180831161073457829003601f168201915b50505060018401546002850154600386015460048701546005880154600689015460078a015460088b01546009909b0154999a9699959850939650919490939192916001600160a01b039182169181169060ff600160a01b8204811691600160a81b9004168c565b6097546001600160a01b031681565b6107d0611a96565b6001600160a01b03166107e16109bf565b6001600160a01b0316146108075760405162461bcd60e51b81526004016103b1906128f9565b6065546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3606580546001600160a01b0319169055565b610859612112565b609a828154811061086657fe5b600091825260209182902060408051600a93909302909101805460026001821615610100026000190190911604601f810185900490940283016101a090810190925261018083018481529293909284929091849184018282801561090b5780601f106108e05761010080835404028352916020019161090b565b820191906000526020600020905b8154815290600101906020018083116108ee57829003601f168201915b50505091835250506001828101546020830152600283015460408301526003830154606083015260048301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546001600160a01b03908116610100840152600984015490811661012084015260ff600160a01b82048116151561014085015261016090930192600160a81b90910416908111156109ab57fe5b60018111156109b657fe5b90525092915050565b6065546001600160a01b031690565b600260015414156109f15760405162461bcd60e51b81526004016103b1906129fa565b60026001556109fe611a96565b6001600160a01b0316610a0f6109bf565b6001600160a01b031614610a355760405162461bcd60e51b81526004016103b1906128f9565b610a3d612112565b609a8281548110610a4a57fe5b600091825260209182902060408051600a93909302909101805460026001821615610100026000190190911604601f810185900490940283016101a0908101909252610180830184815292939092849290918491840182828015610aef5780601f10610ac457610100808354040283529160200191610aef565b820191906000526020600020905b815481529060010190602001808311610ad257829003601f168201915b50505091835250506001828101546020830152600283015460408301526003830154606083015260048301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546001600160a01b03908116610100840152600984015490811661012084015260ff600160a01b82048116151561014085015261016090930192600160a81b9091041690811115610b8f57fe5b6001811115610b9a57fe5b81525050905080610140015115610bc35760405162461bcd60e51b81526004016103b190612a31565b8060200151421015610be75760405162461bcd60e51b81526004016103b190612965565b6040516370a0823160e01b8152600090610c77908490737ceb23fd6bc0add59e62ac25578270cff1b9f619906370a0823190610c2790309060040161253c565b60206040518083038186803b158015610c3f57600080fd5b505afa158015610c53573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102be919061238f565b6098549091506001600160a01b03166316a34956610ca16002610c9b856003611a9a565b90611adb565b8461012001516040518363ffffffff1660e01b8152600401610cc4929190612a89565b600060405180830381600087803b158015610cde57600080fd5b505af1158015610cf2573d6000803e3d6000fd5b5050505060e08201516001610140840152609a805484919086908110610d1457fe5b90600052602060002090600a02016000820151816000019080519060200190610d3e929190612094565b50602082015160018281019190915560408301516002830155606083015160038301556080830151600483015560a0830151600583015560c0830151600683015560e083015160078301556101008301516008830180546001600160a01b03199081166001600160a01b03938416179091556101208501516009850180546101408801519316919093161760ff60a01b1916600160a01b91151591909102178082556101608501519260ff60a81b1990911690600160a81b908490811115610e0257fe5b02179055505081159050610e3657610120830151610e3690737ceb23fd6bc0add59e62ac25578270cff1b9f6199083611b0d565b8261012001516001600160a01b0316638383ff6885856101000151846040518463ffffffff1660e01b8152600401610e7093929190612aa0565b600060405180830381600087803b158015610e8a57600080fd5b505af1158015610e9e573d6000803e3d6000fd5b505050508261010001516001600160a01b0316847f19cae222ef19833ac099aed0d3cd78d340f372cf3777f21611efd2d63fc915d283604051610ee19190612a80565b60405180910390a35050600180555050565b6097546001600160a01b03163314610f1d5760405162461bcd60e51b81526004016103b1906129d2565b6001600160a01b038116610f435760405162461bcd60e51b81526004016103b1906126d1565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b737ceb23fd6bc0add59e62ac25578270cff1b9f61981565b600181565b609b6020908152600092835260408084209091529082529020805460019091015460ff1682565b600054610100900460ff1680610fc25750610fc2611b68565b80610fd0575060005460ff16155b610fec5760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611017576000805460ff1961ff0019909116610100171660011790555b609780546001600160a01b0319166001600160a01b03841617905561103a611b79565b611042611c0c565b8015611054576000805461ff00191690555b5050565b60606000806110678585611a9a565b905060006110808561107a886001611c82565b90611a9a565b9050600061108f876001611c82565b90506099548211156110a357505060995460005b60995415806110b6575060016099540383115b156110fb5760408051600080825260208201909252906110ec565b6110d9612112565b8152602001906001900390816110d15790505b50600094509450505050611300565b600060606111098486611ca7565b67ffffffffffffffff8111801561111f57600080fd5b5060405190808252806020026020018201604052801561115957816020015b611146612112565b81526020019060019003908161113e5790505b5090505b838510156112f7576099548510156112e857609a858154811061117c57fe5b600091825260209182902060408051600a93909302909101805460026001821615610100026000190190911604601f810185900490940283016101a09081019092526101808301848152929390928492909184918401828280156112215780601f106111f657610100808354040283529160200191611221565b820191906000526020600020905b81548152906001019060200180831161120457829003601f168201915b50505091835250506001828101546020830152600283015460408301526003830154606083015260048301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546001600160a01b03908116610100840152600984015490811661012084015260ff600160a01b82048116151561014085015261016090930192600160a81b90910416908111156112c157fe5b60018111156112cc57fe5b815250508183815181106112dc57fe5b60200260200101819052505b6001948501949091019061115d565b95509093505050505b9250929050565b6000611311612112565b609a848154811061131e57fe5b600091825260209182902060408051600a93909302909101805460026001821615610100026000190190911604601f810185900490940283016101a09081019092526101808301848152929390928492909184918401828280156113c35780601f10611398576101008083540402835291602001916113c3565b820191906000526020600020905b8154815290600101906020018083116113a657829003601f168201915b50505091835250506001828101546020830152600283015460408301526003830154606083015260048301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546001600160a01b03908116610100840152600984015490811661012084015260ff600160a01b82048116151561014085015261016090930192600160a81b909104169081111561146357fe5b600181111561146e57fe5b81525050905060008161010001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156114b457600080fd5b505afa1580156114c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ec91906123f7565b60ff169050600081601260ff1603600a0a905061152081610c9b612710610c9b87604001518a611a9a90919063ffffffff16565b9695505050505050565b611532611a96565b6001600160a01b03166115436109bf565b6001600160a01b0316146115695760405162461bcd60e51b81526004016103b1906128f9565b6001600160a01b03811661158f5760405162461bcd60e51b81526004016103b1906126f6565b6065546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3606580546001600160a01b0319166001600160a01b0392909216919091179055565b601281565b6115f8611a96565b6001600160a01b03166116096109bf565b6001600160a01b03161461162f5760405162461bcd60e51b81526004016103b1906128f9565b6001600160a01b0381166116555760405162461bcd60e51b81526004016103b19061268a565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b61167f612112565b609a838154811061168c57fe5b600091825260209182902060408051600a93909302909101805460026001821615610100026000190190911604601f810185900490940283016101a09081019092526101808301848152929390928492909184918401828280156117315780601f1061170657610100808354040283529160200191611731565b820191906000526020600020905b81548152906001019060200180831161171457829003601f168201915b50505091835250506001828101546020830152600283015460408301526003830154606083015260048301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546001600160a01b03908116610100840152600984015490811661012084015260ff600160a01b82048116151561014085015261016090930192600160a81b90910416908111156117d157fe5b60018111156117dc57fe5b815250509050806101400151156118055760405162461bcd60e51b81526004016103b190612a31565b806020015142106118285760405162461bcd60e51b81526004016103b190612965565b611848737ceb23fd6bc0add59e62ac25578270cff1b9f619333085611ccf565b61185061207d565b506000838152609b602090815260408083203384528252918290208251808401909352805480845260019091015460ff161515918301919091526118949084611c82565b81526000848152609b60209081526040808320338452825290912082518155908201516001909101805460ff191691151591909117905560e08201516118da9084611c82565b60e0830152609a8054839190869081106118f057fe5b90600052602060002090600a0201600082015181600001908051906020019061191a929190612094565b50602082015160018281019190915560408301516002830155606083015160038301556080830151600483015560a0830151600583015560c0830151600683015560e083015160078301556101008301516008830180546001600160a01b03199081166001600160a01b03938416179091556101208501516009850180546101408801519316919093161760ff60a01b1916600160a01b91151591909102178082556101608501519260ff60a81b1990911690600160a81b9084908111156119de57fe5b0217905550505061012082015160405163a8c8f12560e01b81526001600160a01b039091169063a8c8f12590611a1c90879033908890600401612aa0565b600060405180830381600087803b158015611a3657600080fd5b505af1158015611a4a573d6000803e3d6000fd5b50505050336001600160a01b0316847f6b8d42c9cc0941503ffe3a7d736e8613bbee6a3a47528a6f041727eec728594e85604051611a889190612a80565b60405180910390a350505050565b3390565b600082611aa957506000610366565b82820282848281611ab657fe5b0414611ad45760405162461bcd60e51b81526004016103b1906128b8565b9392505050565b6000808211611afc5760405162461bcd60e51b81526004016103b1906127f0565b818381611b0557fe5b049392505050565b611b638363a9059cbb60e01b8484604051602401611b2c929190612574565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cf6565b505050565b6000611b7330611d85565b15905090565b600054610100900460ff1680611b925750611b92611b68565b80611ba0575060005460ff16155b611bbc5760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611be7576000805460ff1961ff0019909116610100171660011790555b611bef611d8b565b611bf7611e0c565b8015611c09576000805461ff00191690555b50565b600054610100900460ff1680611c255750611c25611b68565b80611c33575060005460ff16155b611c4f5760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611c7a576000805460ff1961ff0019909116610100171660011790555b611bf7611ee6565b600082820183811015611ad45760405162461bcd60e51b81526004016103b19061273c565b600082821115611cc95760405162461bcd60e51b81526004016103b190612773565b50900390565b611cf0846323b872dd60e01b858585604051602401611b2c93929190612550565b50505050565b6060611d4b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611f6c9092919063ffffffff16565b805190915015611b635780806020019051810190611d699190612250565b611b635760405162461bcd60e51b81526004016103b190612988565b3b151590565b600054610100900460ff1680611da45750611da4611b68565b80611db2575060005460ff16155b611dce5760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611bf7576000805460ff1961ff0019909116610100171660011790558015611c09576000805461ff001916905550565b600054610100900460ff1680611e255750611e25611b68565b80611e33575060005460ff16155b611e4f5760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611e7a576000805460ff1961ff0019909116610100171660011790555b6000611e84611a96565b606580546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015611c09576000805461ff001916905550565b600054610100900460ff1680611eff5750611eff611b68565b80611f0d575060005460ff16155b611f295760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611f54576000805460ff1961ff0019909116610100171660011790555b600180558015611c09576000805461ff001916905550565b6060611f7b8484600085611f83565b949350505050565b606082471015611fa55760405162461bcd60e51b81526004016103b1906127aa565b611fae85611d85565b611fca5760405162461bcd60e51b81526004016103b19061292e565b60006060866001600160a01b03168587604051611fe79190612520565b60006040518083038185875af1925050503d8060008114612024576040519150601f19603f3d011682016040523d82523d6000602084013e612029565b606091505b5091509150612039828286612044565b979650505050505050565b60608315612053575081611ad4565b8251156120635782518084602001fd5b8160405162461bcd60e51b81526004016103b191906125f4565b604080518082019091526000808252602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120d557805160ff1916838001178555612102565b82800160010185558215612102579182015b828111156121025782518255916020019190600101906120e7565b5061210e929150612191565b5090565b604051806101800160405280606081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b031681526020016000151581526020016000600181111561218c57fe5b905290565b5b8082111561210e5760008155600101612192565b803561036681612b30565b803561036681612b45565b80356002811061036657600080fd5b600082601f8301126121db578081fd5b813567ffffffffffffffff8111156121f1578182fd5b612204601f8201601f1916602001612add565b915080825283602082850101111561221b57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215612245578081fd5b8135611ad481612b30565b600060208284031215612261578081fd5b8151611ad481612b45565b60006020828403121561227d578081fd5b813567ffffffffffffffff80821115612294578283fd5b81840191506101808083870312156122aa578384fd5b6122b381612add565b90508235828111156122c3578485fd5b6122cf878286016121cb565b8252506020830135602082015260408301356040820152606083013560608201526080830135608082015260a083013560a082015260c083013560c082015260e083013560e08201526101009150612329868385016121a6565b82820152610120915061233e868385016121a6565b828201526101409150612353868385016121b1565b828201526101609150612368868385016121bc565b91810191909152949350505050565b600060208284031215612388578081fd5b5035919050565b6000602082840312156123a0578081fd5b5051919050565b600080604083850312156123b9578081fd5b8235915060208301356123cb81612b30565b809150509250929050565b600080604083850312156123e8578182fd5b50508035926020909101359150565b600060208284031215612408578081fd5b815160ff81168114611ad4578182fd5b6001600160a01b03169052565b15159052565b6002811061243557fe5b9052565b60008151808452612451816020860160208601612b04565b601f01601f19169290920160200192915050565b6000610180825181855261247b82860182612439565b9150506020830151602085015260408301516040850152606083015160608501526080830151608085015260a083015160a085015260c083015160c085015260e083015160e0850152610100808401516124d782870182612418565b5050610120808401516124ec82870182612418565b50506101408084015161250182870182612425565b5050610160808401516125168287018261242b565b5090949350505050565b60008251612532818460208701612b04565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b60006040820160408352808551808352606085019150602092506060838202860101838801855b838110156125e257605f198884030185526125d0838351612465565b948601949250908501906001016125b4565b50509290940194909452949350505050565b600060208252611ad46020830184612439565b6000610180825261261c61018083018f612439565b90508c60208301528b60408301528a60608301528960808301528860a08301528760c08301528660e083015260018060a01b038087166101008401528086166101208401525083151561014083015261267961016083018461242b565b9d9c50505050505050505050505050565b60208082526007908201526610b6b4b73a32b960c91b604082015260600190565b6020808252600c908201526b2162656e656669636961727960a01b604082015260600190565b6020808252600b908201526a21676f7665726e616e636560a81b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b60208082526006908201526510ba37b5b2b760d11b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60208082526009908201526821646563696d616c7360b81b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60208082526009908201526821646561646c696e6560b81b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252600e908201526d6f6e6c79476f7665726e616e636560901b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526009908201526808585c98da1a5d995960ba1b604082015260600190565b600060208252611ad46020830184612465565b8151815260209182015115159181019190915260400190565b90815260200190565b9182526001600160a01b0316602082015260400190565b9283526001600160a01b03919091166020830152604082015260600190565b9182521515602082015260400190565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715612afc57600080fd5b604052919050565b60005b83811015612b1f578181015183820152602001612b07565b83811115611cf05750506000910152565b6001600160a01b0381168114611c0957600080fd5b8015158114611c0957600080fdfea264697066735822122097f135279bbe806dcd83802d7bb02d44323c33206bd680a4bfb53348d4741d7f64736f6c634300060c0033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806393c829fc116100c3578063ceb6a22f1161007c578063ceb6a22f1461028f578063ee41f0bc146102b0578063f2fde38b146102c3578063f7d2deb0146102d6578063fca3b5aa146102eb578063fd41c9c7146102fe5761014d565b806393c829fc14610225578063ab033ea914610238578063ad5c46481461024b578063b3de9b5d14610253578063b9d02df41461025b578063c4d66de81461027c5761014d565b8063571a26a011610115578063571a26a0146101c2578063579e526c146101905780635aa6e675146101ed578063715018a6146101f557806378bd7935146101fd5780638da5cb5b1461021d5761014d565b806307546172146101525780631069f3b514610170578063121aee991461019057806323336892146101a55780632ad71573146101ba575b600080fd5b61015a610311565b604051610167919061253c565b60405180910390f35b61018361017e3660046123a7565b610320565b6040516101679190612a67565b61019861036c565b6040516101679190612a80565b6101b86101b336600461226c565b610372565b005b6101986106a5565b6101d56101d0366004612377565b6106ab565b6040516101679c9b9a99989796959493929190612607565b61015a6107b9565b6101b86107c8565b61021061020b366004612377565b610851565b6040516101679190612a54565b61015a6109bf565b6101b8610233366004612377565b6109ce565b6101b8610246366004612234565b610ef3565b61015a610f65565b610198610f7d565b61026e6102693660046123a7565b610f82565b604051610167929190612abf565b6101b861028a366004612234565b610fa9565b6102a261029d3660046123d6565b611058565b60405161016792919061258d565b6101986102be3660046123d6565b611307565b6101b86102d1366004612234565b61152a565b6102de6115eb565b6040516101679190612acf565b6101b86102f9366004612234565b6115f0565b6101b861030c3660046123d6565b611677565b6098546001600160a01b031681565b61032861207d565b506000828152609b602090815260408083206001600160a01b03851684528252918290208251808401909352805483526001015460ff161515908201525b92915050565b61271081565b61037a611a96565b6001600160a01b031661038b6109bf565b6001600160a01b0316146103ba5760405162461bcd60e51b81526004016103b1906128f9565b60405180910390fd5b428160200151116103dd5760405162461bcd60e51b81526004016103b190612965565b6101208101516001600160a01b03166104085760405162461bcd60e51b81526004016103b1906126ab565b6101008101516001600160a01b03166104335760405162461bcd60e51b81526004016103b190612827565b60008161010001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561047357600080fd5b505afa158015610487573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ab91906123f7565b60ff16905060128111156104d15760405162461bcd60e51b81526004016103b190612895565b600060e08301819052609a80546001810182559152825180518492600a027f44da158ba27f9252712a74ff6a55c5d531f69609f1f6e7f17c4443a8e2089be4019161052191839160200190612094565b50602082015160018281019190915560408301516002830155606083015160038301556080830151600483015560a0830151600583015560c0830151600683015560e083015160078301556101008301516008830180546001600160a01b03199081166001600160a01b03938416179091556101208501516009850180546101408801519316919093161760ff60a01b1916600160a01b91151591909102178082556101608501519260ff60a81b1990911690600160a81b9084908111156105e557fe5b0217905550506099805460010190819055610120840151610100850151604051630d3f117f60e21b81526001600160a01b0390921693506334fc45fc9261063192909190600401612a89565b600060405180830381600087803b15801561064b57600080fd5b505af115801561065f573d6000803e3d6000fd5b505050508161010001516001600160a01b03166099547f748fd6a01f0f0df2e8354235caf8fdf83654b5a47b2358be7e7bffb16b726ceb60405160405180910390a35050565b60995481565b609a81815481106106b857fe5b6000918252602091829020600a919091020180546040805160026001841615610100026000190190931692909204601f8101859004850283018501909152808252919350918391908301828280156107515780601f1061072657610100808354040283529160200191610751565b820191906000526020600020905b81548152906001019060200180831161073457829003601f168201915b50505060018401546002850154600386015460048701546005880154600689015460078a015460088b01546009909b0154999a9699959850939650919490939192916001600160a01b039182169181169060ff600160a01b8204811691600160a81b9004168c565b6097546001600160a01b031681565b6107d0611a96565b6001600160a01b03166107e16109bf565b6001600160a01b0316146108075760405162461bcd60e51b81526004016103b1906128f9565b6065546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3606580546001600160a01b0319169055565b610859612112565b609a828154811061086657fe5b600091825260209182902060408051600a93909302909101805460026001821615610100026000190190911604601f810185900490940283016101a090810190925261018083018481529293909284929091849184018282801561090b5780601f106108e05761010080835404028352916020019161090b565b820191906000526020600020905b8154815290600101906020018083116108ee57829003601f168201915b50505091835250506001828101546020830152600283015460408301526003830154606083015260048301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546001600160a01b03908116610100840152600984015490811661012084015260ff600160a01b82048116151561014085015261016090930192600160a81b90910416908111156109ab57fe5b60018111156109b657fe5b90525092915050565b6065546001600160a01b031690565b600260015414156109f15760405162461bcd60e51b81526004016103b1906129fa565b60026001556109fe611a96565b6001600160a01b0316610a0f6109bf565b6001600160a01b031614610a355760405162461bcd60e51b81526004016103b1906128f9565b610a3d612112565b609a8281548110610a4a57fe5b600091825260209182902060408051600a93909302909101805460026001821615610100026000190190911604601f810185900490940283016101a0908101909252610180830184815292939092849290918491840182828015610aef5780601f10610ac457610100808354040283529160200191610aef565b820191906000526020600020905b815481529060010190602001808311610ad257829003601f168201915b50505091835250506001828101546020830152600283015460408301526003830154606083015260048301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546001600160a01b03908116610100840152600984015490811661012084015260ff600160a01b82048116151561014085015261016090930192600160a81b9091041690811115610b8f57fe5b6001811115610b9a57fe5b81525050905080610140015115610bc35760405162461bcd60e51b81526004016103b190612a31565b8060200151421015610be75760405162461bcd60e51b81526004016103b190612965565b6040516370a0823160e01b8152600090610c77908490737ceb23fd6bc0add59e62ac25578270cff1b9f619906370a0823190610c2790309060040161253c565b60206040518083038186803b158015610c3f57600080fd5b505afa158015610c53573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102be919061238f565b6098549091506001600160a01b03166316a34956610ca16002610c9b856003611a9a565b90611adb565b8461012001516040518363ffffffff1660e01b8152600401610cc4929190612a89565b600060405180830381600087803b158015610cde57600080fd5b505af1158015610cf2573d6000803e3d6000fd5b5050505060e08201516001610140840152609a805484919086908110610d1457fe5b90600052602060002090600a02016000820151816000019080519060200190610d3e929190612094565b50602082015160018281019190915560408301516002830155606083015160038301556080830151600483015560a0830151600583015560c0830151600683015560e083015160078301556101008301516008830180546001600160a01b03199081166001600160a01b03938416179091556101208501516009850180546101408801519316919093161760ff60a01b1916600160a01b91151591909102178082556101608501519260ff60a81b1990911690600160a81b908490811115610e0257fe5b02179055505081159050610e3657610120830151610e3690737ceb23fd6bc0add59e62ac25578270cff1b9f6199083611b0d565b8261012001516001600160a01b0316638383ff6885856101000151846040518463ffffffff1660e01b8152600401610e7093929190612aa0565b600060405180830381600087803b158015610e8a57600080fd5b505af1158015610e9e573d6000803e3d6000fd5b505050508261010001516001600160a01b0316847f19cae222ef19833ac099aed0d3cd78d340f372cf3777f21611efd2d63fc915d283604051610ee19190612a80565b60405180910390a35050600180555050565b6097546001600160a01b03163314610f1d5760405162461bcd60e51b81526004016103b1906129d2565b6001600160a01b038116610f435760405162461bcd60e51b81526004016103b1906126d1565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b737ceb23fd6bc0add59e62ac25578270cff1b9f61981565b600181565b609b6020908152600092835260408084209091529082529020805460019091015460ff1682565b600054610100900460ff1680610fc25750610fc2611b68565b80610fd0575060005460ff16155b610fec5760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611017576000805460ff1961ff0019909116610100171660011790555b609780546001600160a01b0319166001600160a01b03841617905561103a611b79565b611042611c0c565b8015611054576000805461ff00191690555b5050565b60606000806110678585611a9a565b905060006110808561107a886001611c82565b90611a9a565b9050600061108f876001611c82565b90506099548211156110a357505060995460005b60995415806110b6575060016099540383115b156110fb5760408051600080825260208201909252906110ec565b6110d9612112565b8152602001906001900390816110d15790505b50600094509450505050611300565b600060606111098486611ca7565b67ffffffffffffffff8111801561111f57600080fd5b5060405190808252806020026020018201604052801561115957816020015b611146612112565b81526020019060019003908161113e5790505b5090505b838510156112f7576099548510156112e857609a858154811061117c57fe5b600091825260209182902060408051600a93909302909101805460026001821615610100026000190190911604601f810185900490940283016101a09081019092526101808301848152929390928492909184918401828280156112215780601f106111f657610100808354040283529160200191611221565b820191906000526020600020905b81548152906001019060200180831161120457829003601f168201915b50505091835250506001828101546020830152600283015460408301526003830154606083015260048301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546001600160a01b03908116610100840152600984015490811661012084015260ff600160a01b82048116151561014085015261016090930192600160a81b90910416908111156112c157fe5b60018111156112cc57fe5b815250508183815181106112dc57fe5b60200260200101819052505b6001948501949091019061115d565b95509093505050505b9250929050565b6000611311612112565b609a848154811061131e57fe5b600091825260209182902060408051600a93909302909101805460026001821615610100026000190190911604601f810185900490940283016101a09081019092526101808301848152929390928492909184918401828280156113c35780601f10611398576101008083540402835291602001916113c3565b820191906000526020600020905b8154815290600101906020018083116113a657829003601f168201915b50505091835250506001828101546020830152600283015460408301526003830154606083015260048301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546001600160a01b03908116610100840152600984015490811661012084015260ff600160a01b82048116151561014085015261016090930192600160a81b909104169081111561146357fe5b600181111561146e57fe5b81525050905060008161010001516001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156114b457600080fd5b505afa1580156114c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ec91906123f7565b60ff169050600081601260ff1603600a0a905061152081610c9b612710610c9b87604001518a611a9a90919063ffffffff16565b9695505050505050565b611532611a96565b6001600160a01b03166115436109bf565b6001600160a01b0316146115695760405162461bcd60e51b81526004016103b1906128f9565b6001600160a01b03811661158f5760405162461bcd60e51b81526004016103b1906126f6565b6065546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3606580546001600160a01b0319166001600160a01b0392909216919091179055565b601281565b6115f8611a96565b6001600160a01b03166116096109bf565b6001600160a01b03161461162f5760405162461bcd60e51b81526004016103b1906128f9565b6001600160a01b0381166116555760405162461bcd60e51b81526004016103b19061268a565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b61167f612112565b609a838154811061168c57fe5b600091825260209182902060408051600a93909302909101805460026001821615610100026000190190911604601f810185900490940283016101a09081019092526101808301848152929390928492909184918401828280156117315780601f1061170657610100808354040283529160200191611731565b820191906000526020600020905b81548152906001019060200180831161171457829003601f168201915b50505091835250506001828101546020830152600283015460408301526003830154606083015260048301546080830152600583015460a0830152600683015460c0830152600783015460e083015260088301546001600160a01b03908116610100840152600984015490811661012084015260ff600160a01b82048116151561014085015261016090930192600160a81b90910416908111156117d157fe5b60018111156117dc57fe5b815250509050806101400151156118055760405162461bcd60e51b81526004016103b190612a31565b806020015142106118285760405162461bcd60e51b81526004016103b190612965565b611848737ceb23fd6bc0add59e62ac25578270cff1b9f619333085611ccf565b61185061207d565b506000838152609b602090815260408083203384528252918290208251808401909352805480845260019091015460ff161515918301919091526118949084611c82565b81526000848152609b60209081526040808320338452825290912082518155908201516001909101805460ff191691151591909117905560e08201516118da9084611c82565b60e0830152609a8054839190869081106118f057fe5b90600052602060002090600a0201600082015181600001908051906020019061191a929190612094565b50602082015160018281019190915560408301516002830155606083015160038301556080830151600483015560a0830151600583015560c0830151600683015560e083015160078301556101008301516008830180546001600160a01b03199081166001600160a01b03938416179091556101208501516009850180546101408801519316919093161760ff60a01b1916600160a01b91151591909102178082556101608501519260ff60a81b1990911690600160a81b9084908111156119de57fe5b0217905550505061012082015160405163a8c8f12560e01b81526001600160a01b039091169063a8c8f12590611a1c90879033908890600401612aa0565b600060405180830381600087803b158015611a3657600080fd5b505af1158015611a4a573d6000803e3d6000fd5b50505050336001600160a01b0316847f6b8d42c9cc0941503ffe3a7d736e8613bbee6a3a47528a6f041727eec728594e85604051611a889190612a80565b60405180910390a350505050565b3390565b600082611aa957506000610366565b82820282848281611ab657fe5b0414611ad45760405162461bcd60e51b81526004016103b1906128b8565b9392505050565b6000808211611afc5760405162461bcd60e51b81526004016103b1906127f0565b818381611b0557fe5b049392505050565b611b638363a9059cbb60e01b8484604051602401611b2c929190612574565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cf6565b505050565b6000611b7330611d85565b15905090565b600054610100900460ff1680611b925750611b92611b68565b80611ba0575060005460ff16155b611bbc5760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611be7576000805460ff1961ff0019909116610100171660011790555b611bef611d8b565b611bf7611e0c565b8015611c09576000805461ff00191690555b50565b600054610100900460ff1680611c255750611c25611b68565b80611c33575060005460ff16155b611c4f5760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611c7a576000805460ff1961ff0019909116610100171660011790555b611bf7611ee6565b600082820183811015611ad45760405162461bcd60e51b81526004016103b19061273c565b600082821115611cc95760405162461bcd60e51b81526004016103b190612773565b50900390565b611cf0846323b872dd60e01b858585604051602401611b2c93929190612550565b50505050565b6060611d4b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611f6c9092919063ffffffff16565b805190915015611b635780806020019051810190611d699190612250565b611b635760405162461bcd60e51b81526004016103b190612988565b3b151590565b600054610100900460ff1680611da45750611da4611b68565b80611db2575060005460ff16155b611dce5760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611bf7576000805460ff1961ff0019909116610100171660011790558015611c09576000805461ff001916905550565b600054610100900460ff1680611e255750611e25611b68565b80611e33575060005460ff16155b611e4f5760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611e7a576000805460ff1961ff0019909116610100171660011790555b6000611e84611a96565b606580546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015611c09576000805461ff001916905550565b600054610100900460ff1680611eff5750611eff611b68565b80611f0d575060005460ff16155b611f295760405162461bcd60e51b81526004016103b190612847565b600054610100900460ff16158015611f54576000805460ff1961ff0019909116610100171660011790555b600180558015611c09576000805461ff001916905550565b6060611f7b8484600085611f83565b949350505050565b606082471015611fa55760405162461bcd60e51b81526004016103b1906127aa565b611fae85611d85565b611fca5760405162461bcd60e51b81526004016103b19061292e565b60006060866001600160a01b03168587604051611fe79190612520565b60006040518083038185875af1925050503d8060008114612024576040519150601f19603f3d011682016040523d82523d6000602084013e612029565b606091505b5091509150612039828286612044565b979650505050505050565b60608315612053575081611ad4565b8251156120635782518084602001fd5b8160405162461bcd60e51b81526004016103b191906125f4565b604080518082019091526000808252602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120d557805160ff1916838001178555612102565b82800160010185558215612102579182015b828111156121025782518255916020019190600101906120e7565b5061210e929150612191565b5090565b604051806101800160405280606081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b031681526020016000151581526020016000600181111561218c57fe5b905290565b5b8082111561210e5760008155600101612192565b803561036681612b30565b803561036681612b45565b80356002811061036657600080fd5b600082601f8301126121db578081fd5b813567ffffffffffffffff8111156121f1578182fd5b612204601f8201601f1916602001612add565b915080825283602082850101111561221b57600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215612245578081fd5b8135611ad481612b30565b600060208284031215612261578081fd5b8151611ad481612b45565b60006020828403121561227d578081fd5b813567ffffffffffffffff80821115612294578283fd5b81840191506101808083870312156122aa578384fd5b6122b381612add565b90508235828111156122c3578485fd5b6122cf878286016121cb565b8252506020830135602082015260408301356040820152606083013560608201526080830135608082015260a083013560a082015260c083013560c082015260e083013560e08201526101009150612329868385016121a6565b82820152610120915061233e868385016121a6565b828201526101409150612353868385016121b1565b828201526101609150612368868385016121bc565b91810191909152949350505050565b600060208284031215612388578081fd5b5035919050565b6000602082840312156123a0578081fd5b5051919050565b600080604083850312156123b9578081fd5b8235915060208301356123cb81612b30565b809150509250929050565b600080604083850312156123e8578182fd5b50508035926020909101359150565b600060208284031215612408578081fd5b815160ff81168114611ad4578182fd5b6001600160a01b03169052565b15159052565b6002811061243557fe5b9052565b60008151808452612451816020860160208601612b04565b601f01601f19169290920160200192915050565b6000610180825181855261247b82860182612439565b9150506020830151602085015260408301516040850152606083015160608501526080830151608085015260a083015160a085015260c083015160c085015260e083015160e0850152610100808401516124d782870182612418565b5050610120808401516124ec82870182612418565b50506101408084015161250182870182612425565b5050610160808401516125168287018261242b565b5090949350505050565b60008251612532818460208701612b04565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b60006040820160408352808551808352606085019150602092506060838202860101838801855b838110156125e257605f198884030185526125d0838351612465565b948601949250908501906001016125b4565b50509290940194909452949350505050565b600060208252611ad46020830184612439565b6000610180825261261c61018083018f612439565b90508c60208301528b60408301528a60608301528960808301528860a08301528760c08301528660e083015260018060a01b038087166101008401528086166101208401525083151561014083015261267961016083018461242b565b9d9c50505050505050505050505050565b60208082526007908201526610b6b4b73a32b960c91b604082015260600190565b6020808252600c908201526b2162656e656669636961727960a01b604082015260600190565b6020808252600b908201526a21676f7665726e616e636560a81b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b60208082526006908201526510ba37b5b2b760d11b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b60208082526009908201526821646563696d616c7360b81b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60208082526009908201526821646561646c696e6560b81b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252600e908201526d6f6e6c79476f7665726e616e636560901b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526009908201526808585c98da1a5d995960ba1b604082015260600190565b600060208252611ad46020830184612465565b8151815260209182015115159181019190915260400190565b90815260200190565b9182526001600160a01b0316602082015260400190565b9283526001600160a01b03919091166020830152604082015260600190565b9182521515602082015260400190565b60ff91909116815260200190565b60405181810167ffffffffffffffff81118282101715612afc57600080fd5b604052919050565b60005b83811015612b1f578181015183820152602001612b07565b83811115611cf05750506000910152565b6001600160a01b0381168114611c0957600080fd5b8015158114611c0957600080fdfea264697066735822122097f135279bbe806dcd83802d7bb02d44323c33206bd680a4bfb53348d4741d7f64736f6c634300060c0033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

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

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