Address Details
contract

0xa3037b2AADaE7a1FB37Fd925D44B10db74347206

Contract Name
AuctionFactory
Creator
0xf48ece–cd07ba at 0x3e243c–708439
Balance
0 CELO ( )
Locked CELO Balance
0.00 CELO
Voting CELO Balance
0.00 CELO
Pending Unlocked Gold
0.00 CELO
Tokens
Fetching tokens...
Transactions
2 Transactions
Transfers
0 Transfers
Gas Used
2,525,178
Last Balance Update
11641965
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
AuctionFactory




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




Optimization runs
200
EVM Version
istanbul




Verified at
2022-05-26T12:35:04.448285Z

project:/contracts/Auction.sol

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

// Importing OpenZeppelin's contracts
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract Auction is ERC721Holder, Ownable, ReentrancyGuard {

    using SafeMath for uint256;
    IERC20 private erc20Token;

    // static
    uint256 public immutable floorPrice;
    uint256 public immutable startTime;
    uint256 public immutable endTime;
    address private immutable beneficiary;
    uint256 private immutable tokenIssue;
    uint256 private immutable redeemQty;
    uint private immutable feePercent;

    // state
    bool public canceled;
    bool public ended;
    bool private fundCollected;
    uint256 public highestBindingBid;
    address public highestBidder;
    address[] private bidders;   
    mapping(address => uint256) public fundsByBidder;        
    mapping(address => bool) public rewardCollected;        
    mapping(uint256 => uint256) public tokenRedeemed;
    uint256[] private tokensAllowed;

    // events
    event LogBid(address bidder, uint256 bid, address highestBidder, uint256 highestBid, uint256 highestBindingBid);
    event LogWithdrawal(address withdrawalAccount, uint256 amount);
    event LogCanceled(bool success);
    event LogRefund(address sender, uint256 amount);
    event FundCollected(uint256 merchantFee, uint256 marketplaceFee);
    event TokenCollected(address winner, uint256 tokenId);
    event Received(address sender, uint256 amount);
    event TokenRedeemed(uint tokenId, uint256 redeemedTotal);

    //trigger when deploy
    constructor(IERC20 _erc20Token, address _beneficiary, uint256 _floorPrice, uint256 _startTime, uint256 _endTime, uint256 _tokenIssue, uint256 _feePercent, uint256 _redeemQty)
    {
        require(_startTime > 1000000000, 'Auction start timestamp is not in seconds!');
        require(_endTime > block.timestamp, 'Auction end timestamp can not be the past!');
        require(_beneficiary != address(0x0), 'Beneficiary address is not correct!');
        erc20Token = _erc20Token;
        beneficiary = _beneficiary;
        floorPrice = etherToWei(_floorPrice);
        startTime = _startTime;
        endTime = _endTime;
        tokenIssue = _tokenIssue;
        feePercent = _feePercent;
        redeemQty = _redeemQty;
    }

    // bid on NFD
    function placeBid(uint256 amount) external
        nonReentrant
        onlyAfterStart
        onlyBeforeEnd
        onlyNotCanceled
        onlyNotBeneficiary
    {   
        address _bidder = msg.sender;
        require(erc20Token.balanceOf(_bidder) >= amount, 'Insufficiant ERC20 token balance!'); 
        require(erc20Token.allowance(_bidder, address(this)) >= amount, 'Approve ERC20 tokens first!');      

        // calculate the user's total bid based on the current amount they've sent to the contract
        // plus whatever has been sent with this transaction
        uint newBid = fundsByBidder[_bidder].add(amount);

        // reject payments of less than floor price
        require(newBid >= floorPrice, 'Bid Token amount too low!, amount should be above floor price');

         // if the user isn't even willing to overbid the highest binding bid, there's nothing for us
        // to do except revert the transaction.
        if (newBid <= highestBindingBid) revert('overbid the highest binding bid!');

        // grab the previous highest bid (before updating fundsByBidder, in case msg.sender is the
        // highestBidder and is just increasing their maximum bid).
        uint highestBid = fundsByBidder[highestBidder];

        fundsByBidder[_bidder] = newBid;

        if (newBid <= highestBid) {
            // if the user has overbid the highestBindingBid but not the highestBid, we simply
            // increase the highestBindingBid and leave highestBidder alone.

            // note that this case is impossible if msg.sender == highestBidder because you can never
            // bid less ETH than you've already bid.

            highestBindingBid = min(newBid.add(etherToWei(1)), highestBid);
        } else {
            // if msg.sender is already the highest bidder, they must simply be wanting to raise
            // their maximum bid, in which case we shouldn't increase the highestBindingBid.

            // if the user is NOT highestBidder, and has overbid highestBid completely, we set them
            // as the new highestBidder and recalculate highestBindingBid.

            if (_bidder != highestBidder) {
                highestBidder = _bidder;
                highestBindingBid = min(newBid, highestBid.add(etherToWei(1)));
            }
            highestBid = newBid;
        }                 
               
        // ERC20 token transfer from bidder to current contract address
        erc20Token.transferFrom(_bidder, address(this), amount);
        addNewBidder(_bidder);
        emit LogBid(_bidder, amount, highestBidder, highestBid, highestBindingBid);
    }

    function addNewBidder(address bidder) internal virtual
    {
        bool alreadyBidder; 
        for (uint256 i = 0; i < bidders.length; i++) {
            if(msg.sender == bidders[i]) {alreadyBidder = true; break;}
        }
        if(!alreadyBidder) bidders.push(bidder);
    }

    function min(uint a, uint b)
        private
        pure
        returns (uint)
    {
        if (a < b) return a;
        return b;
    }

    function withdraw() external
        nonReentrant
        onlyHasCanceled
        onlyNotBeneficiary
        onlyBidder
    {
        address withdrawalAccount;
        uint256 withdrawalAmount;        

        withdrawalAccount = _msgSender();
        withdrawalAmount = fundsByBidder[withdrawalAccount];

        require(withdrawalAmount > 0, 'You have already withdrawal your funds!');
        fundsByBidder[withdrawalAccount] -= withdrawalAmount;

        //withdraw the ERC20 tokens paid for bid
        erc20Token.transfer(withdrawalAccount, withdrawalAmount);
        emit LogWithdrawal(withdrawalAccount, withdrawalAmount);
    }

    function getHighestBid() public       
        view returns (uint256)
    {
        return fundsByBidder[highestBidder];
    }

    function getMyBid() public
        view returns (uint256)
    {
        return fundsByBidder[_msgSender()];
    }

    function getAuctionStatus() public
        view returns (string memory )
    {
        if( canceled ) return 'canceled';
        if( block.timestamp > endTime ) return 'ended';
        if( block.timestamp < startTime ) return 'not-started';
        return 'running';
    }

    function getTokenReddemCount(uint256 _tokenId) public
        view returns (uint256)
    {
        return tokenRedeemed[_tokenId];
    }

    function getFeePercent() external 
        onlyOwner      
        view returns (uint256)
    {
        return feePercent;
    }

    function tokenList() external 
        onlyOwner
        onlyCompleted
        view returns (uint256[] memory) 
    {
        return tokensAllowed;
    }

    function bidderList() external 
        onlyOwner
        onlyAfterStart
        view returns (address[] memory) 
    {
        return bidders;
    }

    function winnerList() external
        onlyOwner
        view returns (address[] memory)
    {
        return _winnerList();
    }

    function etherToWei(uint valueEther) internal pure returns (uint)
    {
       return valueEther*(10**18);
    }

    function onERC721Received(
        address,
        address,
        uint256 _tokenId,
        bytes memory
    ) public virtual override returns (bytes4) {

        require(tokenIssue > tokensAllowed.length, 'Token allowance has reached the maximum!');
        tokensAllowed.push(_tokenId);
        return this.onERC721Received.selector;
    }

    function redeemNFD(uint256 _tokenId) external virtual
        onlyOwner
        onlyCompleted
    {   
        bool tokenAllowed;
        for( uint256 i = 0; i < tokensAllowed.length; i++ ) 
        {
            if(tokensAllowed[i] == _tokenId) {
                tokenAllowed = true;
                break;
            }
        }
        require(tokenAllowed, 'Token is not allowed for redeemed!');
        require( redeemQty > tokenRedeemed[_tokenId], "User have reached the maximum allowance!");
        tokenRedeemed[_tokenId] = tokenRedeemed[_tokenId].add(1);
        emit TokenRedeemed( _tokenId,  tokenRedeemed[_tokenId]);        
    }

    function _winnersListPrepare(uint _priceMargin, address[] memory _winners, uint _winnerIndex) internal 
        view 
        returns (address[] memory)
    {        
        uint priceFilter = fundsByBidder[highestBidder].sub(etherToWei(_priceMargin));
        for (uint j = 0; j < bidders.length; j++) {
            if( _winnerIndex == _winners.length ) break;
            address bidder = bidders[j];
            if( fundsByBidder[bidder] >= priceFilter ){
                bool duplicateWinner;
                for (uint k = 0; k <= _winnerIndex; k++) {
                    if( bidder == _winners[k] ) duplicateWinner = true;
                }
                if(!duplicateWinner){                        
                    _winners[_winnerIndex] = bidder;
                    ++_winnerIndex;
                }
            }                
        }
        if( _winnerIndex != _winners.length ) _winnersListPrepare(_priceMargin.add(1), _winners, _winnerIndex);
        return _winners; 
    }

    function _winnerList() internal 
        virtual
        onlyCompleted
        view 
        returns (address[] memory) 
    {        
        require(bidders.length > 0, 'No bidder found, winner list can not be generate!');
        uint256 maxWinners = bidders.length < tokenIssue ? bidders.length : tokenIssue;
        address[] memory winners = new address[](maxWinners); 
        winners[0] = highestBidder;
        if( maxWinners == 1 ) return winners;
        return _winnersListPrepare(1,winners, 1);
    }

    function cancelAuction() external
        nonReentrant
        onlyOwner
        onlyBeforeEnd
        onlyNotCanceled
        returns (bool success)
    {
        canceled = true;
        emit LogCanceled(true);
        return true;
    }

    function refund() external
        nonReentrant
        onlyNotBeneficiary
        onlyCompleted
        onlyBidder
        onlyNonWinner
    {
        uint256 withdrawalAmount = fundsByBidder[_msgSender()];
        require(withdrawalAmount > 0, 'You already have refund back!');
        fundsByBidder[_msgSender()] -= withdrawalAmount;
        
        //refund the ERC20 tokens to bidder, paid for bid but not become winner
        erc20Token.transfer(_msgSender(), withdrawalAmount);
        emit LogRefund(_msgSender(), withdrawalAmount);
    }

    function collectToken(uint _tokenId, address _virtuousToken) external
        nonReentrant
        onlyNotBeneficiary
        onlyCompleted
        onlyWinner
        onlyRewardNotCollected
    {   
        IERC721 virtuousToken = IERC721(_virtuousToken);
        require(virtuousToken.balanceOf(address(this)) > 0, "Caller must own nft");
        require(virtuousToken.ownerOf(_tokenId) == address(this), "You must own the token");
        rewardCollected[_msgSender()] = true;
        virtuousToken.safeTransferFrom(address(this), _msgSender(), _tokenId);
        emit TokenCollected( _msgSender(),  _tokenId);
    }

    function collectFund() external
        nonReentrant
        onlyBeneficiaryOrOwner
        onlyNotCollected
    {   
        address[] memory winners = _winnerList();
        uint256 merchantFund;
        uint256 marketplaceRoyalty;
        for( uint256 i = 0; i < winners.length; i++ ) 
        {   
            address winner = winners[i];
            uint256 amount = fundsByBidder[winner];                   
            uint256 marketplaceFee = amount.div(100).mul(feePercent);
            marketplaceRoyalty = marketplaceRoyalty.add(marketplaceFee);
            uint256 merchantFee = amount.sub(marketplaceFee);
            merchantFund = merchantFund.add(merchantFee);            
            fundsByBidder[winner] -= amount;
        }
        fundCollected = true;
        erc20Token.transfer(beneficiary, merchantFund);
        erc20Token.transfer(owner(), marketplaceRoyalty);
        emit FundCollected(merchantFund, marketplaceRoyalty);
    }

    receive() external payable 
    {
        emit Received(_msgSender(), msg.value);
    }

    fallback() external payable {
        emit Received(_msgSender(), msg.value);
    }

    modifier onlyNotBeneficiary {
        if (_msgSender() == beneficiary) revert('Beneficiary can not perform the action!');
        _;
    }

    modifier onlyBeneficiaryOrOwner {
        require( _msgSender() == beneficiary || _msgSender() == owner(), 'Beneficiary / Owner can only perform the action!');
        _;
    }

    modifier onlyAfterStart {
        if (block.timestamp < startTime) revert('Auction yet not start!');
        _;
    }

    modifier onlyBeforeEnd {
        if (block.timestamp > endTime) revert('Auction already ended!');
        _;
    }

    modifier onlyNotCanceled {
        if (canceled) revert('Auction already canceled!');
        _;
    }

    modifier onlyHasCanceled {
        if (!canceled) revert('Auction is not canceled!');
        _;
    }

    modifier onlyCompleted {
        require(block.timestamp > endTime && !canceled, "Auction is not ended yet!");
        _;
    }

    modifier onlyNotCollected {
        require(!fundCollected, "Funds already collected!");
        _;
    }

    modifier onlyBidder {
        require(fundsByBidder[_msgSender()] > 0, 'You are not a valid bidder!');
        _;
    }

    modifier onlyNonWinner {
        address[] memory winners = _winnerList();
        for( uint256 i = 0; i < winners.length; i++ ) {
            if( _msgSender() == winners[i] ) revert('You are winner, you can not perform this action!');
        }
        _;
    }

    modifier onlyWinner {
        address[] memory winners = _winnerList();
        bool winner;
        for( uint256 i = 0; i < winners.length; i++ ) {
            if( _msgSender() == winners[i] ){ winner = true; break; }
        }
        require(winner, 'You are not a winner!');
        _;
    }

    modifier onlyRewardNotCollected {
        require(!rewardCollected[_msgSender()], 'You have already collected your token!');
        _;
    }
}

