Address Details
contract
0x9d7DF668656c4aDa9d0D33A1C433D9dc95061278
- Contract Name
- Auction
- Creator
- 0x6d3f1b–09369f at 0x82fd5f–682731
- 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
- 2 Transfers
- Gas Used
- 258,547
- Last Balance Update
- 12332702
Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- Auction
- Optimization enabled
- true
- Compiler version
- v0.8.4+commit.c7e474f2
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2023-02-01T15:29:31.016846Z
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 > block.timestamp, 'Auction start timestamp is invalid!'); require(_endTime > block.timestamp && _endTime > _startTime, 'Auction end timestamp can not be the past or invalid!'); require(_beneficiary != address(0x0), 'Beneficiary address is not correct!'); erc20Token = _erc20Token; beneficiary = _beneficiary; floorPrice = _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); _checkBidder(_bidder); emit LogBid(_bidder, amount, highestBidder, highestBid, highestBindingBid); } function _checkBidder(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!'); if(redeemQty > 0 && redeemQty > tokenRedeemed[_tokenId]) { revert("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!'); _; } }
/_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":"constructor","stateMutability":"nonpayable","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":"event","name":"FundCollected","inputs":[{"type":"uint256","name":"merchantFee","internalType":"uint256","indexed":false},{"type":"uint256","name":"marketplaceFee","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"LogBid","inputs":[{"type":"address","name":"bidder","internalType":"address","indexed":false},{"type":"uint256","name":"bid","internalType":"uint256","indexed":false},{"type":"address","name":"highestBidder","internalType":"address","indexed":false},{"type":"uint256","name":"highestBid","internalType":"uint256","indexed":false},{"type":"uint256","name":"highestBindingBid","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"LogCanceled","inputs":[{"type":"bool","name":"success","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"LogRefund","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"LogWithdrawal","inputs":[{"type":"address","name":"withdrawalAccount","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Received","inputs":[{"type":"address","name":"sender","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TokenCollected","inputs":[{"type":"address","name":"winner","internalType":"address","indexed":false},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TokenRedeemed","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false},{"type":"uint256","name":"redeemedTotal","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"fallback","stateMutability":"payable"},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"bidderList","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"success","internalType":"bool"}],"name":"cancelAuction","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"canceled","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"collectFund","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"collectToken","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"address","name":"_virtuousToken","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"endTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"ended","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"floorPrice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"fundsByBidder","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"getAuctionStatus","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getFeePercent","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getHighestBid","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMyBid","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTokenReddemCount","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"highestBidder","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"highestBindingBid","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"onERC721Received","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"bytes","name":"","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"placeBid","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"redeemNFD","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"refund","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"rewardCollected","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"startTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"tokenList","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenRedeemed","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"winnerList","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[]},{"type":"receive","stateMutability":"payable"}]
Contract Creation Code
0x6101606040523480156200001257600080fd5b5060405162002fd438038062002fd4833981016040819052620000359162000231565b6200004033620001e1565b60018055428511620000a55760405162461bcd60e51b815260206004820152602360248201527f41756374696f6e2073746172742074696d657374616d7020697320696e76616c60448201526269642160e81b60648201526084015b60405180910390fd5b4284118015620000b457508484115b620001285760405162461bcd60e51b815260206004820152603560248201527f41756374696f6e20656e642074696d657374616d702063616e206e6f7420626560448201527f207468652070617374206f7220696e76616c696421000000000000000000000060648201526084016200009c565b6001600160a01b0387166200018c5760405162461bcd60e51b815260206004820152602360248201527f42656e65666963696172792061646472657373206973206e6f7420636f72726560448201526263742160e81b60648201526084016200009c565b600280546001600160a01b0319166001600160a01b03999099169890981790975560609590951b6001600160601b03191660e05260809390935260a09190915260c052610100526101405261012052620002bf565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600080600080600080610100898b0312156200024e578384fd5b88516200025b81620002a6565b60208a01519098506200026e81620002a6565b60408a015160608b015160808c015160a08d015160c08e015160e0909e01519c9f949e50929c919b909a509198509650945092505050565b6001600160a01b0381168114620002bc57600080fd5b50565b60805160a05160c05160e05160601c610100516101205161014051612c24620003b060003960008181610d4e015261223101526000818161178801526117c0015260008181610ac0015281816123b601526123dc01526000818161069601528181610bee01528181610e1c01528181611103015281816113440152611c92015260008181610333015281816106d601528181610fc9015281816113840152818161167c01528181611a3201528181611bd20152818161215b01526122f201526000818161043701528181611011015281816118df0152611b690152600081816105240152611ea80152612c246000f3fe6080604052600436106101c65760003560e01c806378e97925116100f75780639979ef4511610095578063ce10cf8011610064578063ce10cf80146105ca578063f28c4040146105f7578063f2fde38b14610624578063f5b56c561461064457610210565b80639979ef45146105465780639e2c58ca14610566578063b0954dee14610588578063be74264d146105b557610210565b80638da5cb5b116100d15780638da5cb5b146104ab5780638fa8b790146104dd57806391f90157146104f25780639363c8121461051257610210565b806378e97925146104255780637b0e08201461045957806384ddc67f1461048957610210565b80633ccfd60b11610164578063590e1ae31161013e578063590e1ae3146103c657806369de8347146103db578063704416b4146103fb578063715018a61461041057610210565b80633ccfd60b146103635780633f9942ff146103785780634979440a1461039957610210565b806315d6af8f116101a057806315d6af8f146102c857806324d507fd146102ea5780632e93be30146102ff5780633197cbb61461032157610210565b80631257e2791461023757806312fa6feb14610259578063150b7a021461028f57610210565b36610210577f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874335b604080516001600160a01b0390921682523460208301520160405180910390a1005b7f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874336101ee565b34801561024357600080fd5b50610257610252366004612933565b61065a565b005b34801561026557600080fd5b5060025461027a90600160a81b900460ff1681565b60405190151581526020015b60405180910390f35b34801561029b57600080fd5b506102af6102aa36600461280a565b610ab8565b6040516001600160e01b03199091168152602001610286565b3480156102d457600080fd5b506102dd610b80565b6040516102869190612962565b3480156102f657600080fd5b50610257610bbb565b34801561030b57600080fd5b50610314610f8f565b60405161028691906129e7565b34801561032d57600080fd5b506103557f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610286565b34801561036f57600080fd5b5061025761107f565b34801561038457600080fd5b5060025461027a90600160a01b900460ff1681565b3480156103a557600080fd5b506004546001600160a01b0316600090815260066020526040902054610355565b3480156103d257600080fd5b50610257611311565b3480156103e757600080fd5b506102576103f6366004612903565b611650565b34801561040757600080fd5b506102dd6118b0565b34801561041c57600080fd5b506102576119a6565b34801561043157600080fd5b506103557f000000000000000000000000000000000000000000000000000000000000000081565b34801561046557600080fd5b5061027a6104743660046127cb565b60076020526000908152604090205460ff1681565b34801561049557600080fd5b5033600090815260066020526040902054610355565b3480156104b757600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610286565b3480156104e957600080fd5b5061027a6119dc565b3480156104fe57600080fd5b506004546104c5906001600160a01b031681565b34801561051e57600080fd5b506103557f000000000000000000000000000000000000000000000000000000000000000081565b34801561055257600080fd5b50610257610561366004612903565b611b3f565b34801561057257600080fd5b5061057b61212c565b60405161028691906129af565b34801561059457600080fd5b506103556105a3366004612903565b60086020526000908152604090205481565b3480156105c157600080fd5b50610355612203565b3480156105d657600080fd5b506103556105e53660046127cb565b60066020526000908152604090205481565b34801561060357600080fd5b50610355610612366004612903565b60009081526008602052604090205490565b34801561063057600080fd5b5061025761063f3660046127cb565b612253565b34801561065057600080fd5b5061035560035481565b600260015414156106865760405162461bcd60e51b815260040161067d90612aed565b60405180910390fd5b6002600155336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156106d45760405162461bcd60e51b815260040161067d90612a71565b7f00000000000000000000000000000000000000000000000000000000000000004211801561070d5750600254600160a01b900460ff16155b6107295760405162461bcd60e51b815260040161067d90612a3a565b60006107336122ee565b90506000805b82518110156107a45782818151811061076257634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031661077a3390565b6001600160a01b0316141561079257600191506107a4565b8061079c81612b92565b915050610739565b50806107ea5760405162461bcd60e51b8152602060048201526015602482015274596f7520617265206e6f7420612077696e6e65722160581b604482015260640161067d565b3360009081526007602052604090205460ff16156108595760405162461bcd60e51b815260206004820152602660248201527f596f75206861766520616c726561647920636f6c6c656374656420796f757220604482015265746f6b656e2160d01b606482015260840161067d565b6040516370a0823160e01b815230600482015283906000906001600160a01b038316906370a082319060240160206040518083038186803b15801561089d57600080fd5b505afa1580156108b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d5919061291b565b116109185760405162461bcd60e51b815260206004820152601360248201527210d85b1b195c881b5d5cdd081bdddb881b999d606a1b604482015260640161067d565b6040516331a9108f60e11b81526004810186905230906001600160a01b03831690636352211e9060240160206040518083038186803b15801561095a57600080fd5b505afa15801561096e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099291906127ee565b6001600160a01b0316146109e15760405162461bcd60e51b81526020600482015260166024820152752cb7ba9036bab9ba1037bbb7103a3432903a37b5b2b760511b604482015260640161067d565b33600081815260076020526040808220805460ff191660011790558051632142170760e11b8152306004820152602481019390935260448301889052516001600160a01b038416926342842e0e92606480830193919282900301818387803b158015610a4c57600080fd5b505af1158015610a60573d6000803e3d6000fd5b505050507f17b3a70c980ec7f4b25a351955fa92638e9757afd4216535ac95a0153857680d610a8c3390565b604080516001600160a01b039092168252602082018890520160405180910390a1505060018055505050565b6009546000907f000000000000000000000000000000000000000000000000000000000000000011610b3d5760405162461bcd60e51b815260206004820152602860248201527f546f6b656e20616c6c6f77616e636520686173207265616368656420746865206044820152676d6178696d756d2160c01b606482015260840161067d565b5050600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af015550630a85bd0160e11b919050565b6000546060906001600160a01b03163314610bad5760405162461bcd60e51b815260040161067d90612ab8565b610bb56122ee565b90505b90565b60026001541415610bde5760405162461bcd60e51b815260040161067d90612aed565b6002600155336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480610c2457506000546001600160a01b031633145b610c895760405162461bcd60e51b815260206004820152603060248201527f42656e6566696369617279202f204f776e65722063616e206f6e6c792070657260448201526f666f726d2074686520616374696f6e2160801b606482015260840161067d565b600254600160b01b900460ff1615610ce35760405162461bcd60e51b815260206004820152601860248201527f46756e647320616c726561647920636f6c6c6563746564210000000000000000604482015260640161067d565b6000610ced6122ee565b905060008060005b8351811015610def576000848281518110610d2057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03811660009081526006909252604082205490925090610d7e7f0000000000000000000000000000000000000000000000000000000000000000610d788460646124d0565b906124e5565b9050610d8a85826124f1565b94506000610d9883836124fd565b9050610da487826124f1565b6001600160a01b038516600090815260066020526040812080549299508592909190610dd1908490612b7b565b92505081905550505050508080610de790612b92565b915050610cf5565b506002805460ff60b01b198116600160b01b1790915560405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018590529091169063a9059cbb90604401602060405180830381600087803b158015610e7057600080fd5b505af1158015610e84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea891906128e3565b506002546001600160a01b031663a9059cbb610ecc6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c91906128e3565b5060408051838152602081018390527f9f711bbd3973f42733d63b23f9999746f6a259ee84921299074f3a9955876518910160405180910390a150506001805550565b600254606090600160a01b900460ff1615610fc7575060408051808201909152600881526718d85b98d95b195960c21b602082015290565b7f000000000000000000000000000000000000000000000000000000000000000042111561100f5750604080518082019091526005815264195b99195960da1b602082015290565b7f000000000000000000000000000000000000000000000000000000000000000042101561105d575060408051808201909152600b81526a1b9bdd0b5cdd185c9d195960aa1b602082015290565b5060408051808201909152600781526672756e6e696e6760c81b602082015290565b600260015414156110a25760405162461bcd60e51b815260040161067d90612aed565b6002600181905554600160a01b900460ff166111005760405162461bcd60e51b815260206004820152601860248201527f41756374696f6e206973206e6f742063616e63656c6564210000000000000000604482015260640161067d565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614156111495760405162461bcd60e51b815260040161067d90612a71565b336000908152600660205260409020546111a55760405162461bcd60e51b815260206004820152601b60248201527f596f7520617265206e6f7420612076616c696420626964646572210000000000604482015260640161067d565b33600081815260066020526040902054806112125760405162461bcd60e51b815260206004820152602760248201527f596f75206861766520616c7265616479207769746864726177616c20796f75726044820152662066756e64732160c81b606482015260840161067d565b6001600160a01b0382166000908152600660205260408120805483929061123a908490612b7b565b909155505060025460405163a9059cbb60e01b81526001600160a01b038481166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b15801561128d57600080fd5b505af11580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c591906128e3565b50604080516001600160a01b0384168152602081018390527fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e9191015b60405180910390a1505060018055565b600260015414156113345760405162461bcd60e51b815260040161067d90612aed565b6002600155336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156113825760405162461bcd60e51b815260040161067d90612a71565b7f0000000000000000000000000000000000000000000000000000000000000000421180156113bb5750600254600160a01b900460ff16155b6113d75760405162461bcd60e51b815260040161067d90612a3a565b336000908152600660205260409020546114335760405162461bcd60e51b815260206004820152601b60248201527f596f7520617265206e6f7420612076616c696420626964646572210000000000604482015260640161067d565b600061143d6122ee565b905060005b81518110156115055781818151811061146b57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166114833390565b6001600160a01b031614156114f35760405162461bcd60e51b815260206004820152603060248201527f596f75206172652077696e6e65722c20796f752063616e206e6f74207065726660448201526f6f726d207468697320616374696f6e2160801b606482015260840161067d565b806114fd81612b92565b915050611442565b5033600090815260066020526040902054806115635760405162461bcd60e51b815260206004820152601d60248201527f596f7520616c7265616479206861766520726566756e64206261636b21000000604482015260640161067d565b3360009081526006602052604081208054839290611582908490612b7b565b90915550506002546001600160a01b031663a9059cbb336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156115e157600080fd5b505af11580156115f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161991906128e3565b5060408051338152602081018390527fb6c0eca8138e097d71e2dd31e19a1266487f0553f170b7260ffe68bcbe9ff8a79101611301565b6000546001600160a01b0316331461167a5760405162461bcd60e51b815260040161067d90612ab8565b7f0000000000000000000000000000000000000000000000000000000000000000421180156116b35750600254600160a01b900460ff16155b6116cf5760405162461bcd60e51b815260040161067d90612a3a565b6000805b60095481101561172b5782600982815481106116ff57634e487b7160e01b600052603260045260246000fd5b90600052602060002001541415611719576001915061172b565b8061172381612b92565b9150506116d3565b50806117845760405162461bcd60e51b815260206004820152602260248201527f546f6b656e206973206e6f7420616c6c6f77656420666f722072656465656d65604482015261642160f01b606482015260840161067d565b60007f00000000000000000000000000000000000000000000000000000000000000001180156117e157506000828152600860205260409020547f0000000000000000000000000000000000000000000000000000000000000000115b1561183f5760405162461bcd60e51b815260206004820152602860248201527f557365722068617665207265616368656420746865206d6178696d756d20616c6044820152676c6f77616e63652160c01b606482015260840161067d565b6000828152600860205260409020546118599060016124f1565b60008381526008602052604090819020829055517f559dc6ea45ea5071b1480938c0df2cd88fca6c769bfc8aeebc7c38364ff1ed5e916118a491859190918252602082015260400190565b60405180910390a15050565b6000546060906001600160a01b031633146118dd5760405162461bcd60e51b815260040161067d90612ab8565b7f00000000000000000000000000000000000000000000000000000000000000004210156119465760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20796574206e6f742073746172742160501b604482015260640161067d565b600580548060200260200160405190810160405280929190818152602001828054801561199c57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161197e575b5050505050905090565b6000546001600160a01b031633146119d05760405162461bcd60e51b815260040161067d90612ab8565b6119da6000612509565b565b600060026001541415611a015760405162461bcd60e51b815260040161067d90612aed565b60026001556000546001600160a01b03163314611a305760405162461bcd60e51b815260040161067d90612ab8565b7f0000000000000000000000000000000000000000000000000000000000000000421115611a995760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20616c726561647920656e6465642160501b604482015260640161067d565b600254600160a01b900460ff1615611aef5760405162461bcd60e51b815260206004820152601960248201527841756374696f6e20616c72656164792063616e63656c65642160381b604482015260640161067d565b6002805460ff60a01b1916600160a01b179055604051600181527f1fd636bc86322e474244a9366e9b72f9e75d3ba45b442352c7f950c92a9808a59060200160405180910390a150600180805590565b60026001541415611b625760405162461bcd60e51b815260040161067d90612aed565b60026001557f0000000000000000000000000000000000000000000000000000000000000000421015611bd05760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20796574206e6f742073746172742160501b604482015260640161067d565b7f0000000000000000000000000000000000000000000000000000000000000000421115611c395760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20616c726561647920656e6465642160501b604482015260640161067d565b600254600160a01b900460ff1615611c8f5760405162461bcd60e51b815260206004820152601960248201527841756374696f6e20616c72656164792063616e63656c65642160381b604482015260640161067d565b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161415611cd85760405162461bcd60e51b815260040161067d90612a71565b6002546040516370a0823160e01b815233600482018190529183916001600160a01b03909116906370a082319060240160206040518083038186803b158015611d2057600080fd5b505afa158015611d34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d58919061291b565b1015611db05760405162461bcd60e51b815260206004820152602160248201527f496e73756666696369616e7420455243323020746f6b656e2062616c616e63656044820152602160f81b606482015260840161067d565b600254604051636eb1769f60e11b81526001600160a01b0383811660048301523060248301528492169063dd62ed3e9060440160206040518083038186803b158015611dfb57600080fd5b505afa158015611e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e33919061291b565b1015611e815760405162461bcd60e51b815260206004820152601b60248201527f417070726f766520455243323020746f6b656e73206669727374210000000000604482015260640161067d565b6001600160a01b038116600090815260066020526040812054611ea490846124f1565b90507f0000000000000000000000000000000000000000000000000000000000000000811015611f3c5760405162461bcd60e51b815260206004820152603d60248201527f42696420546f6b656e20616d6f756e7420746f6f206c6f77212c20616d6f756e60448201527f742073686f756c642062652061626f766520666c6f6f72207072696365000000606482015260840161067d565b6003548111611f8d5760405162461bcd60e51b815260206004820181905260248201527f6f7665726269642074686520686967686573742062696e64696e672062696421604482015260640161067d565b6004546001600160a01b039081166000908152600660205260408082205492851682529020829055808211611fe157611fd9611fd3611fcc6001612559565b84906124f1565b8261256d565b60035561202e565b6004546001600160a01b0384811691161461202b57600480546001600160a01b0319166001600160a01b03851617905561202782612022611fcc6001612559565b61256d565b6003555b50805b6002546040516323b872dd60e01b81526001600160a01b03858116600483015230602483015260448201879052909116906323b872dd90606401602060405180830381600087803b15801561208257600080fd5b505af1158015612096573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ba91906128e3565b506120c483612584565b600454600354604080516001600160a01b03808816825260208201899052909316908301526060820183905260808201527ff152f4ff5e488c55370a2d53925a55055228ebd8ec95bd0251bbb299e48786b09060a00160405180910390a15050600180555050565b6000546060906001600160a01b031633146121595760405162461bcd60e51b815260040161067d90612ab8565b7f0000000000000000000000000000000000000000000000000000000000000000421180156121925750600254600160a01b900460ff16155b6121ae5760405162461bcd60e51b815260040161067d90612a3a565b600980548060200260200160405190810160405280929190818152602001828054801561199c57602002820191906000526020600020905b8154815260200190600101908083116121e6575050505050905090565b600080546001600160a01b0316331461222e5760405162461bcd60e51b815260040161067d90612ab8565b507f000000000000000000000000000000000000000000000000000000000000000090565b6000546001600160a01b0316331461227d5760405162461bcd60e51b815260040161067d90612ab8565b6001600160a01b0381166122e25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161067d565b6122eb81612509565b50565b60607f0000000000000000000000000000000000000000000000000000000000000000421180156123295750600254600160a01b900460ff16155b6123455760405162461bcd60e51b815260040161067d90612a3a565b6005546123ae5760405162461bcd60e51b815260206004820152603160248201527f4e6f2062696464657220666f756e642c2077696e6e6572206c6973742063616e604482015270206e6f742062652067656e65726174652160781b606482015260840161067d565b6005546000907f000000000000000000000000000000000000000000000000000000000000000011612400577f0000000000000000000000000000000000000000000000000000000000000000612404565b6005545b905060008167ffffffffffffffff81111561242f57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612458578160200160208202803683370190505b5060045481519192506001600160a01b031690829060009061248a57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505081600114156124bc579150610bb89050565b6124c96001826001612640565b9250505090565b60006124dc8284612b3c565b90505b92915050565b60006124dc8284612b5c565b60006124dc8284612b24565b60006124dc8284612b7b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006124df82670de0b6b3a7640000612b5c565b60008183101561257e5750816124df565b50919050565b6000805b6005548110156125ea57600581815481106125b357634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03163314156125d857600191506125ea565b806125e281612b92565b915050612588565b508061263c57600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b0384161790555b5050565b6060600061267161265086612559565b6004546001600160a01b0316600090815260066020526040902054906124fd565b905060005b6005548110156127a257845184141561268e576127a2565b6000600582815481106126b157634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168083526006909152604090912054909150831161278f576000805b8681116127425787818151811061270a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316836001600160a01b0316141561273057600191505b8061273a81612b92565b9150506126e3565b508061278d578187878151811061276957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015261278a86612b92565b95505b505b508061279a81612b92565b915050612676565b50835183146127c2576127c06127b98660016124f1565b8585612640565b505b50919392505050565b6000602082840312156127dc578081fd5b81356127e781612bd9565b9392505050565b6000602082840312156127ff578081fd5b81516127e781612bd9565b6000806000806080858703121561281f578283fd5b843561282a81612bd9565b9350602085013561283a81612bd9565b925060408501359150606085013567ffffffffffffffff8082111561285d578283fd5b818701915087601f830112612870578283fd5b81358181111561288257612882612bc3565b604051601f8201601f19908116603f011681019083821181831017156128aa576128aa612bc3565b816040528281528a60208487010111156128c2578586fd5b82602086016020830137918201602001949094529598949750929550505050565b6000602082840312156128f4578081fd5b815180151581146127e7578182fd5b600060208284031215612914578081fd5b5035919050565b60006020828403121561292c578081fd5b5051919050565b60008060408385031215612945578182fd5b82359150602083013561295781612bd9565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156129a35783516001600160a01b03168352928401929184019160010161297e565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156129a3578351835292840192918401916001016129cb565b6000602080835283518082850152825b81811015612a13578581018301518582016040015282016129f7565b81811115612a245783604083870101525b50601f01601f1916929092016040019392505050565b60208082526019908201527f41756374696f6e206973206e6f7420656e646564207965742100000000000000604082015260600190565b60208082526027908201527f42656e65666963696172792063616e206e6f7420706572666f726d2074686520604082015266616374696f6e2160c81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60008219821115612b3757612b37612bad565b500190565b600082612b5757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612b7657612b76612bad565b500290565b600082821015612b8d57612b8d612bad565b500390565b6000600019821415612ba657612ba6612bad565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146122eb57600080fdfea2646970667358221220274139a569f45e7234848cd2bcc35b79881aeb1ec6defad46a1701f33f26469064736f6c63430008040033000000000000000000000000874069fa1eb16d44d622f2e0ca25eea172369bc1000000000000000000000000bb4c47bd70d7aaf7045bb287638f270b2cc3801400000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000062becca800000000000000000000000000000000000000000000000000000000649f2f2f000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000
Deployed ByteCode
0x6080604052600436106101c65760003560e01c806378e97925116100f75780639979ef4511610095578063ce10cf8011610064578063ce10cf80146105ca578063f28c4040146105f7578063f2fde38b14610624578063f5b56c561461064457610210565b80639979ef45146105465780639e2c58ca14610566578063b0954dee14610588578063be74264d146105b557610210565b80638da5cb5b116100d15780638da5cb5b146104ab5780638fa8b790146104dd57806391f90157146104f25780639363c8121461051257610210565b806378e97925146104255780637b0e08201461045957806384ddc67f1461048957610210565b80633ccfd60b11610164578063590e1ae31161013e578063590e1ae3146103c657806369de8347146103db578063704416b4146103fb578063715018a61461041057610210565b80633ccfd60b146103635780633f9942ff146103785780634979440a1461039957610210565b806315d6af8f116101a057806315d6af8f146102c857806324d507fd146102ea5780632e93be30146102ff5780633197cbb61461032157610210565b80631257e2791461023757806312fa6feb14610259578063150b7a021461028f57610210565b36610210577f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874335b604080516001600160a01b0390921682523460208301520160405180910390a1005b7f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874336101ee565b34801561024357600080fd5b50610257610252366004612933565b61065a565b005b34801561026557600080fd5b5060025461027a90600160a81b900460ff1681565b60405190151581526020015b60405180910390f35b34801561029b57600080fd5b506102af6102aa36600461280a565b610ab8565b6040516001600160e01b03199091168152602001610286565b3480156102d457600080fd5b506102dd610b80565b6040516102869190612962565b3480156102f657600080fd5b50610257610bbb565b34801561030b57600080fd5b50610314610f8f565b60405161028691906129e7565b34801561032d57600080fd5b506103557f00000000000000000000000000000000000000000000000000000000649f2f2f81565b604051908152602001610286565b34801561036f57600080fd5b5061025761107f565b34801561038457600080fd5b5060025461027a90600160a01b900460ff1681565b3480156103a557600080fd5b506004546001600160a01b0316600090815260066020526040902054610355565b3480156103d257600080fd5b50610257611311565b3480156103e757600080fd5b506102576103f6366004612903565b611650565b34801561040757600080fd5b506102dd6118b0565b34801561041c57600080fd5b506102576119a6565b34801561043157600080fd5b506103557f0000000000000000000000000000000000000000000000000000000062becca881565b34801561046557600080fd5b5061027a6104743660046127cb565b60076020526000908152604090205460ff1681565b34801561049557600080fd5b5033600090815260066020526040902054610355565b3480156104b757600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610286565b3480156104e957600080fd5b5061027a6119dc565b3480156104fe57600080fd5b506004546104c5906001600160a01b031681565b34801561051e57600080fd5b506103557f00000000000000000000000000000000000000000000000006f05b59d3b2000081565b34801561055257600080fd5b50610257610561366004612903565b611b3f565b34801561057257600080fd5b5061057b61212c565b60405161028691906129af565b34801561059457600080fd5b506103556105a3366004612903565b60086020526000908152604090205481565b3480156105c157600080fd5b50610355612203565b3480156105d657600080fd5b506103556105e53660046127cb565b60066020526000908152604090205481565b34801561060357600080fd5b50610355610612366004612903565b60009081526008602052604090205490565b34801561063057600080fd5b5061025761063f3660046127cb565b612253565b34801561065057600080fd5b5061035560035481565b600260015414156106865760405162461bcd60e51b815260040161067d90612aed565b60405180910390fd5b6002600155336001600160a01b037f000000000000000000000000bb4c47bd70d7aaf7045bb287638f270b2cc380141614156106d45760405162461bcd60e51b815260040161067d90612a71565b7f00000000000000000000000000000000000000000000000000000000649f2f2f4211801561070d5750600254600160a01b900460ff16155b6107295760405162461bcd60e51b815260040161067d90612a3a565b60006107336122ee565b90506000805b82518110156107a45782818151811061076257634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031661077a3390565b6001600160a01b0316141561079257600191506107a4565b8061079c81612b92565b915050610739565b50806107ea5760405162461bcd60e51b8152602060048201526015602482015274596f7520617265206e6f7420612077696e6e65722160581b604482015260640161067d565b3360009081526007602052604090205460ff16156108595760405162461bcd60e51b815260206004820152602660248201527f596f75206861766520616c726561647920636f6c6c656374656420796f757220604482015265746f6b656e2160d01b606482015260840161067d565b6040516370a0823160e01b815230600482015283906000906001600160a01b038316906370a082319060240160206040518083038186803b15801561089d57600080fd5b505afa1580156108b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d5919061291b565b116109185760405162461bcd60e51b815260206004820152601360248201527210d85b1b195c881b5d5cdd081bdddb881b999d606a1b604482015260640161067d565b6040516331a9108f60e11b81526004810186905230906001600160a01b03831690636352211e9060240160206040518083038186803b15801561095a57600080fd5b505afa15801561096e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099291906127ee565b6001600160a01b0316146109e15760405162461bcd60e51b81526020600482015260166024820152752cb7ba9036bab9ba1037bbb7103a3432903a37b5b2b760511b604482015260640161067d565b33600081815260076020526040808220805460ff191660011790558051632142170760e11b8152306004820152602481019390935260448301889052516001600160a01b038416926342842e0e92606480830193919282900301818387803b158015610a4c57600080fd5b505af1158015610a60573d6000803e3d6000fd5b505050507f17b3a70c980ec7f4b25a351955fa92638e9757afd4216535ac95a0153857680d610a8c3390565b604080516001600160a01b039092168252602082018890520160405180910390a1505060018055505050565b6009546000907f000000000000000000000000000000000000000000000000000000000000001411610b3d5760405162461bcd60e51b815260206004820152602860248201527f546f6b656e20616c6c6f77616e636520686173207265616368656420746865206044820152676d6178696d756d2160c01b606482015260840161067d565b5050600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af015550630a85bd0160e11b919050565b6000546060906001600160a01b03163314610bad5760405162461bcd60e51b815260040161067d90612ab8565b610bb56122ee565b90505b90565b60026001541415610bde5760405162461bcd60e51b815260040161067d90612aed565b6002600155336001600160a01b037f000000000000000000000000bb4c47bd70d7aaf7045bb287638f270b2cc38014161480610c2457506000546001600160a01b031633145b610c895760405162461bcd60e51b815260206004820152603060248201527f42656e6566696369617279202f204f776e65722063616e206f6e6c792070657260448201526f666f726d2074686520616374696f6e2160801b606482015260840161067d565b600254600160b01b900460ff1615610ce35760405162461bcd60e51b815260206004820152601860248201527f46756e647320616c726561647920636f6c6c6563746564210000000000000000604482015260640161067d565b6000610ced6122ee565b905060008060005b8351811015610def576000848281518110610d2057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03811660009081526006909252604082205490925090610d7e7f0000000000000000000000000000000000000000000000000000000000000005610d788460646124d0565b906124e5565b9050610d8a85826124f1565b94506000610d9883836124fd565b9050610da487826124f1565b6001600160a01b038516600090815260066020526040812080549299508592909190610dd1908490612b7b565b92505081905550505050508080610de790612b92565b915050610cf5565b506002805460ff60b01b198116600160b01b1790915560405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000bb4c47bd70d7aaf7045bb287638f270b2cc3801481166004830152602482018590529091169063a9059cbb90604401602060405180830381600087803b158015610e7057600080fd5b505af1158015610e84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea891906128e3565b506002546001600160a01b031663a9059cbb610ecc6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c91906128e3565b5060408051838152602081018390527f9f711bbd3973f42733d63b23f9999746f6a259ee84921299074f3a9955876518910160405180910390a150506001805550565b600254606090600160a01b900460ff1615610fc7575060408051808201909152600881526718d85b98d95b195960c21b602082015290565b7f00000000000000000000000000000000000000000000000000000000649f2f2f42111561100f5750604080518082019091526005815264195b99195960da1b602082015290565b7f0000000000000000000000000000000000000000000000000000000062becca842101561105d575060408051808201909152600b81526a1b9bdd0b5cdd185c9d195960aa1b602082015290565b5060408051808201909152600781526672756e6e696e6760c81b602082015290565b600260015414156110a25760405162461bcd60e51b815260040161067d90612aed565b6002600181905554600160a01b900460ff166111005760405162461bcd60e51b815260206004820152601860248201527f41756374696f6e206973206e6f742063616e63656c6564210000000000000000604482015260640161067d565b337f000000000000000000000000bb4c47bd70d7aaf7045bb287638f270b2cc380146001600160a01b031614156111495760405162461bcd60e51b815260040161067d90612a71565b336000908152600660205260409020546111a55760405162461bcd60e51b815260206004820152601b60248201527f596f7520617265206e6f7420612076616c696420626964646572210000000000604482015260640161067d565b33600081815260066020526040902054806112125760405162461bcd60e51b815260206004820152602760248201527f596f75206861766520616c7265616479207769746864726177616c20796f75726044820152662066756e64732160c81b606482015260840161067d565b6001600160a01b0382166000908152600660205260408120805483929061123a908490612b7b565b909155505060025460405163a9059cbb60e01b81526001600160a01b038481166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b15801561128d57600080fd5b505af11580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c591906128e3565b50604080516001600160a01b0384168152602081018390527fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e9191015b60405180910390a1505060018055565b600260015414156113345760405162461bcd60e51b815260040161067d90612aed565b6002600155336001600160a01b037f000000000000000000000000bb4c47bd70d7aaf7045bb287638f270b2cc380141614156113825760405162461bcd60e51b815260040161067d90612a71565b7f00000000000000000000000000000000000000000000000000000000649f2f2f421180156113bb5750600254600160a01b900460ff16155b6113d75760405162461bcd60e51b815260040161067d90612a3a565b336000908152600660205260409020546114335760405162461bcd60e51b815260206004820152601b60248201527f596f7520617265206e6f7420612076616c696420626964646572210000000000604482015260640161067d565b600061143d6122ee565b905060005b81518110156115055781818151811061146b57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166114833390565b6001600160a01b031614156114f35760405162461bcd60e51b815260206004820152603060248201527f596f75206172652077696e6e65722c20796f752063616e206e6f74207065726660448201526f6f726d207468697320616374696f6e2160801b606482015260840161067d565b806114fd81612b92565b915050611442565b5033600090815260066020526040902054806115635760405162461bcd60e51b815260206004820152601d60248201527f596f7520616c7265616479206861766520726566756e64206261636b21000000604482015260640161067d565b3360009081526006602052604081208054839290611582908490612b7b565b90915550506002546001600160a01b031663a9059cbb336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156115e157600080fd5b505af11580156115f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061161991906128e3565b5060408051338152602081018390527fb6c0eca8138e097d71e2dd31e19a1266487f0553f170b7260ffe68bcbe9ff8a79101611301565b6000546001600160a01b0316331461167a5760405162461bcd60e51b815260040161067d90612ab8565b7f00000000000000000000000000000000000000000000000000000000649f2f2f421180156116b35750600254600160a01b900460ff16155b6116cf5760405162461bcd60e51b815260040161067d90612a3a565b6000805b60095481101561172b5782600982815481106116ff57634e487b7160e01b600052603260045260246000fd5b90600052602060002001541415611719576001915061172b565b8061172381612b92565b9150506116d3565b50806117845760405162461bcd60e51b815260206004820152602260248201527f546f6b656e206973206e6f7420616c6c6f77656420666f722072656465656d65604482015261642160f01b606482015260840161067d565b60007f00000000000000000000000000000000000000000000000000000000000000001180156117e157506000828152600860205260409020547f0000000000000000000000000000000000000000000000000000000000000000115b1561183f5760405162461bcd60e51b815260206004820152602860248201527f557365722068617665207265616368656420746865206d6178696d756d20616c6044820152676c6f77616e63652160c01b606482015260840161067d565b6000828152600860205260409020546118599060016124f1565b60008381526008602052604090819020829055517f559dc6ea45ea5071b1480938c0df2cd88fca6c769bfc8aeebc7c38364ff1ed5e916118a491859190918252602082015260400190565b60405180910390a15050565b6000546060906001600160a01b031633146118dd5760405162461bcd60e51b815260040161067d90612ab8565b7f0000000000000000000000000000000000000000000000000000000062becca84210156119465760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20796574206e6f742073746172742160501b604482015260640161067d565b600580548060200260200160405190810160405280929190818152602001828054801561199c57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161197e575b5050505050905090565b6000546001600160a01b031633146119d05760405162461bcd60e51b815260040161067d90612ab8565b6119da6000612509565b565b600060026001541415611a015760405162461bcd60e51b815260040161067d90612aed565b60026001556000546001600160a01b03163314611a305760405162461bcd60e51b815260040161067d90612ab8565b7f00000000000000000000000000000000000000000000000000000000649f2f2f421115611a995760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20616c726561647920656e6465642160501b604482015260640161067d565b600254600160a01b900460ff1615611aef5760405162461bcd60e51b815260206004820152601960248201527841756374696f6e20616c72656164792063616e63656c65642160381b604482015260640161067d565b6002805460ff60a01b1916600160a01b179055604051600181527f1fd636bc86322e474244a9366e9b72f9e75d3ba45b442352c7f950c92a9808a59060200160405180910390a150600180805590565b60026001541415611b625760405162461bcd60e51b815260040161067d90612aed565b60026001557f0000000000000000000000000000000000000000000000000000000062becca8421015611bd05760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20796574206e6f742073746172742160501b604482015260640161067d565b7f00000000000000000000000000000000000000000000000000000000649f2f2f421115611c395760405162461bcd60e51b815260206004820152601660248201527541756374696f6e20616c726561647920656e6465642160501b604482015260640161067d565b600254600160a01b900460ff1615611c8f5760405162461bcd60e51b815260206004820152601960248201527841756374696f6e20616c72656164792063616e63656c65642160381b604482015260640161067d565b337f000000000000000000000000bb4c47bd70d7aaf7045bb287638f270b2cc380146001600160a01b03161415611cd85760405162461bcd60e51b815260040161067d90612a71565b6002546040516370a0823160e01b815233600482018190529183916001600160a01b03909116906370a082319060240160206040518083038186803b158015611d2057600080fd5b505afa158015611d34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d58919061291b565b1015611db05760405162461bcd60e51b815260206004820152602160248201527f496e73756666696369616e7420455243323020746f6b656e2062616c616e63656044820152602160f81b606482015260840161067d565b600254604051636eb1769f60e11b81526001600160a01b0383811660048301523060248301528492169063dd62ed3e9060440160206040518083038186803b158015611dfb57600080fd5b505afa158015611e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e33919061291b565b1015611e815760405162461bcd60e51b815260206004820152601b60248201527f417070726f766520455243323020746f6b656e73206669727374210000000000604482015260640161067d565b6001600160a01b038116600090815260066020526040812054611ea490846124f1565b90507f00000000000000000000000000000000000000000000000006f05b59d3b20000811015611f3c5760405162461bcd60e51b815260206004820152603d60248201527f42696420546f6b656e20616d6f756e7420746f6f206c6f77212c20616d6f756e60448201527f742073686f756c642062652061626f766520666c6f6f72207072696365000000606482015260840161067d565b6003548111611f8d5760405162461bcd60e51b815260206004820181905260248201527f6f7665726269642074686520686967686573742062696e64696e672062696421604482015260640161067d565b6004546001600160a01b039081166000908152600660205260408082205492851682529020829055808211611fe157611fd9611fd3611fcc6001612559565b84906124f1565b8261256d565b60035561202e565b6004546001600160a01b0384811691161461202b57600480546001600160a01b0319166001600160a01b03851617905561202782612022611fcc6001612559565b61256d565b6003555b50805b6002546040516323b872dd60e01b81526001600160a01b03858116600483015230602483015260448201879052909116906323b872dd90606401602060405180830381600087803b15801561208257600080fd5b505af1158015612096573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ba91906128e3565b506120c483612584565b600454600354604080516001600160a01b03808816825260208201899052909316908301526060820183905260808201527ff152f4ff5e488c55370a2d53925a55055228ebd8ec95bd0251bbb299e48786b09060a00160405180910390a15050600180555050565b6000546060906001600160a01b031633146121595760405162461bcd60e51b815260040161067d90612ab8565b7f00000000000000000000000000000000000000000000000000000000649f2f2f421180156121925750600254600160a01b900460ff16155b6121ae5760405162461bcd60e51b815260040161067d90612a3a565b600980548060200260200160405190810160405280929190818152602001828054801561199c57602002820191906000526020600020905b8154815260200190600101908083116121e6575050505050905090565b600080546001600160a01b0316331461222e5760405162461bcd60e51b815260040161067d90612ab8565b507f000000000000000000000000000000000000000000000000000000000000000590565b6000546001600160a01b0316331461227d5760405162461bcd60e51b815260040161067d90612ab8565b6001600160a01b0381166122e25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161067d565b6122eb81612509565b50565b60607f00000000000000000000000000000000000000000000000000000000649f2f2f421180156123295750600254600160a01b900460ff16155b6123455760405162461bcd60e51b815260040161067d90612a3a565b6005546123ae5760405162461bcd60e51b815260206004820152603160248201527f4e6f2062696464657220666f756e642c2077696e6e6572206c6973742063616e604482015270206e6f742062652067656e65726174652160781b606482015260840161067d565b6005546000907f000000000000000000000000000000000000000000000000000000000000001411612400577f0000000000000000000000000000000000000000000000000000000000000014612404565b6005545b905060008167ffffffffffffffff81111561242f57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612458578160200160208202803683370190505b5060045481519192506001600160a01b031690829060009061248a57634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505081600114156124bc579150610bb89050565b6124c96001826001612640565b9250505090565b60006124dc8284612b3c565b90505b92915050565b60006124dc8284612b5c565b60006124dc8284612b24565b60006124dc8284612b7b565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006124df82670de0b6b3a7640000612b5c565b60008183101561257e5750816124df565b50919050565b6000805b6005548110156125ea57600581815481106125b357634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03163314156125d857600191506125ea565b806125e281612b92565b915050612588565b508061263c57600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b0384161790555b5050565b6060600061267161265086612559565b6004546001600160a01b0316600090815260066020526040902054906124fd565b905060005b6005548110156127a257845184141561268e576127a2565b6000600582815481106126b157634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168083526006909152604090912054909150831161278f576000805b8681116127425787818151811061270a57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316836001600160a01b0316141561273057600191505b8061273a81612b92565b9150506126e3565b508061278d578187878151811061276957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039092166020928302919091019091015261278a86612b92565b95505b505b508061279a81612b92565b915050612676565b50835183146127c2576127c06127b98660016124f1565b8585612640565b505b50919392505050565b6000602082840312156127dc578081fd5b81356127e781612bd9565b9392505050565b6000602082840312156127ff578081fd5b81516127e781612bd9565b6000806000806080858703121561281f578283fd5b843561282a81612bd9565b9350602085013561283a81612bd9565b925060408501359150606085013567ffffffffffffffff8082111561285d578283fd5b818701915087601f830112612870578283fd5b81358181111561288257612882612bc3565b604051601f8201601f19908116603f011681019083821181831017156128aa576128aa612bc3565b816040528281528a60208487010111156128c2578586fd5b82602086016020830137918201602001949094529598949750929550505050565b6000602082840312156128f4578081fd5b815180151581146127e7578182fd5b600060208284031215612914578081fd5b5035919050565b60006020828403121561292c578081fd5b5051919050565b60008060408385031215612945578182fd5b82359150602083013561295781612bd9565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156129a35783516001600160a01b03168352928401929184019160010161297e565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156129a3578351835292840192918401916001016129cb565b6000602080835283518082850152825b81811015612a13578581018301518582016040015282016129f7565b81811115612a245783604083870101525b50601f01601f1916929092016040019392505050565b60208082526019908201527f41756374696f6e206973206e6f7420656e646564207965742100000000000000604082015260600190565b60208082526027908201527f42656e65666963696172792063616e206e6f7420706572666f726d2074686520604082015266616374696f6e2160c81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60008219821115612b3757612b37612bad565b500190565b600082612b5757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612b7657612b76612bad565b500290565b600082821015612b8d57612b8d612bad565b500390565b6000600019821415612ba657612ba6612bad565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146122eb57600080fdfea2646970667358221220274139a569f45e7234848cd2bcc35b79881aeb1ec6defad46a1701f33f26469064736f6c63430008040033