Contract Address Details

0x0D5B8fAC50f09A6C90c6d7AE0036b1890fB92a75

Contract Name
MasterChefNFT
Creator
0xf9e78cā€“318f5b at 0x166c30ā€“32ebce
Balance
0 Doge
Tokens
Fetching tokens...
Transactions
3,026 Transactions
Transfers
7,415 Transfers
Gas Used
621,517,330
Last Balance Update
26577226
Contract name:
MasterChefNFT




Optimization enabled
false
Compiler version
v0.8.9+commit.e5eed63a




EVM Version
default




Verified at
2022-09-28T01:05:55.984644Z

Constructor Arguments

0000000000000000000000004a78a6a8f8b3773f7a78befd106f280403eea807000000000000000000000000aebd7a84ced1622593ff24d667df707007f183c100000000000000000000000077b5c56d36fd0e9b40d2e9efa26d072c128b3f740000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d2000000000000000000000000a94aa23f43e9f00ce154f3c1c7f971ecb5318be8000000000000000000000000000000000000000000000000003cfe655b1ee6e000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000633af8f0

Arg [0] (address) : 0x4a78a6a8f8b3773f7a78befd106f280403eea807
Arg [1] (address) : 0xaebd7a84ced1622593ff24d667df707007f183c1
Arg [2] (address) : 0x77b5c56d36fd0e9b40d2e9efa26d072c128b3f74
Arg [3] (address) : 0x9c26e24ac6f0ea783ff9ca2bf81543c67cf446d2
Arg [4] (address) : 0xa94aa23f43e9f00ce154f3c1c7f971ecb5318be8
Arg [5] (uint256) : 17168209876543200
Arg [6] (uint256) : 1000
Arg [7] (uint256) : 1664809200

              

Contract source code

// SPDX-License-Identifier: MIT

// Sources flattened with hardhat v2.11.1 https://hardhat.org

// File @openzeppelin/contracts/utils/Context.sol@v4.2.0

pragma solidity ^0.8.0;

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

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


// File @openzeppelin/contracts/access/Ownable.sol@v4.2.0

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.2.0

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}


// File @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol@v4.2.0

pragma solidity ^0.8.0;

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

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

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


// File @openzeppelin/contracts/token/ERC20/ERC20.sol@v4.2.0

pragma solidity ^0.8.0;



/**
 * @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, IERC20Metadata {
    mapping(address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

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

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

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

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

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

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

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        unchecked {
            _approve(sender, _msgSender(), currentAllowance - amount);
        }

        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

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

        emit Transfer(sender, recipient, amount);

        _afterTokenTransfer(sender, recipient, amount);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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


// File @uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol@v1.0.1

pragma solidity >=0.5.0;

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}


// File contracts/BanksyToken.sol

/*
     ,-""""-.
   ,'      _ `.
  /       )_)  \
 :              :
 \              /
  \            /
   `.        ,'
     `.    ,'
       `.,'
        /\`.   ,-._
            `-'         BanksyDao.finance
 */
// Kurama protocol License Identifier:  62b9ff30-1008-4e02-893d-971dd776fe08

pragma solidity ^0.8.9;



/*
 * TABLE ERROR REFERENCE:
 * E1: The sender is on the blacklist. Please contact to support.
 * E2: The recipient is on the blacklist. Please contact to support.
 * E3: User cannot send more than allowed.
 * E4: User is not operator.
 * E5: User is excluded from antibot system.
 * E6: Bot address is already on the blacklist.
 * E7: The expiration time has to be greater than 0.
 * E8: Bot address is not found on the blacklist.
 * E9: Address cant be 0.
 * E10: newMaxUserTransferAmountRate must be greather than 50 (0.05%)
 * E11: newMaxUserTransferAmountRate must be less than or equal to 10000 (100%)
 * E12: newTransferTax sum must be less than MAX
 * E13: transferTax can't be higher than amount
 */
contract BanksyToken is ERC20, Ownable {
    ///@dev Max transfer amount rate. (default is 3% of total supply)
    uint16 public maxUserTransferAmountRate = 300;

    ///@dev Exclude operators from antiBot system
    mapping(address => bool) private _excludedOperators;

    ///@dev mapping store blacklist. address => ExpirationTime 
    mapping(address => uint256) private _blacklist;

    ///@dev Length of blacklist addressess
    uint256 public blacklistLength;

    // Banksy Treasury
    address public treasuryDAOAddress;

    // Burnd Address
    address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD;

    // Operator Role
    address internal _operator;

    event OperatorTransferred(address indexed previousOperator, address indexed newOperator);
    event TransferTaxRateUpdated(address indexed operator, uint256 previousRate, uint256 newRate);
    event SetMaxUserTransferAmountRate(address indexed operator, uint256 previousRate, uint256 newRate);
    event AddBotAddress(address indexed botAddress);
    event RemoveBotAddress(address indexed botAddress);
    event SetOperators(address indexed operatorAddress, bool previousStatus, bool newStatus);

    constructor(address _treasuryDAOAddress)
        ERC20('BANKSY V2', 'BANKSY')
    {
        // Exclude operator addresses: lps, burn, treasury, admin, etc from antibot system
        _excludedOperators[msg.sender] = true;
        _excludedOperators[address(0)] = true;
        _excludedOperators[address(this)] = true;
        _excludedOperators[BURN_ADDRESS] = true;
        _excludedOperators[_treasuryDAOAddress] = true;

        treasuryDAOAddress = _treasuryDAOAddress;

        _operator = _msgSender();
    }

    /// Modifiers ///
    modifier antiBot(address sender, address recipient, uint256 amount) {
        //check blacklist
        require(!blacklistCheck(sender), "E1");
        require(!blacklistCheck(recipient), "E2");

        // check  if sender|recipient has a tx amount is within the allowed limits
        if (!isExcludedOperator(sender)) {
            if (!isExcludedOperator(recipient))
                require(amount <= maxUserTransferAmount(), "E3");
        }

        _;
    }

    modifier onlyOperator() {
        require(_operator == _msgSender(), "E4");
        _;
    }

    /// External functions ///
    function burn(uint256 amount) external onlyOwner {
        _burn(msg.sender, amount);
    }

    /// @dev internal function to add address to blacklist.
    function addBotAddressToBlackList(address botAddress, uint256 expirationTime) external onlyOwner {
        require(!isExcludedOperator(botAddress), "E5");
        require(_blacklist[botAddress] == 0, "E6");
        require(expirationTime > 0, "E7");

        _blacklist[botAddress] = expirationTime;
        blacklistLength = blacklistLength + 1;

        emit AddBotAddress(botAddress);
    }
    
    ///@dev internal function to remove address from blacklist.
    function removeBotAddressToBlackList(address botAddress) external onlyOperator {
        require(_blacklist[botAddress] > 0, "E8");

        delete _blacklist[botAddress];
        blacklistLength = blacklistLength - 1;

        emit RemoveBotAddress(botAddress);
    }

    ///@dev Update operator address
    function transferOperator(address newOperator) external onlyOperator {
        require(newOperator != address(0), "E9");

        _operator = newOperator;

        emit OperatorTransferred(_operator, newOperator);
    }

    ///@dev Update operator address status
    function setOperators(address operatorAddress, bool status) external onlyOperator {
        require(operatorAddress != address(0), "E9");

        emit SetOperators(operatorAddress, _excludedOperators[operatorAddress], status);

        _excludedOperators[operatorAddress] = status;
    }

    /*
     * Updates the max user transfer amount.
     * @dev set it to 10000 in order to turn off anti whale system (anti bot)
     */
    function setMaxUserTransferAmountRate(uint16 newMaxUserTransferAmountRate) external onlyOperator {
        require(newMaxUserTransferAmountRate >= 50, "E10");
        require(newMaxUserTransferAmountRate <= 10000, "E11");

        emit SetMaxUserTransferAmountRate(_msgSender(), maxUserTransferAmountRate, newMaxUserTransferAmountRate);

        maxUserTransferAmountRate = newMaxUserTransferAmountRate;
    }

    /// External functions that are view ///
    ///@dev check if the address is in the blacklist or not
    function blacklistCheckExpirationTime(address botAddress) external view returns(uint256) {
        return _blacklist[botAddress];
    }

    function operator() external view returns (address) {
        return _operator;
    }

    ///@dev Check if the address is excluded from antibot system.
    function isExcludedOperator(address userAddress) public view returns(bool) {
        return _excludedOperators[userAddress];
    }

    /// Public functions ///
    /// @notice Creates `amount` token to `to`. Must only be called by the owner (MasterChef).
    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }

    ///@dev Max user transfer allowed
    function maxUserTransferAmount() public view returns (uint256) {
        return (totalSupply() * maxUserTransferAmountRate) / 10000;
    }

    ///@dev check if the address is in the blacklist or expired
    function blacklistCheck(address _botAddress) public view returns(bool) {
        return _blacklist[_botAddress] > block.timestamp;
    }

    /// Internal functions ///
    /// @dev overrides transfer function to meet tokenomics of BANKSY
    function _transfer(address sender, address recipient, uint256 amount) internal virtual override antiBot(sender, recipient, amount) {
        super._transfer(sender, recipient, amount);
    }
}


// File contracts/libs/IWETH.sol

pragma solidity >=0.5.0;

interface IWETH {
    function deposit() external payable;
    function transfer(address to, uint value) external returns (bool);
    function withdraw(uint) external;
}


// File @openzeppelin/contracts/security/ReentrancyGuard.sol@v4.2.0

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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


// File @openzeppelin/contracts/utils/Strings.sol@v4.2.0

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}


// File @openzeppelin/contracts/utils/introspection/IERC165.sol@v4.2.0

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}


// File @openzeppelin/contracts/utils/introspection/ERC165.sol@v4.2.0

pragma solidity ^0.8.0;

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}


// File @openzeppelin/contracts/access/AccessControl.sol@v4.2.0

pragma solidity ^0.8.0;



/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    function hasRole(bytes32 role, address account) external view returns (bool);

    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    function grantRole(bytes32 role, address account) external;

    function revokeRole(bytes32 role, address account) external;

    function renounceRole(bytes32 role, address account) external;
}

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, getRoleAdmin(role), adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}


// File @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol@v1.1.0-beta.0

pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}


// File @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol@v1.1.0-beta.0

pragma solidity >=0.6.2;

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}


// File @uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol@v1.0.1

pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}


// File contracts/TreasuryDAO.sol

/*
     ,-""""-.
   ,'      _ `.
  /       )_)  \
 :              :
 \              /
  \            /
   `.        ,'
     `.    ,'
       `.,'
        /\`.   ,-._
            `-'         BanksyDao.finance
 */
// Kurama protocol License Identifier:  62b9ff30-1008-4e02-893d-971dd776fe08

pragma solidity ^0.8.9;






/*
 * Errors table:
 * E1: transfer failed!
 * E2: failed approve
 */
contract TreasuryDAO is ReentrancyGuard, AccessControl {
    bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR");

    address public immutable usdAddress;

    // default to two weeks
    uint256 public distributionTimeFrame = 3600 * 24 * 14;

    uint256 public lastUsdDistroTime;

    uint256 public pendingUsd;

    // receive() external payable {}

    event UsdTransferredToUser(address recipient, uint256 amount);
    event BanksyTransferredToUser(address recipient, uint256 amount);
    event SetDistributionTimeFrame(uint256 distributionTimeFrame);

    constructor(address _usdAddress, uint256 startTime) {
        usdAddress = _usdAddress;

        lastUsdDistroTime = startTime;

        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
        _setupRole(OPERATOR_ROLE, _msgSender());
    }

    /// External functions ///
    ///@dev sell all of a current type of token for usd. and distribute on a drip.
    function getUsdRelease(uint256 totalUsdLockup) external onlyRole(OPERATOR_ROLE) returns (uint256) {
        uint256 usdBalance = IERC20(usdAddress).balanceOf(address(this));
        if (pendingUsd + totalUsdLockup > usdBalance)
            return 0;

        uint256 usdAvailable = usdBalance - pendingUsd - totalUsdLockup;

        // only provide a drip if there has been some blocks passed since the last drip
        uint256 timeSinceLastDistro = block.timestamp > lastUsdDistroTime ? block.timestamp - lastUsdDistroTime : 0;

        // We distribute the usd assuming the old usd balance wanted to be distributed over distributionTimeFrame blocks.
        uint256 usdRelease = (timeSinceLastDistro * usdAvailable) / distributionTimeFrame;

        usdRelease = usdRelease > usdAvailable ? usdAvailable : usdRelease;

        lastUsdDistroTime = block.timestamp;
        pendingUsd = pendingUsd + usdRelease;

        return usdRelease;
    }

    function transferUsdToOwner(address ownerAddress, uint256 amount) external onlyRole(OPERATOR_ROLE) {
        uint256 usdBalance = IERC20(usdAddress).balanceOf(address(this));
        if (usdBalance < amount)
            amount = usdBalance;

        require(IERC20(usdAddress).transfer(ownerAddress, amount), "E1");

        /// avoid negative result
        if (amount > pendingUsd)
            amount = pendingUsd;

        pendingUsd = pendingUsd - amount;

        emit UsdTransferredToUser(ownerAddress, amount);
    }

    function setDistributionTimeFrame(uint256 newUsdDistributionTimeFrame) external onlyRole(DEFAULT_ADMIN_ROLE) {
        distributionTimeFrame = newUsdDistributionTimeFrame;

        emit SetDistributionTimeFrame(distributionTimeFrame);
    }

    function emergencyWithDrawToken(address token) external onlyRole(DEFAULT_ADMIN_ROLE) {
        uint256 balanceToken = IERC20(token).balanceOf(address(this));
        if (balanceToken > 0)
            IERC20(token).transfer(msg.sender, balanceToken);
    }
}


// File contracts/libs/IFactoryNFT.sol

