Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Multi Chain
Multichain Addresses
6 addresses found via
Latest 25 from a total of 26 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
Change Marketpla... | 14124800 | 491 days 17 hrs ago | IN | 0 ETH | 0.00293513 | ||||
List Token | 13442479 | 598 days 8 hrs ago | IN | 0 ETH | 0.0056195 | ||||
List Token | 13437840 | 599 days 1 hr ago | IN | 0 ETH | 0.0148772 | ||||
List Token | 13407098 | 603 days 21 hrs ago | IN | 0 ETH | 0.0048444 | ||||
List Token | 13407089 | 603 days 21 hrs ago | IN | 0 ETH | 0.0048444 | ||||
List Token | 13407073 | 603 days 21 hrs ago | IN | 0 ETH | 0.00374633 | ||||
List Token | 13407051 | 603 days 21 hrs ago | IN | 0 ETH | 0.00342337 | ||||
List Token | 12842164 | 691 days 18 hrs ago | IN | 0 ETH | 0.00613684 | ||||
List Token | 12755020 | 705 days 8 hrs ago | IN | 0 ETH | 0.0037193 | ||||
List Token | 12751570 | 705 days 21 hrs ago | IN | 0 ETH | 0.00092982 | ||||
List Token | 12751546 | 705 days 22 hrs ago | IN | 0 ETH | 0.00092982 | ||||
List Token | 12751527 | 705 days 22 hrs ago | IN | 0 ETH | 0.00185965 | ||||
List Token | 12597607 | 729 days 20 hrs ago | IN | 0 ETH | 0.00204561 | ||||
List Token | 12363083 | 766 days 3 hrs ago | IN | 0 ETH | 0.00904288 | ||||
List Token | 12297676 | 776 days 6 hrs ago | IN | 0 ETH | 0.01411474 | ||||
List Token | 12267032 | 780 days 23 hrs ago | IN | 0 ETH | 0.01710878 | ||||
List Token | 12248985 | 783 days 18 hrs ago | IN | 0 ETH | 0.01655088 | ||||
List Token | 12235952 | 785 days 18 hrs ago | IN | 0 ETH | 0.00769303 | ||||
List Token | 12207385 | 790 days 4 hrs ago | IN | 0 ETH | 0.0167865 | ||||
List Token | 12202884 | 790 days 20 hrs ago | IN | 0 ETH | 0.01359706 | ||||
List Token | 12195224 | 792 days 1 hr ago | IN | 0 ETH | 0.02366896 | ||||
List Token | 12193041 | 792 days 9 hrs ago | IN | 0 ETH | 0.03122289 | ||||
List Token | 12193022 | 792 days 9 hrs ago | IN | 0 ETH | 0.03155862 | ||||
List Token | 12192977 | 792 days 9 hrs ago | IN | 0 ETH | 0.02677446 | ||||
List Token | 12192717 | 792 days 10 hrs ago | IN | 0 ETH | 0.02478813 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
NFTKEYMarketPlaceV1
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 999999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity =0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interface/INFTKEYMarketPlaceV1.sol"; /** * @title NFTKEY MarketPlace contract V1 * Note: This marketplace contract is collection based. It serves one ERC721 contract only * Payment tokens usually is the chain native coin's wrapped token, e.g. WETH, WBNB */ contract NFTKEYMarketPlaceV1 is INFTKEYMarketPlaceV1, Ownable, ReentrancyGuard { using SafeMath for uint256; using Address for address; using EnumerableSet for EnumerableSet.UintSet; using EnumerableSet for EnumerableSet.AddressSet; struct TokenBid { EnumerableSet.AddressSet bidders; mapping(address => Bid) bids; } constructor( string memory erc721Name_, address _erc721Address, address _paymentTokenAddress ) public { _erc721Name = erc721Name_; _erc721 = IERC721(_erc721Address); _paymentToken = IERC20(_paymentTokenAddress); } string private _erc721Name; IERC721 private immutable _erc721; IERC20 private immutable _paymentToken; bool private _isListingAndBidEnabled = true; uint8 private _feeFraction = 1; uint8 private _feeBase = 100; uint256 private _actionTimeOutRangeMin = 86400; // 24 hours uint256 private _actionTimeOutRangeMax = 31536000; // One year - This can extend by owner is contract is working smoothly mapping(uint256 => Listing) private _tokenListings; EnumerableSet.UintSet private _tokenIdWithListing; mapping(uint256 => TokenBid) private _tokenBids; EnumerableSet.UintSet private _tokenIdWithBid; EnumerableSet.AddressSet private _emptyBidders; // Help initiate TokenBid struct uint256[] private _tempTokenIdStorage; // Storage to assist cleaning address[] private _tempBidderStorage; // Storage to assist cleaning bids /** * @dev only if listing and bid is enabled * This is to help contract migration in case of upgrade or bug */ modifier onlyMarketplaceOpen() { require(_isListingAndBidEnabled, "Listing and bid are not enabled"); _; } /** * @dev only if the entered timestamp is within the allowed range * This helps to not list or bid for too short or too long period of time */ modifier onlyAllowedExpireTimestamp(uint256 expireTimestamp) { require( expireTimestamp.sub(block.timestamp) >= _actionTimeOutRangeMin, "Please enter a longer period of time" ); require( expireTimestamp.sub(block.timestamp) <= _actionTimeOutRangeMax, "Please enter a shorter period of time" ); _; } /** * @dev check if the account is the owner of this erc721 token */ function _isTokenOwner(uint256 tokenId, address account) private view returns (bool) { return _erc721.ownerOf(tokenId) == account; } /** * @dev check if this contract has approved to transfer this erc721 token */ function _isTokenApproved(uint256 tokenId) private view returns (bool) { return _erc721.getApproved(tokenId) == address(this); } /** * @dev check if this contract has approved to all of this owner's erc721 tokens */ function _isAllTokenApproved(address owner) private view returns (bool) { return _erc721.isApprovedForAll(owner, address(this)); } /** * @dev See {INFTKEYMarketPlaceV1-tokenAddress}. */ function tokenAddress() external view override returns (address) { return address(_erc721); } /** * @dev See {INFTKEYMarketPlaceV1-paymentTokenAddress}. */ function paymentTokenAddress() external view override returns (address) { return address(_paymentToken); } /** * @dev Check if a listing is valid or not * The seller must be the owner * The seller must have give this contract allowance * The sell price must be more than 0 * The listing mustn't be expired */ function _isListingValid(Listing memory listing) private view returns (bool) { if ( _isTokenOwner(listing.tokenId, listing.seller) && (_isTokenApproved(listing.tokenId) || _isAllTokenApproved(listing.seller)) && listing.listingPrice > 0 && listing.expireTimestamp > block.timestamp ) { return true; } } /** * @dev See {INFTKEYMarketPlaceV1-getTokenListing}. */ function getTokenListing(uint256 tokenId) public view override returns (Listing memory) { Listing memory listing = _tokenListings[tokenId]; if (_isListingValid(listing)) { return listing; } } /** * @dev See {INFTKEYMarketPlaceV1-getTokenListings}. */ function getTokenListings(uint256 from, uint256 size) public view override returns (Listing[] memory) { if (from < _tokenIdWithListing.length() && size > 0) { uint256 querySize = size; if ((from + size) > _tokenIdWithListing.length()) { querySize = _tokenIdWithListing.length() - from; } Listing[] memory listings = new Listing[](querySize); for (uint256 i = 0; i < querySize; i++) { Listing memory listing = _tokenListings[_tokenIdWithListing.at(i + from)]; if (_isListingValid(listing)) { listings[i] = listing; } } return listings; } } /** * @dev See {INFTKEYMarketPlaceV1-getAllTokenListings}. */ function getAllTokenListings() external view override returns (Listing[] memory) { return getTokenListings(0, _tokenIdWithListing.length()); } /** * @dev Check if an bid is valid or not * Bidder must not be the owner * Bidder must give the contract allowance same or more than bid price * Bid price must > 0 * Bid mustn't been expired */ function _isBidValid(Bid memory bid) private view returns (bool) { if ( !_isTokenOwner(bid.tokenId, bid.bidder) && _paymentToken.allowance(bid.bidder, address(this)) >= bid.bidPrice && bid.bidPrice > 0 && bid.expireTimestamp > block.timestamp ) { return true; } } /** * @dev See {INFTKEYMarketPlaceV1-getBidderTokenBid}. */ function getBidderTokenBid(uint256 tokenId, address bidder) public view override returns (Bid memory) { Bid memory bid = _tokenBids[tokenId].bids[bidder]; if (_isBidValid(bid)) { return bid; } } /** * @dev See {INFTKEYMarketPlaceV1-getTokenBids}. */ function getTokenBids(uint256 tokenId) external view override returns (Bid[] memory) { Bid[] memory bids = new Bid[](_tokenBids[tokenId].bidders.length()); for (uint256 i; i < _tokenBids[tokenId].bidders.length(); i++) { address bidder = _tokenBids[tokenId].bidders.at(i); Bid memory bid = _tokenBids[tokenId].bids[bidder]; if (_isBidValid(bid)) { bids[i] = bid; } } return bids; } /** * @dev See {INFTKEYMarketPlaceV1-getTokenHighestBid}. */ function getTokenHighestBid(uint256 tokenId) public view override returns (Bid memory) { Bid memory highestBid = Bid(tokenId, 0, address(0), 0); for (uint256 i; i < _tokenBids[tokenId].bidders.length(); i++) { address bidder = _tokenBids[tokenId].bidders.at(i); Bid memory bid = _tokenBids[tokenId].bids[bidder]; if (_isBidValid(bid) && bid.bidPrice > highestBid.bidPrice) { highestBid = bid; } } return highestBid; } /** * @dev See {INFTKEYMarketPlaceV1-getTokenHighestBids}. */ function getTokenHighestBids(uint256 from, uint256 size) public view override returns (Bid[] memory) { if (from < _tokenIdWithBid.length() && size > 0) { uint256 querySize = size; if ((from + size) > _tokenIdWithBid.length()) { querySize = _tokenIdWithBid.length() - from; } Bid[] memory highestBids = new Bid[](querySize); for (uint256 i = 0; i < querySize; i++) { highestBids[i] = getTokenHighestBid(_tokenIdWithBid.at(i + from)); } return highestBids; } } /** * @dev See {INFTKEYMarketPlaceV1-getAllTokenHighestBids}. */ function getAllTokenHighestBids() external view override returns (Bid[] memory) { return getTokenHighestBids(0, _tokenIdWithBid.length()); } /** * @dev delist a token - remove token id record and remove listing from mapping * @param tokenId erc721 token Id */ function _delistToken(uint256 tokenId) private { if (_tokenIdWithListing.contains(tokenId)) { delete _tokenListings[tokenId]; _tokenIdWithListing.remove(tokenId); } } /** * @dev remove a bid of a bidder * @param tokenId erc721 token Id * @param bidder bidder address */ function _removeBidOfBidder(uint256 tokenId, address bidder) private { if (_tokenBids[tokenId].bidders.contains(bidder)) { // Step 1: delete the bid and the address delete _tokenBids[tokenId].bids[bidder]; _tokenBids[tokenId].bidders.remove(bidder); // Step 2: if no bid left if (_tokenBids[tokenId].bidders.length() == 0) { _tokenIdWithBid.remove(tokenId); } } } /** * @dev See {INFTKEYMarketPlaceV1-listToken}. * People can only list if listing is allowed * The timestamp set needs to be in the allowed range * Only token owner can list token * Price must be higher than 0 * This contract must be approved to transfer this token */ function listToken( uint256 tokenId, uint256 value, uint256 expireTimestamp ) external override onlyMarketplaceOpen onlyAllowedExpireTimestamp(expireTimestamp) { require(value > 0, "Please list for more than 0 or use the transfer function"); require(_isTokenOwner(tokenId, msg.sender), "Only token owner can list token"); require( _isTokenApproved(tokenId) || _isAllTokenApproved(msg.sender), "This token is not allowed to transfer by this contract" ); _tokenListings[tokenId] = Listing(tokenId, value, msg.sender, expireTimestamp); _tokenIdWithListing.add(tokenId); emit TokenListed(tokenId, msg.sender, value); } /** * @dev See {INFTKEYMarketPlaceV1-delistToken}. * msg.sender must be the seller of the listing record */ function delistToken(uint256 tokenId) external override { require(_tokenListings[tokenId].seller == msg.sender, "Only token seller can delist token"); emit TokenDelisted(tokenId, _tokenListings[tokenId].seller); _delistToken(tokenId); } /** * @dev See {INFTKEYMarketPlaceV1-buyToken}. * Must have a valid listing * msg.sender must not the owner of token * msg.value must be at least sell price plus fees */ function buyToken(uint256 tokenId) external payable override nonReentrant { Listing memory listing = getTokenListing(tokenId); // Get valid listing require(listing.seller != address(0), "Token is not for sale"); // Listing not valid require(!_isTokenOwner(tokenId, msg.sender), "Token owner can't buy their own token"); uint256 fees = listing.listingPrice.mul(_feeFraction).div(_feeBase); require( msg.value >= listing.listingPrice + fees, "The value send is below sale price plus fees" ); // Send value to token seller and fees to contract owner uint256 valueWithoutFees = msg.value.sub(fees); Address.sendValue(payable(listing.seller), valueWithoutFees); Address.sendValue(payable(owner()), fees); // Send token to buyer emit TokenBought(tokenId, listing.seller, msg.sender, msg.value, valueWithoutFees, fees); _erc721.safeTransferFrom(listing.seller, msg.sender, tokenId); // Remove token listing _delistToken(tokenId); _removeBidOfBidder(tokenId, msg.sender); } /** * @dev See {INFTKEYMarketPlaceV1-enterBidForToken}. * People can only enter bid if bid is allowed * The timestamp set needs to be in the allowed range * bid price > 0 * must not be token owner * must allow this contract to spend enough payment token */ function enterBidForToken( uint256 tokenId, uint256 bidPrice, uint256 expireTimestamp ) external override onlyMarketplaceOpen onlyAllowedExpireTimestamp(expireTimestamp) { require(bidPrice > 0, "Please bid for more than 0"); require(!_isTokenOwner(tokenId, msg.sender), "This Token belongs to this address"); require( _paymentToken.allowance(msg.sender, address(this)) >= bidPrice, "Need to have enough token holding to bid on this token" ); Bid memory bid = Bid(tokenId, bidPrice, msg.sender, expireTimestamp); // if no bids of this token add a entry to both records _tokenIdWithBid and _tokenBids if (!_tokenIdWithBid.contains(tokenId)) { _tokenIdWithBid.add(tokenId); _tokenBids[tokenId] = TokenBid(_emptyBidders); } _tokenBids[tokenId].bidders.add(msg.sender); _tokenBids[tokenId].bids[msg.sender] = bid; emit TokenBidEntered(tokenId, msg.sender, bidPrice); } /** * @dev See {INFTKEYMarketPlaceV1-withdrawBidForToken}. * There must be a bid exists * remove this bid record */ function withdrawBidForToken(uint256 tokenId) external override { Bid memory bid = _tokenBids[tokenId].bids[msg.sender]; require(bid.bidder == msg.sender, "This address doesn't have bid on this token"); emit TokenBidWithdrawn(tokenId, bid.bidder, bid.bidPrice); _removeBidOfBidder(tokenId, msg.sender); } /** * @dev See {INFTKEYMarketPlaceV1-acceptBidForToken}. * Must be owner of this token * Must have approved this contract to transfer token * Must have a valid existing bid that matches the bidder address */ function acceptBidForToken(uint256 tokenId, address bidder) external override nonReentrant { require(_isTokenOwner(tokenId, msg.sender), "Only token owner can accept bid of token"); require( _isTokenApproved(tokenId) || _isAllTokenApproved(msg.sender), "The token is not approved to transfer by the contract" ); Bid memory existingBid = getBidderTokenBid(tokenId, bidder); require( existingBid.bidPrice > 0 && existingBid.bidder == bidder, "This token doesn't have a matching bid" ); uint256 fees = existingBid.bidPrice.mul(_feeFraction).div(_feeBase + _feeFraction); uint256 tokenValue = existingBid.bidPrice.sub(fees); SafeERC20.safeTransferFrom(_paymentToken, existingBid.bidder, msg.sender, tokenValue); SafeERC20.safeTransferFrom(_paymentToken, existingBid.bidder, owner(), fees); _erc721.safeTransferFrom(msg.sender, existingBid.bidder, tokenId); emit TokenBidAccepted( tokenId, msg.sender, existingBid.bidder, existingBid.bidPrice, tokenValue, fees ); // Remove token listing _delistToken(tokenId); _removeBidOfBidder(tokenId, existingBid.bidder); } /** * @dev See {INFTKEYMarketPlaceV1-getInvalidListingCount}. */ function getInvalidListingCount() external view override returns (uint256) { uint256 count = 0; for (uint256 i = 0; i < _tokenIdWithListing.length(); i++) { if (!_isListingValid(_tokenListings[_tokenIdWithListing.at(i)])) { count = count.add(1); } } return count; } /** * @dev Count how many bid records of a token are invalid now */ function _getInvalidBidOfTokenCount(uint256 tokenId) private view returns (uint256) { uint256 count = 0; for (uint256 i = 0; i < _tokenBids[tokenId].bidders.length(); i++) { address bidder = _tokenBids[tokenId].bidders.at(i); Bid memory bid = _tokenBids[tokenId].bids[bidder]; if (!_isBidValid(bid)) { count = count.add(1); } } return count; } /** * @dev See {INFTKEYMarketPlaceV1-getInvalidBidCount}. */ function getInvalidBidCount() external view override returns (uint256) { uint256 count = 0; for (uint256 i = 0; i < _tokenIdWithBid.length(); i++) { count = count.add(_getInvalidBidOfTokenCount(_tokenIdWithBid.at(i))); } return count; } /** * @dev See {INFTKEYMarketPlaceV1-cleanAllInvalidListings}. */ function cleanAllInvalidListings() external override { for (uint256 i = 0; i < _tokenIdWithListing.length(); i++) { uint256 tokenId = _tokenIdWithListing.at(i); if (!_isListingValid(_tokenListings[tokenId])) { _tempTokenIdStorage.push(tokenId); } } for (uint256 i = 0; i < _tempTokenIdStorage.length; i++) { _delistToken(_tempTokenIdStorage[i]); } delete _tempTokenIdStorage; } /** * @dev remove invalid bids of a token * @param tokenId erc721 token Id */ function _cleanInvalidBidsOfToken(uint256 tokenId) private { for (uint256 i = 0; i < _tokenBids[tokenId].bidders.length(); i++) { address bidder = _tokenBids[tokenId].bidders.at(i); Bid memory bid = _tokenBids[tokenId].bids[bidder]; if (!_isBidValid(bid)) { _tempBidderStorage.push(_tokenBids[tokenId].bidders.at(i)); } } for (uint256 i = 0; i < _tempBidderStorage.length; i++) { address bidder = _tempBidderStorage[i]; _removeBidOfBidder(tokenId, bidder); } delete _tempBidderStorage; } /** * @dev See {INFTKEYMarketPlaceV1-cleanAllInvalidBids}. */ function cleanAllInvalidBids() external override { for (uint256 i = 0; i < _tokenIdWithBid.length(); i++) { uint256 tokenId = _tokenIdWithBid.at(i); uint256 invalidCount = _getInvalidBidOfTokenCount(tokenId); if (invalidCount > 0) { _tempTokenIdStorage.push(tokenId); } } for (uint256 i = 0; i < _tempTokenIdStorage.length; i++) { _cleanInvalidBidsOfToken(_tempTokenIdStorage[i]); } delete _tempTokenIdStorage; } /** * @dev See {INFTKEYMarketPlaceV1-erc721Name}. */ function erc721Name() external view override returns (string memory) { return _erc721Name; } /** * @dev See {INFTKEYMarketPlaceV1-isListingAndBidEnabled}. */ function isListingAndBidEnabled() external view override returns (bool) { return _isListingAndBidEnabled; } /** * @dev Enable to disable Bids and Listing */ function changeMarketplaceStatus(bool enabled) external onlyOwner { _isListingAndBidEnabled = enabled; } /** * @dev See {INFTKEYMarketPlaceV1-actionTimeOutRangeMin}. */ function actionTimeOutRangeMin() external view override returns (uint256) { return _actionTimeOutRangeMin; } /** * @dev See {INFTKEYMarketPlaceV1-actionTimeOutRangeMax}. */ function actionTimeOutRangeMax() external view override returns (uint256) { return _actionTimeOutRangeMax; } /** * @dev Change minimum listing and bid time range */ function changeMinActionTimeLimit(uint256 timeInSec) external onlyOwner { _actionTimeOutRangeMin = timeInSec; } /** * @dev Change maximum listing and bid time range */ function changeMaxActionTimeLimit(uint256 timeInSec) external onlyOwner { _actionTimeOutRangeMax = timeInSec; } /** * @dev See {INFTKEYMarketPlaceV1-serviceFee}. */ function serviceFee() external view override returns (uint8, uint8) { return (_feeFraction, _feeBase); } /** * @dev Change withdrawal fee percentage. * If 1%, then input (1,100) * If 0.5%, then input (5,1000) * @param feeFraction_ Fraction of withdrawal fee based on feeBase_ * @param feeBase_ Fraction of withdrawal fee base */ function changeSeriveFee(uint8 feeFraction_, uint8 feeBase_) external onlyOwner { require(feeFraction_ <= feeBase_, "Fee fraction exceeded base."); uint256 percentage = (feeFraction_ * 1000) / feeBase_; require(percentage <= 25, "Attempt to set percentage higher than 2.5%."); _feeFraction = feeFraction_; _feeBase = feeBase_; } }
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity =0.6.12; pragma experimental ABIEncoderV2; interface INFTKEYMarketPlaceV1 { struct Bid { uint256 tokenId; uint256 bidPrice; address bidder; uint256 expireTimestamp; } struct Listing { uint256 tokenId; uint256 listingPrice; address seller; uint256 expireTimestamp; } event TokenListed(uint256 indexed tokenId, address indexed fromAddress, uint256 minValue); event TokenDelisted(uint256 indexed tokenId, address indexed fromAddress); event TokenBidEntered(uint256 indexed tokenId, address indexed fromAddress, uint256 value); event TokenBidWithdrawn(uint256 indexed tokenId, address indexed fromAddress, uint256 value); event TokenBought( uint256 indexed tokenId, address indexed fromAddress, address indexed toAddress, uint256 total, uint256 value, uint256 fees ); event TokenBidAccepted( uint256 indexed tokenId, address indexed owner, address indexed bidder, uint256 total, uint256 value, uint256 fees ); /** * @dev surface the erc721 token contract address */ function tokenAddress() external view returns (address); /** * @dev surface the erc20 payment token contract address */ function paymentTokenAddress() external view returns (address); /** * @dev get current listing of a token * @param tokenId erc721 token Id * @return current valid listing or empty listing struct */ function getTokenListing(uint256 tokenId) external view returns (Listing memory); /** * @dev get current valid listings by size * @param from index to start * @param size size to query * @return current valid listings * This to help batch query when list gets big */ function getTokenListings(uint256 from, uint256 size) external view returns (Listing[] memory); /** * @dev get all current valid listings * @return current valid listings */ function getAllTokenListings() external view returns (Listing[] memory); /** * @dev get bidder's bid on a token * @param tokenId erc721 token Id * @param bidder address of a bidder * @return Valid bid or empty bid */ function getBidderTokenBid(uint256 tokenId, address bidder) external view returns (Bid memory); /** * @dev get all valid bids of a token * @param tokenId erc721 token Id * @return Valid bids of a token */ function getTokenBids(uint256 tokenId) external view returns (Bid[] memory); /** * @dev get highest bid of a token * @param tokenId erc721 token Id * @return Valid highest bid or empty bid */ function getTokenHighestBid(uint256 tokenId) external view returns (Bid memory); /** * @dev get current highest bids * @param from index to start * @param size size to query * @return current highest bids * This to help batch query when list gets big */ function getTokenHighestBids(uint256 from, uint256 size) external view returns (Bid[] memory); /** * @dev get all highest bids * @return All valid highest bids */ function getAllTokenHighestBids() external view returns (Bid[] memory); /** * @dev List token for sale * @param tokenId erc721 token Id * @param value min price to sell the token * @param expireTimestamp when would this listing expire */ function listToken( uint256 tokenId, uint256 value, uint256 expireTimestamp ) external; /** * @dev Delist token for sale * @param tokenId erc721 token Id */ function delistToken(uint256 tokenId) external; /** * @dev Buy token * @param tokenId erc721 token Id */ function buyToken(uint256 tokenId) external payable; /** * @dev Enter bid for token * @param tokenId erc721 token Id * @param bidPrice price in payment token * @param expireTimestamp when would this bid expire */ function enterBidForToken( uint256 tokenId, uint256 bidPrice, uint256 expireTimestamp ) external; /** * @dev Withdraw bid for token * @param tokenId erc721 token Id */ function withdrawBidForToken(uint256 tokenId) external; /** * @dev Accept a bid of token from a bidder * @param tokenId erc721 token Id * @param bidder bidder address */ function acceptBidForToken(uint256 tokenId, address bidder) external; /** * @dev Count how many listing records are invalid now * This is to help admin to decide to do a cleaning or not */ function getInvalidListingCount() external view returns (uint256); /** * @dev Count how many bids records are invalid now * This is to help admin to decide to do a cleaning or not */ function getInvalidBidCount() external view returns (uint256); /** * @dev Clean all invalid listings */ function cleanAllInvalidListings() external; /** * @dev Clean all invalid bids */ function cleanAllInvalidBids() external; /** * @dev Name of ERC721 token */ function erc721Name() external view returns (string memory); /** * @dev Show if listing and bid are enabled */ function isListingAndBidEnabled() external view returns (bool); /** * @dev Surface minimum listing and bid time range */ function actionTimeOutRangeMin() external view returns (uint256); /** * @dev Surface maximum listing and bid time range */ function actionTimeOutRangeMax() external view returns (uint256); /** * @dev Service fee * @return fee fraction and fee base */ function serviceFee() external view returns (uint8, uint8); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "../../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`, 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 Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 () internal { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 999999 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"erc721Name_","type":"string"},{"internalType":"address","name":"_erc721Address","type":"address"},{"internalType":"address","name":"_paymentTokenAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"bidder","type":"address"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fees","type":"uint256"}],"name":"TokenBidAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TokenBidEntered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TokenBidWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fees","type":"uint256"}],"name":"TokenBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"}],"name":"TokenDelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"minValue","type":"uint256"}],"name":"TokenListed","type":"event"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"bidder","type":"address"}],"name":"acceptBidForToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"actionTimeOutRangeMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"actionTimeOutRangeMin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"buyToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"changeMarketplaceStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timeInSec","type":"uint256"}],"name":"changeMaxActionTimeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"timeInSec","type":"uint256"}],"name":"changeMinActionTimeLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"feeFraction_","type":"uint8"},{"internalType":"uint8","name":"feeBase_","type":"uint8"}],"name":"changeSeriveFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cleanAllInvalidBids","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cleanAllInvalidListings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"delistToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"bidPrice","type":"uint256"},{"internalType":"uint256","name":"expireTimestamp","type":"uint256"}],"name":"enterBidForToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"erc721Name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllTokenHighestBids","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"bidPrice","type":"uint256"},{"internalType":"address","name":"bidder","type":"address"},{"internalType":"uint256","name":"expireTimestamp","type":"uint256"}],"internalType":"struct INFTKEYMarketPlaceV1.Bid[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllTokenListings","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"listingPrice","type":"uint256"},{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint256","name":"expireTimestamp","type":"uint256"}],"internalType":"struct INFTKEYMarketPlaceV1.Listing[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"bidder","type":"address"}],"name":"getBidderTokenBid","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"bidPrice","type":"uint256"},{"internalType":"address","name":"bidder","type":"address"},{"internalType":"uint256","name":"expireTimestamp","type":"uint256"}],"internalType":"struct INFTKEYMarketPlaceV1.Bid","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInvalidBidCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getInvalidListingCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenBids","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"bidPrice","type":"uint256"},{"internalType":"address","name":"bidder","type":"address"},{"internalType":"uint256","name":"expireTimestamp","type":"uint256"}],"internalType":"struct INFTKEYMarketPlaceV1.Bid[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenHighestBid","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"bidPrice","type":"uint256"},{"internalType":"address","name":"bidder","type":"address"},{"internalType":"uint256","name":"expireTimestamp","type":"uint256"}],"internalType":"struct INFTKEYMarketPlaceV1.Bid","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"from","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"getTokenHighestBids","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"bidPrice","type":"uint256"},{"internalType":"address","name":"bidder","type":"address"},{"internalType":"uint256","name":"expireTimestamp","type":"uint256"}],"internalType":"struct INFTKEYMarketPlaceV1.Bid[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenListing","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"listingPrice","type":"uint256"},{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint256","name":"expireTimestamp","type":"uint256"}],"internalType":"struct INFTKEYMarketPlaceV1.Listing","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"from","type":"uint256"},{"internalType":"uint256","name":"size","type":"uint256"}],"name":"getTokenListings","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"listingPrice","type":"uint256"},{"internalType":"address","name":"seller","type":"address"},{"internalType":"uint256","name":"expireTimestamp","type":"uint256"}],"internalType":"struct INFTKEYMarketPlaceV1.Listing[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isListingAndBidEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"expireTimestamp","type":"uint256"}],"name":"listToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentTokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"serviceFee","outputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawBidForToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c060405260038054610100600160ff199092169190911761ff0019161762ff0000191662640000179055620151806004556301e133806005553480156200004657600080fd5b506040516200432b3803806200432b833981016040819052620000699162000199565b600062000075620000f9565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180558251620000d8906002906020860190620000fd565b506001600160601b0319606092831b8116608052911b1660a05250620002ce565b3390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200014057805160ff191683800117855562000170565b8280016001018555821562000170579182015b828111156200017057825182559160200191906001019062000153565b506200017e92915062000182565b5090565b5b808211156200017e576000815560010162000183565b600080600060608486031215620001ae578283fd5b83516001600160401b0380821115620001c5578485fd5b818601915086601f830112620001d9578485fd5b815181811115620001e8578586fd5b620001fd601f8201601f19166020016200025b565b915080825287602082850101111562000214578586fd5b6200022781602084016020860162000282565b50809450505060208401516200023d81620002b5565b60408501519092506200025081620002b5565b809150509250925092565b6040518181016001600160401b03811182821017156200027a57600080fd5b604052919050565b60005b838110156200029f57818101518382015260200162000285565b83811115620002af576000848401525b50505050565b6001600160a01b0381168114620002cb57600080fd5b50565b60805160601c60a05160601c6140066200032560003980610bcb5280610bfb528061183b5280611dcf528061237852508061098f5280610c6f5280611702528061244c5280612825528061291c52506140066000f3fe6080604052600436106101e35760003560e01c806385f5a92a11610102578063b6be53ba11610095578063e724488111610064578063e724488114610528578063e7d585a814610548578063f0e6dcab14610568578063f2fde38b1461058a576101e3565b8063b6be53ba146104b3578063bce64a7d146104d3578063bed659bc146104f3578063e154870214610513576101e3565b80639d76ea58116100d15780639d76ea5814610454578063a3c0b5f014610469578063a6a27f3a14610489578063afb18fe71461049e576101e3565b806385f5a92a146103cf5780638abdf5aa146103ef5780638da5cb5b1461041257806398792eec14610434576101e3565b806354b0de6a1161017a578063715018a611610149578063715018a61461035657806373885b701461036b57806375ccb1f21461038d5780637d7660e0146103ba576101e3565b806354b0de6a146102d45780635cc2c66b146102f65780635eef51ee1461031657806370a3b39014610336576101e3565b8063336c16c6116101b6578063336c16c614610275578063383fba251461029557806340a97919146102aa578063453dfc50146102bf576101e3565b80631e56afe9146101e85780632426fc241461021e5780632d296bf11461024057806333549d3d14610253575b600080fd5b3480156101f457600080fd5b506102086102033660046132be565b6105aa565b6040516102159190613f33565b60405180910390f35b34801561022a57600080fd5b5061023e6102393660046132be565b6106d6565b005b61023e61024e3660046132be565b610757565b34801561025f57600080fd5b50610268610a16565b6040516102159190613f41565b34801561028157600080fd5b5061023e6102903660046132ee565b610a1c565b3480156102a157600080fd5b5061023e610d6c565b3480156102b657600080fd5b50610268610e78565b3480156102cb57600080fd5b50610268610ebb565b3480156102e057600080fd5b506102e9610ec1565b6040516102159190613471565b34801561030257600080fd5b506102e961031136600461331d565b610ed7565b34801561032257600080fd5b5061023e610331366004613369565b610fb9565b34801561034257600080fd5b506102086103513660046132ee565b61112d565b34801561036257600080fd5b5061023e6111be565b34801561037757600080fd5b506103806112a0565b604051610215919061350c565b34801561039957600080fd5b506103ad6103a836600461331d565b611351565b60405161021591906134bf565b3480156103c657600080fd5b5061023e611495565b3480156103db57600080fd5b5061023e6103ea3660046132be565b611541565b3480156103fb57600080fd5b50610404611649565b604051610215929190613f60565b34801561041e57600080fd5b50610427611661565b60405161021591906133f8565b34801561044057600080fd5b5061020861044f3660046132be565b61167d565b34801561046057600080fd5b50610427611700565b34801561047557600080fd5b5061023e6104843660046132be565b611724565b34801561049557600080fd5b5061026861179c565b3480156104aa57600080fd5b50610427611839565b3480156104bf57600080fd5b5061023e6104ce366004613286565b61185d565b3480156104df57600080fd5b5061023e6104ee36600461333e565b611901565b3480156104ff57600080fd5b5061023e61050e3660046132be565b611b7c565b34801561051f57600080fd5b506103ad611c3c565b34801561053457600080fd5b5061023e61054336600461333e565b611c4d565b34801561055457600080fd5b506102e96105633660046132be565b612059565b34801561057457600080fd5b5061057d6121a1565b6040516102159190613501565b34801561059657600080fd5b5061023e6105a536600461324e565b6121aa565b6105b2613181565b6105ba613181565b604051806080016040528084815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815250905060005b6000848152600960205260409020610610906122f7565b8110156106cd57600084815260096020526040812061062f9083612302565b9050610639613181565b50600085815260096020908152604080832073ffffffffffffffffffffffffffffffffffffffff80861685526002918201845293829020825160808101845281548152600182015494810194909452908101549093169082015260039091015460608201526106a781612315565b80156106ba575083602001518160200151115b156106c3578093505b50506001016105f9565b5090505b919050565b6106de61242d565b73ffffffffffffffffffffffffffffffffffffffff166106fc611661565b73ffffffffffffffffffffffffffffffffffffffff1614610752576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613b97565b60405180910390fd5b600455565b60026001541415610794576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613dae565b60026001556107a1613181565b6107aa8261167d565b604081015190915073ffffffffffffffffffffffffffffffffffffffff166107fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613b60565b6108088233612431565b1561083f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613674565b60035460208201516000916108709160ff62010000830481169261086a929161010090910416612511565b90612565565b9050808260200151013410156108b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107499061380a565b60006108be34836125b1565b90506108ce8360400151826125f3565b6108df6108d9611661565b836125f3565b3373ffffffffffffffffffffffffffffffffffffffff16836040015173ffffffffffffffffffffffffffffffffffffffff16857f1d83c44501b48d5dc85fea9b94506cda160418d62c65b481199bdbec265df15734858760405161094593929190613f4a565b60405180910390a460408084015190517f42842e0e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016916342842e0e916109c7919033908990600401613440565b600060405180830381600087803b1580156109e157600080fd5b505af11580156109f5573d6000803e3d6000fd5b50505050610a02846126d5565b610a0c8433612736565b5050600180555050565b60045490565b60026001541415610a59576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613dae565b6002600155610a688233612431565b610a9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613e79565b610aa7826127f8565b80610ab65750610ab6336128dc565b610aec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107499061355d565b610af4613181565b610afe838361112d565b905060008160200151118015610b4357508173ffffffffffffffffffffffffffffffffffffffff16816040015173ffffffffffffffffffffffffffffffffffffffff16145b610b79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613c29565b6003546020820151600091610ba991610100820460ff9081166201000090930481168301169161086a9190612511565b90506000610bc48284602001516125b190919063ffffffff16565b9050610bf67f0000000000000000000000000000000000000000000000000000000000000000846040015133846129a3565b610c2d7f00000000000000000000000000000000000000000000000000000000000000008460400151610c27611661565b856129a3565b60408084015190517f42842e0e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016916342842e0e91610ca69133918a90600401613440565b600060405180830381600087803b158015610cc057600080fd5b505af1158015610cd4573d6000803e3d6000fd5b50505050826040015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16867f2c907f0c6ace0ad59e44f69f6873314bb2b85cca7eeffb05ca93fa65326bfbb486602001518587604051610d4293929190613f4a565b60405180910390a4610d53856126d5565b610d61858460400151612736565b505060018055505050565b60005b610d7960076122f7565b811015610e33576000610d8d600783612302565b600081815260066020908152604091829020825160808101845281548152600182015492810192909252600281015473ffffffffffffffffffffffffffffffffffffffff16928201929092526003909101546060820152909150610df090612a4c565b610e2a57600e80546001810182556000919091527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd018190555b50600101610d6f565b5060005b600e54811015610e6957610e61600e8281548110610e5157fe5b90600052602060002001546126d5565b600101610e37565b50610e76600e60006131bf565b565b600080805b610e87600a6122f7565b811015610eb557610eab610ea4610e9f600a84612302565b612a85565b8390612b54565b9150600101610e7d565b50905090565b60055490565b6060610ed26000610311600a6122f7565b905090565b6060610ee3600a6122f7565b83108015610ef15750600082115b15610fb35781610f01600a6122f7565b8385011115610f195783610f15600a6122f7565b0390505b60608167ffffffffffffffff81118015610f3257600080fd5b50604051908082528060200260200182016040528015610f6c57816020015b610f59613181565b815260200190600190039081610f515790505b50905060005b82811015610fa957610f8a610203600a838901612302565b828281518110610f9657fe5b6020908102919091010152600101610f72565b509150610fb39050565b92915050565b610fc161242d565b73ffffffffffffffffffffffffffffffffffffffff16610fdf611661565b73ffffffffffffffffffffffffffffffffffffffff161461102c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613b97565b8060ff168260ff16111561106c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613d1a565b60008160ff168360ff166103e80261ffff168161108557fe5b0461ffff16905060198111156110c7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610749906139ec565b506003805460ff92831662010000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff94909316610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff9091161792909216179055565b611135613181565b61113d613181565b50600083815260096020908152604080832073ffffffffffffffffffffffffffffffffffffffff80871685526002918201845293829020825160808101845281548152600182015494810194909452908101549093169082015260039091015460608201526111ab81612315565b156111b7579050610fb3565b5092915050565b6111c661242d565b73ffffffffffffffffffffffffffffffffffffffff166111e4611661565b73ffffffffffffffffffffffffffffffffffffffff1614611231576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613b97565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60028054604080516020601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010060018716150201909416859004938401819004810282018101909252828152606093909290918301828280156113475780601f1061131c57610100808354040283529160200191611347565b820191906000526020600020905b81548152906001019060200180831161132a57829003601f168201915b5050505050905090565b606061135d60076122f7565b8310801561136b5750600082115b15610fb3578161137b60076122f7565b8385011115611393578361138f60076122f7565b0390505b60608167ffffffffffffffff811180156113ac57600080fd5b506040519080825280602002602001820160405280156113e657816020015b6113d3613181565b8152602001906001900390816113cb5790505b50905060005b82811015610fa9576113fc613181565b6006600061140d6007858b01612302565b81526020808201929092526040908101600020815160808101835281548152600182015493810193909352600281015473ffffffffffffffffffffffffffffffffffffffff1691830191909152600301546060820152905061146e81612a4c565b1561148c578083838151811061148057fe5b60200260200101819052505b506001016113ec565b60005b6114a2600a6122f7565b81101561150b5760006114b6600a83612302565b905060006114c382612a85565b9050801561150157600e80546001810182556000919091527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd018290555b5050600101611498565b5060005b600e54811015610e6957611539600e828154811061152957fe5b9060005260206000200154612b93565b60010161150f565b611549613181565b5060008181526009602090815260408083203380855260029182018452938290208251608081018452815481526001820154948101949094529081015473ffffffffffffffffffffffffffffffffffffffff169183018290526003015460608301529091146115e4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613c86565b806040015173ffffffffffffffffffffffffffffffffffffffff16827f4afa471ce7ab7fa67258e3afb1adf7e899e0495602eeb26d90d41e1b64dea5a683602001516040516116339190613f41565b60405180910390a36116458233612736565b5050565b60035460ff6101008204811691620100009004169091565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b611685613181565b61168d613181565b50600082815260066020908152604091829020825160808101845281548152600182015492810192909252600281015473ffffffffffffffffffffffffffffffffffffffff169282019290925260039091015460608201526116ee81612a4c565b156116fa5790506106d1565b50919050565b7f000000000000000000000000000000000000000000000000000000000000000090565b61172c61242d565b73ffffffffffffffffffffffffffffffffffffffff1661174a611661565b73ffffffffffffffffffffffffffffffffffffffff1614611797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613b97565b600555565b600080805b6117ab60076122f7565b811015610eb55761181f600660006117c4600785612302565b81526020808201929092526040908101600020815160808101835281548152600182015493810193909352600281015473ffffffffffffffffffffffffffffffffffffffff1691830191909152600301546060820152612a4c565b6118315761182e826001612b54565b91505b6001016117a1565b7f000000000000000000000000000000000000000000000000000000000000000090565b61186561242d565b73ffffffffffffffffffffffffffffffffffffffff16611883611661565b73ffffffffffffffffffffffffffffffffffffffff16146118d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613b97565b600380547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60035460ff1661193d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613708565b600454819061194c82426125b1565b1015611984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613ed6565b60055461199182426125b1565b11156119c9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610749906138fb565b60008311611a03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613a49565b611a0d8433612431565b611a43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613e42565b611a4c846127f8565b80611a5b5750611a5b336128dc565b611a91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613bcc565b604080516080810182528581526020808201868152338385019081526060840187815260008a815260069094529490922092518355516001830155516002820180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790559051600390910155611b26600785612d26565b503373ffffffffffffffffffffffffffffffffffffffff16847f7765a1c07bdce3390c521eaeb86030b188b77cbaba2d76bd7c9c32d906bfbcba85604051611b6e9190613f41565b60405180910390a350505050565b60008181526006602052604090206002015473ffffffffffffffffffffffffffffffffffffffff163314611bdc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613de5565b60008181526006602052604080822060020154905173ffffffffffffffffffffffffffffffffffffffff9091169183917f70a382c18b6e794d86997f6e1f1efca577925cfa85c476a6ff7031f0a3dd6ed09190a3611c39816126d5565b50565b6060610ed260006103a860076122f7565b60035460ff16611c89576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613708565b6004548190611c9882426125b1565b1015611cd0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613ed6565b600554611cdd82426125b1565b1115611d15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610749906138fb565b60008311611d4f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107499061373f565b611d598433612431565b15611d90576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107499061398f565b6040517fdd62ed3e000000000000000000000000000000000000000000000000000000008152839073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063dd62ed3e90611e069033903090600401613419565b60206040518083038186803b158015611e1e57600080fd5b505afa158015611e32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5691906132d6565b1015611e8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613aa6565b611e96613181565b506040805160808101825285815260208101859052339181019190915260608101839052611ec5600a86612d32565b611f7d57611ed4600a86612d26565b5060408051600c805460806020828102850182018652606085018381529495869591860194938593918701928592849284918a0182828015611f3557602002820191906000526020600020905b815481526020019060010190808311611f21575b505050919092525050509052509052600086815260096020908152604090912082518051805180519394929385938492611f7592849291909101906131dd565b505050505050505b6000858152600960205260409020611f959033612d3e565b506000858152600960209081526040808320338085526002918201845293829020855181559285015160018401558482015190830180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90921691909117905560608401516003909201919091555186907f0ea16c10401e9d7c547471845914c4a904af6a01b9fa1e195eeecae9f78bcca19061204a908890613f41565b60405180910390a35050505050565b60008181526009602052604090206060908190612075906122f7565b67ffffffffffffffff8111801561208b57600080fd5b506040519080825280602002602001820160405280156120c557816020015b6120b2613181565b8152602001906001900390816120aa5790505b50905060005b60008481526009602052604090206120e2906122f7565b8110156106cd5760008481526009602052604081206121019083612302565b905061210b613181565b50600085815260096020908152604080832073ffffffffffffffffffffffffffffffffffffffff808616855260029182018452938290208251608081018452815481526001820154948101949094529081015490931690820152600390910154606082015261217981612315565b15612197578084848151811061218b57fe5b60200260200101819052505b50506001016120cb565b60035460ff1690565b6121b261242d565b73ffffffffffffffffffffffffffffffffffffffff166121d0611661565b73ffffffffffffffffffffffffffffffffffffffff161461221d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613b97565b73ffffffffffffffffffffffffffffffffffffffff811661226a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613617565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000610fb382612d60565b600061230e8383612d64565b9392505050565b600061232982600001518360400151612431565b1580156124015750602082015160408084015190517fdd62ed3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163dd62ed3e916123ae91903090600401613419565b60206040518083038186803b1580156123c657600080fd5b505afa1580156123da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123fe91906132d6565b10155b8015612411575060008260200151115b80156124205750428260600151115b156106d1575060016106d1565b3390565b60008173ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16636352211e856040518263ffffffff1660e01b81526004016124a39190613f41565b60206040518083038186803b1580156124bb57600080fd5b505afa1580156124cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124f3919061326a565b73ffffffffffffffffffffffffffffffffffffffff16149392505050565b60008261252057506000610fb3565b8282028284828161252d57fe5b041461230e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613b03565b60008082116125a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613958565b8183816125a957fe5b049392505050565b6000828211156125ed576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613776565b50900390565b8047101561262d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613867565b60008273ffffffffffffffffffffffffffffffffffffffff1682604051612653906133f5565b60006040518083038185875af1925050503d8060008114612690576040519150601f19603f3d011682016040523d82523d6000602084013e612695565b606091505b50509050806126d0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610749906137ad565b505050565b6126e0600782612d32565b15611c39576000818152600660205260408120818155600181018290556002810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905560030155611645600782612dc3565b600082815260096020526040902061274e9082612dcf565b1561164557600082815260096020818152604080842073ffffffffffffffffffffffffffffffffffffffff86168552600280820184529185208581556001810186905591820180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055600390910184905592859052526127d19082612df1565b5060008281526009602052604090206127e9906122f7565b611645576126d0600a83612dc3565b6040517f081812fc00000000000000000000000000000000000000000000000000000000815260009030907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063081812fc9061286f908690600401613f41565b60206040518083038186803b15801561288757600080fd5b505afa15801561289b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128bf919061326a565b73ffffffffffffffffffffffffffffffffffffffff161492915050565b6040517fe985e9c500000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c5906129539085903090600401613419565b60206040518083038186803b15801561296b57600080fd5b505afa15801561297f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb391906132a2565b612a46846323b872dd60e01b8585856040516024016129c493929190613440565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612e13565b50505050565b6000612a6082600001518360400151612431565b801561240157508151612a72906127f8565b80612401575061240182604001516128dc565b600080805b6000848152600960205260409020612aa1906122f7565b8110156106cd576000848152600960205260408120612ac09083612302565b9050612aca613181565b50600085815260096020908152604080832073ffffffffffffffffffffffffffffffffffffffff8086168552600291820184529382902082516080810184528154815260018201549481019490945290810154909316908201526003909101546060820152612b3881612315565b612b4a57612b47846001612b54565b93505b5050600101612a8a565b60008282018381101561230e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610749906136d1565b60005b6000828152600960205260409020612bad906122f7565b811015612cc5576000828152600960205260408120612bcc9083612302565b9050612bd6613181565b50600083815260096020908152604080832073ffffffffffffffffffffffffffffffffffffffff8086168552600291820184529382902082516080810184528154815260018201549481019490945290810154909316908201526003909101546060820152612c4481612315565b612cbb576000848152600960205260409020600f90612c639085612302565b81546001810183556000928352602090922090910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9092169190911790555b5050600101612b96565b5060005b600f54811015612d19576000600f8281548110612ce257fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff169050612d108382612736565b50600101612cc9565b50611c39600f60006131bf565b600061230e8383612ec9565b600061230e8383612f13565b600061230e8373ffffffffffffffffffffffffffffffffffffffff8416612ec9565b5490565b81546000908210612da1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610749906135ba565b826000018281548110612db057fe5b9060005260206000200154905092915050565b600061230e8383612f2b565b600061230e8373ffffffffffffffffffffffffffffffffffffffff8416612f13565b600061230e8373ffffffffffffffffffffffffffffffffffffffff8416612f2b565b6060612e75826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661300f9092919063ffffffff16565b8051909150156126d05780806020019051810190612e9391906132a2565b6126d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613d51565b6000612ed58383612f13565b612f0b57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610fb3565b506000610fb3565b60009081526001919091016020526040902054151590565b600081815260018301602052604081205480156130055783547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8083019190810190600090879083908110612f7c57fe5b9060005260206000200154905080876000018481548110612f9957fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080612fc957fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610fb3565b6000915050610fb3565b606061301e8484600085613026565b949350505050565b606082471015613062576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107499061389e565b61306b85613128565b6130a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074990613ce3565b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040516130cb91906133d9565b60006040518083038185875af1925050503d8060008114613108576040519150601f19603f3d011682016040523d82523d6000602084013e61310d565b606091505b509150915061311d82828661312e565b979650505050505050565b3b151590565b6060831561313d57508161230e565b82511561314d5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610749919061350c565b60405180608001604052806000815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b5080546000825590600052602060002090810190611c399190613228565b828054828255906000526020600020908101928215613218579160200282015b828111156132185782518255916020019190600101906131fd565b50613224929150613228565b5090565b5b808211156132245760008155600101613229565b803560ff81168114610fb357600080fd5b60006020828403121561325f578081fd5b813561230e81613fa0565b60006020828403121561327b578081fd5b815161230e81613fa0565b600060208284031215613297578081fd5b813561230e81613fc2565b6000602082840312156132b3578081fd5b815161230e81613fc2565b6000602082840312156132cf578081fd5b5035919050565b6000602082840312156132e7578081fd5b5051919050565b60008060408385031215613300578081fd5b82359150602083013561331281613fa0565b809150509250929050565b6000806040838503121561332f578182fd5b50508035926020909101359150565b600080600060608486031215613352578081fd5b505081359360208301359350604090920135919050565b6000806040838503121561337b578182fd5b613385848461323d565b9150613394846020850161323d565b90509250929050565b805182526020810151602083015273ffffffffffffffffffffffffffffffffffffffff6040820151166040830152606081015160608301525050565b600082516133eb818460208701613f74565b9190910192915050565b90565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff92831681529116602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b6020808252825182820181905260009190848201906040850190845b818110156134b3576134a083855161339d565b928401926080929092019160010161348d565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156134b3576134ee83855161339d565b92840192608092909201916001016134db565b901515815260200190565b600060208252825180602084015261352b816040850160208701613f74565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60208082526035908201527f54686520746f6b656e206973206e6f7420617070726f76656420746f2074726160408201527f6e736665722062792074686520636f6e74726163740000000000000000000000606082015260800190565b60208082526022908201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60408201527f6473000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f546f6b656e206f776e65722063616e277420627579207468656972206f776e2060408201527f746f6b656e000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252601f908201527f4c697374696e6720616e642062696420617265206e6f7420656e61626c656400604082015260600190565b6020808252601a908201527f506c656173652062696420666f72206d6f7265207468616e2030000000000000604082015260600190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b6020808252603a908201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260408201527f6563697069656e74206d61792068617665207265766572746564000000000000606082015260800190565b6020808252602c908201527f5468652076616c75652073656e642069732062656c6f772073616c652070726960408201527f636520706c757320666565730000000000000000000000000000000000000000606082015260800190565b6020808252601d908201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604082015260600190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60408201527f722063616c6c0000000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f506c6561736520656e74657220612073686f7274657220706572696f64206f6660408201527f2074696d65000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601a908201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604082015260600190565b60208082526022908201527f5468697320546f6b656e2062656c6f6e677320746f207468697320616464726560408201527f7373000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602b908201527f417474656d707420746f207365742070657263656e746167652068696768657260408201527f207468616e20322e35252e000000000000000000000000000000000000000000606082015260800190565b60208082526038908201527f506c65617365206c69737420666f72206d6f7265207468616e2030206f72207560408201527f736520746865207472616e736665722066756e6374696f6e0000000000000000606082015260800190565b60208082526036908201527f4e65656420746f206861766520656e6f75676820746f6b656e20686f6c64696e60408201527f6720746f20626964206f6e207468697320746f6b656e00000000000000000000606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526015908201527f546f6b656e206973206e6f7420666f722073616c650000000000000000000000604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526036908201527f5468697320746f6b656e206973206e6f7420616c6c6f77656420746f2074726160408201527f6e73666572206279207468697320636f6e747261637400000000000000000000606082015260800190565b60208082526026908201527f5468697320746f6b656e20646f65736e277420686176652061206d617463686960408201527f6e67206269640000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602b908201527f54686973206164647265737320646f65736e2774206861766520626964206f6e60408201527f207468697320746f6b656e000000000000000000000000000000000000000000606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252601b908201527f466565206672616374696f6e20657863656564656420626173652e0000000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60408201527f6f74207375636365656400000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526022908201527f4f6e6c7920746f6b656e2073656c6c65722063616e2064656c69737420746f6b60408201527f656e000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f4f6e6c7920746f6b656e206f776e65722063616e206c69737420746f6b656e00604082015260600190565b60208082526028908201527f4f6e6c7920746f6b656e206f776e65722063616e20616363657074206269642060408201527f6f6620746f6b656e000000000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f506c6561736520656e7465722061206c6f6e67657220706572696f64206f662060408201527f74696d6500000000000000000000000000000000000000000000000000000000606082015260800190565b60808101610fb3828461339d565b90815260200190565b9283526020830191909152604082015260600190565b60ff92831681529116602082015260400190565b60005b83811015613f8f578181015183820152602001613f77565b83811115612a465750506000910152565b73ffffffffffffffffffffffffffffffffffffffff81168114611c3957600080fd5b8015158114611c3957600080fdfea264697066735822122098f98e6653e374f262293702c7cf614cf80b60c8608e44ab7e25cdbe5d412b3d64736f6c634300060c0033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000024de7018b2c73b5437eaf647e914a9042cc6d770000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000044c69666500000000000000000000000000000000000000000000000000000000
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000006000000000000000000000000024de7018b2c73b5437eaf647e914a9042cc6d770000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000044c69666500000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : erc721Name_ (string): Life
Arg [1] : _erc721Address (address): 0x24DE7018b2C73B5437eaF647e914a9042CC6D770
Arg [2] : _paymentTokenAddress (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000024de7018b2c73b5437eaf647e914a9042cc6d770
Arg [2] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [4] : 4c69666500000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.