Contract Address Details

0x0dCb0CB0120d355CdE1ce56040be57Add0185BAa

Token
Binance (BNB)
Creator
0xfa9da5–d99251 at 0x31a6a2–edb230
Balance
0 ETC ( )
Tokens
Fetching tokens...
Transactions
90 Transactions
Transfers
0 Transfers
Gas Used
4,127,182
Last Balance Update
16425074
Contract name:
AnyswapV6ERC20




Optimization enabled
true
Compiler version
v0.8.14+commit.80d49f37




Optimization runs
200
EVM Version
default




Verified at
2022-06-17T18:28:29.053455Z

Constructor Arguments

00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fa9da51631268a30ec3ddd1ccbf46c65fad99251000000000000000000000000000000000000000000000000000000000000000742696e616e6365000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003424e420000000000000000000000000000000000000000000000000000000000

Arg [0] (string) : Binance
Arg [1] (string) : BNB
Arg [2] (uint8) : 18
Arg [3] (address) : 0x0000000000000000000000000000000000000000
Arg [4] (address) : 0xfa9da51631268a30ec3ddd1ccbf46c65fad99251

              

Contract source code

// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity ^0.8.2;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    function totalSupply() external view returns (uint256);
    function decimals() external view returns (uint8);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

library Address {
    function isContract(address account) internal view returns (bool) {
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != 0x0 && codehash != accountHash);
    }
}