contract AuctionFactory is Ownable, ReentrancyGuard {
    address[] public auctions;
    event AuctionCreated(address auctionContract, uint numAuctions, address[] allAuctions);

    function createAuction(IERC20 _erc20Token, address _beneficiary, uint256 _floorPrice, uint256 _startTime, uint256 _endTime, uint256 _tokenIssue, uint256 _feePercent, uint256 _redeemQty) public
        onlyOwner
    {
        Auction newAuction = new Auction(_erc20Token, _beneficiary, _floorPrice, _startTime, _endTime, _tokenIssue, _feePercent, _redeemQty);
        auctions.push(address(newAuction));
        emit AuctionCreated(address(newAuction), auctions.length, auctions);
    }

    function allAuctions() public view returns (address[] memory) {
        return auctions;
    }
} 
        

/_openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
          

/_openzeppelin/contracts/security/ReentrancyGuard.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

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

/_openzeppelin/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}
          

/_openzeppelin/contracts/token/ERC721/IERC721.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}
          

/_openzeppelin/contracts/token/ERC721/IERC721Receiver.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

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 `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}
          

/_openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721Receiver.sol";

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

/_openzeppelin/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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

/_openzeppelin/contracts/utils/introspection/IERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

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

/_openzeppelin/contracts/utils/math/SafeMath.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

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

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

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

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

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

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

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

Contract ABI

[{"type":"event","name":"AuctionCreated","inputs":[{"type":"address","name":"auctionContract","internalType":"address","indexed":false},{"type":"uint256","name":"numAuctions","internalType":"uint256","indexed":false},{"type":"address[]","name":"allAuctions","internalType":"address[]","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"allAuctions","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"auctions","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"createAuction","inputs":[{"type":"address","name":"_erc20Token","internalType":"contract IERC20"},{"type":"address","name":"_beneficiary","internalType":"address"},{"type":"uint256","name":"_floorPrice","internalType":"uint256"},{"type":"uint256","name":"_startTime","internalType":"uint256"},{"type":"uint256","name":"_endTime","internalType":"uint256"},{"type":"uint256","name":"_tokenIssue","internalType":"uint256"},{"type":"uint256","name":"_feePercent","internalType":"uint256"},{"type":"uint256","name":"_redeemQty","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b5061001a33610023565b60018055610073565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b613593806100826000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80631bbcd4a514610067578063571a26a014610085578063715018a6146100b05780638da5cb5b146100ba57806399cd7883146100cb578063f2fde38b146100de575b600080fd5b61006f6100f1565b60405161007c91906104ea565b60405180910390f35b61009861009336600461046f565b610153565b6040516001600160a01b03909116815260200161007c565b6100b861017d565b005b6000546001600160a01b0316610098565b6100b86100d9366004610405565b6101bc565b6100b86100ec3660046103e2565b6102ea565b6060600280548060200260200160405190810160405280929190818152602001828054801561014957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161012b575b5050505050905090565b6002818154811061016357600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b031633146101b05760405162461bcd60e51b81526004016101a790610537565b60405180910390fd5b6101ba6000610385565b565b6000546001600160a01b031633146101e65760405162461bcd60e51b81526004016101a790610537565b600088888888888888886040516101fc906103d5565b6001600160a01b03988916815297909616602088015260408701949094526060860192909252608085015260a084015260c083015260e082015261010001604051809103906000f080158015610256573d6000803e3d6000fd5b506002805460018101825560008290527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b03841617905580546040519293507f0cc063913912f66d3b1f26761bf12fefdeb0f7cccc0319f70cff0e0a0e12113e926102d792859291610487565b60405180910390a1505050505050505050565b6000546001600160a01b031633146103145760405162461bcd60e51b81526004016101a790610537565b6001600160a01b0381166103795760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101a7565b61038281610385565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b612fdc8061058283390190565b6000602082840312156103f3578081fd5b81356103fe8161056c565b9392505050565b600080600080600080600080610100898b031215610421578384fd5b883561042c8161056c565b9750602089013561043c8161056c565b979a9799505050506040860135956060810135956080820135955060a0820135945060c0820135935060e0909101359150565b600060208284031215610480578081fd5b5035919050565b60006060820160018060a01b03808716845260208681860152606060408601528286548085526080870191508786528286209450855b818110156104db5785548516835260019586019592840192016104bd565b50909998505050505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561052b5783516001600160a01b031683529284019291840191600101610506565b50909695505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6001600160a01b038116811461038257600080fdfe6101606040523480156200001257600080fd5b5060405162002fdc38038062002fdc833981016040819052620000359162000241565b6200004033620001d5565b60018055633b9aca008511620000b05760405162461bcd60e51b815260206004820152602a60248201527f41756374696f6e2073746172742074696d657374616d70206973206e6f7420696044820152696e207365636f6e64732160b01b60648201526084015b60405180910390fd5b428411620001145760405162461bcd60e51b815260206004820152602a60248201527f41756374696f6e20656e642074696d657374616d702063616e206e6f742062656044820152692074686520706173742160b01b6064820152608401620000a7565b6001600160a01b038716620001785760405162461bcd60e51b815260206004820152602360248201527f42656e65666963696172792061646472657373206973206e6f7420636f72726560448201526263742160e81b6064820152608401620000a7565b600280546001600160a01b0319166001600160a01b038a16179055606087901b6001600160601b03191660e052620001b08662000225565b60805260a09490945260c09290925261010052610140526101205250620002fb915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006200023b82670de0b6b3a7640000620002b6565b92915050565b600080600080600080600080610100898b0312156200025e578384fd5b88516200026b81620002e2565b60208a01519098506200027e81620002e2565b60408a015160608b015160808c015160a08d015160c08e015160e0909e01519c9f949e50929c919b909a509198509650945092505050565b6000816000190483118215151615620002dd57634e487b7160e01b81526011600452602481fd5b500290565b6001600160a01b0381168114620002f857600080fd5b50565b60805160a05160c05160e05160601c610100516101205161014051612bf7620003e560003960008181610d4e015261220401526000611795015260008181610ac00152818161238901526123af01526000818161069601528181610bee01528181610e1c01528181611103015281816113440152611c65015260008181610333015281816106d601528181610fc9015281816113840152818161167c01528181611a0501528181611ba50152818161212e01526122c501526000818161043701528181611011015281816118b20152611b3c0152600081816105240152611e7b0152612bf76000f3fe6080604052600436106101c65760003560e01c806378e97925116100f75780639979ef4511610095578063ce10cf8011610064578063ce10cf80146105ca578063f28c4040146105f7578063f2fde38b14610624578063f5b56c561461064457610210565b80639979ef45146105465780639e2c58ca14610566578063b0954dee14610588578063be74264d146105b557610210565b80638da5cb5b116100d15780638da5cb5b146104ab5780638fa8b790146104dd57806391f90157146104f25780639363c8121461051257610210565b806378e97925146104255780637b0e08201461045957806384ddc67f1461048957610210565b80633ccfd60b11610164578063590e1ae31161013e578063590e1ae3146103c657806369de8347146103db578063704416b4146103fb578063715018a61461041057610210565b80633ccfd60b146103635780633f9942ff146103785780634979440a1461039957610210565b806315d6af8f116101a057806315d6af8f146102c857806324d507fd146102ea5780632e93be30146102ff5780633197cbb61461032157610210565b80631257e2791461023757806312fa6feb14610259578063150b7a021461028f57610210565b36610210577f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874335b604080516001600160a01b0390921682523460208301520160405180910390a1005b7f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874336101ee565b34801561024357600080fd5b50610257610252366004612906565b61065a565b005b34801561026557600080fd5b5060025461027a90600160a81b900460ff1681565b60405190151581526020015b60405180910390f35b34801561029b57600080fd5b506102af6102aa3660046127dd565b610ab8565b6040516001600160e01b03199091168152602001610286565b3480156102d457600080fd5b506102dd610b80565b6040516102869190612935565b3480156102f657600080fd5b50610257610bbb565b34801561030b57600080fd5b50610314610f8f565b60405161028691906129ba565b34801561032d57600080fd5b506103557f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610286565b34801561036f57600080fd5b5061025761107f565b34801561038457600080fd5b5060025461027a90600160a01b900460ff1681565b3480156103a557600080fd5b506004546001600160a01b0316600090815260066020526040902054610355565b3480156103d257600080fd5b50610257611311565b3480156103e757600080fd5b506102576103f63660046128d6565b611650565b34801561040757600080fd5b506102dd611883565b34801561041c57600080fd5b50610257611979565b34801561043157600080fd5b506103557f000000000000000000000000000000000000000000000000000000000000000081565b34801561046557600080fd5b5061027a61047436600461279e565b60076020526000908152604090205460ff1681565b34801561049557600080fd5b5033600090815260066020526040902054610355565b3480156104b757600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610286565b3480156104e957600080fd5b5061027a6119af565b3480156104fe57600080fd5b506004546104c5906001600160a01b031681565b34801561051e57600080fd5b506103557f000000000000000000000000000000000000000000000000000000000000000081565b34801561055257600080fd5b506102576105613660046128d6565b611b12565b34801561057257600080fd5b5061057b6120ff565b6040516102869190612982565b34801561059457600080fd5b506103556105a33660046128d6565b60086020526000908152604090205481565b3480156105c157600080fd5b506103556121d6565b3480156105d657600080fd5b506103556105e536600461279e565b60066020526000908152604090205481565b34801561060357600080fd5b506103556106123660046128d6565b60009081526008602052604090205490565b34801561063057600080fd5b5061025761063f36600461279e565b612226565b34801561065057600080fd5b5061035560035481565b600260015414156106865760405162461bcd60e51b815260040161067d90612ac0565b60405180910390fd5b6002600155336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156106d45760405162461bcd60e51b815260040161067d90612a44565b7f00000000000000000000000000000000000000000000000000000000000000004211801561070d5750600254600160a01b900460ff16155b6107295760405162461bcd60e51b815260040161067d90612a0d565b60006107336122c1565b90506000805b82518110156107a45782818151811061076257634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031661077a3390565b6001600160a01b0316141561079257600191506107a4565b8061079c81612b65565b915050610739565b50806107ea5760405162461bcd60e51b8152602060048201526015602482015274596f7520617265206e6f7420612077696e6e65722160581b604482015260640161067d565b3360009081526007602052604090205460ff16156108595760405162461bcd60e51b815260206004820152602660248201527f596f75206861766520616c726561647920636f6c6c656374656420796f757220604482015265746f6b656e2160d01b606482015260840161067d565b6040516370a0823160e01b815230600482015283906000906001600160a01b038316906370a082319060240160206040518083038186803b15801561089d57600080fd5b505afa1580156108b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d591906128ee565b116109185760405162461bcd60e51b815260206004820152601360248201527210d85b1b195c881b5d5cdd081bdddb881b999d606a1b604482015260640161067d565b6040516331a9108f60e11b81526004810186905230906001600160a01b03831690636352211e9060240160206040518083038186803b15801561095a57600080fd5b505afa15801561096e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099291906127c1565b6001600160a01b0316146109e15760405162461bcd60e51b81526020600482015260166024820152752cb7ba9036bab9ba1037bbb7103a3432903a37b5b2b760511b604482015260640161067d565b33600081815260076020526040808220805460ff191660011790558051632142170760e11b8152306004820152602481019390935260448301889052516001600160a01b038416926342842e0e92606480830193919282900301818387803b158015610a4c57600080fd5b505af1158015610a60573d6000803e3d6000fd5b505050507f17b3a70c980ec7f4b25a351955fa92638e9757afd4216535ac95a0153857680d610a8c3390565b604080516001600160a01b039092168252602082018890520160405180910390a1505060018055505050565b6009546000907f000000000000000000000000000000000000000000000000000000000000000011610b3d5760405162461bcd60e51b815260206004820152602860248201527f546f6b656e20616c6c6f77616e636520686173207265616368656420746865206044820152676d6178696d756d2160c01b606482015260840161067d565b5050600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af015550630a85bd0160e11b919050565b6000546060906001600160a01b03163314610bad5760405162461bcd60e51b815260040161067d90612a8b565b610bb56122c1565b90505b90565b60026001541415610bde5760405162461bcd60e51b815260040161067d90612ac0565b6002600155336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610c2457506000546001600160a01b031633145b610c895760405162461bcd60e51b815260206004820152603060248201527f42656e6566696369617279202f204f776e65722063616e206f6e6c792070657260448201526f666f726d2074686520616374696f6e2160801b606482015260840161067d565b600254600160b01b900460ff1615610ce35760405162461bcd60e51b815260206004820152601860248201527f46756e647320616c726561647920636f6c6c6563746564210000000000000000604482015260640161067d565b6000610ced6122c1565b905060008060005b8351811015610def576000848281518110610d2057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03811660009081526006909252604082205490925090610d7e7f0000000000000000000000000000000000000000000000000000000000000000610d788460646124a3565b906124b8565b9050610d8a85826124c4565b94506000610d9883836124d0565b9050610da487826124c4565b6001600160a01b038516600090815260066020526040812080549299508592909190610dd1908490612b4e565b92505081905550505050508080610de790612b65565b915050610cf5565b506002805460ff60b01b198116600160b01b1790915560405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018590529091169063a9059cbb90604401602060405180830381600087803b158015610e7057600080fd5b505af1158015610e84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea891906128b6565b506002546001600160a01b031663a9059cbb610ecc6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c91906128b6565b5060408051838152602081018390527f9f711bbd3973f42733d63b23f9999746f6a259ee84921299074f3a9955876518910160405180910390a150506001805550565b600254606090600160a01b900460ff1615610fc7575060408051808201909152600881526718d85b98d95b195960c21b602082015290565b7f000000000000000000000000000000000000000000000000000000000000000042111561100f5750604080518082019091526005815264195b99195960da1b602082015290565b7f000000000000000000000000000000000000000000000000000000000000000042101561105d575060408051808201909152600b81526a1b9bdd0b5cdd185c9d195960aa1b602082015290565b5060408051808201909152600781526672756e6e696e6760c81b602082015290565b600260015414156110a25760405162461bcd60e51b815260040161067d90612ac0565b6002600181905554600160a01b900460ff166111005760405162461bcd60e51b815260206004820152601860248201527f41756374696f6e206973206e6f742063616e63656c6564210000000000000000604482015260640161067d565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614156111495760405162461bcd60e51b815260040161067d90612a44565b336000908152600660205260409020546111a55760405162461bcd60e51b815260206004820152601b60248201527f596f7520617265206e6f7420612076616c696420626964646572210000000000604482015260640161067d565b33600081815260066020526040902054806112125760405162461bcd60e51b815260206004820152602760248201527f596f75206861766520616c7265616479207769746864726177616c20796f75726044820152662066756e64732160c81b606482015260840161067d565b6001600160a01b0382166000908152600660205260408120805483929061123a908490612b4e565b909155505060025460405163a9059cbb60e01b81526001600160a01b038481166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b15801561128d57600080fd5b505af11580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c591906128b6565b50604080516001600160a01b0384168152602081018390527fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e9191015b60405180910390a1505060018055565b600260015414156113345760405162461bcd60e51b815260040161067d90612ac0565b6002600155336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156113825760405162461bcd60e51b815260040161067d90612a44565b7f0000000000000000000000000000000000000000000000000000000000000000421180156113bb5750600254600160a01b900460ff16155b6113d75760405162461bcd60e51b815260040161067d90612a0d565b336000908152600660205260409020546114335760405162461bcd60e51b815260206004820152601b60248201527f596f7520617265206e6f7420612076616c696420626964646572210000000000604482015260640161067d565b600061143d6122c1565b905060005b81518110156115055781818151811061146b57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166114833390565b6001600160a01b031614156114f35760405162461bcd60e51b815260206004820152603060248201527f596f75206172652077696e6e65722c20796f752063616e206e6f74207065726660448201526f6f726d207468697320616374696f6e2160801b606482015260840161067d565b806114fd81612b65565b915050611442565b5033600090815260066020526040902054806115635760405162461bcd60e51b815260206004820152601d60248201527f596f7520616c7265616479206861766520726566756e64206261636b21000000604482015260640161067d565b3360009081526006602052604081208054839290611582908490612b4e565b90915550506002546001600160a01b031663a9059cbb336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156115e157600080fd5b505af11580156115f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161991906128b6565b5060408051338152602081018390527fb6c0eca8138e097d71e2dd31e19a1266487f0553f170b7260ffe68bcbe9ff8a79101611301565b6000546001600160a01b0316331461167a5760405162461bcd60e51b815260040161067d90612a8b565b7f0000000000000000000000000000000000000000000000000000000000000000421180156116b35750600254600160a01b900460ff16155b6116cf5760405162461bcd60e51b815260040161067d90612a0d565b6000805b60095481101561172b5782600982815481106116ff57634e487b7160e01b600052603260045260246000fd5b90600052602060002001541415611719576001915061172b565b8061172381612b65565b9150506116d3565b50806117845760405162461bcd60e51b815260206004820152602260248201527f546f6b656e206973206e6f7420616c6c6f77656420666f722072656465656d65604482015261642160f01b606482015260840161067d565b6000828152600860205260409020547f0000000000000000000000000000000000000000000000000000000000000000116118125760405162461bcd60e51b815260206004820152602860248201527f557365722068617665207265616368656420746865206d6178696d756d20616c6044820152676c6f77616e63652160c01b606482015260840161067d565b60008281526008602052604090205461182c9060016124c4565b60008381526008602052604090819020829055517f559dc6ea45ea5071b1480938c0df2cd88fca6c769bfc8aeebc7c38364ff1ed5e9161187791859190918252602082015260400190565b60405180910390a15050565b6000546060906001600160a01b031633146118b05760405162461bcd60e51b815260040161067d90612a8b565b7f00000000000000000000000000000000000000000000000000000000000000004210156119195760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20796574206e6f742073746172742160501b604482015260640161067d565b600580548060200260200160405190810160405280929190818152602001828054801561196f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611951575b5050505050905090565b6000546001600160a01b031633146119a35760405162461bcd60e51b815260040161067d90612a8b565b6119ad60006124dc565b565b6000600260015414156119d45760405162461bcd60e51b815260040161067d90612ac0565b60026001556000546001600160a01b03163314611a035760405162461bcd60e51b815260040161067d90612a8b565b7f0000000000000000000000000000000000000000000000000000000000000000421115611a6c5760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20616c726561647920656e6465642160501b604482015260640161067d565b600254600160a01b900460ff1615611ac25760405162461bcd60e51b815260206004820152601960248201527841756374696f6e20616c72656164792063616e63656c65642160381b604482015260640161067d565b6002805460ff60a01b1916600160a01b179055604051600181527f1fd636bc86322e474244a9366e9b72f9e75d3ba45b442352c7f950c92a9808a59060200160405180910390a150600180805590565b60026001541415611b355760405162461bcd60e51b815260040161067d90612ac0565b60026001557f0000000000000000000000000000000000000000000000000000000000000000421015611ba35760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20796574206e6f742073746172742160501b604482015260640161067d565b7f0000000000000000000000000000000000000000000000000000000000000000421115611c0c5760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20616c726561647920656e6465642160501b604482015260640161067d565b600254600160a01b900460ff1615611c625760405162461bcd60e51b815260206004820152601960248201527841756374696f6e20616c72656164792063616e63656c65642160381b604482015260640161067d565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161415611cab5760405162461bcd60e51b815260040161067d90612a44565b6002546040516370a0823160e01b815233600482018190529183916001600160a01b03909116906370a082319060240160206040518083038186803b158015611cf357600080fd5b505afa158015611d07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d2b91906128ee565b1015611d835760405162461bcd60e51b815260206004820152602160248201527f496e73756666696369616e7420455243323020746f6b656e2062616c616e63656044820152602160f81b606482015260840161067d565b600254604051636eb1769f60e11b81526001600160a01b0383811660048301523060248301528492169063dd62ed3e9060440160206040518083038186803b158015611dce57600080fd5b505afa158015611de2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e0691906128ee565b1015611e545760405162461bcd60e51b815260206004820152601b60248201527f417070726f766520455243323020746f6b656e73206669727374210000000000604482015260640161067d565b6001600160a01b038116600090815260066020526040812054611e7790846124c4565b90507f0000000000000000000000000000000000000000000000000000000000000000811015611f0f5760405162461bcd60e51b815260206004820152603d60248201527f42696420546f6b656e20616d6f756e7420746f6f206c6f77212c20616d6f756e60448201527f742073686f756c642062652061626f766520666c6f6f72207072696365000000606482015260840161067d565b6003548111611f605760405162461bcd60e51b815260206004820181905260248201527f6f7665726269642074686520686967686573742062696e64696e672062696421604482015260640161067d565b6004546001600160a01b039081166000908152600660205260408082205492851682529020829055808211611fb457611fac611fa6611f9f600161252c565b84906124c4565b82612540565b600355612001565b6004546001600160a01b03848116911614611ffe57600480546001600160a01b0319166001600160a01b038516179055611ffa82611ff5611f9f600161252c565b612540565b6003555b50805b6002546040516323b872dd60e01b81526001600160a01b03858116600483015230602483015260448201879052909116906323b872dd90606401602060405180830381600087803b15801561205557600080fd5b505af1158015612069573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208d91906128b6565b5061209783612557565b600454600354604080516001600160a01b03808816825260208201899052909316908301526060820183905260808201527ff152f4ff5e488c55370a2d53925a55055228ebd8ec95bd0251bbb299e48786b09060a00160405180910390a15050600180555050565b6000546060906001600160a01b0316331461212c5760405162461bcd60e51b815260040161067d90612a8b565b7f0000000000000000000000000000000000000000000000000000000000000000421180156121655750600254600160a01b900460ff16155b6121815760405162461bcd60e51b815260040161067d90612a0d565b600980548060200260200160405190810160405280929190818152602001828054801561196f57602002820191906000526020600020905b8154815260200190600101908083116121b9575050505050905090565b600080546001600160a01b031633146122015760405162461bcd60e51b815260040161067d90612a8b565b507f000000000000000000000000000000000000000000000000000000000000000090565b6000546001600160a01b031633146122505760405162461bcd60e51b815260040161067d90612a8b565b6001600160a01b0381166122b55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161067d565b6122be816124dc565b50565b60607f0000000000000000000000000000000000000000000000000000000000000000421180156122fc5750600254600160a01b900460ff16155b6123185760405162461bcd60e51b815260040161067d90612a0d565b6005546123815760405162461bcd60e51b815260206004820152603160248201527f4e6f2062696464657220666f756e642c2077696e6e6572206c6973742063616e604482015270206e6f742062652067656e65726174652160781b606482015260840161067d565b6005546000907f0000000000000000000000000000000000000000000000000000000000000000116123d3577f00000000000000000000000000000000000000000000000000000000000000006123d7565b6005545b905060008167ffffffffffffffff81111561240257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561242b578160200160208202803683370190505b5060045481519192506001600160a01b031690829060009061245d57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b031681525050816001141561248f579150610bb89050565b61249c6001826001612613565b9250505090565b60006124af8284612b0f565b90505b92915050565b60006124af8284612b2f565b60006124af8284612af7565b60006124af8284612b4e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006124b282670de0b6b3a7640000612b2f565b6000818310156125515750816124b2565b50919050565b6000805b6005548110156125bd576005818154811061258657634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03163314156125ab57600191506125bd565b806125b581612b65565b91505061255b565b508061260f57600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b0384161790555b5050565b606060006126446126238661252c565b6004546001600160a01b0316600090815260066020526040902054906124d0565b905060005b60055481101561277557845184141561266157612775565b60006005828154811061268457634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031680835260069091526040909120549091508311612762576000805b868111612715578781815181106126dd57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316836001600160a01b0316141561270357600191505b8061270d81612b65565b9150506126b6565b5080612760578187878151811061273c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015261275d86612b65565b95505b505b508061276d81612b65565b915050612649565b50835183146127955761279361278c8660016124c4565b8585612613565b505b50919392505050565b6000602082840312156127af578081fd5b81356127ba81612bac565b9392505050565b6000602082840312156127d2578081fd5b81516127ba81612bac565b600080600080608085870312156127f2578283fd5b84356127fd81612bac565b9350602085013561280d81612bac565b925060408501359150606085013567ffffffffffffffff80821115612830578283fd5b818701915087601f830112612843578283fd5b81358181111561285557612855612b96565b604051601f8201601f19908116603f0116810190838211818310171561287d5761287d612b96565b816040528281528a6020848701011115612895578586fd5b82602086016020830137918201602001949094529598949750929550505050565b6000602082840312156128c7578081fd5b815180151581146127ba578182fd5b6000602082840312156128e7578081fd5b5035919050565b6000602082840312156128ff578081fd5b5051919050565b60008060408385031215612918578182fd5b82359150602083013561292a81612bac565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156129765783516001600160a01b031683529284019291840191600101612951565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156129765783518352928401929184019160010161299e565b6000602080835283518082850152825b818110156129e6578581018301518582016040015282016129ca565b818111156129f75783604083870101525b50601f01601f1916929092016040019392505050565b60208082526019908201527f41756374696f6e206973206e6f7420656e646564207965742100000000000000604082015260600190565b60208082526027908201527f42656e65666963696172792063616e206e6f7420706572666f726d2074686520604082015266616374696f6e2160c81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60008219821115612b0a57612b0a612b80565b500190565b600082612b2a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612b4957612b49612b80565b500290565b600082821015612b6057612b60612b80565b500390565b6000600019821415612b7957612b79612b80565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146122be57600080fdfea2646970667358221220c9e7f96f58137087835da5d60c361dff7c5a2f23f2f2bd37ffaec179abb6aa4564736f6c63430008040033a264697066735822122055f47b492ac4c8e4024b95aec8c853e6bf1342b14d8fece1e6e9c38b88cd44fb64736f6c63430008040033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c80631bbcd4a514610067578063571a26a014610085578063715018a6146100b05780638da5cb5b146100ba57806399cd7883146100cb578063f2fde38b146100de575b600080fd5b61006f6100f1565b60405161007c91906104ea565b60405180910390f35b61009861009336600461046f565b610153565b6040516001600160a01b03909116815260200161007c565b6100b861017d565b005b6000546001600160a01b0316610098565b6100b86100d9366004610405565b6101bc565b6100b86100ec3660046103e2565b6102ea565b6060600280548060200260200160405190810160405280929190818152602001828054801561014957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161012b575b5050505050905090565b6002818154811061016357600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b031633146101b05760405162461bcd60e51b81526004016101a790610537565b60405180910390fd5b6101ba6000610385565b565b6000546001600160a01b031633146101e65760405162461bcd60e51b81526004016101a790610537565b600088888888888888886040516101fc906103d5565b6001600160a01b03988916815297909616602088015260408701949094526060860192909252608085015260a084015260c083015260e082015261010001604051809103906000f080158015610256573d6000803e3d6000fd5b506002805460018101825560008290527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b03841617905580546040519293507f0cc063913912f66d3b1f26761bf12fefdeb0f7cccc0319f70cff0e0a0e12113e926102d792859291610487565b60405180910390a1505050505050505050565b6000546001600160a01b031633146103145760405162461bcd60e51b81526004016101a790610537565b6001600160a01b0381166103795760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101a7565b61038281610385565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b612fdc8061058283390190565b6000602082840312156103f3578081fd5b81356103fe8161056c565b9392505050565b600080600080600080600080610100898b031215610421578384fd5b883561042c8161056c565b9750602089013561043c8161056c565b979a9799505050506040860135956060810135956080820135955060a0820135945060c0820135935060e0909101359150565b600060208284031215610480578081fd5b5035919050565b60006060820160018060a01b03808716845260208681860152606060408601528286548085526080870191508786528286209450855b818110156104db5785548516835260019586019592840192016104bd565b50909998505050505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561052b5783516001600160a01b031683529284019291840191600101610506565b50909695505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6001600160a01b038116811461038257600080fdfe6101606040523480156200001257600080fd5b5060405162002fdc38038062002fdc833981016040819052620000359162000241565b6200004033620001d5565b60018055633b9aca008511620000b05760405162461bcd60e51b815260206004820152602a60248201527f41756374696f6e2073746172742074696d657374616d70206973206e6f7420696044820152696e207365636f6e64732160b01b60648201526084015b60405180910390fd5b428411620001145760405162461bcd60e51b815260206004820152602a60248201527f41756374696f6e20656e642074696d657374616d702063616e206e6f742062656044820152692074686520706173742160b01b6064820152608401620000a7565b6001600160a01b038716620001785760405162461bcd60e51b815260206004820152602360248201527f42656e65666963696172792061646472657373206973206e6f7420636f72726560448201526263742160e81b6064820152608401620000a7565b600280546001600160a01b0319166001600160a01b038a16179055606087901b6001600160601b03191660e052620001b08662000225565b60805260a09490945260c09290925261010052610140526101205250620002fb915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006200023b82670de0b6b3a7640000620002b6565b92915050565b600080600080600080600080610100898b0312156200025e578384fd5b88516200026b81620002e2565b60208a01519098506200027e81620002e2565b60408a015160608b015160808c015160a08d015160c08e015160e0909e01519c9f949e50929c919b909a509198509650945092505050565b6000816000190483118215151615620002dd57634e487b7160e01b81526011600452602481fd5b500290565b6001600160a01b0381168114620002f857600080fd5b50565b60805160a05160c05160e05160601c610100516101205161014051612bf7620003e560003960008181610d4e015261220401526000611795015260008181610ac00152818161238901526123af01526000818161069601528181610bee01528181610e1c01528181611103015281816113440152611c65015260008181610333015281816106d601528181610fc9015281816113840152818161167c01528181611a0501528181611ba50152818161212e01526122c501526000818161043701528181611011015281816118b20152611b3c0152600081816105240152611e7b0152612bf76000f3fe6080604052600436106101c65760003560e01c806378e97925116100f75780639979ef4511610095578063ce10cf8011610064578063ce10cf80146105ca578063f28c4040146105f7578063f2fde38b14610624578063f5b56c561461064457610210565b80639979ef45146105465780639e2c58ca14610566578063b0954dee14610588578063be74264d146105b557610210565b80638da5cb5b116100d15780638da5cb5b146104ab5780638fa8b790146104dd57806391f90157146104f25780639363c8121461051257610210565b806378e97925146104255780637b0e08201461045957806384ddc67f1461048957610210565b80633ccfd60b11610164578063590e1ae31161013e578063590e1ae3146103c657806369de8347146103db578063704416b4146103fb578063715018a61461041057610210565b80633ccfd60b146103635780633f9942ff146103785780634979440a1461039957610210565b806315d6af8f116101a057806315d6af8f146102c857806324d507fd146102ea5780632e93be30146102ff5780633197cbb61461032157610210565b80631257e2791461023757806312fa6feb14610259578063150b7a021461028f57610210565b36610210577f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874335b604080516001600160a01b0390921682523460208301520160405180910390a1005b7f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874336101ee565b34801561024357600080fd5b50610257610252366004612906565b61065a565b005b34801561026557600080fd5b5060025461027a90600160a81b900460ff1681565b60405190151581526020015b60405180910390f35b34801561029b57600080fd5b506102af6102aa3660046127dd565b610ab8565b6040516001600160e01b03199091168152602001610286565b3480156102d457600080fd5b506102dd610b80565b6040516102869190612935565b3480156102f657600080fd5b50610257610bbb565b34801561030b57600080fd5b50610314610f8f565b60405161028691906129ba565b34801561032d57600080fd5b506103557f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610286565b34801561036f57600080fd5b5061025761107f565b34801561038457600080fd5b5060025461027a90600160a01b900460ff1681565b3480156103a557600080fd5b506004546001600160a01b0316600090815260066020526040902054610355565b3480156103d257600080fd5b50610257611311565b3480156103e757600080fd5b506102576103f63660046128d6565b611650565b34801561040757600080fd5b506102dd611883565b34801561041c57600080fd5b50610257611979565b34801561043157600080fd5b506103557f000000000000000000000000000000000000000000000000000000000000000081565b34801561046557600080fd5b5061027a61047436600461279e565b60076020526000908152604090205460ff1681565b34801561049557600080fd5b5033600090815260066020526040902054610355565b3480156104b757600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610286565b3480156104e957600080fd5b5061027a6119af565b3480156104fe57600080fd5b506004546104c5906001600160a01b031681565b34801561051e57600080fd5b506103557f000000000000000000000000000000000000000000000000000000000000000081565b34801561055257600080fd5b506102576105613660046128d6565b611b12565b34801561057257600080fd5b5061057b6120ff565b6040516102869190612982565b34801561059457600080fd5b506103556105a33660046128d6565b60086020526000908152604090205481565b3480156105c157600080fd5b506103556121d6565b3480156105d657600080fd5b506103556105e536600461279e565b60066020526000908152604090205481565b34801561060357600080fd5b506103556106123660046128d6565b60009081526008602052604090205490565b34801561063057600080fd5b5061025761063f36600461279e565b612226565b34801561065057600080fd5b5061035560035481565b600260015414156106865760405162461bcd60e51b815260040161067d90612ac0565b60405180910390fd5b6002600155336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156106d45760405162461bcd60e51b815260040161067d90612a44565b7f00000000000000000000000000000000000000000000000000000000000000004211801561070d5750600254600160a01b900460ff16155b6107295760405162461bcd60e51b815260040161067d90612a0d565b60006107336122c1565b90506000805b82518110156107a45782818151811061076257634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031661077a3390565b6001600160a01b0316141561079257600191506107a4565b8061079c81612b65565b915050610739565b50806107ea5760405162461bcd60e51b8152602060048201526015602482015274596f7520617265206e6f7420612077696e6e65722160581b604482015260640161067d565b3360009081526007602052604090205460ff16156108595760405162461bcd60e51b815260206004820152602660248201527f596f75206861766520616c726561647920636f6c6c656374656420796f757220604482015265746f6b656e2160d01b606482015260840161067d565b6040516370a0823160e01b815230600482015283906000906001600160a01b038316906370a082319060240160206040518083038186803b15801561089d57600080fd5b505afa1580156108b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d591906128ee565b116109185760405162461bcd60e51b815260206004820152601360248201527210d85b1b195c881b5d5cdd081bdddb881b999d606a1b604482015260640161067d565b6040516331a9108f60e11b81526004810186905230906001600160a01b03831690636352211e9060240160206040518083038186803b15801561095a57600080fd5b505afa15801561096e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099291906127c1565b6001600160a01b0316146109e15760405162461bcd60e51b81526020600482015260166024820152752cb7ba9036bab9ba1037bbb7103a3432903a37b5b2b760511b604482015260640161067d565b33600081815260076020526040808220805460ff191660011790558051632142170760e11b8152306004820152602481019390935260448301889052516001600160a01b038416926342842e0e92606480830193919282900301818387803b158015610a4c57600080fd5b505af1158015610a60573d6000803e3d6000fd5b505050507f17b3a70c980ec7f4b25a351955fa92638e9757afd4216535ac95a0153857680d610a8c3390565b604080516001600160a01b039092168252602082018890520160405180910390a1505060018055505050565b6009546000907f000000000000000000000000000000000000000000000000000000000000000011610b3d5760405162461bcd60e51b815260206004820152602860248201527f546f6b656e20616c6c6f77616e636520686173207265616368656420746865206044820152676d6178696d756d2160c01b606482015260840161067d565b5050600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af015550630a85bd0160e11b919050565b6000546060906001600160a01b03163314610bad5760405162461bcd60e51b815260040161067d90612a8b565b610bb56122c1565b90505b90565b60026001541415610bde5760405162461bcd60e51b815260040161067d90612ac0565b6002600155336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610c2457506000546001600160a01b031633145b610c895760405162461bcd60e51b815260206004820152603060248201527f42656e6566696369617279202f204f776e65722063616e206f6e6c792070657260448201526f666f726d2074686520616374696f6e2160801b606482015260840161067d565b600254600160b01b900460ff1615610ce35760405162461bcd60e51b815260206004820152601860248201527f46756e647320616c726561647920636f6c6c6563746564210000000000000000604482015260640161067d565b6000610ced6122c1565b905060008060005b8351811015610def576000848281518110610d2057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03811660009081526006909252604082205490925090610d7e7f0000000000000000000000000000000000000000000000000000000000000000610d788460646124a3565b906124b8565b9050610d8a85826124c4565b94506000610d9883836124d0565b9050610da487826124c4565b6001600160a01b038516600090815260066020526040812080549299508592909190610dd1908490612b4e565b92505081905550505050508080610de790612b65565b915050610cf5565b506002805460ff60b01b198116600160b01b1790915560405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018590529091169063a9059cbb90604401602060405180830381600087803b158015610e7057600080fd5b505af1158015610e84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea891906128b6565b506002546001600160a01b031663a9059cbb610ecc6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c91906128b6565b5060408051838152602081018390527f9f711bbd3973f42733d63b23f9999746f6a259ee84921299074f3a9955876518910160405180910390a150506001805550565b600254606090600160a01b900460ff1615610fc7575060408051808201909152600881526718d85b98d95b195960c21b602082015290565b7f000000000000000000000000000000000000000000000000000000000000000042111561100f5750604080518082019091526005815264195b99195960da1b602082015290565b7f000000000000000000000000000000000000000000000000000000000000000042101561105d575060408051808201909152600b81526a1b9bdd0b5cdd185c9d195960aa1b602082015290565b5060408051808201909152600781526672756e6e696e6760c81b602082015290565b600260015414156110a25760405162461bcd60e51b815260040161067d90612ac0565b6002600181905554600160a01b900460ff166111005760405162461bcd60e51b815260206004820152601860248201527f41756374696f6e206973206e6f742063616e63656c6564210000000000000000604482015260640161067d565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614156111495760405162461bcd60e51b815260040161067d90612a44565b336000908152600660205260409020546111a55760405162461bcd60e51b815260206004820152601b60248201527f596f7520617265206e6f7420612076616c696420626964646572210000000000604482015260640161067d565b33600081815260066020526040902054806112125760405162461bcd60e51b815260206004820152602760248201527f596f75206861766520616c7265616479207769746864726177616c20796f75726044820152662066756e64732160c81b606482015260840161067d565b6001600160a01b0382166000908152600660205260408120805483929061123a908490612b4e565b909155505060025460405163a9059cbb60e01b81526001600160a01b038481166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b15801561128d57600080fd5b505af11580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c591906128b6565b50604080516001600160a01b0384168152602081018390527fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e9191015b60405180910390a1505060018055565b600260015414156113345760405162461bcd60e51b815260040161067d90612ac0565b6002600155336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156113825760405162461bcd60e51b815260040161067d90612a44565b7f0000000000000000000000000000000000000000000000000000000000000000421180156113bb5750600254600160a01b900460ff16155b6113d75760405162461bcd60e51b815260040161067d90612a0d565b336000908152600660205260409020546114335760405162461bcd60e51b815260206004820152601b60248201527f596f7520617265206e6f7420612076616c696420626964646572210000000000604482015260640161067d565b600061143d6122c1565b905060005b81518110156115055781818151811061146b57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166114833390565b6001600160a01b031614156114f35760405162461bcd60e51b815260206004820152603060248201527f596f75206172652077696e6e65722c20796f752063616e206e6f74207065726660448201526f6f726d207468697320616374696f6e2160801b606482015260840161067d565b806114fd81612b65565b915050611442565b5033600090815260066020526040902054806115635760405162461bcd60e51b815260206004820152601d60248201527f596f7520616c7265616479206861766520726566756e64206261636b21000000604482015260640161067d565b3360009081526006602052604081208054839290611582908490612b4e565b90915550506002546001600160a01b031663a9059cbb336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156115e157600080fd5b505af11580156115f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161991906128b6565b5060408051338152602081018390527fb6c0eca8138e097d71e2dd31e19a1266487f0553f170b7260ffe68bcbe9ff8a79101611301565b6000546001600160a01b0316331461167a5760405162461bcd60e51b815260040161067d90612a8b565b7f0000000000000000000000000000000000000000000000000000000000000000421180156116b35750600254600160a01b900460ff16155b6116cf5760405162461bcd60e51b815260040161067d90612a0d565b6000805b60095481101561172b5782600982815481106116ff57634e487b7160e01b600052603260045260246000fd5b90600052602060002001541415611719576001915061172b565b8061172381612b65565b9150506116d3565b50806117845760405162461bcd60e51b815260206004820152602260248201527f546f6b656e206973206e6f7420616c6c6f77656420666f722072656465656d65604482015261642160f01b606482015260840161067d565b6000828152600860205260409020547f0000000000000000000000000000000000000000000000000000000000000000116118125760405162461bcd60e51b815260206004820152602860248201527f557365722068617665207265616368656420746865206d6178696d756d20616c6044820152676c6f77616e63652160c01b606482015260840161067d565b60008281526008602052604090205461182c9060016124c4565b60008381526008602052604090819020829055517f559dc6ea45ea5071b1480938c0df2cd88fca6c769bfc8aeebc7c38364ff1ed5e9161187791859190918252602082015260400190565b60405180910390a15050565b6000546060906001600160a01b031633146118b05760405162461bcd60e51b815260040161067d90612a8b565b7f00000000000000000000000000000000000000000000000000000000000000004210156119195760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20796574206e6f742073746172742160501b604482015260640161067d565b600580548060200260200160405190810160405280929190818152602001828054801561196f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611951575b5050505050905090565b6000546001600160a01b031633146119a35760405162461bcd60e51b815260040161067d90612a8b565b6119ad60006124dc565b565b6000600260015414156119d45760405162461bcd60e51b815260040161067d90612ac0565b60026001556000546001600160a01b03163314611a035760405162461bcd60e51b815260040161067d90612a8b565b7f0000000000000000000000000000000000000000000000000000000000000000421115611a6c5760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20616c726561647920656e6465642160501b604482015260640161067d565b600254600160a01b900460ff1615611ac25760405162461bcd60e51b815260206004820152601960248201527841756374696f6e20616c72656164792063616e63656c65642160381b604482015260640161067d565b6002805460ff60a01b1916600160a01b179055604051600181527f1fd636bc86322e474244a9366e9b72f9e75d3ba45b442352c7f950c92a9808a59060200160405180910390a150600180805590565b60026001541415611b355760405162461bcd60e51b815260040161067d90612ac0565b60026001557f0000000000000000000000000000000000000000000000000000000000000000421015611ba35760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20796574206e6f742073746172742160501b604482015260640161067d565b7f0000000000000000000000000000000000000000000000000000000000000000421115611c0c5760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20616c726561647920656e6465642160501b604482015260640161067d565b600254600160a01b900460ff1615611c625760405162461bcd60e51b815260206004820152601960248201527841756374696f6e20616c72656164792063616e63656c65642160381b604482015260640161067d565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161415611cab5760405162461bcd60e51b815260040161067d90612a44565b6002546040516370a0823160e01b815233600482018190529183916001600160a01b03909116906370a082319060240160206040518083038186803b158015611cf357600080fd5b505afa158015611d07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d2b91906128ee565b1015611d835760405162461bcd60e51b815260206004820152602160248201527f496e73756666696369616e7420455243323020746f6b656e2062616c616e63656044820152602160f81b606482015260840161067d565b600254604051636eb1769f60e11b81526001600160a01b0383811660048301523060248301528492169063dd62ed3e9060440160206040518083038186803b158015611dce57600080fd5b505afa158015611de2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e0691906128ee565b1015611e545760405162461bcd60e51b815260206004820152601b60248201527f417070726f766520455243323020746f6b656e73206669727374210000000000604482015260640161067d565b6001600160a01b038116600090815260066020526040812054611e7790846124c4565b90507f0000000000000000000000000000000000000000000000000000000000000000811015611f0f5760405162461bcd60e51b815260206004820152603d60248201527f42696420546f6b656e20616d6f756e7420746f6f206c6f77212c20616d6f756e60448201527f742073686f756c642062652061626f766520666c6f6f72207072696365000000606482015260840161067d565b6003548111611f605760405162461bcd60e51b815260206004820181905260248201527f6f7665726269642074686520686967686573742062696e64696e672062696421604482015260640161067d565b6004546001600160a01b039081166000908152600660205260408082205492851682529020829055808211611fb457611fac611fa6611f9f600161252c565b84906124c4565b82612540565b600355612001565b6004546001600160a01b03848116911614611ffe57600480546001600160a01b0319166001600160a01b038516179055611ffa82611ff5611f9f600161252c565b612540565b6003555b50805b6002546040516323b872dd60e01b81526001600160a01b03858116600483015230602483015260448201879052909116906323b872dd90606401602060405180830381600087803b15801561205557600080fd5b505af1158015612069573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208d91906128b6565b5061209783612557565b600454600354604080516001600160a01b03808816825260208201899052909316908301526060820183905260808201527ff152f4ff5e488c55370a2d53925a55055228ebd8ec95bd0251bbb299e48786b09060a00160405180910390a15050600180555050565b6000546060906001600160a01b0316331461212c5760405162461bcd60e51b815260040161067d90612a8b565b7f0000000000000000000000000000000000000000000000000000000000000000421180156121655750600254600160a01b900460ff16155b6121815760405162461bcd60e51b815260040161067d90612a0d565b600980548060200260200160405190810160405280929190818152602001828054801561196f57602002820191906000526020600020905b8154815260200190600101908083116121b9575050505050905090565b600080546001600160a01b031633146122015760405162461bcd60e51b815260040161067d90612a8b565b507f000000000000000000000000000000000000000000000000000000000000000090565b6000546001600160a01b031633146122505760405162461bcd60e51b815260040161067d90612a8b565b6001600160a01b0381166122b55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161067d565b6122be816124dc565b50565b60607f0000000000000000000000000000000000000000000000000000000000000000421180156122fc5750600254600160a01b900460ff16155b6123185760405162461bcd60e51b815260040161067d90612a0d565b6005546123815760405162461bcd60e51b815260206004820152603160248201527f4e6f2062696464657220666f756e642c2077696e6e6572206c6973742063616e604482015270206e6f742062652067656e65726174652160781b606482015260840161067d565b6005546000907f0000000000000000000000000000000000000000000000000000000000000000116123d3577f00000000000000000000000000000000000000000000000000000000000000006123d7565b6005545b905060008167ffffffffffffffff81111561240257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561242b578160200160208202803683370190505b5060045481519192506001600160a01b031690829060009061245d57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b031681525050816001141561248f579150610bb89050565b61249c6001826001612613565b9250505090565b60006124af8284612b0f565b90505b92915050565b60006124af8284612b2f565b60006124af8284612af7565b60006124af8284612b4e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006124b282670de0b6b3a7640000612b2f565b6000818310156125515750816124b2565b50919050565b6000805b6005548110156125bd576005818154811061258657634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03163314156125ab57600191506125bd565b806125b581612b65565b91505061255b565b508061260f57600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b0384161790555b5050565b606060006126446126238661252c565b6004546001600160a01b0316600090815260066020526040902054906124d0565b905060005b60055481101561277557845184141561266157612775565b60006005828154811061268457634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031680835260069091526040909120549091508311612762576000805b868111612715578781815181106126dd57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316836001600160a01b0316141561270357600191505b8061270d81612b65565b9150506126b6565b5080612760578187878151811061273c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015261275d86612b65565b95505b505b508061276d81612b65565b915050612649565b50835183146127955761279361278c8660016124c4565b8585612613565b505b50919392505050565b6000602082840312156127af578081fd5b81356127ba81612bac565b9392505050565b6000602082840312156127d2578081fd5b81516127ba81612bac565b600080600080608085870312156127f2578283fd5b84356127fd81612bac565b9350602085013561280d81612bac565b925060408501359150606085013567ffffffffffffffff80821115612830578283fd5b818701915087601f830112612843578283fd5b81358181111561285557612855612b96565b604051601f8201601f19908116603f0116810190838211818310171561287d5761287d612b96565b816040528281528a6020848701011115612895578586fd5b82602086016020830137918201602001949094529598949750929550505050565b6000602082840312156128c7578081fd5b815180151581146127ba578182fd5b6000602082840312156128e7578081fd5b5035919050565b6000602082840312156128ff578081fd5b5051919050565b60008060408385031215612918578182fd5b82359150602083013561292a81612bac565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156129765783516001600160a01b031683529284019291840191600101612951565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156129765783518352928401929184019160010161299e565b6000602080835283518082850152825b818110156129e6578581018301518582016040015282016129ca565b818111156129f75783604083870101525b50601f01601f1916929092016040019392505050565b60208082526019908201527f41756374696f6e206973206e6f7420656e646564207965742100000000000000604082015260600190565b60208082526027908201527f42656e65666963696172792063616e206e6f7420706572666f726d2074686520604082015266616374696f6e2160c81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60008219821115612b0a57612b0a612b80565b500190565b600082612b2a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612b4957612b49612b80565b500290565b600082821015612b6057612b60612b80565b500390565b6000600019821415612b7957612b79612b80565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146122be57600080fdfea2646970667358221220c9e7f96f58137087835da5d60c361dff7c5a2f23f2f2bd37ffaec179abb6aa4564736f6c63430008040033a264697066735822122055f47b492ac4c8e4024b95aec8c853e6bf1342b14d8fece1e6e9c38b88cd44fb64736f6c63430008040033