/*
    ,-,--.   ,---.      .-._                           ___    ,---.      .-._         
 ,-.'-  _\.--.'  \    /==/ \  .-._  _,..---._  .-._ .'=.'\ .--.'  \    /==/ \  .-._  
/==/_ ,_.'\==\-/\ \   |==|, \/ /, /==/,   -  \/==/ \|==|  |\==\-/\ \   |==|, \/ /, / 
\==\  \   /==/-|_\ |  |==|-  \|  ||==|   _   _\==|,|  / - |/==/-|_\ |  |==|-  \|  |  
 \==\ -\  \==\,   - \ |==| ,  | -||==|  .=.   |==|  \/  , |\==\,   - \ |==| ,  | -|  
 _\==\ ,\ /==/ -   ,| |==| -   _ ||==|,|   | -|==|- ,   _ |/==/ -   ,| |==| -   _ |  
/==/\/ _ /==/-  /\ - \|==|  /\ , ||==|  '='   /==| _ /\   /==/-  /\ - \|==|  /\ , |  
\==\ - , |==\ _.\=\.-'/==/, | |- ||==|-,   _`//==/  / / , |==\ _.\=\.-'/==/, | |- |  
 `--`---' `--`        `--`./  `--``-.`.____.' `--`./  `--` `--`        `--`./  `--`  
                                                                    by sandman.finance                                     
 */
pragma solidity ^0.8.6;

interface  IFactoryNFT {
    function setExperience(uint256 tokenId, uint256 newExperience) external;
    function getArtWorkOverView(uint256 tokenId) external returns (uint256,uint256,uint256);
    function safeTransferFrom(address from, address to, uint256 tokenId) external;
    function ownerOf(uint256 tokenId) external view returns (address owner);
    function balanceOf(address owner) external view returns (uint256 balance);
}


// File contracts/libs/ImergeAPI.sol

/*
    ,-,--.   ,---.      .-._                           ___    ,---.      .-._         
 ,-.'-  _\.--.'  \    /==/ \  .-._  _,..---._  .-._ .'=.'\ .--.'  \    /==/ \  .-._  
/==/_ ,_.'\==\-/\ \   |==|, \/ /, /==/,   -  \/==/ \|==|  |\==\-/\ \   |==|, \/ /, / 
\==\  \   /==/-|_\ |  |==|-  \|  ||==|   _   _\==|,|  / - |/==/-|_\ |  |==|-  \|  |  
 \==\ -\  \==\,   - \ |==| ,  | -||==|  .=.   |==|  \/  , |\==\,   - \ |==| ,  | -|  
 _\==\ ,\ /==/ -   ,| |==| -   _ ||==|,|   | -|==|- ,   _ |/==/ -   ,| |==| -   _ |  
/==/\/ _ /==/-  /\ - \|==|  /\ , ||==|  '='   /==| _ /\   /==/-  /\ - \|==|  /\ , |  
\==\ - , |==\ _.\=\.-'/==/, | |- ||==|-,   _`//==/  / / , |==\ _.\=\.-'/==/, | |- |  
 `--`---' `--`        `--`./  `--``-.`.____.' `--`./  `--` `--`        `--`./  `--`  
                                                                    by sandman.finance                                     
 */
pragma solidity ^0.8.6;

interface  ImergeAPI {
    function getSkillCard(uint256 _nftID)
        external
        view
        returns (
            uint256,
            uint256,
            uint256,
            uint256,
            uint256,
            uint256
        );
}


// File @openzeppelin/contracts/utils/Address.sol@v4.2.0

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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

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


// File @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol@v4.2.0

pragma solidity ^0.8.0;


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

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

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

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

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

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

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

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


// File @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol@v4.2.0

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}


// File @openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol@v4.2.0

pragma solidity ^0.8.0;

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
}


// File contracts/MasterChefNFT.sol

/*
     ,-""""-.
   ,'      _ `.
  /       )_)  \
 :              :
 \              /
  \            /
   `.        ,'
     `.    ,'
       `.,'
        /\`.   ,-._
            `-'         BanksyDao.finance
 */
// Kurama protocol License Identifier:  62b9ff30-1008-4e02-893d-971dd776fe08

pragma solidity ^0.8.9;







/*
 * Errors Ref Table
 * E1: add: invalid deposit fee basis points
 * E2: add: invalid harvest interval
 * E3: set: invalid deposit fee basis points
 * E4: we dont accept deposits of 0 size
 * E5: withdraw: not good
 * E6: user already added nft
 * E7: User is not owner of nft sent
 * E8: user no has nft
 * E9: !nonzero
 * E10: cannot change start block if sale has already commenced
 * E11: cannot set start block in the past
 */