library SafeERC20 {
    using Address for address;

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

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

    function safeApprove(IERC20 token, address spender, uint value) internal {
        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 callOptionalReturn(IERC20 token, bytes memory data) private {
        require(address(token).isContract(), "SafeERC20: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = address(token).call(data);
        require(success, "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");
        }
    }
}

contract AnyswapV6ERC20 is IERC20 {
    using SafeERC20 for IERC20;
    string public name;
    string public symbol;
    uint8  public immutable override decimals;

    address public immutable underlying;
    bool public constant underlyingIsMinted = false;

    /// @dev Records amount of AnyswapV6ERC20 token owned by account.
    mapping (address => uint256) public override balanceOf;
    uint256 private _totalSupply;

    // init flag for setting immediate vault, needed for CREATE2 support
    bool private _init;

    // flag to enable/disable swapout vs vault.burn so multiple events are triggered
    bool private _vaultOnly;

    // delay for timelock functions
    uint public constant DELAY = 2 days;

    // set of minters, can be this bridge or other bridges
    mapping(address => bool) public isMinter;
    address[] public minters;

    // primary controller of the token contract
    address public vault;

    address public pendingMinter;
    uint public delayMinter;

    address public pendingVault;
    uint public delayVault;

    modifier onlyAuth() {
        require(isMinter[msg.sender], "AnyswapV6ERC20: FORBIDDEN");
        _;
    }

    modifier onlyVault() {
        require(msg.sender == vault, "AnyswapV6ERC20: FORBIDDEN");
        _;
    }

    function owner() external view returns (address) {
        return vault;
    }

    function mpc() external view returns (address) {
        return vault;
    }

    function setVaultOnly(bool enabled) external onlyVault {
        _vaultOnly = enabled;
    }

    function initVault(address _vault) external onlyVault {
        require(_init);
        _init = false;
        vault = _vault;
        isMinter[_vault] = true;
        minters.push(_vault);
    }

    function setVault(address _vault) external onlyVault {
        require(_vault != address(0), "AnyswapV6ERC20: address(0)");
        pendingVault = _vault;
        delayVault = block.timestamp + DELAY;
    }

    function applyVault() external onlyVault {
        require(pendingVault != address(0) && block.timestamp >= delayVault);
        vault = pendingVault;

        pendingVault = address(0);
        delayVault = 0;
    }

    function setMinter(address _auth) external onlyVault {
        require(_auth != address(0), "AnyswapV6ERC20: address(0)");
        pendingMinter = _auth;
        delayMinter = block.timestamp + DELAY;
    }

    function applyMinter() external onlyVault {
        require(pendingMinter != address(0) && block.timestamp >= delayMinter);
        isMinter[pendingMinter] = true;
        minters.push(pendingMinter);

        pendingMinter = address(0);
        delayMinter = 0;
    }

    // No time delay revoke minter emergency function
    function revokeMinter(address _auth) external onlyVault {
        isMinter[_auth] = false;
    }

    function getAllMinters() external view returns (address[] memory) {
        return minters;
    }

    function changeVault(address newVault) external onlyVault returns (bool) {
        require(newVault != address(0), "AnyswapV6ERC20: address(0)");
        emit LogChangeVault(vault, newVault, block.timestamp);
        vault = newVault;
        pendingVault = address(0);
        delayVault = 0;
        return true;
    }

    function mint(address to, uint256 amount) external onlyAuth returns (bool) {
        _mint(to, amount);
        return true;
    }

    function burn(address from, uint256 amount) external onlyAuth returns (bool) {
        _burn(from, amount);
        return true;
    }

    function Swapin(bytes32 txhash, address account, uint256 amount) external onlyAuth returns (bool) {
        if (underlying != address(0) && IERC20(underlying).balanceOf(address(this)) >= amount) {
            IERC20(underlying).safeTransfer(account, amount);
        } else {
            _mint(account, amount);
        }
        emit LogSwapin(txhash, account, amount);
        return true;
    }

    function Swapout(uint256 amount, address bindaddr) external returns (bool) {
        require(!_vaultOnly, "AnyswapV6ERC20: vaultOnly");
        require(bindaddr != address(0), "AnyswapV6ERC20: address(0)");
        if (underlying != address(0) && balanceOf[msg.sender] < amount) {
            IERC20(underlying).safeTransferFrom(msg.sender, address(this), amount);
        } else {
            _burn(msg.sender, amount);
        }
        emit LogSwapout(msg.sender, bindaddr, amount);
        return true;
    }

    /// @dev Records number of AnyswapV6ERC20 token that account (second) will be allowed to spend on behalf of another account (first) through {transferFrom}.
    mapping (address => mapping (address => uint256)) public override allowance;

    event LogChangeVault(address indexed oldVault, address indexed newVault, uint indexed effectiveTime);
    event LogSwapin(bytes32 indexed txhash, address indexed account, uint amount);
    event LogSwapout(address indexed account, address indexed bindaddr, uint amount);

    constructor(string memory _name, string memory _symbol, uint8 _decimals, address _underlying, address _vault) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;
        underlying = _underlying;
        if (_underlying != address(0)) {
            require(_decimals == IERC20(_underlying).decimals());
        }

        // Use init to allow for CREATE2 accross all chains
        _init = true;

        // Disable/Enable swapout for v1 tokens vs mint/burn for v3 tokens
        _vaultOnly = false;

        vault = _vault;
    }

    /// @dev Returns the total supply of AnyswapV6ERC20 token as the ETH held in this contract.
    function totalSupply() external view override returns (uint256) {
        return _totalSupply;
    }

    function deposit() external returns (uint) {
        uint _amount = IERC20(underlying).balanceOf(msg.sender);
        IERC20(underlying).safeTransferFrom(msg.sender, address(this), _amount);
        return _deposit(_amount, msg.sender);
    }

    function deposit(uint amount) external returns (uint) {
        IERC20(underlying).safeTransferFrom(msg.sender, address(this), amount);
        return _deposit(amount, msg.sender);
    }

    function deposit(uint amount, address to) external returns (uint) {
        IERC20(underlying).safeTransferFrom(msg.sender, address(this), amount);
        return _deposit(amount, to);
    }

    function depositVault(uint amount, address to) external onlyVault returns (uint) {
        return _deposit(amount, to);
    }

    function _deposit(uint amount, address to) internal returns (uint) {
        require(!underlyingIsMinted);
        require(underlying != address(0) && underlying != address(this));
        _mint(to, amount);
        return amount;
    }

    function withdraw() external returns (uint) {
        return _withdraw(msg.sender, balanceOf[msg.sender], msg.sender);
    }

    function withdraw(uint amount) external returns (uint) {
        return _withdraw(msg.sender, amount, msg.sender);
    }

    function withdraw(uint amount, address to) external returns (uint) {
        return _withdraw(msg.sender, amount, to);
    }

    function withdrawVault(address from, uint amount, address to) external onlyVault returns (uint) {
        return _withdraw(from, amount, to);
    }

    function _withdraw(address from, uint amount, address to) internal returns (uint) {
        require(!underlyingIsMinted);
        require(underlying != address(0) && underlying != address(this));
        _burn(from, amount);
        IERC20(underlying).safeTransfer(to, amount);
        return 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 {
        require(account != address(0), "ERC20: mint to the zero address");

        _totalSupply += amount;
        balanceOf[account] += 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 {
        require(account != address(0), "ERC20: burn from the zero address");

        uint256 balance = balanceOf[account];
        require(balance >= amount, "ERC20: burn amount exceeds balance");

        balanceOf[account] = balance - amount;
        _totalSupply -= amount;
        emit Transfer(account, address(0), amount);
    }

    /// @dev Sets `value` as allowance of `spender` account over caller account's AnyswapV6ERC20 token.
    /// Emits {Approval} event.
    /// Returns boolean value indicating whether operation succeeded.
    function approve(address spender, uint256 value) external override returns (bool) {
        allowance[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);

        return true;
    }

    /// @dev Moves `value` AnyswapV6ERC20 token from caller's account to account (`to`).
    /// Emits {Transfer} event.
    /// Returns boolean value indicating whether operation succeeded.
    /// Requirements:
    ///   - caller account must have at least `value` AnyswapV6ERC20 token.
    function transfer(address to, uint256 value) external override returns (bool) {
        require(to != address(0) && to != address(this));
        uint256 balance = balanceOf[msg.sender];
        require(balance >= value, "AnyswapV6ERC20: transfer amount exceeds balance");

        balanceOf[msg.sender] = balance - value;
        balanceOf[to] += value;
        emit Transfer(msg.sender, to, value);

        return true;
    }

    /// @dev Moves `value` AnyswapV6ERC20 token from account (`from`) to account (`to`) using allowance mechanism.
    /// `value` is then deducted from caller account's allowance, unless set to `type(uint256).max`.
    /// Emits {Approval} event to reflect reduced allowance `value` for caller account to spend from account (`from`),
    /// unless allowance is set to `type(uint256).max`
    /// Emits {Transfer} event.
    /// Returns boolean value indicating whether operation succeeded.
    /// Requirements:
    ///   - `from` account must have at least `value` balance of AnyswapV6ERC20 token.
    ///   - `from` account must have approved caller to spend at least `value` of AnyswapV6ERC20 token, unless `from` and caller are the same account.
    function transferFrom(address from, address to, uint256 value) external override returns (bool) {
        require(to != address(0) && to != address(this));
        if (from != msg.sender) {
            uint256 allowed = allowance[from][msg.sender];
            if (allowed != type(uint256).max) {
                require(allowed >= value, "AnyswapV6ERC20: request exceeds allowance");
                uint256 reduced = allowed - value;
                allowance[from][msg.sender] = reduced;
                emit Approval(from, msg.sender, reduced);
            }
        }

        uint256 balance = balanceOf[from];
        require(balance >= value, "AnyswapV6ERC20: transfer amount exceeds balance");

        balanceOf[from] = balance - value;
        balanceOf[to] += value;
        emit Transfer(from, to, value);

        return true;
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"string","name":"_name","internalType":"string"},{"type":"string","name":"_symbol","internalType":"string"},{"type":"uint8","name":"_decimals","internalType":"uint8"},{"type":"address","name":"_underlying","internalType":"address"},{"type":"address","name":"_vault","internalType":"address"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"LogChangeVault","inputs":[{"type":"address","name":"oldVault","internalType":"address","indexed":true},{"type":"address","name":"newVault","internalType":"address","indexed":true},{"type":"uint256","name":"effectiveTime","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"LogSwapin","inputs":[{"type":"bytes32","name":"txhash","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"LogSwapout","inputs":[{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"bindaddr","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"DELAY","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"Swapin","inputs":[{"type":"bytes32","name":"txhash","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"Swapout","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"bindaddr","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"applyMinter","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"applyVault","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"burn","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"changeVault","inputs":[{"type":"address","name":"newVault","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"delayMinter","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"delayVault","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"deposit","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"deposit","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"deposit","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"depositVault","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getAllMinters","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initVault","inputs":[{"type":"address","name":"_vault","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isMinter","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"mint","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"minters","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"mpc","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pendingMinter","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"pendingVault","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeMinter","inputs":[{"type":"address","name":"_auth","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMinter","inputs":[{"type":"address","name":"_auth","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setVault","inputs":[{"type":"address","name":"_vault","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setVaultOnly","inputs":[{"type":"bool","name":"enabled","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"underlying","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"underlyingIsMinted","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"vault","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdraw","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdraw","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdraw","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdrawVault","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061025c5760003560e01c806387689e2811610146578063c3081240116100c3578063d93f244511610087578063d93f244514610544578063dd62ed3e1461054c578063ec126c7714610577578063f75c266414610455578063fbfa77cf1461058a578063fca3b5aa1461059d57600080fd5b8063c308124014610505578063c4b740f51461050e578063cfbd488514610521578063d0e30db014610534578063d6c797511461053c57600080fd5b8063a045442c1161010a578063a045442c14610494578063a9059cbb146104a9578063aa271e1a146104bc578063b6b55f25146104df578063bebbf4d0146104f257600080fd5b806387689e281461044c5780638da5cb5b1461045557806391c5df491461046657806395d89b41146104795780639dc29fac1461048157600080fd5b80633ccfd60b116101df5780636817031b116101a35780636817031b146103c257806369b41170146103d55780636e553f65146103df5780636f307dc3146103f257806370a08231146104195780638623ec7b1461043957600080fd5b80633ccfd60b1461035657806340c10f191461035e57806352113ba71461037157806360e232a91461039c578063628d6cba146103af57600080fd5b806318160ddd1161022657806318160ddd146102dc57806323b872dd146102e45780632e1a7d4d146102f75780632ebe3fbb1461030a578063313ce5671461031d57600080fd5b806239d6ec14610261578062f714ce1461028757806306fdde031461029a578063095ea7b3146102af5780630d707df8146102d2575b600080fd5b61027461026f366004611977565b6105b0565b6040519081526020015b60405180910390f35b6102746102953660046119b3565b6105f9565b6102a261060d565b60405161027e9190611a0b565b6102c26102bd366004611a3e565b61069b565b604051901515815260200161027e565b6102da610707565b005b600354610274565b6102c26102f2366004611a68565b6107d6565b610274610305366004611aa4565b6109d4565b6102da610318366004611abd565b6109e7565b6103447f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff909116815260200161027e565b610274610aa1565b6102c261036c366004611a3e565b610ac2565b600a54610384906001600160a01b031681565b6040516001600160a01b03909116815260200161027e565b6102c26103aa366004611abd565b610b04565b6102c26103bd3660046119b3565b610bc9565b6102da6103d0366004611abd565b610d16565b6102746202a30081565b6102746103ed3660046119b3565b610d94565b6103847f000000000000000000000000000000000000000000000000000000000000000081565b610274610427366004611abd565b60026020526000908152604090205481565b610384610447366004611aa4565b610dd5565b610274600b5481565b6007546001600160a01b0316610384565b600854610384906001600160a01b031681565b6102a2610dff565b6102c261048f366004611a3e565b610e0c565b61049c610e45565b60405161027e9190611ad8565b6102c26104b7366004611a3e565b610ea7565b6102c26104ca366004611abd565b60056020526000908152604090205460ff1681565b6102746104ed366004611aa4565b610f7e565b6102746105003660046119b3565b610fbf565b61027460095481565b6102da61051c366004611b36565b610fec565b6102da61052f366004611abd565b611030565b61027461107b565b6102c2600081565b6102da61114f565b61027461055a366004611b53565b600c60209081526000928352604080842090915290825290205481565b6102c2610585366004611b7d565b6111ca565b600754610384906001600160a01b031681565b6102da6105ab366004611abd565b61133d565b6007546000906001600160a01b031633146105e65760405162461bcd60e51b81526004016105dd90611ba2565b60405180910390fd5b6105f18484846113bb565b949350505050565b60006106063384846113bb565b9392505050565b6000805461061a90611bd9565b80601f016020809104026020016040519081016040528092919081815260200182805461064690611bd9565b80156106935780601f1061066857610100808354040283529160200191610693565b820191906000526020600020905b81548152906001019060200180831161067657829003601f168201915b505050505081565b336000818152600c602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906106f69086815260200190565b60405180910390a350600192915050565b6007546001600160a01b031633146107315760405162461bcd60e51b81526004016105dd90611ba2565b6008546001600160a01b03161580159061074d57506009544210155b61075657600080fd5b600880546001600160a01b0390811660009081526005602052604081208054600160ff199091168117909155835460068054928301815583527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9091018054919093166001600160a01b0319918216179092558254909116909155600955565b60006001600160a01b038316158015906107f957506001600160a01b0383163014155b61080257600080fd5b6001600160a01b038416331461090e576001600160a01b0384166000908152600c60209081526040808320338452909152902054600019811461090c57828110156108a15760405162461bcd60e51b815260206004820152602960248201527f416e7973776170563645524332303a2072657175657374206578636565647320604482015268616c6c6f77616e636560b81b60648201526084016105dd565b60006108ad8483611c29565b6001600160a01b0387166000818152600c6020908152604080832033808552908352928190208590555184815293945090927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505b505b6001600160a01b038416600090815260026020526040902054828110156109475760405162461bcd60e51b81526004016105dd90611c40565b6109518382611c29565b6001600160a01b038087166000908152600260205260408082209390935590861681529081208054859290610987908490611c8f565b92505081905550836001600160a01b0316856001600160a01b0316600080516020611d31833981519152856040516109c191815260200190565b60405180910390a3506001949350505050565b60006109e13383336113bb565b92915050565b6007546001600160a01b03163314610a115760405162461bcd60e51b81526004016105dd90611ba2565b60045460ff16610a2057600080fd5b6004805460ff19908116909155600780546001600160a01b039093166001600160a01b0319938416811790915560008181526005602052604081208054909316600190811790935560068054938401815590527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f9091018054909216179055565b336000818152600260205260408120549091610abd91816113bb565b905090565b3360009081526005602052604081205460ff16610af15760405162461bcd60e51b81526004016105dd90611ba2565b610afb838361146d565b50600192915050565b6007546000906001600160a01b03163314610b315760405162461bcd60e51b81526004016105dd90611ba2565b6001600160a01b038216610b575760405162461bcd60e51b81526004016105dd90611ca7565b60075460405142916001600160a01b03808616929116907f5c364079e7102c27c608f9b237c735a1b7bfa0b67f27c2ad26bad447bf965cac90600090a450600780546001600160a01b0383166001600160a01b031991821617909155600a805490911690556000600b5560015b919050565b600454600090610100900460ff1615610c245760405162461bcd60e51b815260206004820152601960248201527f416e7973776170563645524332303a207661756c744f6e6c790000000000000060448201526064016105dd565b6001600160a01b038216610c4a5760405162461bcd60e51b81526004016105dd90611ca7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615801590610c9057503360009081526002602052604090205483115b15610ccf57610cca6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308661153a565b610cd9565b610cd933846115ab565b6040518381526001600160a01b0383169033907f6b616089d04950dc06c45c6dd787d657980543f89651aec47924752c7d16c888906020016106f6565b6007546001600160a01b03163314610d405760405162461bcd60e51b81526004016105dd90611ba2565b6001600160a01b038116610d665760405162461bcd60e51b81526004016105dd90611ca7565b600a80546001600160a01b0319166001600160a01b038316179055610d8e6202a30042611c8f565b600b5550565b6000610dcb6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308661153a565b61060683836116f0565b60068181548110610de557600080fd5b6000918252602090912001546001600160a01b0316905081565b6001805461061a90611bd9565b3360009081526005602052604081205460ff16610e3b5760405162461bcd60e51b81526004016105dd90611ba2565b610afb83836115ab565b60606006805480602002602001604051908101604052809291908181526020018280548015610e9d57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e7f575b5050505050905090565b60006001600160a01b03831615801590610eca57506001600160a01b0383163014155b610ed357600080fd5b3360009081526002602052604090205482811015610f035760405162461bcd60e51b81526004016105dd90611c40565b610f0d8382611c29565b33600090815260026020526040808220929092556001600160a01b03861681529081208054859290610f40908490611c8f565b90915550506040518381526001600160a01b038516903390600080516020611d31833981519152906020015b60405180910390a35060019392505050565b6000610fb56001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308561153a565b6109e182336116f0565b6007546000906001600160a01b03163314610dcb5760405162461bcd60e51b81526004016105dd90611ba2565b6007546001600160a01b031633146110165760405162461bcd60e51b81526004016105dd90611ba2565b600480549115156101000261ff0019909216919091179055565b6007546001600160a01b0316331461105a5760405162461bcd60e51b81526004016105dd90611ba2565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6040516370a0823160e01b815233600482015260009081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa1580156110e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111089190611cde565b905061113f6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308461153a565b61114981336116f0565b91505090565b6007546001600160a01b031633146111795760405162461bcd60e51b81526004016105dd90611ba2565b600a546001600160a01b0316158015906111955750600b544210155b61119e57600080fd5b600a8054600780546001600160a01b03199081166001600160a01b038416179091551690556000600b55565b3360009081526005602052604081205460ff166111f95760405162461bcd60e51b81526004016105dd90611ba2565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316158015906112b957506040516370a0823160e01b815230600482015282907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611292573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b69190611cde565b10155b156112f7576112f26001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016848461176d565b611301565b611301838361146d565b826001600160a01b0316847f05d0634fe981be85c22e2942a880821b70095d84e152c3ea3c17a4e4250d9d6184604051610f6c91815260200190565b6007546001600160a01b031633146113675760405162461bcd60e51b81526004016105dd90611ba2565b6001600160a01b03811661138d5760405162461bcd60e51b81526004016105dd90611ca7565b600880546001600160a01b0319166001600160a01b0383161790556113b56202a30042611c8f565b60095550565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161580159061141e57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163014155b61142757600080fd5b61143184846115ab565b6114656001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016838561176d565b509092915050565b6001600160a01b0382166114c35760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016105dd565b80600360008282546114d59190611c8f565b90915550506001600160a01b03821660009081526002602052604081208054839290611502908490611c8f565b90915550506040518181526001600160a01b03831690600090600080516020611d318339815191529060200160405180910390a35050565b6040516001600160a01b03808516602483015283166044820152606481018290526115a59085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526117a2565b50505050565b6001600160a01b03821661160b5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016105dd565b6001600160a01b0382166000908152600260205260409020548181101561167f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016105dd565b6116898282611c29565b6001600160a01b038416600090815260026020526040812091909155600380548492906116b7908490611c29565b90915550506040518281526000906001600160a01b03851690600080516020611d318339815191529060200160405180910390a3505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161580159061175357507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163014155b61175c57600080fd5b611766828461146d565b5090919050565b6040516001600160a01b03831660248201526044810182905261179d90849063a9059cbb60e01b9060640161156e565b505050565b6117b4826001600160a01b0316611929565b6118005760405162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740060448201526064016105dd565b600080836001600160a01b03168360405161181b9190611cf7565b6000604051808303816000865af19150503d8060008114611858576040519150601f19603f3d011682016040523d82523d6000602084013e61185d565b606091505b5091509150816118af5760405162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460448201526064016105dd565b8051156115a557808060200190518101906118ca9190611d13565b6115a55760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105dd565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906105f15750141592915050565b80356001600160a01b0381168114610bc457600080fd5b60008060006060848603121561198c57600080fd5b61199584611960565b9250602084013591506119aa60408501611960565b90509250925092565b600080604083850312156119c657600080fd5b823591506119d660208401611960565b90509250929050565b60005b838110156119fa5781810151838201526020016119e2565b838111156115a55750506000910152565b6020815260008251806020840152611a2a8160408501602087016119df565b601f01601f19169190910160400192915050565b60008060408385031215611a5157600080fd5b611a5a83611960565b946020939093013593505050565b600080600060608486031215611a7d57600080fd5b611a8684611960565b9250611a9460208501611960565b9150604084013590509250925092565b600060208284031215611ab657600080fd5b5035919050565b600060208284031215611acf57600080fd5b61060682611960565b6020808252825182820181905260009190848201906040850190845b81811015611b195783516001600160a01b031683529284019291840191600101611af4565b50909695505050505050565b8015158114611b3357600080fd5b50565b600060208284031215611b4857600080fd5b813561060681611b25565b60008060408385031215611b6657600080fd5b611b6f83611960565b91506119d660208401611960565b600080600060608486031215611b9257600080fd5b83359250611a9460208501611960565b60208082526019908201527f416e7973776170563645524332303a20464f5242494444454e00000000000000604082015260600190565b600181811c90821680611bed57607f821691505b602082108103611c0d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015611c3b57611c3b611c13565b500390565b6020808252602f908201527f416e7973776170563645524332303a207472616e7366657220616d6f756e742060408201526e657863656564732062616c616e636560881b606082015260800190565b60008219821115611ca257611ca2611c13565b500190565b6020808252601a908201527f416e7973776170563645524332303a2061646472657373283029000000000000604082015260600190565b600060208284031215611cf057600080fd5b5051919050565b60008251611d098184602087016119df565b9190910192915050565b600060208284031215611d2557600080fd5b815161060681611b2556feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220468458ae9f41d8d30c26258de8ff05afe8b2afc0ea06050d773bb03d2ea09dd364736f6c634300080e0033