contract MasterChefNFT is Ownable, ReentrancyGuard, ERC721Holder {
    using SafeERC20 for IERC20;

    struct UserInfo {
        uint256 amount;
        uint256 banksyRewardDebt;
        uint256 usdRewardDebt;
        uint256 banksyRewardLockup;
        uint256 usdRewardLockup;
        uint256 nextHarvestUntil;
    }

    struct UserNftInfo {
        uint256 nftId;
        uint256 powerStaking;
        uint256 experience;
        bool hasNft;
    }

    struct PoolInfo {
        address lpToken;
        uint256 allocPoint;
        uint256 lastRewardTime;
        uint256 accBanksyPerShare;
        uint256 totalLocked;
        uint256 harvestInterval;
        uint256 depositFeeBP;
        uint256 tokenType;
    }

    uint256 public constant banksyMaximumSupply = 50 * (10 ** 3) * (10 ** 18); // 50,000 banksyToken

    uint256 constant MAX_EMISSION_RATE = 10 * (10 ** 18); // 10

    uint256 constant MAXIMUM_HARVEST_INTERVAL = 4 hours;

    // The Banksy TOKEN!
    address public immutable banksyToken;

    // Banksy Treasury
    TreasuryDAO public immutable treasuryDAO;

    // Banksy Treasury Util Address
    address public immutable treasuryUtil;

    // Interface NFT FACTORY
    address public immutable iFactoryNFT;

    // Total usd collected
    uint256 public totalUsdCollected;

    // USD per share
    uint256 public accDepositUsdRewardPerShare;

    // Banksy tokens created per second.
    uint256 public banksyPerSecond;

    // Experience rate created per second.
    uint256 public experienceRate;

    // Deposit Fee address.
    address public feeAddress;

    // Info of each pool.
    PoolInfo[] public poolInfo;

    // Info of each user that stakes LP tokens.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;

    mapping(uint256 => mapping(address => UserNftInfo)) public userNftInfo;

    // Total allocation points. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint;

    // Ownership PID.
    uint256 public ownershipPid;
    
    // The block number when Banksy mining starts.
    uint256 public startTime;

    // The block number when Banksy mining ends.
    uint256 public emmissionEndTime = type(uint256).max;

    // Used NFT.
    // mapping(uint256 => bool) nftIds;

    // Whitelist for avoid harvest lockup for some operative contracts like vaults.
    mapping(address => bool) public harvestLockupWhiteList;

    // The harvest interval.
    uint256 harvestInterval;

    // Total token minted for farming.
    uint256 totalSupplyFarmed;

    // Total usd Lockup
    uint256 public totalUsdLockup;

    // Events definitions
    event AddPool(uint256 indexed pid, uint256 tokenType, uint256 allocPoint, address lpToken, uint256 depositFeeBP);
    event SetPool(uint256 indexed pid, address lpToken, uint256 allocPoint, uint256 depositFeeBP);
    event Deposit(address indexed user, uint256 indexed pid, uint256 amount, uint256 treasuryDepositFee);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event WithdrawNFT(address indexed user, uint256 indexed pid, uint256 nftId);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event SetEmissionRate(address indexed caller, uint256 previousAmount, uint256 newAmount);
    event SetFeeAddress(address indexed user, address indexed newAddress);
    event SetStartTime(uint256 indexed newStartTime);
    event RewardLockedUp(address indexed user, uint256 indexed pid, uint256 amountLockedUp);
    event WithDrawNFTByIndex(uint256 indexed nftId, address indexed userAddress);

    constructor(
        TreasuryDAO _treasuryDAO,
        address _treasuryUtil,
        address _banksyToken,
        address _iFactoryNFT,
        address _feeAddress,
        uint256 _banksyPerSecond,
        uint256 _experienceRate,
        uint256 _startTime
    ) {
        treasuryDAO = _treasuryDAO;
        treasuryUtil = _treasuryUtil;
        banksyToken = _banksyToken;
        iFactoryNFT = _iFactoryNFT;
        feeAddress = _feeAddress;
        banksyPerSecond = _banksyPerSecond;
        experienceRate = _experienceRate;
        startTime = _startTime;
    }

    /// External functions ///
    /// Add a new lp to the pool. Can only be called by the owner.
    function add(
        uint256 newTokenType,
        uint256 newAllocPoint,
        address newLpToken,
        uint256 newDepositFeeBP,
        uint256 newHarvestInterval,
        bool withUpdate
    ) external onlyOwner {
        // Make sure the provided token is ERC20
        IERC20(newLpToken).balanceOf(address(this));

        require(newDepositFeeBP <= 401, "E1");
        require(newHarvestInterval <= MAXIMUM_HARVEST_INTERVAL, "E2");

        if (withUpdate)
            _massUpdatePools();

        uint256 lastRewardTime = block.timestamp > startTime ? block.timestamp : startTime;
        totalAllocPoint = totalAllocPoint + newAllocPoint;

        poolInfo.push(PoolInfo({
          tokenType: newTokenType,
          lpToken : newLpToken,
          allocPoint : newAllocPoint,
          lastRewardTime : lastRewardTime,
          depositFeeBP : newDepositFeeBP,
          totalLocked: 0,
          accBanksyPerShare: 0,
          harvestInterval: newHarvestInterval
        }));

        emit AddPool(poolInfo.length - 1, newTokenType, newAllocPoint, newLpToken, newDepositFeeBP);
    }

    /// Update the given pool's Banksy allocation point and deposit fee. Can only be called by the owner.
    function set(
        uint256 pid,
        uint256 newTokenType,
        uint256 newAllocPoint,
        uint256 newDepositFeeBP,
        uint256 newHarvestInterval,
        bool withUpdate
    ) external onlyOwner {
        require(newDepositFeeBP <= 401, "E3");

        if (withUpdate)
            _massUpdatePools();

        totalAllocPoint = totalAllocPoint - poolInfo[pid].allocPoint + newAllocPoint;
        poolInfo[pid].allocPoint = newAllocPoint;
        poolInfo[pid].depositFeeBP = newDepositFeeBP;
        poolInfo[pid].tokenType = newTokenType;
        poolInfo[pid].harvestInterval = newHarvestInterval;

        emit SetPool(pid, poolInfo[pid].lpToken, newAllocPoint, newDepositFeeBP);
    }

    function deposit(uint256 pid, uint256 amount) external nonReentrant {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        _updatePool(pid);
        _payPendingBanksy(pid);
        uint256 treasuryDepositFee;
        if (amount > 0) {
            uint256 balanceBefore = IERC20(pool.lpToken).balanceOf(address(this));
            IERC20(pool.lpToken).safeTransferFrom(address(msg.sender), address(this), amount);
            amount = IERC20(pool.lpToken).balanceOf(address(this)) - balanceBefore;
            require(amount > 0, "E4");

            if (pool.depositFeeBP > 0) {
                uint256 totalDepositFee = (amount * pool.depositFeeBP) / 10000;
                uint256 devDepositFee = (totalDepositFee * 7500) / 10000;
                treasuryDepositFee = totalDepositFee - devDepositFee;
                amount = amount - totalDepositFee;
                // send 3% to banksy finance
                IERC20(pool.lpToken).safeTransfer(feeAddress, devDepositFee);
                // send 1% to treasury
                IERC20(pool.lpToken).safeTransfer(address(treasuryUtil), treasuryDepositFee);
            }

            user.amount = user.amount + amount;
            pool.totalLocked = pool.totalLocked + amount;
        }
        user.banksyRewardDebt = (user.amount * pool.accBanksyPerShare) / 1e24;
        if (pid == ownershipPid)
            user.usdRewardDebt = ((user.amount * accDepositUsdRewardPerShare) / 1e24);

        emit Deposit(msg.sender, pid, amount, treasuryDepositFee);
    }

    function withdraw(uint256 pid, uint256 amount) external nonReentrant {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        require(user.amount >= amount, "E5");

        _updatePool(pid);
        _payPendingBanksy(pid);
        
        if (amount > 0) {
            user.amount = user.amount - amount;
            IERC20(pool.lpToken).safeTransfer(address(msg.sender), amount);
            pool.totalLocked = pool.totalLocked - amount;
        }

        user.banksyRewardDebt = (user.amount * pool.accBanksyPerShare) / 1e24;

        if (pid == ownershipPid)
            user.usdRewardDebt = ((user.amount * accDepositUsdRewardPerShare) / 1e24);

        emit Withdraw(msg.sender, pid, amount);
    }

    function addNFT(uint256 pid, uint256 nftId) external nonReentrant {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        UserNftInfo storage userNft = userNftInfo[pid][msg.sender];

        require(!userNft.hasNft, "E6");
        require(IFactoryNFT(iFactoryNFT).ownerOf(nftId) == msg.sender, "E7");

        _updatePool(pid);
        _payPendingBanksy(pid);

        IFactoryNFT(iFactoryNFT).safeTransferFrom(msg.sender, address(this), nftId);

        userNft.hasNft = true;
        // nftIds[nftId] = true;
        userNft.nftId = nftId;
        userNft.powerStaking = _getNFTPowerStaking(userNft.nftId);
        userNft.experience = _getNFTExperience(userNft.nftId);

        _updateHarvestLockup(pid);

        user.banksyRewardDebt = (user.amount * pool.accBanksyPerShare) / 1e24;
    }

    function withdrawNFT(uint256 pid) external nonReentrant {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        UserNftInfo storage userNft = userNftInfo[pid][msg.sender];

        require(userNft.hasNft, "E8");

        _updatePool(pid);

        _payPendingBanksy(pid);
        
        if (user.banksyRewardLockup > 0) {
            _payNFTBoost(pid, user.banksyRewardLockup);
            userNft.experience = userNft.experience + ((user.banksyRewardLockup * experienceRate) / 10000);
            IFactoryNFT(iFactoryNFT).setExperience(userNft.nftId, userNft.experience);
        }

        IFactoryNFT(iFactoryNFT).safeTransferFrom(address(this), msg.sender, userNft.nftId); 

        // nftIds[user.nftId] = false;

        userNft.hasNft = false;
        userNft.nftId = 0;
        userNft.powerStaking = 0;
        userNft.experience = 0;

        _updateHarvestLockup(pid);

        user.banksyRewardDebt = (user.amount * pool.accBanksyPerShare) / 1e24;

        emit WithdrawNFT(msg.sender, pid, userNft.nftId);
    }

    function emergencyWithdraw(uint256 pid) external nonReentrant {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        uint256 amount = user.amount;
        user.amount = 0;
        user.banksyRewardDebt = 0;
        user.banksyRewardLockup = 0;

        user.usdRewardDebt = 0;
        user.usdRewardLockup = 0;

        user.nextHarvestUntil = 0;
        IERC20(pool.lpToken).safeTransfer(address(msg.sender), amount);

        // In the case of an accounting error, we choose to let the user emergency withdraw anyway
        if (pool.totalLocked >= amount)
            pool.totalLocked = pool.totalLocked - amount;
        else
            pool.totalLocked = 0;

        emit EmergencyWithdraw(msg.sender, pid, amount);
    }

    // Set fee address. OnlyOwner
    function setFeeAddress(address newFeeAddress) external onlyOwner {
        require(newFeeAddress != address(0), "E9");
        feeAddress = newFeeAddress;
        // emit SetFeeAddress(msg.sender, newFeeAddress);
    }

    ///@dev Set startTime. Only can run before start by Owner.
    function setStartTime(uint256 newStartTime) external onlyOwner {
        require(block.timestamp < startTime, "E10");
        require(block.timestamp < newStartTime, "E11");

        startTime = newStartTime;
        _massUpdateLastRewardTimePools();

        // emit SetStartTime(startTime);
    }

    function setEmissionRate(uint256 newBanksyPerSecond) external onlyOwner {
        require(newBanksyPerSecond > 0);
        require(newBanksyPerSecond < MAX_EMISSION_RATE);

        _massUpdatePools();
        banksyPerSecond = newBanksyPerSecond;

        emit SetEmissionRate(msg.sender, banksyPerSecond, newBanksyPerSecond);
    }

    function setExperienceRate(uint256 newExperienceRate) external onlyOwner {
        require(newExperienceRate >= 0);

        experienceRate = newExperienceRate;
    }

    /// Add/Remove address to whitelist for havest lockup.
    function setHarvestLockupWhiteList(address recipient, bool newStatus) external onlyOwner {
        harvestLockupWhiteList[recipient] = newStatus;
    }

    ///@dev Emergency NFT WithDraw, only owner.
    function emergencyWithdrawNFTByIndex(uint256 nftId, address userAddress) external onlyOwner {
        require(IFactoryNFT(iFactoryNFT).ownerOf(nftId) == address(this));

        IFactoryNFT(iFactoryNFT).safeTransferFrom(address(this), userAddress, nftId);

        emit WithDrawNFTByIndex(nftId, userAddress);
    }

    /// External functions that are view ///
    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    ///@return pending USD.
    function pendingUsd(address userAddress) external view returns (uint256) {
        UserInfo storage user = userInfo[0][userAddress];

        return ((user.amount * accDepositUsdRewardPerShare) / 1e24) + user.usdRewardLockup - user.usdRewardDebt;
    }

    ///@return pending Banksy.
    function pendingBanksy(uint256 pid, address userAddress) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][userAddress];
        uint256 accBanksyPerShare = pool.accBanksyPerShare;
        if (block.timestamp > pool.lastRewardTime && pool.totalLocked != 0 && totalAllocPoint > 0) {
            uint256 multiplier = getMultiplier(pool.lastRewardTime, block.timestamp);
            uint256 banksyReward = (multiplier * banksyPerSecond * pool.allocPoint) / totalAllocPoint;
            accBanksyPerShare = accBanksyPerShare + ((banksyReward * 1e24) / pool.totalLocked);
        }
        uint256 pending = ((user.amount * accBanksyPerShare) /  1e24) - user.banksyRewardDebt;

        return pending + user.banksyRewardLockup;
    }

    /// Public functions ///
    function canHarvest(uint256 pid, address userAddress) public view returns (bool) {
        UserInfo storage user = userInfo[pid][userAddress];

        return block.timestamp >= user.nextHarvestUntil;
    }

    /// Internal functions ///
    function _massUpdatePools() internal {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            _updatePool(pid);
        }
    }

    function _updatePool(uint256 pid) internal {
        PoolInfo storage pool = poolInfo[pid];
        if (block.timestamp <= pool.lastRewardTime)
            return;

        if (pool.totalLocked == 0 || pool.allocPoint == 0) {
            pool.lastRewardTime = block.timestamp;
            return;
        }

        // Ownership pool is always pool 0.
        if (poolInfo[ownershipPid].totalLocked > 0) {
            uint256 usdRelease = treasuryDAO.getUsdRelease(totalUsdLockup);
            accDepositUsdRewardPerShare = accDepositUsdRewardPerShare + ((usdRelease * 1e24) / poolInfo[ownershipPid].totalLocked);
            totalUsdCollected = totalUsdCollected + usdRelease;
        }

        uint256 multiplier = getMultiplier(pool.lastRewardTime, block.timestamp);
        uint256 banksyReward = (multiplier * banksyPerSecond * pool.allocPoint) / totalAllocPoint;

        // This shouldn't happen, but just in case we stop rewards.
        if (totalSupplyFarmed > banksyMaximumSupply)
            banksyReward = 0;
        else if ((totalSupplyFarmed + banksyReward) > banksyMaximumSupply)
            banksyReward = banksyMaximumSupply - totalSupplyFarmed;

        if (banksyReward > 0) {
            BanksyToken(banksyToken).mint(address(this), banksyReward);
            totalSupplyFarmed = totalSupplyFarmed + banksyReward;
        }

        // The first time we reach Banksy max supply we solidify the end of farming.
        if (totalSupplyFarmed >= banksyMaximumSupply && emmissionEndTime == type(uint256).max)
            emmissionEndTime = block.timestamp;

        pool.accBanksyPerShare = pool.accBanksyPerShare + ((banksyReward * 1e24) / pool.totalLocked);
        pool.lastRewardTime = block.timestamp;
    }

    function _safeTokenTransfer(address token, address to, uint256 amount) internal {
        uint256 tokenBal = IERC20(token).balanceOf(address(this));
        IERC20(token).safeTransfer(to, amount > tokenBal ? tokenBal : amount);
    }

    // Update lastRewardTime variables for all pools.
    function _massUpdateLastRewardTimePools() internal {
        uint256 length = poolInfo.length;
        for (uint256 pid = 0; pid < length; ++pid) {
            poolInfo[pid].lastRewardTime = startTime;
        }
    }

    ///@dev Pay or Lockup pending banksyToken.
    function _payPendingBanksy(uint256 pid) internal {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];

        if (user.nextHarvestUntil == 0)
            _updateHarvestLockup(pid);

        uint256 pendingBanksyToken = ((user.amount * pool.accBanksyPerShare) / 1e24) - user.banksyRewardDebt;
        uint256 pendingUsdToken;
        if (pid == ownershipPid) {
            pendingUsdToken = ((user.amount * accDepositUsdRewardPerShare) / 1e24) - user.usdRewardDebt;
        }

        if (canHarvest(pid, msg.sender)) {
            if (pendingBanksyToken > 0 || user.banksyRewardLockup > 0) {
                uint256 banksyRewards = pendingBanksyToken + user.banksyRewardLockup;
                // reset lockup
                user.banksyRewardLockup = 0;
                _updateHarvestLockup(pid);

                // send rewards
                _safeTokenTransfer(banksyToken, msg.sender, banksyRewards);

                UserNftInfo storage userNft = userNftInfo[pid][msg.sender];

                if (userNft.hasNft) {
                    _payNFTBoost(pid, banksyRewards);
                    userNft.experience = userNft.experience + ((banksyRewards * experienceRate) / 10000);
                    IFactoryNFT(iFactoryNFT).setExperience(userNft.nftId, userNft.experience);
                }
            }

            if (pid == ownershipPid) {
                if (pendingUsdToken > 0 || user.usdRewardLockup > 0) {
                    uint256 usdRewards = pendingUsdToken + user.usdRewardLockup;
                    treasuryDAO.transferUsdToOwner(msg.sender, usdRewards);
                    if (user.usdRewardLockup > 0) {
                        totalUsdLockup = totalUsdLockup - user.usdRewardLockup;
                        user.usdRewardLockup = 0;
                    }
                }
            }
        } else if (pendingBanksyToken > 0 || pendingUsdToken > 0) {
            user.banksyRewardLockup = user.banksyRewardLockup + pendingBanksyToken;
            if (pid == ownershipPid) {
                if (pendingUsdToken > 0) {
                    user.usdRewardLockup = user.usdRewardLockup + pendingUsdToken;
                    totalUsdLockup = totalUsdLockup + pendingUsdToken;
                }
            }
        }

        emit RewardLockedUp(msg.sender, pid, pendingBanksyToken);
    }

    function _getNFTExperience(uint256 nftID) internal returns (uint256) {
        (,uint256 experience,) = IFactoryNFT(iFactoryNFT).getArtWorkOverView(nftID);

        return experience;
    }

    function _updateHarvestLockup(uint256 pid) internal {
        PoolInfo storage pool = poolInfo[pid];
        UserInfo storage user = userInfo[pid][msg.sender];
        UserNftInfo storage userNft = userNftInfo[pid][msg.sender];

        uint256 newHarvestInverval = harvestLockupWhiteList[msg.sender] ? 0 : pool.harvestInterval;

        if (userNft.hasNft && newHarvestInverval > 0) {
            uint256 quarterInterval = (newHarvestInverval * 2500) / 10000;
            uint256 extraBoosted;
            if (userNft.experience > 100)
                extraBoosted = (userNft.experience / 10) / 1e18;

            if (extraBoosted > quarterInterval)
                extraBoosted = quarterInterval;

            newHarvestInverval = newHarvestInverval - quarterInterval - extraBoosted;
        }

        user.nextHarvestUntil = block.timestamp + newHarvestInverval;
    }

    function _payNFTBoost(uint256 pid, uint256 pending) internal {
        UserNftInfo storage userNft = userNftInfo[pid][msg.sender];

        uint256 extraBoosted;
        if (userNft.experience > 100)
            extraBoosted = (userNft.experience / 1e18) / 100;

        uint256 rewardBoosted = (pending * (userNft.powerStaking + extraBoosted)) / 10000;
        if (rewardBoosted > 0)
            BanksyToken(banksyToken).mint(msg.sender, rewardBoosted);
    }

    /// Internal functions that are view ///
    function _getNFTPowerStaking(uint256 nftID) internal returns (uint256) {
        (uint256 power,,) = IFactoryNFT(iFactoryNFT).getArtWorkOverView(nftID);

        return power;
    }

    ///@dev Return reward multiplier over the given from to to time.
    function getMultiplier(uint256 from, uint256 to) internal view returns (uint256) {
        // As we set the multiplier to 0 here after emmissionEndTime
        // deposits aren't blocked after farming ends.
        if (from > emmissionEndTime)
            return 0;

        if (to > emmissionEndTime)
            return emmissionEndTime - from;
        else
            return to - from;
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_treasuryDAO","internalType":"contract TreasuryDAO"},{"type":"address","name":"_treasuryUtil","internalType":"address"},{"type":"address","name":"_banksyToken","internalType":"address"},{"type":"address","name":"_iFactoryNFT","internalType":"address"},{"type":"address","name":"_feeAddress","internalType":"address"},{"type":"uint256","name":"_banksyPerSecond","internalType":"uint256"},{"type":"uint256","name":"_experienceRate","internalType":"uint256"},{"type":"uint256","name":"_startTime","internalType":"uint256"}]},{"type":"event","name":"AddPool","inputs":[{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"tokenType","internalType":"uint256","indexed":false},{"type":"uint256","name":"allocPoint","internalType":"uint256","indexed":false},{"type":"address","name":"lpToken","internalType":"address","indexed":false},{"type":"uint256","name":"depositFeeBP","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"treasuryDepositFee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"EmergencyWithdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RewardLockedUp","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amountLockedUp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"SetEmissionRate","inputs":[{"type":"address","name":"caller","internalType":"address","indexed":true},{"type":"uint256","name":"previousAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"newAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"SetFeeAddress","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"address","name":"newAddress","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SetPool","inputs":[{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"address","name":"lpToken","internalType":"address","indexed":false},{"type":"uint256","name":"allocPoint","internalType":"uint256","indexed":false},{"type":"uint256","name":"depositFeeBP","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"SetStartTime","inputs":[{"type":"uint256","name":"newStartTime","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"WithDrawNFTByIndex","inputs":[{"type":"uint256","name":"nftId","internalType":"uint256","indexed":true},{"type":"address","name":"userAddress","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"WithdrawNFT","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"nftId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"accDepositUsdRewardPerShare","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"add","inputs":[{"type":"uint256","name":"newTokenType","internalType":"uint256"},{"type":"uint256","name":"newAllocPoint","internalType":"uint256"},{"type":"address","name":"newLpToken","internalType":"address"},{"type":"uint256","name":"newDepositFeeBP","internalType":"uint256"},{"type":"uint256","name":"newHarvestInterval","internalType":"uint256"},{"type":"bool","name":"withUpdate","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addNFT","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"},{"type":"uint256","name":"nftId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"banksyMaximumSupply","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"banksyPerSecond","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"banksyToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"canHarvest","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"},{"type":"address","name":"userAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdraw","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdrawNFTByIndex","inputs":[{"type":"uint256","name":"nftId","internalType":"uint256"},{"type":"address","name":"userAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"emmissionEndTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"experienceRate","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"feeAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"harvestLockupWhiteList","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"iFactoryNFT","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"onERC721Received","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"bytes","name":"","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ownershipPid","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingBanksy","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"},{"type":"address","name":"userAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingUsd","inputs":[{"type":"address","name":"userAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"lpToken","internalType":"address"},{"type":"uint256","name":"allocPoint","internalType":"uint256"},{"type":"uint256","name":"lastRewardTime","internalType":"uint256"},{"type":"uint256","name":"accBanksyPerShare","internalType":"uint256"},{"type":"uint256","name":"totalLocked","internalType":"uint256"},{"type":"uint256","name":"harvestInterval","internalType":"uint256"},{"type":"uint256","name":"depositFeeBP","internalType":"uint256"},{"type":"uint256","name":"tokenType","internalType":"uint256"}],"name":"poolInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"poolLength","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"set","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"},{"type":"uint256","name":"newTokenType","internalType":"uint256"},{"type":"uint256","name":"newAllocPoint","internalType":"uint256"},{"type":"uint256","name":"newDepositFeeBP","internalType":"uint256"},{"type":"uint256","name":"newHarvestInterval","internalType":"uint256"},{"type":"bool","name":"withUpdate","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setEmissionRate","inputs":[{"type":"uint256","name":"newBanksyPerSecond","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setExperienceRate","inputs":[{"type":"uint256","name":"newExperienceRate","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeAddress","inputs":[{"type":"address","name":"newFeeAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setHarvestLockupWhiteList","inputs":[{"type":"address","name":"recipient","internalType":"address"},{"type":"bool","name":"newStatus","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setStartTime","inputs":[{"type":"uint256","name":"newStartTime","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"startTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalAllocPoint","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalUsdCollected","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalUsdLockup","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract TreasuryDAO"}],"name":"treasuryDAO","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"treasuryUtil","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"banksyRewardDebt","internalType":"uint256"},{"type":"uint256","name":"usdRewardDebt","internalType":"uint256"},{"type":"uint256","name":"banksyRewardLockup","internalType":"uint256"},{"type":"uint256","name":"usdRewardLockup","internalType":"uint256"},{"type":"uint256","name":"nextHarvestUntil","internalType":"uint256"}],"name":"userInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"nftId","internalType":"uint256"},{"type":"uint256","name":"powerStaking","internalType":"uint256"},{"type":"uint256","name":"experience","internalType":"uint256"},{"type":"bool","name":"hasNft","internalType":"bool"}],"name":"userNftInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawNFT","inputs":[{"type":"uint256","name":"pid","internalType":"uint256"}]}]
            

Contract Creation Code

0x6101006040527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600d553480156200003657600080fd5b50604051620057033803806200570383398181016040528101906200005c91906200036d565b6200007c62000070620001b760201b60201c565b620001bf60201b60201c565b600180819055508773ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250508673ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff16815250508573ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508473ffffffffffffffffffffffffffffffffffffffff1660e08173ffffffffffffffffffffffffffffffffffffffff168152505083600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550826004819055508160058190555080600c81905550505050505050505062000436565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620002b58262000288565b9050919050565b6000620002c982620002a8565b9050919050565b620002db81620002bc565b8114620002e757600080fd5b50565b600081519050620002fb81620002d0565b92915050565b6200030c81620002a8565b81146200031857600080fd5b50565b6000815190506200032c8162000301565b92915050565b6000819050919050565b620003478162000332565b81146200035357600080fd5b50565b60008151905062000367816200033c565b92915050565b600080600080600080600080610100898b03121562000391576200039062000283565b5b6000620003a18b828c01620002ea565b9850506020620003b48b828c016200031b565b9750506040620003c78b828c016200031b565b9650506060620003da8b828c016200031b565b9550506080620003ed8b828c016200031b565b94505060a0620004008b828c0162000356565b93505060c0620004138b828c0162000356565b92505060e0620004268b828c0162000356565b9150509295985092959890939650565b60805160a05160c05160e05161522a620004d96000396000818161093e015281816109d401528181610b8101528181611431015281816114fa015281816122ba015281816123cb01528181613104015281816138c3015261397e0152600081816124f801526128e201526000818161211101528181612bd901526131d3015260008181610b3c01528181612d9a01528181613035015261341c015261522a6000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c8063715018a61161013b5780638da5cb5b116100b8578063da23b2e31161007c578063da23b2e3146106da578063dbaff4c2146106f8578063dccd9cb114610716578063e2bbb15814610734578063f2fde38b1461075057610248565b80638da5cb5b1461063157806393f1a40b1461064f578063a1bdb15e14610684578063ad18e97e146106a0578063b532b95d146106be57610248565b80638705fcd4116100ff5780638705fcd4146105785780638743effa1461059457806389c804c4146105c45780638a21a15e146105f75780638b7033281461061557610248565b8063715018a6146104f8578063772008481461050257806378e979251461051e5780637ba124e41461053c57806381531aa51461055a57610248565b80633e0a322d116101c95780635482110b1161018d5780635482110b14610442578063553dafea1461045e5780635ff687a01461047a578063605d6ffd146104aa5780636a9003a1146104c857610248565b80633e0a322d146103b457806341275358146103d057806343c23b6d146103ee578063441a3e701461040a5780635312ea8e1461042657610248565b8063149813b411610210578063149813b4146102e1578063150b7a02146102ff5780631526fe271461032f57806317caf6f1146103665780632e6c998d1461038457610248565b8063023245d71461024d57806303c0fb6c14610269578063061b4f1914610287578063081e3eda146102a55780630dbd95d7146102c3575b600080fd5b61026760048036038101906102629190613e40565b61076c565b005b610271610b3a565b60405161027e9190613eae565b60405180910390f35b61028f610b5e565b60405161029c9190613ed8565b60405180910390f35b6102ad610b64565b6040516102ba9190613ed8565b60405180910390f35b6102cb610b71565b6040516102d89190613ed8565b60405180910390f35b6102e9610b7f565b6040516102f69190613eae565b60405180910390f35b61031960048036038101906103149190614065565b610ba3565b6040516103269190614123565b60405180910390f35b61034960048036038101906103449190613e40565b610bb7565b60405161035d98979695949392919061413e565b60405180910390f35b61036e610c2f565b60405161037b9190613ed8565b60405180910390f35b61039e600480360381019061039991906141bc565b610c35565b6040516103ab9190614217565b60405180910390f35b6103ce60048036038101906103c99190613e40565b610c9b565b005b6103d8610daf565b6040516103e59190613eae565b60405180910390f35b61040860048036038101906104039190613e40565b610dd5565b005b610424600480360381019061041f9190614232565b610e69565b005b610440600480360381019061043b9190613e40565b6110da565b005b61045c6004803603810190610457919061429e565b6112c5565b005b610478600480360381019061047391906141bc565b61139c565b005b610494600480360381019061048f91906142de565b6115cf565b6040516104a19190614217565b60405180910390f35b6104b26115ef565b6040516104bf9190613ed8565b60405180910390f35b6104e260048036038101906104dd91906141bc565b6115f5565b6040516104ef9190613ed8565b60405180910390f35b61050061176d565b005b61051c6004803603810190610517919061430b565b6117f5565b005b610526611a3a565b6040516105339190613ed8565b60405180910390f35b610544611a40565b6040516105519190613ed8565b60405180910390f35b610562611a46565b60405161056f9190613ed8565b60405180910390f35b610592600480360381019061058d91906142de565b611a4c565b005b6105ae60048036038101906105a991906142de565b611b7c565b6040516105bb9190613ed8565b60405180910390f35b6105de60048036038101906105d991906141bc565b611c1e565b6040516105ee9493929190614398565b60405180910390f35b6105ff611c68565b60405161060c9190613ed8565b60405180910390f35b61062f600480360381019061062a91906143dd565b611c6e565b005b610639611f9c565b6040516106469190613eae565b60405180910390f35b610669600480360381019061066491906141bc565b611fc5565b60405161067b9695949392919061446a565b60405180910390f35b61069e60048036038101906106999190613e40565b61200e565b005b6106a861210f565b6040516106b5919061452a565b60405180910390f35b6106d860048036038101906106d39190614232565b612133565b005b6106e26124f0565b6040516106ef9190613ed8565b60405180910390f35b6107006124f6565b60405161070d9190613eae565b60405180910390f35b61071e61251a565b60405161072b9190613ed8565b60405180910390f35b61074e60048036038101906107499190614232565b612520565b005b61076a600480360381019061076591906142de565b612a4b565b005b600260015414156107b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a9906145a2565b60405180910390fd5b60026001819055506000600782815481106107d0576107cf6145c2565b5b9060005260206000209060080201905060006008600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006009600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060030160009054906101000a900460ff166108d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d09061463d565b60405180910390fd5b6108e284612b43565b6108eb84612ed0565b6000826003015411156109d25761090684836003015461335b565b612710600554836003015461091b919061468c565b6109259190614715565b81600201546109349190614746565b81600201819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663edd58d08826000015483600201546040518363ffffffff1660e01b815260040161099f92919061479c565b600060405180830381600087803b1580156109b957600080fd5b505af11580156109cd573d6000803e3d6000fd5b505050505b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166342842e0e303384600001546040518463ffffffff1660e01b8152600401610a33939291906147c5565b600060405180830381600087803b158015610a4d57600080fd5b505af1158015610a61573d6000803e3d6000fd5b5050505060008160030160006101000a81548160ff021916908315150217905550600081600001819055506000816001018190555060008160020181905550610aa9846134af565b69d3c21bcecceda100000083600301548360000154610ac8919061468c565b610ad29190614715565b8260010181905550833373ffffffffffffffffffffffffffffffffffffffff167f72669f1abc5c863b907b781db14a7bab022278d6436116140679c6bca956ba0c8360000154604051610b259190613ed8565b60405180910390a35050506001808190555050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600b5481565b6000600780549050905090565b690a968163f0a57b40000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b600063150b7a0260e01b9050949350505050565b60078181548110610bc757600080fd5b90600052602060002090600802016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154908060040154908060050154908060060154908060070154905088565b600a5481565b6000806008600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806005015442101591505092915050565b610ca361369a565b73ffffffffffffffffffffffffffffffffffffffff16610cc1611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614610d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0e90614848565b60405180910390fd5b600c544210610d5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d52906148b4565b60405180910390fd5b804210610d9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9490614920565b60405180910390fd5b80600c81905550610dac6136a2565b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ddd61369a565b73ffffffffffffffffffffffffffffffffffffffff16610dfb611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614610e51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4890614848565b60405180910390fd5b6000811015610e5f57600080fd5b8060058190555050565b60026001541415610eaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea6906145a2565b60405180910390fd5b6002600181905550600060078381548110610ecd57610ecc6145c2565b5b9060005260206000209060080201905060006008600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508281600001541015610f78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6f9061498c565b60405180910390fd5b610f8184612b43565b610f8a84612ed0565b600083111561101357828160000154610fa391906149ac565b8160000181905550610ffa33848460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166136f89092919063ffffffff16565b82826004015461100a91906149ac565b82600401819055505b69d3c21bcecceda100000082600301548260000154611032919061468c565b61103c9190614715565b8160010181905550600b5484141561107e5769d3c21bcecceda1000000600354826000015461106b919061468c565b6110759190614715565b81600201819055505b833373ffffffffffffffffffffffffffffffffffffffff167ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568856040516110c59190613ed8565b60405180910390a35050600180819055505050565b60026001541415611120576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611117906145a2565b60405180910390fd5b600260018190555060006007828154811061113e5761113d6145c2565b5b9060005260206000209060080201905060006008600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000154905060008260000181905550600082600101819055506000826003018190555060008260020181905550600082600401819055506000826005018190555061123633828560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166136f89092919063ffffffff16565b8083600401541061125e5780836004015461125191906149ac565b8360040181905550611269565b600083600401819055505b833373ffffffffffffffffffffffffffffffffffffffff167fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595836040516112b09190613ed8565b60405180910390a35050506001808190555050565b6112cd61369a565b73ffffffffffffffffffffffffffffffffffffffff166112eb611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614611341576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133890614848565b60405180910390fd5b80600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6113a461369a565b73ffffffffffffffffffffffffffffffffffffffff166113c2611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614611418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140f90614848565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff1660e01b81526004016114889190613ed8565b60206040518083038186803b1580156114a057600080fd5b505afa1580156114b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d891906149f5565b73ffffffffffffffffffffffffffffffffffffffff16146114f857600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166342842e0e3083856040518463ffffffff1660e01b8152600401611555939291906147c5565b600060405180830381600087803b15801561156f57600080fd5b505af1158015611583573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff16827fa6bac298d7a8e319bbc79937cea774c645f778c42ea8f54b0773dc4bbacbf73f60405160405180910390a35050565b600e6020528060005260406000206000915054906101000a900460ff1681565b60115481565b6000806007848154811061160c5761160b6145c2565b5b9060005260206000209060080201905060006008600086815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008260030154905082600201544211801561169157506000836004015414155b801561169f57506000600a54115b156117195760006116b484600201544261377e565b90506000600a548560010154600454846116ce919061468c565b6116d8919061468c565b6116e29190614715565b9050846004015469d3c21bcecceda1000000826116ff919061468c565b6117099190614715565b836117149190614746565b925050505b6000826001015469d3c21bcecceda100000083856000015461173b919061468c565b6117459190614715565b61174f91906149ac565b90508260030154816117619190614746565b94505050505092915050565b61177561369a565b73ffffffffffffffffffffffffffffffffffffffff16611793611f9c565b73ffffffffffffffffffffffffffffffffffffffff16146117e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e090614848565b60405180910390fd5b6117f360006137c7565b565b6117fd61369a565b73ffffffffffffffffffffffffffffffffffffffff1661181b611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614611871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186890614848565b60405180910390fd5b6101918311156118b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ad90614a6e565b60405180910390fd5b80156118c5576118c461388b565b5b83600787815481106118da576118d96145c2565b5b906000526020600020906008020160010154600a546118f991906149ac565b6119039190614746565b600a81905550836007878154811061191e5761191d6145c2565b5b9060005260206000209060080201600101819055508260078781548110611948576119476145c2565b5b9060005260206000209060080201600601819055508460078781548110611972576119716145c2565b5b906000526020600020906008020160070181905550816007878154811061199c5761199b6145c2565b5b906000526020600020906008020160050181905550857f22d010b39cce830b2f23926bfb7551a230dbe713d1f6085480fef4a6ad7a4aaa600788815481106119e7576119e66145c2565b5b906000526020600020906008020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168686604051611a2a93929190614a8e565b60405180910390a2505050505050565b600c5481565b600d5481565b60055481565b611a5461369a565b73ffffffffffffffffffffffffffffffffffffffff16611a72611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614611ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abf90614848565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2f90614b11565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806008600080815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060020154816004015469d3c21bcecceda10000006003548460000154611bf8919061468c565b611c029190614715565b611c0c9190614746565b611c1691906149ac565b915050919050565b6009602052816000526040600020602052806000526040600020600091509150508060000154908060010154908060020154908060030160009054906101000a900460ff16905084565b60025481565b611c7661369a565b73ffffffffffffffffffffffffffffffffffffffff16611c94611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614611cea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce190614848565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611d239190613eae565b60206040518083038186803b158015611d3b57600080fd5b505afa158015611d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d739190614b46565b50610191831115611db9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db090614bbf565b60405180910390fd5b613840821115611dfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df590614c2b565b60405180910390fd5b8015611e0d57611e0c61388b565b5b6000600c544211611e2057600c54611e22565b425b905085600a54611e329190614746565b600a8190555060076040518061010001604052808773ffffffffffffffffffffffffffffffffffffffff168152602001888152602001838152602001600081526020016000815260200185815260200186815260200189815250908060018154018082558091505060019003906000526020600020906008020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e0820151816007015550506001600780549050611f5691906149ac565b7fbabbe3cb19e781d5cabb91a9d7e6a2fe19b883477ed02df8f7b81438be6ae42388888888604051611f8b9493929190614c4b565b60405180910390a250505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6008602052816000526040600020602052806000526040600020600091509150508060000154908060010154908060020154908060030154908060040154908060050154905086565b61201661369a565b73ffffffffffffffffffffffffffffffffffffffff16612034611f9c565b73ffffffffffffffffffffffffffffffffffffffff161461208a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208190614848565b60405180910390fd5b6000811161209757600080fd5b678ac7230489e8000081106120ab57600080fd5b6120b361388b565b806004819055503373ffffffffffffffffffffffffffffffffffffffff167f1d6d701a35096c20378cd75889e191ea7805a050284fffba3bc572d9d354644f6004548360405161210492919061479c565b60405180910390a250565b7f000000000000000000000000000000000000000000000000000000000000000081565b60026001541415612179576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612170906145a2565b60405180910390fd5b6002600181905550600060078381548110612197576121966145c2565b5b9060005260206000209060080201905060006008600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006009600086815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060030160009054906101000a900460ff16156122a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161229890614cdc565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff1660e01b81526004016123119190613ed8565b60206040518083038186803b15801561232957600080fd5b505afa15801561233d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236191906149f5565b73ffffffffffffffffffffffffffffffffffffffff16146123b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ae90614d48565b60405180910390fd5b6123c085612b43565b6123c985612ed0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166342842e0e3330876040518463ffffffff1660e01b8152600401612426939291906147c5565b600060405180830381600087803b15801561244057600080fd5b505af1158015612454573d6000803e3d6000fd5b5050505060018160030160006101000a81548160ff02191690831515021790555083816000018190555061248b81600001546138be565b81600101819055506124a08160000154613979565b81600201819055506124b1856134af565b69d3c21bcecceda1000000836003015483600001546124d0919061468c565b6124da9190614715565b8260010181905550505050600180819055505050565b60035481565b7f000000000000000000000000000000000000000000000000000000000000000081565b60045481565b60026001541415612566576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255d906145a2565b60405180910390fd5b6002600181905550600060078381548110612584576125836145c2565b5b9060005260206000209060080201905060006008600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506125f184612b43565b6125fa84612ed0565b6000808411156129815760008360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016126639190613eae565b60206040518083038186803b15801561267b57600080fd5b505afa15801561268f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126b39190614b46565b90506127063330878760000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16613a34909392919063ffffffff16565b808460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016127649190613eae565b60206040518083038186803b15801561277c57600080fd5b505afa158015612790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127b49190614b46565b6127be91906149ac565b945060008511612803576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127fa90614db4565b60405180910390fd5b60008460060154111561294f576000612710856006015487612825919061468c565b61282f9190614715565b90506000612710611d4c83612844919061468c565b61284e9190614715565b9050808261285c91906149ac565b9350818761286a91906149ac565b96506128dd600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828860000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166136f89092919063ffffffff16565b61294c7f0000000000000000000000000000000000000000000000000000000000000000858860000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166136f89092919063ffffffff16565b50505b84836000015461295f9190614746565b83600001819055508484600401546129779190614746565b8460040181905550505b69d3c21bcecceda1000000836003015483600001546129a0919061468c565b6129aa9190614715565b8260010181905550600b548514156129ec5769d3c21bcecceda100000060035483600001546129d9919061468c565b6129e39190614715565b82600201819055505b843373ffffffffffffffffffffffffffffffffffffffff167f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e8684604051612a3592919061479c565b60405180910390a3505050600180819055505050565b612a5361369a565b73ffffffffffffffffffffffffffffffffffffffff16612a71611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614612ac7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612abe90614848565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b2e90614e46565b60405180910390fd5b612b40816137c7565b50565b600060078281548110612b5957612b586145c2565b5b9060005260206000209060080201905080600201544211612b7a5750612ecd565b600081600401541480612b91575060008160010154145b15612ba55742816002018190555050612ecd565b60006007600b5481548110612bbd57612bbc6145c2565b5b9060005260206000209060080201600401541115612cf75760007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663818ac0616011546040518263ffffffff1660e01b8152600401612c329190613ed8565b602060405180830381600087803b158015612c4c57600080fd5b505af1158015612c60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c849190614b46565b90506007600b5481548110612c9c57612c9b6145c2565b5b90600052602060002090600802016004015469d3c21bcecceda100000082612cc4919061468c565b612cce9190614715565b600354612cdb9190614746565b60038190555080600254612cef9190614746565b600281905550505b6000612d0782600201544261377e565b90506000600a54836001015460045484612d21919061468c565b612d2b919061468c565b612d359190614715565b9050690a968163f0a57b4000006010541115612d545760009050612d8f565b690a968163f0a57b40000081601054612d6d9190614746565b1115612d8e57601054690a968163f0a57b400000612d8b91906149ac565b90505b5b6000811115612e3a577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166340c10f1930836040518363ffffffff1660e01b8152600401612df3929190614e66565b600060405180830381600087803b158015612e0d57600080fd5b505af1158015612e21573d6000803e3d6000fd5b5050505080601054612e339190614746565b6010819055505b690a968163f0a57b40000060105410158015612e7757507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600d54145b15612e845742600d819055505b826004015469d3c21bcecceda100000082612e9f919061468c565b612ea99190614715565b8360030154612eb89190614746565b83600301819055504283600201819055505050505b50565b600060078281548110612ee657612ee56145c2565b5b9060005260206000209060080201905060006008600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600081600501541415612f6157612f60836134af565b5b6000816001015469d3c21bcecceda100000084600301548460000154612f87919061468c565b612f919190614715565b612f9b91906149ac565b90506000600b54851415612fe257826002015469d3c21bcecceda10000006003548560000154612fcb919061468c565b612fd59190614715565b612fdf91906149ac565b90505b612fec8533610c35565b15613296576000821180613004575060008360030154115b1561319b57600083600301548361301b9190614746565b905060008460030181905550613030866134af565b61305b7f00000000000000000000000000000000000000000000000000000000000000003383613abd565b60006009600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060030160009054906101000a900460ff1615613198576130d0878361335b565b612710600554836130e1919061468c565b6130eb9190614715565b81600201546130fa9190614746565b81600201819055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663edd58d08826000015483600201546040518363ffffffff1660e01b815260040161316592919061479c565b600060405180830381600087803b15801561317f57600080fd5b505af1158015613193573d6000803e3d6000fd5b505050505b50505b600b548514156132915760008111806131b8575060008360040154115b156132905760008360040154826131cf9190614746565b90507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663cd84d2f833836040518363ffffffff1660e01b815260040161322c929190614e66565b600060405180830381600087803b15801561324657600080fd5b505af115801561325a573d6000803e3d6000fd5b5050505060008460040154111561328e57836004015460115461327d91906149ac565b601181905550600084600401819055505b505b5b613305565b60008211806132a55750600081115b15613304578183600301546132ba9190614746565b8360030181905550600b54851415613303576000811115613302578083600401546132e59190614746565b8360040181905550806011546132fb9190614746565b6011819055505b5b5b5b843373ffffffffffffffffffffffffffffffffffffffff167fee470483107f579a55c754fa00613c45a9a3b617a418b39cb0be97e5381ba7c18460405161334c9190613ed8565b60405180910390a35050505050565b60006009600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006064826002015411156133e5576064670de0b6b3a764000083600201546133d89190614715565b6133e29190614715565b90505b60006127108284600101546133fa9190614746565b85613405919061468c565b61340f9190614715565b905060008111156134a8577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166340c10f1933836040518363ffffffff1660e01b8152600401613475929190614e66565b600060405180830381600087803b15801561348f57600080fd5b505af11580156134a3573d6000803e3d6000fd5b505050505b5050505050565b6000600782815481106134c5576134c46145c2565b5b9060005260206000209060080201905060006008600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006009600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166135da5783600501546135dd565b60005b90508160030160009054906101000a900460ff1680156135fd5750600081115b1561367f5760006127106109c483613615919061468c565b61361f9190614715565b9050600060648460020154111561365757670de0b6b3a7640000600a856002015461364a9190614715565b6136549190614715565b90505b81811115613663578190505b80828461367091906149ac565b61367a91906149ac565b925050505b804261368b9190614746565b83600501819055505050505050565b600033905090565b6000600780549050905060005b818110156136f457600c54600782815481106136ce576136cd6145c2565b5b906000526020600020906008020160020181905550806136ed90614e8f565b90506136af565b5050565b6137798363a9059cbb60e01b8484604051602401613717929190614e66565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613b89565b505050565b6000600d5483111561379357600090506137c1565b600d548211156137b25782600d546137ab91906149ac565b90506137c1565b82826137be91906149ac565b90505b92915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600780549050905060005b818110156138ba576138a981612b43565b806138b390614e8f565b9050613898565b5050565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633593b463846040518263ffffffff1660e01b815260040161391a9190613ed8565b606060405180830381600087803b15801561393457600080fd5b505af1158015613948573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061396c9190614ed8565b5050905080915050919050565b6000807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16633593b463846040518263ffffffff1660e01b81526004016139d59190613ed8565b606060405180830381600087803b1580156139ef57600080fd5b505af1158015613a03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a279190614ed8565b5091505080915050919050565b613ab7846323b872dd60e01b858585604051602401613a55939291906147c5565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613b89565b50505050565b60008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401613af89190613eae565b60206040518083038186803b158015613b1057600080fd5b505afa158015613b24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b489190614b46565b9050613b8383828411613b5b5783613b5d565b825b8673ffffffffffffffffffffffffffffffffffffffff166136f89092919063ffffffff16565b50505050565b6000613beb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613c509092919063ffffffff16565b9050600081511115613c4b5780806020019051810190613c0b9190614f40565b613c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613c4190614fdf565b60405180910390fd5b5b505050565b6060613c5f8484600085613c68565b90509392505050565b606082471015613cad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ca490615071565b60405180910390fd5b613cb685613d7c565b613cf5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613cec906150dd565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613d1e9190615177565b60006040518083038185875af1925050503d8060008114613d5b576040519150601f19603f3d011682016040523d82523d6000602084013e613d60565b606091505b5091509150613d70828286613d8f565b92505050949350505050565b600080823b905060008111915050919050565b60608315613d9f57829050613def565b600083511115613db25782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613de691906151d2565b60405180910390fd5b9392505050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b613e1d81613e0a565b8114613e2857600080fd5b50565b600081359050613e3a81613e14565b92915050565b600060208284031215613e5657613e55613e00565b5b6000613e6484828501613e2b565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613e9882613e6d565b9050919050565b613ea881613e8d565b82525050565b6000602082019050613ec36000830184613e9f565b92915050565b613ed281613e0a565b82525050565b6000602082019050613eed6000830184613ec9565b92915050565b613efc81613e8d565b8114613f0757600080fd5b50565b600081359050613f1981613ef3565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613f7282613f29565b810181811067ffffffffffffffff82111715613f9157613f90613f3a565b5b80604052505050565b6000613fa4613df6565b9050613fb08282613f69565b919050565b600067ffffffffffffffff821115613fd057613fcf613f3a565b5b613fd982613f29565b9050602081019050919050565b82818337600083830152505050565b600061400861400384613fb5565b613f9a565b90508281526020810184848401111561402457614023613f24565b5b61402f848285613fe6565b509392505050565b600082601f83011261404c5761404b613f1f565b5b813561405c848260208601613ff5565b91505092915050565b6000806000806080858703121561407f5761407e613e00565b5b600061408d87828801613f0a565b945050602061409e87828801613f0a565b93505060406140af87828801613e2b565b925050606085013567ffffffffffffffff8111156140d0576140cf613e05565b5b6140dc87828801614037565b91505092959194509250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61411d816140e8565b82525050565b60006020820190506141386000830184614114565b92915050565b600061010082019050614154600083018b613e9f565b614161602083018a613ec9565b61416e6040830189613ec9565b61417b6060830188613ec9565b6141886080830187613ec9565b61419560a0830186613ec9565b6141a260c0830185613ec9565b6141af60e0830184613ec9565b9998505050505050505050565b600080604083850312156141d3576141d2613e00565b5b60006141e185828601613e2b565b92505060206141f285828601613f0a565b9150509250929050565b60008115159050919050565b614211816141fc565b82525050565b600060208201905061422c6000830184614208565b92915050565b6000806040838503121561424957614248613e00565b5b600061425785828601613e2b565b925050602061426885828601613e2b565b9150509250929050565b61427b816141fc565b811461428657600080fd5b50565b60008135905061429881614272565b92915050565b600080604083850312156142b5576142b4613e00565b5b60006142c385828601613f0a565b92505060206142d485828601614289565b9150509250929050565b6000602082840312156142f4576142f3613e00565b5b600061430284828501613f0a565b91505092915050565b60008060008060008060c0878903121561432857614327613e00565b5b600061433689828a01613e2b565b965050602061434789828a01613e2b565b955050604061435889828a01613e2b565b945050606061436989828a01613e2b565b935050608061437a89828a01613e2b565b92505060a061438b89828a01614289565b9150509295509295509295565b60006080820190506143ad6000830187613ec9565b6143ba6020830186613ec9565b6143c76040830185613ec9565b6143d46060830184614208565b95945050505050565b60008060008060008060c087890312156143fa576143f9613e00565b5b600061440889828a01613e2b565b965050602061441989828a01613e2b565b955050604061442a89828a01613f0a565b945050606061443b89828a01613e2b565b935050608061444c89828a01613e2b565b92505060a061445d89828a01614289565b9150509295509295509295565b600060c08201905061447f6000830189613ec9565b61448c6020830188613ec9565b6144996040830187613ec9565b6144a66060830186613ec9565b6144b36080830185613ec9565b6144c060a0830184613ec9565b979650505050505050565b6000819050919050565b60006144f06144eb6144e684613e6d565b6144cb565b613e6d565b9050919050565b6000614502826144d5565b9050919050565b6000614514826144f7565b9050919050565b61452481614509565b82525050565b600060208201905061453f600083018461451b565b92915050565b600082825260208201905092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061458c601f83614545565b915061459782614556565b602082019050919050565b600060208201905081810360008301526145bb8161457f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4538000000000000000000000000000000000000000000000000000000000000600082015250565b6000614627600283614545565b9150614632826145f1565b602082019050919050565b600060208201905081810360008301526146568161461a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061469782613e0a565b91506146a283613e0a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156146db576146da61465d565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061472082613e0a565b915061472b83613e0a565b92508261473b5761473a6146e6565b5b828204905092915050565b600061475182613e0a565b915061475c83613e0a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156147915761479061465d565b5b828201905092915050565b60006040820190506147b16000830185613ec9565b6147be6020830184613ec9565b9392505050565b60006060820190506147da6000830186613e9f565b6147e76020830185613e9f565b6147f46040830184613ec9565b949350505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614832602083614545565b915061483d826147fc565b602082019050919050565b6000602082019050818103600083015261486181614825565b9050919050565b7f4531300000000000000000000000000000000000000000000000000000000000600082015250565b600061489e600383614545565b91506148a982614868565b602082019050919050565b600060208201905081810360008301526148cd81614891565b9050919050565b7f4531310000000000000000000000000000000000000000000000000000000000600082015250565b600061490a600383614545565b9150614915826148d4565b602082019050919050565b60006020820190508181036000830152614939816148fd565b9050919050565b7f4535000000000000000000000000000000000000000000000000000000000000600082015250565b6000614976600283614545565b915061498182614940565b602082019050919050565b600060208201905081810360008301526149a581614969565b9050919050565b60006149b782613e0a565b91506149c283613e0a565b9250828210156149d5576149d461465d565b5b828203905092915050565b6000815190506149ef81613ef3565b92915050565b600060208284031215614a0b57614a0a613e00565b5b6000614a19848285016149e0565b91505092915050565b7f4533000000000000000000000000000000000000000000000000000000000000600082015250565b6000614a58600283614545565b9150614a6382614a22565b602082019050919050565b60006020820190508181036000830152614a8781614a4b565b9050919050565b6000606082019050614aa36000830186613e9f565b614ab06020830185613ec9565b614abd6040830184613ec9565b949350505050565b7f4539000000000000000000000000000000000000000000000000000000000000600082015250565b6000614afb600283614545565b9150614b0682614ac5565b602082019050919050565b60006020820190508181036000830152614b2a81614aee565b9050919050565b600081519050614b4081613e14565b92915050565b600060208284031215614b5c57614b5b613e00565b5b6000614b6a84828501614b31565b91505092915050565b7f4531000000000000000000000000000000000000000000000000000000000000600082015250565b6000614ba9600283614545565b9150614bb482614b73565b602082019050919050565b60006020820190508181036000830152614bd881614b9c565b9050919050565b7f4532000000000000000000000000000000000000000000000000000000000000600082015250565b6000614c15600283614545565b9150614c2082614bdf565b602082019050919050565b60006020820190508181036000830152614c4481614c08565b9050919050565b6000608082019050614c606000830187613ec9565b614c6d6020830186613ec9565b614c7a6040830185613e9f565b614c876060830184613ec9565b95945050505050565b7f4536000000000000000000000000000000000000000000000000000000000000600082015250565b6000614cc6600283614545565b9150614cd182614c90565b602082019050919050565b60006020820190508181036000830152614cf581614cb9565b9050919050565b7f4537000000000000000000000000000000000000000000000000000000000000600082015250565b6000614d32600283614545565b9150614d3d82614cfc565b602082019050919050565b60006020820190508181036000830152614d6181614d25565b9050919050565b7f4534000000000000000000000000000000000000000000000000000000000000600082015250565b6000614d9e600283614545565b9150614da982614d68565b602082019050919050565b60006020820190508181036000830152614dcd81614d91565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614e30602683614545565b9150614e3b82614dd4565b604082019050919050565b60006020820190508181036000830152614e5f81614e23565b9050919050565b6000604082019050614e7b6000830185613e9f565b614e886020830184613ec9565b9392505050565b6000614e9a82613e0a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614ecd57614ecc61465d565b5b600182019050919050565b600080600060608486031215614ef157614ef0613e00565b5b6000614eff86828701614b31565b9350506020614f1086828701614b31565b9250506040614f2186828701614b31565b9150509250925092565b600081519050614f3a81614272565b92915050565b600060208284031215614f5657614f55613e00565b5b6000614f6484828501614f2b565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614fc9602a83614545565b9150614fd482614f6d565b604082019050919050565b60006020820190508181036000830152614ff881614fbc565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b600061505b602683614545565b915061506682614fff565b604082019050919050565b6000602082019050818103600083015261508a8161504e565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b60006150c7601d83614545565b91506150d282615091565b602082019050919050565b600060208201905081810360008301526150f6816150ba565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015615131578082015181840152602081019050615116565b83811115615140576000848401525b50505050565b6000615151826150fd565b61515b8185615108565b935061516b818560208601615113565b80840191505092915050565b60006151838284615146565b915081905092915050565b600081519050919050565b60006151a48261518e565b6151ae8185614545565b93506151be818560208601615113565b6151c781613f29565b840191505092915050565b600060208201905081810360008301526151ec8184615199565b90509291505056fea264697066735822122089a0b21f3c7e67eb9e60824380a1875061fe5c587ee1f5cb383e1ff434bcd03564736f6c634300080900330000000000000000000000004a78a6a8f8b3773f7a78befd106f280403eea807000000000000000000000000aebd7a84ced1622593ff24d667df707007f183c100000000000000000000000077b5c56d36fd0e9b40d2e9efa26d072c128b3f740000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d2000000000000000000000000a94aa23f43e9f00ce154f3c1c7f971ecb5318be8000000000000000000000000000000000000000000000000003cfe655b1ee6e000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000633af8f0

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106102485760003560e01c8063715018a61161013b5780638da5cb5b116100b8578063da23b2e31161007c578063da23b2e3146106da578063dbaff4c2146106f8578063dccd9cb114610716578063e2bbb15814610734578063f2fde38b1461075057610248565b80638da5cb5b1461063157806393f1a40b1461064f578063a1bdb15e14610684578063ad18e97e146106a0578063b532b95d146106be57610248565b80638705fcd4116100ff5780638705fcd4146105785780638743effa1461059457806389c804c4146105c45780638a21a15e146105f75780638b7033281461061557610248565b8063715018a6146104f8578063772008481461050257806378e979251461051e5780637ba124e41461053c57806381531aa51461055a57610248565b80633e0a322d116101c95780635482110b1161018d5780635482110b14610442578063553dafea1461045e5780635ff687a01461047a578063605d6ffd146104aa5780636a9003a1146104c857610248565b80633e0a322d146103b457806341275358146103d057806343c23b6d146103ee578063441a3e701461040a5780635312ea8e1461042657610248565b8063149813b411610210578063149813b4146102e1578063150b7a02146102ff5780631526fe271461032f57806317caf6f1146103665780632e6c998d1461038457610248565b8063023245d71461024d57806303c0fb6c14610269578063061b4f1914610287578063081e3eda146102a55780630dbd95d7146102c3575b600080fd5b61026760048036038101906102629190613e40565b61076c565b005b610271610b3a565b60405161027e9190613eae565b60405180910390f35b61028f610b5e565b60405161029c9190613ed8565b60405180910390f35b6102ad610b64565b6040516102ba9190613ed8565b60405180910390f35b6102cb610b71565b6040516102d89190613ed8565b60405180910390f35b6102e9610b7f565b6040516102f69190613eae565b60405180910390f35b61031960048036038101906103149190614065565b610ba3565b6040516103269190614123565b60405180910390f35b61034960048036038101906103449190613e40565b610bb7565b60405161035d98979695949392919061413e565b60405180910390f35b61036e610c2f565b60405161037b9190613ed8565b60405180910390f35b61039e600480360381019061039991906141bc565b610c35565b6040516103ab9190614217565b60405180910390f35b6103ce60048036038101906103c99190613e40565b610c9b565b005b6103d8610daf565b6040516103e59190613eae565b60405180910390f35b61040860048036038101906104039190613e40565b610dd5565b005b610424600480360381019061041f9190614232565b610e69565b005b610440600480360381019061043b9190613e40565b6110da565b005b61045c6004803603810190610457919061429e565b6112c5565b005b610478600480360381019061047391906141bc565b61139c565b005b610494600480360381019061048f91906142de565b6115cf565b6040516104a19190614217565b60405180910390f35b6104b26115ef565b6040516104bf9190613ed8565b60405180910390f35b6104e260048036038101906104dd91906141bc565b6115f5565b6040516104ef9190613ed8565b60405180910390f35b61050061176d565b005b61051c6004803603810190610517919061430b565b6117f5565b005b610526611a3a565b6040516105339190613ed8565b60405180910390f35b610544611a40565b6040516105519190613ed8565b60405180910390f35b610562611a46565b60405161056f9190613ed8565b60405180910390f35b610592600480360381019061058d91906142de565b611a4c565b005b6105ae60048036038101906105a991906142de565b611b7c565b6040516105bb9190613ed8565b60405180910390f35b6105de60048036038101906105d991906141bc565b611c1e565b6040516105ee9493929190614398565b60405180910390f35b6105ff611c68565b60405161060c9190613ed8565b60405180910390f35b61062f600480360381019061062a91906143dd565b611c6e565b005b610639611f9c565b6040516106469190613eae565b60405180910390f35b610669600480360381019061066491906141bc565b611fc5565b60405161067b9695949392919061446a565b60405180910390f35b61069e60048036038101906106999190613e40565b61200e565b005b6106a861210f565b6040516106b5919061452a565b60405180910390f35b6106d860048036038101906106d39190614232565b612133565b005b6106e26124f0565b6040516106ef9190613ed8565b60405180910390f35b6107006124f6565b60405161070d9190613eae565b60405180910390f35b61071e61251a565b60405161072b9190613ed8565b60405180910390f35b61074e60048036038101906107499190614232565b612520565b005b61076a600480360381019061076591906142de565b612a4b565b005b600260015414156107b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a9906145a2565b60405180910390fd5b60026001819055506000600782815481106107d0576107cf6145c2565b5b9060005260206000209060080201905060006008600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006009600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060030160009054906101000a900460ff166108d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d09061463d565b60405180910390fd5b6108e284612b43565b6108eb84612ed0565b6000826003015411156109d25761090684836003015461335b565b612710600554836003015461091b919061468c565b6109259190614715565b81600201546109349190614746565b81600201819055507f0000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d273ffffffffffffffffffffffffffffffffffffffff1663edd58d08826000015483600201546040518363ffffffff1660e01b815260040161099f92919061479c565b600060405180830381600087803b1580156109b957600080fd5b505af11580156109cd573d6000803e3d6000fd5b505050505b7f0000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d273ffffffffffffffffffffffffffffffffffffffff166342842e0e303384600001546040518463ffffffff1660e01b8152600401610a33939291906147c5565b600060405180830381600087803b158015610a4d57600080fd5b505af1158015610a61573d6000803e3d6000fd5b5050505060008160030160006101000a81548160ff021916908315150217905550600081600001819055506000816001018190555060008160020181905550610aa9846134af565b69d3c21bcecceda100000083600301548360000154610ac8919061468c565b610ad29190614715565b8260010181905550833373ffffffffffffffffffffffffffffffffffffffff167f72669f1abc5c863b907b781db14a7bab022278d6436116140679c6bca956ba0c8360000154604051610b259190613ed8565b60405180910390a35050506001808190555050565b7f00000000000000000000000077b5c56d36fd0e9b40d2e9efa26d072c128b3f7481565b600b5481565b6000600780549050905090565b690a968163f0a57b40000081565b7f0000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d281565b600063150b7a0260e01b9050949350505050565b60078181548110610bc757600080fd5b90600052602060002090600802016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154908060040154908060050154908060060154908060070154905088565b600a5481565b6000806008600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806005015442101591505092915050565b610ca361369a565b73ffffffffffffffffffffffffffffffffffffffff16610cc1611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614610d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0e90614848565b60405180910390fd5b600c544210610d5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d52906148b4565b60405180910390fd5b804210610d9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9490614920565b60405180910390fd5b80600c81905550610dac6136a2565b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ddd61369a565b73ffffffffffffffffffffffffffffffffffffffff16610dfb611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614610e51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4890614848565b60405180910390fd5b6000811015610e5f57600080fd5b8060058190555050565b60026001541415610eaf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea6906145a2565b60405180910390fd5b6002600181905550600060078381548110610ecd57610ecc6145c2565b5b9060005260206000209060080201905060006008600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508281600001541015610f78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6f9061498c565b60405180910390fd5b610f8184612b43565b610f8a84612ed0565b600083111561101357828160000154610fa391906149ac565b8160000181905550610ffa33848460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166136f89092919063ffffffff16565b82826004015461100a91906149ac565b82600401819055505b69d3c21bcecceda100000082600301548260000154611032919061468c565b61103c9190614715565b8160010181905550600b5484141561107e5769d3c21bcecceda1000000600354826000015461106b919061468c565b6110759190614715565b81600201819055505b833373ffffffffffffffffffffffffffffffffffffffff167ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568856040516110c59190613ed8565b60405180910390a35050600180819055505050565b60026001541415611120576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611117906145a2565b60405180910390fd5b600260018190555060006007828154811061113e5761113d6145c2565b5b9060005260206000209060080201905060006008600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000154905060008260000181905550600082600101819055506000826003018190555060008260020181905550600082600401819055506000826005018190555061123633828560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166136f89092919063ffffffff16565b8083600401541061125e5780836004015461125191906149ac565b8360040181905550611269565b600083600401819055505b833373ffffffffffffffffffffffffffffffffffffffff167fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595836040516112b09190613ed8565b60405180910390a35050506001808190555050565b6112cd61369a565b73ffffffffffffffffffffffffffffffffffffffff166112eb611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614611341576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133890614848565b60405180910390fd5b80600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6113a461369a565b73ffffffffffffffffffffffffffffffffffffffff166113c2611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614611418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140f90614848565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff167f0000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d273ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff1660e01b81526004016114889190613ed8565b60206040518083038186803b1580156114a057600080fd5b505afa1580156114b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d891906149f5565b73ffffffffffffffffffffffffffffffffffffffff16146114f857600080fd5b7f0000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d273ffffffffffffffffffffffffffffffffffffffff166342842e0e3083856040518463ffffffff1660e01b8152600401611555939291906147c5565b600060405180830381600087803b15801561156f57600080fd5b505af1158015611583573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff16827fa6bac298d7a8e319bbc79937cea774c645f778c42ea8f54b0773dc4bbacbf73f60405160405180910390a35050565b600e6020528060005260406000206000915054906101000a900460ff1681565b60115481565b6000806007848154811061160c5761160b6145c2565b5b9060005260206000209060080201905060006008600086815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008260030154905082600201544211801561169157506000836004015414155b801561169f57506000600a54115b156117195760006116b484600201544261377e565b90506000600a548560010154600454846116ce919061468c565b6116d8919061468c565b6116e29190614715565b9050846004015469d3c21bcecceda1000000826116ff919061468c565b6117099190614715565b836117149190614746565b925050505b6000826001015469d3c21bcecceda100000083856000015461173b919061468c565b6117459190614715565b61174f91906149ac565b90508260030154816117619190614746565b94505050505092915050565b61177561369a565b73ffffffffffffffffffffffffffffffffffffffff16611793611f9c565b73ffffffffffffffffffffffffffffffffffffffff16146117e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e090614848565b60405180910390fd5b6117f360006137c7565b565b6117fd61369a565b73ffffffffffffffffffffffffffffffffffffffff1661181b611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614611871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186890614848565b60405180910390fd5b6101918311156118b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ad90614a6e565b60405180910390fd5b80156118c5576118c461388b565b5b83600787815481106118da576118d96145c2565b5b906000526020600020906008020160010154600a546118f991906149ac565b6119039190614746565b600a81905550836007878154811061191e5761191d6145c2565b5b9060005260206000209060080201600101819055508260078781548110611948576119476145c2565b5b9060005260206000209060080201600601819055508460078781548110611972576119716145c2565b5b906000526020600020906008020160070181905550816007878154811061199c5761199b6145c2565b5b906000526020600020906008020160050181905550857f22d010b39cce830b2f23926bfb7551a230dbe713d1f6085480fef4a6ad7a4aaa600788815481106119e7576119e66145c2565b5b906000526020600020906008020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168686604051611a2a93929190614a8e565b60405180910390a2505050505050565b600c5481565b600d5481565b60055481565b611a5461369a565b73ffffffffffffffffffffffffffffffffffffffff16611a72611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614611ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abf90614848565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2f90614b11565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806008600080815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060020154816004015469d3c21bcecceda10000006003548460000154611bf8919061468c565b611c029190614715565b611c0c9190614746565b611c1691906149ac565b915050919050565b6009602052816000526040600020602052806000526040600020600091509150508060000154908060010154908060020154908060030160009054906101000a900460ff16905084565b60025481565b611c7661369a565b73ffffffffffffffffffffffffffffffffffffffff16611c94611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614611cea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce190614848565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611d239190613eae565b60206040518083038186803b158015611d3b57600080fd5b505afa158015611d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d739190614b46565b50610191831115611db9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db090614bbf565b60405180910390fd5b613840821115611dfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df590614c2b565b60405180910390fd5b8015611e0d57611e0c61388b565b5b6000600c544211611e2057600c54611e22565b425b905085600a54611e329190614746565b600a8190555060076040518061010001604052808773ffffffffffffffffffffffffffffffffffffffff168152602001888152602001838152602001600081526020016000815260200185815260200186815260200189815250908060018154018082558091505060019003906000526020600020906008020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e0820151816007015550506001600780549050611f5691906149ac565b7fbabbe3cb19e781d5cabb91a9d7e6a2fe19b883477ed02df8f7b81438be6ae42388888888604051611f8b9493929190614c4b565b60405180910390a250505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6008602052816000526040600020602052806000526040600020600091509150508060000154908060010154908060020154908060030154908060040154908060050154905086565b61201661369a565b73ffffffffffffffffffffffffffffffffffffffff16612034611f9c565b73ffffffffffffffffffffffffffffffffffffffff161461208a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208190614848565b60405180910390fd5b6000811161209757600080fd5b678ac7230489e8000081106120ab57600080fd5b6120b361388b565b806004819055503373ffffffffffffffffffffffffffffffffffffffff167f1d6d701a35096c20378cd75889e191ea7805a050284fffba3bc572d9d354644f6004548360405161210492919061479c565b60405180910390a250565b7f0000000000000000000000004a78a6a8f8b3773f7a78befd106f280403eea80781565b60026001541415612179576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612170906145a2565b60405180910390fd5b6002600181905550600060078381548110612197576121966145c2565b5b9060005260206000209060080201905060006008600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006009600086815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060030160009054906101000a900460ff16156122a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161229890614cdc565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167f0000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d273ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff1660e01b81526004016123119190613ed8565b60206040518083038186803b15801561232957600080fd5b505afa15801561233d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236191906149f5565b73ffffffffffffffffffffffffffffffffffffffff16146123b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123ae90614d48565b60405180910390fd5b6123c085612b43565b6123c985612ed0565b7f0000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d273ffffffffffffffffffffffffffffffffffffffff166342842e0e3330876040518463ffffffff1660e01b8152600401612426939291906147c5565b600060405180830381600087803b15801561244057600080fd5b505af1158015612454573d6000803e3d6000fd5b5050505060018160030160006101000a81548160ff02191690831515021790555083816000018190555061248b81600001546138be565b81600101819055506124a08160000154613979565b81600201819055506124b1856134af565b69d3c21bcecceda1000000836003015483600001546124d0919061468c565b6124da9190614715565b8260010181905550505050600180819055505050565b60035481565b7f000000000000000000000000aebd7a84ced1622593ff24d667df707007f183c181565b60045481565b60026001541415612566576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255d906145a2565b60405180910390fd5b6002600181905550600060078381548110612584576125836145c2565b5b9060005260206000209060080201905060006008600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506125f184612b43565b6125fa84612ed0565b6000808411156129815760008360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016126639190613eae565b60206040518083038186803b15801561267b57600080fd5b505afa15801561268f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126b39190614b46565b90506127063330878760000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16613a34909392919063ffffffff16565b808460000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016127649190613eae565b60206040518083038186803b15801561277c57600080fd5b505afa158015612790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127b49190614b46565b6127be91906149ac565b945060008511612803576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127fa90614db4565b60405180910390fd5b60008460060154111561294f576000612710856006015487612825919061468c565b61282f9190614715565b90506000612710611d4c83612844919061468c565b61284e9190614715565b9050808261285c91906149ac565b9350818761286a91906149ac565b96506128dd600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828860000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166136f89092919063ffffffff16565b61294c7f000000000000000000000000aebd7a84ced1622593ff24d667df707007f183c1858860000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166136f89092919063ffffffff16565b50505b84836000015461295f9190614746565b83600001819055508484600401546129779190614746565b8460040181905550505b69d3c21bcecceda1000000836003015483600001546129a0919061468c565b6129aa9190614715565b8260010181905550600b548514156129ec5769d3c21bcecceda100000060035483600001546129d9919061468c565b6129e39190614715565b82600201819055505b843373ffffffffffffffffffffffffffffffffffffffff167f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e8684604051612a3592919061479c565b60405180910390a3505050600180819055505050565b612a5361369a565b73ffffffffffffffffffffffffffffffffffffffff16612a71611f9c565b73ffffffffffffffffffffffffffffffffffffffff1614612ac7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612abe90614848565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b2e90614e46565b60405180910390fd5b612b40816137c7565b50565b600060078281548110612b5957612b586145c2565b5b9060005260206000209060080201905080600201544211612b7a5750612ecd565b600081600401541480612b91575060008160010154145b15612ba55742816002018190555050612ecd565b60006007600b5481548110612bbd57612bbc6145c2565b5b9060005260206000209060080201600401541115612cf75760007f0000000000000000000000004a78a6a8f8b3773f7a78befd106f280403eea80773ffffffffffffffffffffffffffffffffffffffff1663818ac0616011546040518263ffffffff1660e01b8152600401612c329190613ed8565b602060405180830381600087803b158015612c4c57600080fd5b505af1158015612c60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c849190614b46565b90506007600b5481548110612c9c57612c9b6145c2565b5b90600052602060002090600802016004015469d3c21bcecceda100000082612cc4919061468c565b612cce9190614715565b600354612cdb9190614746565b60038190555080600254612cef9190614746565b600281905550505b6000612d0782600201544261377e565b90506000600a54836001015460045484612d21919061468c565b612d2b919061468c565b612d359190614715565b9050690a968163f0a57b4000006010541115612d545760009050612d8f565b690a968163f0a57b40000081601054612d6d9190614746565b1115612d8e57601054690a968163f0a57b400000612d8b91906149ac565b90505b5b6000811115612e3a577f00000000000000000000000077b5c56d36fd0e9b40d2e9efa26d072c128b3f7473ffffffffffffffffffffffffffffffffffffffff166340c10f1930836040518363ffffffff1660e01b8152600401612df3929190614e66565b600060405180830381600087803b158015612e0d57600080fd5b505af1158015612e21573d6000803e3d6000fd5b5050505080601054612e339190614746565b6010819055505b690a968163f0a57b40000060105410158015612e7757507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600d54145b15612e845742600d819055505b826004015469d3c21bcecceda100000082612e9f919061468c565b612ea99190614715565b8360030154612eb89190614746565b83600301819055504283600201819055505050505b50565b600060078281548110612ee657612ee56145c2565b5b9060005260206000209060080201905060006008600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600081600501541415612f6157612f60836134af565b5b6000816001015469d3c21bcecceda100000084600301548460000154612f87919061468c565b612f919190614715565b612f9b91906149ac565b90506000600b54851415612fe257826002015469d3c21bcecceda10000006003548560000154612fcb919061468c565b612fd59190614715565b612fdf91906149ac565b90505b612fec8533610c35565b15613296576000821180613004575060008360030154115b1561319b57600083600301548361301b9190614746565b905060008460030181905550613030866134af565b61305b7f00000000000000000000000077b5c56d36fd0e9b40d2e9efa26d072c128b3f743383613abd565b60006009600088815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060030160009054906101000a900460ff1615613198576130d0878361335b565b612710600554836130e1919061468c565b6130eb9190614715565b81600201546130fa9190614746565b81600201819055507f0000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d273ffffffffffffffffffffffffffffffffffffffff1663edd58d08826000015483600201546040518363ffffffff1660e01b815260040161316592919061479c565b600060405180830381600087803b15801561317f57600080fd5b505af1158015613193573d6000803e3d6000fd5b505050505b50505b600b548514156132915760008111806131b8575060008360040154115b156132905760008360040154826131cf9190614746565b90507f0000000000000000000000004a78a6a8f8b3773f7a78befd106f280403eea80773ffffffffffffffffffffffffffffffffffffffff1663cd84d2f833836040518363ffffffff1660e01b815260040161322c929190614e66565b600060405180830381600087803b15801561324657600080fd5b505af115801561325a573d6000803e3d6000fd5b5050505060008460040154111561328e57836004015460115461327d91906149ac565b601181905550600084600401819055505b505b5b613305565b60008211806132a55750600081115b15613304578183600301546132ba9190614746565b8360030181905550600b54851415613303576000811115613302578083600401546132e59190614746565b8360040181905550806011546132fb9190614746565b6011819055505b5b5b5b843373ffffffffffffffffffffffffffffffffffffffff167fee470483107f579a55c754fa00613c45a9a3b617a418b39cb0be97e5381ba7c18460405161334c9190613ed8565b60405180910390a35050505050565b60006009600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006064826002015411156133e5576064670de0b6b3a764000083600201546133d89190614715565b6133e29190614715565b90505b60006127108284600101546133fa9190614746565b85613405919061468c565b61340f9190614715565b905060008111156134a8577f00000000000000000000000077b5c56d36fd0e9b40d2e9efa26d072c128b3f7473ffffffffffffffffffffffffffffffffffffffff166340c10f1933836040518363ffffffff1660e01b8152600401613475929190614e66565b600060405180830381600087803b15801561348f57600080fd5b505af11580156134a3573d6000803e3d6000fd5b505050505b5050505050565b6000600782815481106134c5576134c46145c2565b5b9060005260206000209060080201905060006008600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006009600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166135da5783600501546135dd565b60005b90508160030160009054906101000a900460ff1680156135fd5750600081115b1561367f5760006127106109c483613615919061468c565b61361f9190614715565b9050600060648460020154111561365757670de0b6b3a7640000600a856002015461364a9190614715565b6136549190614715565b90505b81811115613663578190505b80828461367091906149ac565b61367a91906149ac565b925050505b804261368b9190614746565b83600501819055505050505050565b600033905090565b6000600780549050905060005b818110156136f457600c54600782815481106136ce576136cd6145c2565b5b906000526020600020906008020160020181905550806136ed90614e8f565b90506136af565b5050565b6137798363a9059cbb60e01b8484604051602401613717929190614e66565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613b89565b505050565b6000600d5483111561379357600090506137c1565b600d548211156137b25782600d546137ab91906149ac565b90506137c1565b82826137be91906149ac565b90505b92915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600780549050905060005b818110156138ba576138a981612b43565b806138b390614e8f565b9050613898565b5050565b6000807f0000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d273ffffffffffffffffffffffffffffffffffffffff16633593b463846040518263ffffffff1660e01b815260040161391a9190613ed8565b606060405180830381600087803b15801561393457600080fd5b505af1158015613948573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061396c9190614ed8565b5050905080915050919050565b6000807f0000000000000000000000009c26e24ac6f0ea783ff9ca2bf81543c67cf446d273ffffffffffffffffffffffffffffffffffffffff16633593b463846040518263ffffffff1660e01b81526004016139d59190613ed8565b606060405180830381600087803b1580156139ef57600080fd5b505af1158015613a03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a279190614ed8565b5091505080915050919050565b613ab7846323b872dd60e01b858585604051602401613a55939291906147c5565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613b89565b50505050565b60008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401613af89190613eae565b60206040518083038186803b158015613b1057600080fd5b505afa158015613b24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b489190614b46565b9050613b8383828411613b5b5783613b5d565b825b8673ffffffffffffffffffffffffffffffffffffffff166136f89092919063ffffffff16565b50505050565b6000613beb826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613c509092919063ffffffff16565b9050600081511115613c4b5780806020019051810190613c0b9190614f40565b613c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613c4190614fdf565b60405180910390fd5b5b505050565b6060613c5f8484600085613c68565b90509392505050565b606082471015613cad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ca490615071565b60405180910390fd5b613cb685613d7c565b613cf5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613cec906150dd565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613d1e9190615177565b60006040518083038185875af1925050503d8060008114613d5b576040519150601f19603f3d011682016040523d82523d6000602084013e613d60565b606091505b5091509150613d70828286613d8f565b92505050949350505050565b600080823b905060008111915050919050565b60608315613d9f57829050613def565b600083511115613db25782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613de691906151d2565b60405180910390fd5b9392505050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b613e1d81613e0a565b8114613e2857600080fd5b50565b600081359050613e3a81613e14565b92915050565b600060208284031215613e5657613e55613e00565b5b6000613e6484828501613e2b565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613e9882613e6d565b9050919050565b613ea881613e8d565b82525050565b6000602082019050613ec36000830184613e9f565b92915050565b613ed281613e0a565b82525050565b6000602082019050613eed6000830184613ec9565b92915050565b613efc81613e8d565b8114613f0757600080fd5b50565b600081359050613f1981613ef3565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613f7282613f29565b810181811067ffffffffffffffff82111715613f9157613f90613f3a565b5b80604052505050565b6000613fa4613df6565b9050613fb08282613f69565b919050565b600067ffffffffffffffff821115613fd057613fcf613f3a565b5b613fd982613f29565b9050602081019050919050565b82818337600083830152505050565b600061400861400384613fb5565b613f9a565b90508281526020810184848401111561402457614023613f24565b5b61402f848285613fe6565b509392505050565b600082601f83011261404c5761404b613f1f565b5b813561405c848260208601613ff5565b91505092915050565b6000806000806080858703121561407f5761407e613e00565b5b600061408d87828801613f0a565b945050602061409e87828801613f0a565b93505060406140af87828801613e2b565b925050606085013567ffffffffffffffff8111156140d0576140cf613e05565b5b6140dc87828801614037565b91505092959194509250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61411d816140e8565b82525050565b60006020820190506141386000830184614114565b92915050565b600061010082019050614154600083018b613e9f565b614161602083018a613ec9565b61416e6040830189613ec9565b61417b6060830188613ec9565b6141886080830187613ec9565b61419560a0830186613ec9565b6141a260c0830185613ec9565b6141af60e0830184613ec9565b9998505050505050505050565b600080604083850312156141d3576141d2613e00565b5b60006141e185828601613e2b565b92505060206141f285828601613f0a565b9150509250929050565b60008115159050919050565b614211816141fc565b82525050565b600060208201905061422c6000830184614208565b92915050565b6000806040838503121561424957614248613e00565b5b600061425785828601613e2b565b925050602061426885828601613e2b565b9150509250929050565b61427b816141fc565b811461428657600080fd5b50565b60008135905061429881614272565b92915050565b600080604083850312156142b5576142b4613e00565b5b60006142c385828601613f0a565b92505060206142d485828601614289565b9150509250929050565b6000602082840312156142f4576142f3613e00565b5b600061430284828501613f0a565b91505092915050565b60008060008060008060c0878903121561432857614327613e00565b5b600061433689828a01613e2b565b965050602061434789828a01613e2b565b955050604061435889828a01613e2b565b945050606061436989828a01613e2b565b935050608061437a89828a01613e2b565b92505060a061438b89828a01614289565b9150509295509295509295565b60006080820190506143ad6000830187613ec9565b6143ba6020830186613ec9565b6143c76040830185613ec9565b6143d46060830184614208565b95945050505050565b60008060008060008060c087890312156143fa576143f9613e00565b5b600061440889828a01613e2b565b965050602061441989828a01613e2b565b955050604061442a89828a01613f0a565b945050606061443b89828a01613e2b565b935050608061444c89828a01613e2b565b92505060a061445d89828a01614289565b9150509295509295509295565b600060c08201905061447f6000830189613ec9565b61448c6020830188613ec9565b6144996040830187613ec9565b6144a66060830186613ec9565b6144b36080830185613ec9565b6144c060a0830184613ec9565b979650505050505050565b6000819050919050565b60006144f06144eb6144e684613e6d565b6144cb565b613e6d565b9050919050565b6000614502826144d5565b9050919050565b6000614514826144f7565b9050919050565b61452481614509565b82525050565b600060208201905061453f600083018461451b565b92915050565b600082825260208201905092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061458c601f83614545565b915061459782614556565b602082019050919050565b600060208201905081810360008301526145bb8161457f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4538000000000000000000000000000000000000000000000000000000000000600082015250565b6000614627600283614545565b9150614632826145f1565b602082019050919050565b600060208201905081810360008301526146568161461a565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061469782613e0a565b91506146a283613e0a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156146db576146da61465d565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061472082613e0a565b915061472b83613e0a565b92508261473b5761473a6146e6565b5b828204905092915050565b600061475182613e0a565b915061475c83613e0a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156147915761479061465d565b5b828201905092915050565b60006040820190506147b16000830185613ec9565b6147be6020830184613ec9565b9392505050565b60006060820190506147da6000830186613e9f565b6147e76020830185613e9f565b6147f46040830184613ec9565b949350505050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000614832602083614545565b915061483d826147fc565b602082019050919050565b6000602082019050818103600083015261486181614825565b9050919050565b7f4531300000000000000000000000000000000000000000000000000000000000600082015250565b600061489e600383614545565b91506148a982614868565b602082019050919050565b600060208201905081810360008301526148cd81614891565b9050919050565b7f4531310000000000000000000000000000000000000000000000000000000000600082015250565b600061490a600383614545565b9150614915826148d4565b602082019050919050565b60006020820190508181036000830152614939816148fd565b9050919050565b7f4535000000000000000000000000000000000000000000000000000000000000600082015250565b6000614976600283614545565b915061498182614940565b602082019050919050565b600060208201905081810360008301526149a581614969565b9050919050565b60006149b782613e0a565b91506149c283613e0a565b9250828210156149d5576149d461465d565b5b828203905092915050565b6000815190506149ef81613ef3565b92915050565b600060208284031215614a0b57614a0a613e00565b5b6000614a19848285016149e0565b91505092915050565b7f4533000000000000000000000000000000000000000000000000000000000000600082015250565b6000614a58600283614545565b9150614a6382614a22565b602082019050919050565b60006020820190508181036000830152614a8781614a4b565b9050919050565b6000606082019050614aa36000830186613e9f565b614ab06020830185613ec9565b614abd6040830184613ec9565b949350505050565b7f4539000000000000000000000000000000000000000000000000000000000000600082015250565b6000614afb600283614545565b9150614b0682614ac5565b602082019050919050565b60006020820190508181036000830152614b2a81614aee565b9050919050565b600081519050614b4081613e14565b92915050565b600060208284031215614b5c57614b5b613e00565b5b6000614b6a84828501614b31565b91505092915050565b7f4531000000000000000000000000000000000000000000000000000000000000600082015250565b6000614ba9600283614545565b9150614bb482614b73565b602082019050919050565b60006020820190508181036000830152614bd881614b9c565b9050919050565b7f4532000000000000000000000000000000000000000000000000000000000000600082015250565b6000614c15600283614545565b9150614c2082614bdf565b602082019050919050565b60006020820190508181036000830152614c4481614c08565b9050919050565b6000608082019050614c606000830187613ec9565b614c6d6020830186613ec9565b614c7a6040830185613e9f565b614c876060830184613ec9565b95945050505050565b7f4536000000000000000000000000000000000000000000000000000000000000600082015250565b6000614cc6600283614545565b9150614cd182614c90565b602082019050919050565b60006020820190508181036000830152614cf581614cb9565b9050919050565b7f4537000000000000000000000000000000000000000000000000000000000000600082015250565b6000614d32600283614545565b9150614d3d82614cfc565b602082019050919050565b60006020820190508181036000830152614d6181614d25565b9050919050565b7f4534000000000000000000000000000000000000000000000000000000000000600082015250565b6000614d9e600283614545565b9150614da982614d68565b602082019050919050565b60006020820190508181036000830152614dcd81614d91565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614e30602683614545565b9150614e3b82614dd4565b604082019050919050565b60006020820190508181036000830152614e5f81614e23565b9050919050565b6000604082019050614e7b6000830185613e9f565b614e886020830184613ec9565b9392505050565b6000614e9a82613e0a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614ecd57614ecc61465d565b5b600182019050919050565b600080600060608486031215614ef157614ef0613e00565b5b6000614eff86828701614b31565b9350506020614f1086828701614b31565b9250506040614f2186828701614b31565b9150509250925092565b600081519050614f3a81614272565b92915050565b600060208284031215614f5657614f55613e00565b5b6000614f6484828501614f2b565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614fc9602a83614545565b9150614fd482614f6d565b604082019050919050565b60006020820190508181036000830152614ff881614fbc565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b600061505b602683614545565b915061506682614fff565b604082019050919050565b6000602082019050818103600083015261508a8161504e565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b60006150c7601d83614545565b91506150d282615091565b602082019050919050565b600060208201905081810360008301526150f6816150ba565b9050919050565b600081519050919050565b600081905092915050565b60005b83811015615131578082015181840152602081019050615116565b83811115615140576000848401525b50505050565b6000615151826150fd565b61515b8185615108565b935061516b818560208601615113565b80840191505092915050565b60006151838284615146565b915081905092915050565b600081519050919050565b60006151a48261518e565b6151ae8185614545565b93506151be818560208601615113565b6151c781613f29565b840191505092915050565b600060208201905081810360008301526151ec8184615199565b90509291505056fea264697066735822122089a0b21f3c7e67eb9e60824380a1875061fe5c587ee1f5cb383e1ff434bcd03564736f6c63430008090033