Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 17579212 | 444 days ago | IN | 0 ETH | 0.10799754 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
WayGateMarketplace
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // binance/polygon/ // On Deployment use Specific values for Enums as Like (0,1,2,3) // Lock Bidder Value import "./interfaces/IWGNFT.sol"; import "./WayGateRoyalties.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol"; contract WayGateMarketplace is WayGateRoyalties { bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; address MARKETPLACE_ADMIN_WALLET; address WAYGATE_ERC721_TOKEN_ADDRESS; address WAYGATE_ERC1155_TOKEN_ADDRESS; uint256 serviceFeePercentage; uint256 airdropFeePercentage; uint256 serviceFeeFor2DNFT; uint256 serviceFeeFor3DNFT; uint256 specialNftDiscountPercentage; event NftonFixedPrice( address owner, bytes32 nftListingIdHash, uint256 timestamp, uint256 nftID, uint256 copies, uint256 Price, NftType nftStatus ); event NftOnAuction( address owner, bytes32 nftListingIdHash, uint256 timestamp, uint256 nftId, uint256 copies, uint256 Price, NftType nftStatus, string ); event AdminSettingsUpdated( uint256 airdropFee, uint256 _serviceFeeFor2DNFT, uint256 _serviceFeeFor3DNFT, uint256 specialDiscountFee, uint256 royaltyFee ); event SellerAmountTransferred(address seller, uint256 amount); event RoyaltyTransferred(address seller, uint256 amount); event NFTClaimed(uint256 bidAmount, address receiver, uint256 copies); event NFTSold(address from, address to, uint256 nftID); event NftUnlisted(address owner, uint256 nftID); event ServiceFeeTransferred(uint256 amount); event RemovedFormSale(uint256, string); event BidPlaced( uint256 bidAmount, uint256 timeStamp, uint256 tokenId, address bidderAddress); modifier notOnSale(bytes32 _nftListingIdHash) { require( nftListingIdDetail[_nftListingIdHash].saleStatus == SaleTypeChoice.NotOnSale, "WayGate: Already on Sale" ); _; } modifier onAuction(bytes32 _nftListingIdHash) { require( nftListingIdDetail[_nftListingIdHash].saleStatus == SaleTypeChoice.onAuction, "WayGate: Not on Auction" ); _; } modifier onFixedPrice(bytes32 _nftListingIdHash) { require( nftListingIdDetail[_nftListingIdHash].saleStatus == SaleTypeChoice.OnfixedPrice, "WayGate: Not on Fixed Price" ); _; } modifier platformAddressesSet() { require( MARKETPLACE_ADMIN_WALLET != address(0) && WAYGATE_ERC721_TOKEN_ADDRESS != address(0) && WAYGATE_ERC1155_TOKEN_ADDRESS != address(0), "WayGate: Platform Addresses Not Set" ); _; } modifier onlyAdmin() { require( MARKETPLACE_ADMIN_WALLET == _msgSender(), "WayGate: Access Denied" ); _; } function initialize() public override initializer { __Ownable_init(); WayGateRoyalties.initialize(); } function listNFTForFixedPrice( uint256 _tokenId, uint256 _price, uint256 _copies, uint256 _saleTokenType, address _hostContract ) external platformAddressesSet { _selectNftContractType(_tokenId, _copies, _hostContract); bytes32 _nftListingIdHash = keccak256( abi.encodePacked( _tokenId, _hostContract, _msgSender(), block.timestamp ) ); nftListingIdDetail[_nftListingIdHash].seller = _msgSender(); nftListingIdDetail[_nftListingIdHash].hostContract = _hostContract; nftListingIdDetail[_nftListingIdHash].tokenId = _tokenId; nftListingIdDetail[_nftListingIdHash].price = _price; nftListingIdDetail[_nftListingIdHash].copies = _copies; nftListingIdDetail[_nftListingIdHash].saleStatus = SaleTypeChoice(2); nftListingIdDetail[_nftListingIdHash].saleTokenType = SaleTokenType( _saleTokenType ); if ( _hostContract == WAYGATE_ERC721_TOKEN_ADDRESS || _hostContract == WAYGATE_ERC1155_TOKEN_ADDRESS ) { _platformNftTypeStatus(_tokenId, _hostContract, _nftListingIdHash); } _transferNftToMarketplace(_hostContract, _tokenId, _nftListingIdHash); emit NftonFixedPrice( _msgSender(), _nftListingIdHash, block.timestamp, _tokenId, _copies, _price, nftType ); } function listNFTForTimedAuction( uint256 _tokenId, uint32 _startTime, uint32 _endTime, uint256 _price, uint256 _saleTokenType, address _hostContract ) external platformAddressesSet { require( _startTime != _endTime && block.timestamp < _endTime && _startTime < _endTime, "WayGate: Time Error" ); require(_endTime > _startTime + 86400, "WayGate: Minimum time limit"); require( !( IERC165Upgradeable(_hostContract).supportsInterface( type(IERC1155Upgradeable).interfaceId ) ), "WAYGATE: 1155 Auctions Unsupported" ); _selectNftContractType(_tokenId, 1, _hostContract); bytes32 _nftListingIdHash = keccak256( abi.encodePacked( _tokenId, _hostContract, _msgSender(), block.timestamp ) ); nftListingIdDetail[_nftListingIdHash].seller = _msgSender(); nftListingIdDetail[_nftListingIdHash].hostContract = _hostContract; nftListingIdDetail[_nftListingIdHash].startTime = _startTime; nftListingIdDetail[_nftListingIdHash].endTime = _endTime; nftListingIdDetail[_nftListingIdHash].tokenId = _tokenId; nftListingIdDetail[_nftListingIdHash].price = _price; nftListingIdDetail[_nftListingIdHash].copies = 1; nftListingIdDetail[_nftListingIdHash].saleStatus = SaleTypeChoice(1); nftListingIdDetail[_nftListingIdHash].saleTokenType = SaleTokenType( _saleTokenType ); if (_hostContract == WAYGATE_ERC721_TOKEN_ADDRESS) { _platformNftTypeStatus(_tokenId, _hostContract, _nftListingIdHash); } _transferNftToMarketplace(_hostContract, _tokenId, _nftListingIdHash); emit NftOnAuction( _msgSender(), _nftListingIdHash, block.timestamp, _tokenId, 1, _price, nftType, "Accepting Bids for Timed Auction" ); } function unlistNFT(bytes32 _nftListingIdHash) external { require( nftListingIdDetail[_nftListingIdHash].saleStatus != SaleTypeChoice(0), "WayGate: Not Listed" ); require( nftListingIdDetail[_nftListingIdHash].seller == _msgSender(), "WayGate: Insufficient Allowance" ); if ( nftListingIdDetail[_nftListingIdHash].saleStatus == SaleTypeChoice(1) ) { require( nftListingIdDetail[_nftListingIdHash].bidderAddress == address(0), "WayGate: Bids Found" ); } _unlistNft(_nftListingIdHash); delete nftListingIdDetail[_nftListingIdHash]; } function addAuctionBid( uint256 _bidAmount, bytes32 _nftListingIdHash ) external payable onAuction(_nftListingIdHash) { require( nftListingIdDetail[_nftListingIdHash].saleTokenType == SaleTokenType.nativeBlockchainToken, "WayGate: Not a Native Token" ); uint minBidAmount = getHighestBid(_nftListingIdHash); require( _bidAmount > minBidAmount && msg.value == _bidAmount, "WayGate: Bid Amount < Minimum Bid Amount" ); _addAuctionBid(_bidAmount, _nftListingIdHash); emit BidPlaced( _bidAmount, block.timestamp, nftListingIdDetail[_nftListingIdHash].tokenId, _msgSender() ); } function addAuctionBidWithWayGateTokens( uint256 _bidAmount, bytes32 _nftListingIdHash ) external onAuction(_nftListingIdHash) { require( nftListingIdDetail[_nftListingIdHash].saleTokenType == SaleTokenType.utilityWayGateToken, "WayGate: Invalud Token" ); require( getAllowance() >= _bidAmount, "WayGate: Insufficient Allowance" ); uint minBidAmount = getHighestBid(_nftListingIdHash); require( _bidAmount > minBidAmount, "WayGate: Bid Amount < Minimum Bid Amount" ); _addAuctionBid(_bidAmount, _nftListingIdHash); } function _addAuctionBid( uint256 _bidAmount, bytes32 _nftListingIdHash ) internal nonReentrant { require( nftListingIdDetail[_nftListingIdHash].seller != _msgSender(), "WayGate: Cannot self Bid" ); require( block.timestamp < nftListingIdDetail[_nftListingIdHash].endTime, "WayGate: Auction Time Over" ); if (nftListingIdDetail[_nftListingIdHash].bidderAddress != address(0)) { uint256 lastBidAmount = nftListingIdDetail[_nftListingIdHash] .bidAmount; address lastHighestBiderAddress = nftListingIdDetail[ _nftListingIdHash ].bidderAddress; require( _bidAmount > lastBidAmount, "WayGate: Bid Amount < Minimum Bid Amount" ); _transferAmountToSeller( _nftListingIdHash, lastBidAmount, payable(lastHighestBiderAddress) ); } nftListingIdDetail[_nftListingIdHash].bidAmount = _bidAmount; nftListingIdDetail[_nftListingIdHash].bidderAddress = _msgSender(); if ( nftListingIdDetail[_nftListingIdHash].saleTokenType == SaleTokenType.utilityWayGateToken ) { wayGateToken.transferFrom(_msgSender(), address(this), _bidAmount); } } function claimNft(bytes32 _nftListingIdHash) external { nftListingIdDetail[_nftListingIdHash].bidderAddress != address(0); address highestBiderAddress = getHighestBidder(_nftListingIdHash); require( highestBiderAddress == _msgSender(), "WayGate: Only Highest Bidder can Claim" ); _claimNft(_nftListingIdHash); } function checkNftSaleStatus( bytes32 _nftListingIdHash ) external view returns (SaleTypeChoice) { return nftListingIdDetail[_nftListingIdHash].saleStatus; } function buyNFTForFixedPrice( uint256 copies, bytes32 _nftListingIdHash ) external payable onFixedPrice(_nftListingIdHash) { require( nftListingIdDetail[_nftListingIdHash].saleTokenType == SaleTokenType.nativeBlockchainToken, "WayGate: Invalid Token" ); _buyNFTforFixedPrice(msg.value, copies, _nftListingIdHash); } function buyNFTForFixedPriceWithWayGateTokens( uint256 _tokenAmount, uint256 copies, bytes32 _nftListingIdHash ) external onFixedPrice(_nftListingIdHash) { require( nftListingIdDetail[_nftListingIdHash].saleTokenType == SaleTokenType.utilityWayGateToken, "WayGate: Invalid Token" ); require( getAllowance() >= _tokenAmount, "WayGate: Insufficient Allowance" ); _buyNFTforFixedPrice(_tokenAmount, copies, _nftListingIdHash); } function _buyNFTforFixedPrice( uint256 _tokenAmount, uint256 copies, bytes32 _nftListingIdHash ) internal { uint256 uintPrice = _tokenAmount / copies; require( uintPrice == nftListingIdDetail[_nftListingIdHash].price, "WayGate: Insufficient Amount" ); require( nftListingIdDetail[_nftListingIdHash].seller != _msgSender(), "WayGate: Cannot Self Buy NFT" ); _transferNftAndFeeHandler( nftListingIdDetail[_nftListingIdHash].hostContract, nftListingIdDetail[_nftListingIdHash].tokenId, _msgSender(), _tokenAmount, copies, _nftListingIdHash ); } function clearClaimableTokens( bytes32[] calldata _nftListingIdHash ) external onlyAdmin { for (uint256 i = 0; i < _nftListingIdHash.length; i++) { _claimNft(_nftListingIdHash[i]); } } function getRoyaltiesStatus( address _hostContract ) internal view returns (bool) { bool success = ERC721Upgradeable(_hostContract).supportsInterface( _INTERFACE_ID_ERC2981 ); return success; } function _claimNft( bytes32 _nftListingIdHash ) internal onAuction(_nftListingIdHash) { address highestBiderAddress = getHighestBidder(_nftListingIdHash); if (highestBiderAddress != address(0)) { uint256 highestBidAmount = getHighestBid(_nftListingIdHash); _transferNftAndFeeHandler( nftListingIdDetail[_nftListingIdHash].hostContract, nftListingIdDetail[_nftListingIdHash].tokenId, highestBiderAddress, highestBidAmount, 1, _nftListingIdHash ); emit NFTClaimed( highestBidAmount, highestBiderAddress, nftListingIdDetail[_nftListingIdHash].copies ); } else { _unlistNft(_nftListingIdHash); } delete nftListingIdDetail[_nftListingIdHash]; } function _unlistNft(bytes32 _nftListingIdHash) internal nonReentrant { address _hostContract = nftListingIdDetail[_nftListingIdHash] .hostContract; uint256 _tokenId = nftListingIdDetail[_nftListingIdHash].tokenId; if ( IERC165Upgradeable(_hostContract).supportsInterface( type(IERC721Upgradeable).interfaceId ) ) { ERC721Upgradeable nftContract721 = ERC721Upgradeable(_hostContract); nftContract721.safeTransferFrom( address(this), nftListingIdDetail[_nftListingIdHash].seller, _tokenId ); } else { ERC1155Upgradeable nftContract1155 = ERC1155Upgradeable( _hostContract ); nftContract1155.safeTransferFrom( address(this), nftListingIdDetail[_nftListingIdHash].seller, _tokenId, nftListingIdDetail[_nftListingIdHash].copies, "0x00" ); } emit NftUnlisted(_msgSender(), _tokenId); } function _transferNftAndFeeHandler( address _hostContract, uint256 _tokenId, address _buyerAddress, uint256 _price, uint256 _copies, bytes32 _nftListingIdHash ) internal nonReentrant { if ( nftListingIdDetail[_nftListingIdHash].saleStatus == SaleTypeChoice.OnfixedPrice && nftListingIdDetail[_nftListingIdHash].saleTokenType == SaleTokenType.utilityWayGateToken ) { wayGateToken.transferFrom(_msgSender(), address(this), _price); } address royaltyReceiver; uint royaltyAmount; if (getRoyaltiesStatus(_hostContract)) { (royaltyReceiver, royaltyAmount) = IERC2981Upgradeable( _hostContract ).royaltyInfo(_tokenId, _price); } if ( nftListingIdDetail[_nftListingIdHash].nftTokenTypeStatus == NftTokenType.airdropNFT ) { _royaltyAndWayGateNFTFee( _nftListingIdHash, _price, royaltyAmount, payable(royaltyReceiver), payable(nftListingIdDetail[_nftListingIdHash].seller), airdropFeePercentage ); } if ( nftListingIdDetail[_nftListingIdHash].nftTokenTypeStatus == NftTokenType.specialNFT ) { _royaltyAndWayGateNFTFee( _nftListingIdHash, _price, royaltyAmount, payable(royaltyReceiver), payable(nftListingIdDetail[_nftListingIdHash].seller), specialNftDiscountPercentage ); } if ( nftListingIdDetail[_nftListingIdHash].nftTokenTypeStatus == NftTokenType.simpleNFT ) { if ( nftListingIdDetail[_nftListingIdHash].nftTypeStatus == NftType.TYPE_2D ) _royaltyAndWayGateNFTFee( _nftListingIdHash, _price, royaltyAmount, payable(royaltyReceiver), payable(nftListingIdDetail[_nftListingIdHash].seller), serviceFeeFor2DNFT ); if ( nftListingIdDetail[_nftListingIdHash].nftTypeStatus == NftType.TYPE_3D ) _royaltyAndWayGateNFTFee( _nftListingIdHash, _price, royaltyAmount, payable(royaltyReceiver), payable(nftListingIdDetail[_nftListingIdHash].seller), serviceFeeFor3DNFT ); } if ( IERC165Upgradeable(_hostContract).supportsInterface( type(IERC721Upgradeable).interfaceId ) ) { ERC721Upgradeable nftContract721 = ERC721Upgradeable(_hostContract); require(_copies == 1, "ERC721: Does Not Support Copies"); nftContract721.safeTransferFrom( address(this), _buyerAddress, _tokenId ); delete nftListingIdDetail[_nftListingIdHash]; } else { ERC1155Upgradeable nftContract1155 = ERC1155Upgradeable( _hostContract ); require( _copies <= nftListingIdDetail[_nftListingIdHash].copies, "WayGate: Copies not Available" ); require( _price == nftListingIdDetail[_nftListingIdHash].price * _copies, "WayGate: Insufficient Copies" ); nftContract1155.safeTransferFrom( address(this), _buyerAddress, _tokenId, _copies, "0x00" ); uint256 remainingCopies = nftListingIdDetail[_nftListingIdHash] .copies - _copies; if (remainingCopies != 0) { nftListingIdDetail[_nftListingIdHash].copies = remainingCopies; } else { delete nftListingIdDetail[_nftListingIdHash]; } } } function _transferNftToMarketplace( address _hostContract, uint256 _tokenId, bytes32 _nftListingIdHash ) internal nonReentrant { if ( IERC165Upgradeable(_hostContract).supportsInterface( type(IERC721Upgradeable).interfaceId ) ) { ERC721Upgradeable nftContract721 = ERC721Upgradeable(_hostContract); nftContract721.safeTransferFrom( nftContract721.ownerOf(_tokenId), address(this), _tokenId ); nftContract721.approve(_msgSender(), _tokenId); nftContract721.approve(MARKETPLACE_ADMIN_WALLET, _tokenId); } else { ERC1155Upgradeable nftContract1155 = ERC1155Upgradeable( _hostContract ); nftContract1155.safeTransferFrom( nftListingIdDetail[_nftListingIdHash].seller, address(this), _tokenId, nftListingIdDetail[_nftListingIdHash].copies, "0x00" ); nftContract1155.setApprovalForAll(_msgSender(), true); nftContract1155.setApprovalForAll(MARKETPLACE_ADMIN_WALLET, true); } } function _selectNftContractType( uint256 _tokenId, uint256 _copies, address _hostContract ) internal view { if ( IERC165Upgradeable(_hostContract).supportsInterface( type(IERC721Upgradeable).interfaceId ) ) { ERC721Upgradeable nftContract721 = ERC721Upgradeable(_hostContract); require(_copies == 1, "WayGate: ERC721 doesn't support copies"); require( nftContract721.ownerOf(_tokenId) == _msgSender(), "WayGate: Not an Owner" ); } else { ERC1155Upgradeable nftContract1155 = ERC1155Upgradeable( _hostContract ); require( nftContract1155.balanceOf(_msgSender(), _tokenId) >= _copies && _copies > 0, "ERC1155: Not enough copies" ); } } function _platformNftTypeStatus( uint256 _tokenId, address _hostContract, bytes32 _nftListingIdHash ) internal { nftType = NftType(IWGNFT(_hostContract).getNftTypeStatus(_tokenId)); nftListingIdDetail[_nftListingIdHash].nftTypeStatus = nftType; if (_hostContract == WAYGATE_ERC721_TOKEN_ADDRESS) { if (IWGNFT(_hostContract).getWhitelistTokenIdStatus(_tokenId)) { nftListingIdDetail[_nftListingIdHash] .nftTokenTypeStatus = NftTokenType.airdropNFT; } if (IWGNFT(_hostContract).getSpecialNftTokenIdStatus(_tokenId)) { nftListingIdDetail[_nftListingIdHash] .nftTokenTypeStatus = NftTokenType.specialNFT; } } } function setAdminSettings( uint256 _airdropPercentage, uint256 _serviceFeeFor2DNFT, uint256 _serviceFeeFor3DNFT, uint256 _specialNftDiscountPercentage, uint256 _maxRoyaltyPercentage, address _hostContract ) external onlyOwner { airdropFeePercentage = _airdropPercentage; serviceFeeFor2DNFT = _serviceFeeFor2DNFT; serviceFeeFor3DNFT = _serviceFeeFor3DNFT; specialNftDiscountPercentage = _specialNftDiscountPercentage; IWGNFT(_hostContract).setMaxRoyaltyPercentage(_maxRoyaltyPercentage); emit AdminSettingsUpdated( _airdropPercentage, _serviceFeeFor2DNFT, _serviceFeeFor3DNFT, _specialNftDiscountPercentage, _maxRoyaltyPercentage ); } function setPlatformTokenContractAddress( address _erc721, address _erc1155 ) external onlyOwner { require( _erc721 != address(0) && _erc1155 != address(0), "WayGate: Invalid Address" ); require( IERC165Upgradeable(_erc721).supportsInterface( type(IERC721Upgradeable).interfaceId ), "WayGate721: Invalid Address" ); require( IERC165Upgradeable(_erc1155).supportsInterface( type(IERC1155Upgradeable).interfaceId ), "WayGate1155: Invalid Address" ); WAYGATE_ERC721_TOKEN_ADDRESS = _erc721; WAYGATE_ERC1155_TOKEN_ADDRESS = _erc1155; } function setMarketplaceAdminWallet(address _wallet) external onlyOwner { require(_wallet != address(0), "WayGate: Invalid Address"); MARKETPLACE_ADMIN_WALLET = _wallet; } function getListingId( uint256 _tokenId, address _hostContract, uint256 timestamp, address _seller ) external view returns (bytes32) { bytes32 _nftListingIdHash = keccak256( abi.encodePacked(_tokenId, _hostContract, _seller, timestamp) ); require( nftListingIdDetail[_nftListingIdHash].saleStatus != SaleTypeChoice.NotOnSale, "WayGate: Not on Sale" ); return _nftListingIdHash; } function getNFTListingDetails( bytes32 _nftListingIdHash ) external view returns (NFTDetails memory) { return nftListingIdDetail[_nftListingIdHash]; } function getHighestBidder( bytes32 _nftListingIdHash ) public view returns (address) { require( block.timestamp > nftListingIdDetail[_nftListingIdHash].endTime, "WayGate: Auction Time Not Over" ); if (nftListingIdDetail[_nftListingIdHash].bidderAddress != address(0)) { address currentHighestBidder = nftListingIdDetail[_nftListingIdHash] .bidderAddress; return currentHighestBidder; } else { return address(0); } } function getHighestBid( bytes32 _nftListingIdHash ) public view onAuction(_nftListingIdHash) returns (uint256) { if (nftListingIdDetail[_nftListingIdHash].bidderAddress == address(0)) { return nftListingIdDetail[_nftListingIdHash].price; } else { uint256 currentHighestBid = nftListingIdDetail[_nftListingIdHash] .bidAmount; return currentHighestBid; } } function getWayGate721ContractAddress() external view returns (address) { return WAYGATE_ERC721_TOKEN_ADDRESS; } function getServiceFeeFor2DNFT() external view returns (uint256) { return serviceFeeFor2DNFT; } function getServiceFeeFor3DNFT() external view returns (uint256) { return serviceFeeFor3DNFT; } function getWayGate1155ContractAddress() external view returns (address) { return WAYGATE_ERC1155_TOKEN_ADDRESS; } function onERC1155Received( address, address, uint256, uint256, bytes memory ) external virtual returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) external virtual returns (bytes4) { return this.onERC1155BatchReceived.selector; } function onERC721Received( address, address, uint256, bytes memory ) external virtual returns (bytes4) { return this.onERC721Received.selector; } fallback() external payable {} receive() external payable {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981Upgradeable is IERC165Upgradeable { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ReentrancyGuardUpgradeable is Initializable { // 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; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155Upgradeable.sol"; import "./IERC1155ReceiverUpgradeable.sol"; import "./extensions/IERC1155MetadataURIUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable { using AddressUpgradeable for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ function __ERC1155_init(string memory uri_) internal onlyInitializing { __ERC1155_init_unchained(uri_); } function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC1155Upgradeable).interfaceId || interfaceId == type(IERC1155MetadataURIUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155ReceiverUpgradeable.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155ReceiverUpgradeable.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non-ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[47] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155Upgradeable.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURIUpgradeable is IERC1155Upgradeable { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155ReceiverUpgradeable is IERC165Upgradeable { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.2) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @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. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721Upgradeable.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual {} /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such * that `ownerOf(tokenId)` is `a`. */ // solhint-disable-next-line func-name-mixedcase function __unsafe_increaseBalance(address account, uint256 amount) internal { _balances[account] += amount; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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 /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @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 // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface IWGFeeDistributor { function setWayGatePartnersAmount( uint256 _partenrsAmount ) external returns (uint256); function setWayGateAirdropTokenAmount( uint256 _airdropAmount ) external returns (uint256); function setWayGateAirdropNativeTokenAmount( uint256 _airdropNativeTokenAmount ) external returns (uint256); function setWayGatePlatformFeeAmount( uint256 _wayGateplatformFeeAmount ) external returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IWGNFT { function getWhitelistTokenIdStatus( uint256 _tokenId ) external view returns (bool); function getNftTypeStatus(uint256 _tokenId) external view returns (uint); function getSpecialNftTokenIdStatus( uint256 _tokenId ) external view returns (bool); function setMaxRoyaltyPercentage(uint _royaltyPercentage) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IWGFeeDistributor.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; contract WayGateRoyalties is Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable { IERC20Upgradeable wayGateToken; enum NftType { TYPE_NULL, TYPE_2D, TYPE_3D } NftType nftType; enum SaleTypeChoice { NotOnSale, onAuction, OnfixedPrice } enum NftTokenType { simpleNFT, specialNFT, airdropNFT } enum SaleTokenType { nativeBlockchainToken, utilityWayGateToken } struct NFTDetails { uint256 bidAmount; uint256 startTime; uint256 endTime; uint256 tokenId; uint256 price; uint256 copies; address seller; address hostContract; address bidderAddress; NftType nftTypeStatus; SaleTypeChoice saleStatus; SaleTokenType saleTokenType; NftTokenType nftTokenTypeStatus; } uint256 public airdropHolder2DPercentage; uint256 public airdropHolder3DPercentage; address feeDistributorAddress; address platformFeeReceiver; mapping(address => bool) exists; mapping(bytes32 => NFTDetails) nftListingIdDetail; event RoyaltiesTransfer(uint256, uint256, uint256, uint256); event PartnersFeeTransferred( uint256 partnersLength, uint256 feePerPartner, uint256 totalPartnerFee ); modifier onlyFeeDistributor() { require( _msgSender() == feeDistributorAddress, "WayGate: OnlyFeeDistributor" ); _; } function initialize() public virtual onlyInitializing { __Ownable_init(); } function setPlatformFeeReceiverAddress( address _platformFeeReceiver ) external onlyOwner { platformFeeReceiver = _platformFeeReceiver; } function setWayGateDistrubutorAddress( address _feeDistributorAddress ) external onlyOwner { feeDistributorAddress = _feeDistributorAddress; } function setAirdropHolderReceivingPercentage( uint256 _airdropHolder2DPercentage, uint256 _airdropHolder3DPercentage ) external onlyOwner { airdropHolder2DPercentage = _airdropHolder2DPercentage; airdropHolder3DPercentage = _airdropHolder3DPercentage; } function _royaltyAndWayGateNFTFee( bytes32 _nftListingIdHash, uint _nftPrice, uint royaltyAmount, address payable minterAddress, address payable nftSeller, uint256 serviceFee ) internal { uint _totalNftPrice = _nftPrice; uint _WayGateFee = _calculateWayGateFee( _nftListingIdHash, _nftPrice, serviceFee ); uint _airdropFee = _calculateAirdropFee(_nftListingIdHash, _nftPrice); _transferAmountToMinter( _nftListingIdHash, royaltyAmount, minterAddress ); _totalNftPrice = _totalNftPrice - (_WayGateFee + _airdropFee + royaltyAmount); _transferAmountToSeller(_nftListingIdHash, _totalNftPrice, nftSeller); emit RoyaltiesTransfer( _WayGateFee, _airdropFee, royaltyAmount, _totalNftPrice ); } function _calculateWayGateFee( bytes32 _nftListingIdHash, uint price, uint256 serviceFee ) internal returns (uint) { uint WayGateAmount = (price * serviceFee) / 1000; _transferAmountToPlatform(_nftListingIdHash, WayGateAmount); return WayGateAmount; } function _calculateAirdropFee( bytes32 _nftListingIdHash, uint price ) internal returns (uint) { uint airdropAmount; if ( nftListingIdDetail[_nftListingIdHash].nftTypeStatus == NftType.TYPE_2D ) { airdropAmount = (price * airdropHolder2DPercentage) / 1000; _transferAmountToAirdropHolders(_nftListingIdHash, airdropAmount); } else { airdropAmount = (price * airdropHolder3DPercentage) / 1000; _transferAmountToAirdropHolders(_nftListingIdHash, airdropAmount); } return airdropAmount; } function _transferAmountToSeller( bytes32 _nftListingIdHash, uint256 amount, address payable seller ) internal { if ( nftListingIdDetail[_nftListingIdHash].saleTokenType != SaleTokenType.utilityWayGateToken ) { payable(seller).transfer(amount); } else { wayGateToken.transfer(seller, amount); } } function _transferAmountToMinter( bytes32 _nftListingIdHash, uint256 _royaltyAmount, address payable _minterAddress ) internal { if ( nftListingIdDetail[_nftListingIdHash].saleTokenType != SaleTokenType.utilityWayGateToken ) { payable(_minterAddress).transfer(_royaltyAmount); } else { wayGateToken.transfer(_minterAddress, _royaltyAmount); } } function _transferAmountToPlatform( bytes32 _nftListingIdHash, uint256 platformFormFee ) internal { if ( nftListingIdDetail[_nftListingIdHash].saleTokenType != SaleTokenType.utilityWayGateToken ) { payable(platformFeeReceiver).transfer(platformFormFee); } else { wayGateToken.transfer(feeDistributorAddress, platformFormFee); } } function _transferAmountToAirdropHolders( bytes32 _nftListingIdHash, uint airdropAmount ) internal { require( feeDistributorAddress != address(0), "WayGate Royalties: Set Airdrop Fee Distributor Address" ); if ( nftListingIdDetail[_nftListingIdHash].saleTokenType != SaleTokenType.utilityWayGateToken ) { (bool success, ) = payable(feeDistributorAddress).call{ value: airdropAmount }(""); } else { wayGateToken.transfer(feeDistributorAddress, airdropAmount); } } function setWayGateToken(address _tokenAddress) external onlyOwner { require(_tokenAddress != address(0), "address invalid"); wayGateToken = IERC20Upgradeable(_tokenAddress); } function getAllowance() public view returns (uint256) { return wayGateToken.allowance(msg.sender, address(this)); } function getContractWatGateTokenBalance() external view onlyOwner returns (uint256) { return wayGateToken.balanceOf(address(this)); } function getUserWayGateTokenBalance() external view returns (uint256) { return wayGateToken.balanceOf(msg.sender); } function getWayGateTokenAddress() external view returns (IERC20Upgradeable) { return wayGateToken; } function getwayGatePlatformFeeReceiver() external view returns (address) { return platformFeeReceiver; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"airdropFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_serviceFeeFor2DNFT","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_serviceFeeFor3DNFT","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"specialDiscountFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"royaltyFee","type":"uint256"}],"name":"AdminSettingsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"bidAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timeStamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"bidderAddress","type":"address"}],"name":"BidPlaced","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"bidAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"copies","type":"uint256"}],"name":"NFTClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftID","type":"uint256"}],"name":"NFTSold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"bytes32","name":"nftListingIdHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nftId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"copies","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"Price","type":"uint256"},{"indexed":false,"internalType":"enum WayGateRoyalties.NftType","name":"nftStatus","type":"uint8"},{"indexed":false,"internalType":"string","name":"","type":"string"}],"name":"NftOnAuction","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"nftID","type":"uint256"}],"name":"NftUnlisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"bytes32","name":"nftListingIdHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nftID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"copies","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"Price","type":"uint256"},{"indexed":false,"internalType":"enum WayGateRoyalties.NftType","name":"nftStatus","type":"uint8"}],"name":"NftonFixedPrice","type":"event"},{"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":false,"internalType":"uint256","name":"partnersLength","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"feePerPartner","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalPartnerFee","type":"uint256"}],"name":"PartnersFeeTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"","type":"uint256"},{"indexed":false,"internalType":"string","name":"","type":"string"}],"name":"RemovedFormSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"RoyaltiesTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RoyaltyTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SellerAmountTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ServiceFeeTransferred","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"uint256","name":"_bidAmount","type":"uint256"},{"internalType":"bytes32","name":"_nftListingIdHash","type":"bytes32"}],"name":"addAuctionBid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bidAmount","type":"uint256"},{"internalType":"bytes32","name":"_nftListingIdHash","type":"bytes32"}],"name":"addAuctionBidWithWayGateTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"airdropHolder2DPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"airdropHolder3DPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"copies","type":"uint256"},{"internalType":"bytes32","name":"_nftListingIdHash","type":"bytes32"}],"name":"buyNFTForFixedPrice","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenAmount","type":"uint256"},{"internalType":"uint256","name":"copies","type":"uint256"},{"internalType":"bytes32","name":"_nftListingIdHash","type":"bytes32"}],"name":"buyNFTForFixedPriceWithWayGateTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_nftListingIdHash","type":"bytes32"}],"name":"checkNftSaleStatus","outputs":[{"internalType":"enum WayGateRoyalties.SaleTypeChoice","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_nftListingIdHash","type":"bytes32"}],"name":"claimNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_nftListingIdHash","type":"bytes32[]"}],"name":"clearClaimableTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getContractWatGateTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_nftListingIdHash","type":"bytes32"}],"name":"getHighestBid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_nftListingIdHash","type":"bytes32"}],"name":"getHighestBidder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_hostContract","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"address","name":"_seller","type":"address"}],"name":"getListingId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_nftListingIdHash","type":"bytes32"}],"name":"getNFTListingDetails","outputs":[{"components":[{"internalType":"uint256","name":"bidAmount","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"copies","type":"uint256"},{"internalType":"address","name":"seller","type":"address"},{"internalType":"address","name":"hostContract","type":"address"},{"internalType":"address","name":"bidderAddress","type":"address"},{"internalType":"enum WayGateRoyalties.NftType","name":"nftTypeStatus","type":"uint8"},{"internalType":"enum WayGateRoyalties.SaleTypeChoice","name":"saleStatus","type":"uint8"},{"internalType":"enum WayGateRoyalties.SaleTokenType","name":"saleTokenType","type":"uint8"},{"internalType":"enum WayGateRoyalties.NftTokenType","name":"nftTokenTypeStatus","type":"uint8"}],"internalType":"struct WayGateRoyalties.NFTDetails","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getServiceFeeFor2DNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getServiceFeeFor3DNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUserWayGateTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWayGate1155ContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWayGate721ContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWayGateTokenAddress","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getwayGatePlatformFeeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_copies","type":"uint256"},{"internalType":"uint256","name":"_saleTokenType","type":"uint256"},{"internalType":"address","name":"_hostContract","type":"address"}],"name":"listNFTForFixedPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint32","name":"_startTime","type":"uint32"},{"internalType":"uint32","name":"_endTime","type":"uint32"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_saleTokenType","type":"uint256"},{"internalType":"address","name":"_hostContract","type":"address"}],"name":"listNFTForTimedAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_airdropPercentage","type":"uint256"},{"internalType":"uint256","name":"_serviceFeeFor2DNFT","type":"uint256"},{"internalType":"uint256","name":"_serviceFeeFor3DNFT","type":"uint256"},{"internalType":"uint256","name":"_specialNftDiscountPercentage","type":"uint256"},{"internalType":"uint256","name":"_maxRoyaltyPercentage","type":"uint256"},{"internalType":"address","name":"_hostContract","type":"address"}],"name":"setAdminSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_airdropHolder2DPercentage","type":"uint256"},{"internalType":"uint256","name":"_airdropHolder3DPercentage","type":"uint256"}],"name":"setAirdropHolderReceivingPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"name":"setMarketplaceAdminWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_platformFeeReceiver","type":"address"}],"name":"setPlatformFeeReceiverAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_erc721","type":"address"},{"internalType":"address","name":"_erc1155","type":"address"}],"name":"setPlatformTokenContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeDistributorAddress","type":"address"}],"name":"setWayGateDistrubutorAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"setWayGateToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_nftListingIdHash","type":"bytes32"}],"name":"unlistNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b50614555806100206000396000f3fe60806040526004361061021c5760003560e01c8063837629dc11610122578063cad62d4a116100a5578063f124667a1161006c578063f124667a14610638578063f23a6e611461067f578063f2fde38b146106ab578063f5066ba4146106cb578063ffc60089146106eb57005b8063cad62d4a146105ae578063d4196303146105c3578063e0507638146105d8578063e196ee1f146105f8578063e31beb7a1461061857005b8063b337169f116100e9578063b337169f14610519578063b9cce51814610539578063bc197c811461054f578063c3b3e0b01461057b578063c96bf8621461059957005b8063837629dc146104865780638c404e4d146104a65780638da5cb5b146104c6578063973e9b8b146104e4578063a1e09a3e146104f957005b806354c9ea62116101aa578063715018a611610171578063715018a6146104095780637193fd891461041e57806374cebc581461043e57806375aa9f0a146104515780638129fc1c1461047157005b806354c9ea621461035c5780635897b958146103895780635a1fc12c146103a95780635b135375146103c9578063660bcd14146103e957005b80633816db01116101ee5780633816db01146102e05780633ac311e7146102f65780633b7132f7146103145780633df96a441461033457806347f1e54a1461034957005b80630837f07914610225578063150b7a021461025c5780631b9a8d3c14610294578063201bbdbe146102b257005b3661022357005b005b34801561023157600080fd5b50609f546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561026857600080fd5b50610287610277366004613b48565b630a85bd0160e11b949350505050565b6040516102539190613bb4565b3480156102a057600080fd5b50609b546001600160a01b031661023f565b3480156102be57600080fd5b506102d26102cd366004613bc9565b61070b565b604051908152602001610253565b3480156102ec57600080fd5b506102d260985481565b34801561030257600080fd5b5060a0546001600160a01b031661023f565b34801561032057600080fd5b5061022361032f366004613bc9565b6107b3565b34801561034057600080fd5b5060a3546102d2565b610223610357366004613be2565b610960565b34801561036857600080fd5b5061037c610377366004613bc9565b610a61565b6040516102539190613c47565b34801561039557600080fd5b506102236103a4366004613d2a565b610bd8565b3480156103b557600080fd5b506102236103c4366004613d63565b610df5565b3480156103d557600080fd5b506102236103e4366004613be2565b610e67565b3480156103f557600080fd5b506102d2610404366004613d80565b610e7a565b34801561041557600080fd5b50610223610f29565b34801561042a57600080fd5b50610223610439366004613dca565b610f3d565b61022361044c366004613be2565b611067565b34801561045d57600080fd5b5061022361046c366004613be2565b6111cf565b34801561047d57600080fd5b506102236112ee565b34801561049257600080fd5b506102236104a1366004613df6565b611407565b3480156104b257600080fd5b506102236104c1366004613d63565b6115f1565b3480156104d257600080fd5b506033546001600160a01b031661023f565b3480156104f057600080fd5b506102d261161b565b34801561050557600080fd5b5061023f610514366004613bc9565b611694565b34801561052557600080fd5b50610223610534366004613d63565b611740565b34801561054557600080fd5b506102d260995481565b34801561055b57600080fd5b5061028761056a366004613ec3565b63bc197c8160e01b95945050505050565b34801561058757600080fd5b506097546001600160a01b031661023f565b3480156105a557600080fd5b5060a4546102d2565b3480156105ba57600080fd5b506102d261176a565b3480156105cf57600080fd5b506102d261179b565b3480156105e457600080fd5b506102236105f3366004613bc9565b6117d5565b34801561060457600080fd5b50610223610613366004613d63565b61185e565b34801561062457600080fd5b50610223610633366004613f71565b6118d9565b34801561064457600080fd5b50610672610653366004613bc9565b6000908152609d6020526040902060080154600160a81b900460ff1690565b6040516102539190613fc6565b34801561068b57600080fd5b5061028761069a366004613fd9565b63f23a6e6160e01b95945050505050565b3480156106b757600080fd5b506102236106c6366004613d63565b61199c565b3480156106d757600080fd5b506102236106e6366004614042565b611a12565b3480156106f757600080fd5b506102236107063660046140cb565b611aa3565b60008160016000828152609d6020526040902060080154600160a81b900460ff16600281111561073d5761073d613c04565b146107635760405162461bcd60e51b815260040161075a90614120565b60405180910390fd5b6000838152609d60205260409020600801546001600160a01b031661079b576000838152609d602052604090206004015491506107ad565b6000838152609d602052604090205491505b50919050565b600080828152609d6020526040902060080154600160a81b900460ff1660028111156107e1576107e1613c04565b036108245760405162461bcd60e51b815260206004820152601360248201527215d85e51d85d194e88139bdd08131a5cdd1959606a1b604482015260640161075a565b6000818152609d60205260409020600601546001600160a01b0316331461085d5760405162461bcd60e51b815260040161075a90614157565b60016000828152609d6020526040902060080154600160a81b900460ff16600281111561088c5761088c613c04565b036108ef576000818152609d60205260409020600801546001600160a01b0316156108ef5760405162461bcd60e51b815260206004820152601360248201527215d85e51d85d194e88109a591cc8119bdd5b99606a1b604482015260640161075a565b6108f881611e43565b6000908152609d602052604081208181556001810182905560028101829055600381018290556004810182905560058101919091556006810180546001600160a01b0319908116909155600782018054909116905560080180546001600160c01b0319169055565b8060026000828152609d6020526040902060080154600160a81b900460ff16600281111561099057610990613c04565b146109dd5760405162461bcd60e51b815260206004820152601b60248201527f576179476174653a204e6f74206f6e2046697865642050726963650000000000604482015260640161075a565b600080838152609d6020526040902060080154600160b01b900460ff166001811115610a0b57610a0b613c04565b14610a515760405162461bcd60e51b81526020600482015260166024820152752bb0bca3b0ba329d1024b73b30b634b2102a37b5b2b760511b604482015260640161075a565b610a5c348484612032565b505050565b610a696139e9565b6000828152609d602090815260409182902082516101a08101845281548152600182015492810192909252600280820154938301939093526003810154606083015260048101546080830152600581015460a083015260068101546001600160a01b0390811660c08401526007820154811660e0840152600882015490811661010084015291929091610120840191600160a01b90910460ff1690811115610b1357610b13613c04565b6002811115610b2457610b24613c04565b81526020016008820160159054906101000a900460ff166002811115610b4c57610b4c613c04565b6002811115610b5d57610b5d613c04565b81526020016008820160169054906101000a900460ff166001811115610b8557610b85613c04565b6001811115610b9657610b96613c04565b81526020016008820160179054906101000a900460ff166002811115610bbe57610bbe613c04565b6002811115610bcf57610bcf613c04565b90525092915050565b610be061213c565b6001600160a01b03821615801590610c0057506001600160a01b03811615155b610c475760405162461bcd60e51b8152602060048201526018602482015277576179476174653a20496e76616c6964204164647265737360401b604482015260640161075a565b6040516301ffc9a760e01b81526001600160a01b038316906301ffc9a790610c7a906380ac58cd60e01b90600401613bb4565b602060405180830381865afa158015610c97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbb919061418e565b610d075760405162461bcd60e51b815260206004820152601b60248201527f576179476174653732313a20496e76616c696420416464726573730000000000604482015260640161075a565b6040516301ffc9a760e01b81526001600160a01b038216906301ffc9a790610d3a90636cdb3d1360e11b90600401613bb4565b602060405180830381865afa158015610d57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7b919061418e565b610dc75760405162461bcd60e51b815260206004820152601c60248201527f57617947617465313135353a20496e76616c6964204164647265737300000000604482015260640161075a565b609f80546001600160a01b039384166001600160a01b03199182161790915560a08054929093169116179055565b610dfd61213c565b6001600160a01b038116610e455760405162461bcd60e51b815260206004820152600f60248201526e1859191c995cdcc81a5b9d985b1a59608a1b604482015260640161075a565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b610e6f61213c565b609891909155609955565b60008085858486604051602001610e9494939291906141b0565b60408051601f1981840301815291905280516020909101209050600080828152609d6020526040902060080154600160a81b900460ff166002811115610edc57610edc613c04565b03610f205760405162461bcd60e51b8152602060048201526014602482015273576179476174653a204e6f74206f6e2053616c6560601b604482015260640161075a565b95945050505050565b610f3161213c565b610f3b6000612196565b565b8060026000828152609d6020526040902060080154600160a81b900460ff166002811115610f6d57610f6d613c04565b14610fba5760405162461bcd60e51b815260206004820152601b60248201527f576179476174653a204e6f74206f6e2046697865642050726963650000000000604482015260640161075a565b60016000838152609d6020526040902060080154600160b01b900460ff166001811115610fe957610fe9613c04565b1461102f5760405162461bcd60e51b81526020600482015260166024820152752bb0bca3b0ba329d1024b73b30b634b2102a37b5b2b760511b604482015260640161075a565b8361103861161b565b10156110565760405162461bcd60e51b815260040161075a90614157565b611061848484612032565b50505050565b8060016000828152609d6020526040902060080154600160a81b900460ff16600281111561109757611097613c04565b146110b45760405162461bcd60e51b815260040161075a90614120565b600080838152609d6020526040902060080154600160b01b900460ff1660018111156110e2576110e2613c04565b1461112f5760405162461bcd60e51b815260206004820152601b60248201527f576179476174653a204e6f742061204e617469766520546f6b656e0000000000604482015260640161075a565b600061113a8361070b565b9050808411801561114a57508334145b6111665760405162461bcd60e51b815260040161075a906141e2565b61117084846121e8565b6000838152609d602090815260409182902060030154825187815242928101929092528183015233606082015290517f379fe8bc550443c6867a021184bb0e5a961f3fcd271160873847410c7bdd0e289181900360800190a150505050565b8060016000828152609d6020526040902060080154600160a81b900460ff1660028111156111ff576111ff613c04565b1461121c5760405162461bcd60e51b815260040161075a90614120565b60016000838152609d6020526040902060080154600160b01b900460ff16600181111561124b5761124b613c04565b146112915760405162461bcd60e51b81526020600482015260166024820152752bb0bca3b0ba329d1024b73b30b63ab2102a37b5b2b760511b604482015260640161075a565b8261129a61161b565b10156112b85760405162461bcd60e51b815260040161075a90614157565b60006112c38361070b565b90508084116112e45760405162461bcd60e51b815260040161075a906141e2565b61106184846121e8565b600054610100900460ff161580801561130e5750600054600160ff909116105b806113285750303b158015611328575060005460ff166001145b61138b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161075a565b6000805460ff1916600117905580156113ae576000805461ff0019166101001790555b6113b66123f0565b6113be61241f565b8015611404576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b609e546001600160a01b03161580159061142b5750609f546001600160a01b031615155b8015611441575060a0546001600160a01b031615155b61145d5760405162461bcd60e51b815260040161075a9061422a565b61146885848361244e565b60008582334260405160200161148194939291906141b0565b6040516020818303038152906040528051906020012090506114a03390565b6000828152609d602052604090206006810180546001600160a01b03199081166001600160a01b039485161790915560078201805490911692851692909217909155600381018790556004810186905560058101859055600801805460ff60a81b1916600160a91b17905582600181111561151d5761151d613c04565b6000828152609d60205260409020600801805460ff60b01b1916600160b01b83600181111561154e5761154e613c04565b0217905550609f546001600160a01b038381169116148061157c575060a0546001600160a01b038381169116145b1561158c5761158c8683836126bd565b6115978287836128dd565b7fc5151082c13d8a8cc547bddbc104b30d2cfc53fd20ef5528ee1f6ec0b3a69fa533824289888a609760149054906101000a900460ff166040516115e1979695949392919061426d565b60405180910390a1505050505050565b6115f961213c565b609b80546001600160a01b0319166001600160a01b0392909216919091179055565b609754604051636eb1769f60e11b81523360048201523060248201526000916001600160a01b03169063dd62ed3e906044015b602060405180830381865afa15801561166b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168f91906142bb565b905090565b6000818152609d602052604081206002015442116116f45760405162461bcd60e51b815260206004820152601e60248201527f576179476174653a2041756374696f6e2054696d65204e6f74204f7665720000604482015260640161075a565b6000828152609d60205260409020600801546001600160a01b03161561173357506000908152609d60205260409020600801546001600160a01b031690565b506000919050565b919050565b61174861213c565b609a80546001600160a01b0319166001600160a01b0392909216919091179055565b6097546040516370a0823160e01b81523360048201526000916001600160a01b0316906370a082319060240161164e565b60006117a561213c565b6097546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240161164e565b6000818152609d6020526117e882611694565b90506001600160a01b03811633146118515760405162461bcd60e51b815260206004820152602660248201527f576179476174653a204f6e6c792048696768657374204269646465722063616e60448201526520436c61696d60d01b606482015260840161075a565b61185a82612c6f565b5050565b61186661213c565b6001600160a01b0381166118b75760405162461bcd60e51b8152602060048201526018602482015277576179476174653a20496e76616c6964204164647265737360401b604482015260640161075a565b609e80546001600160a01b0319166001600160a01b0392909216919091179055565b6118e161213c565b60a286905560a385905560a484905560a58390556040516323c8a85b60e01b8152600481018390526001600160a01b038216906323c8a85b90602401600060405180830381600087803b15801561193757600080fd5b505af115801561194b573d6000803e3d6000fd5b5050604080518981526020810189905290810187905260608101869052608081018590527f6531c3298162c6ec09641a3acda3dc02c01e5e8c5f7f6aa38f498be6254aef6a925060a00190506115e1565b6119a461213c565b6001600160a01b038116611a095760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161075a565b61140481612196565b609e546001600160a01b03163314611a655760405162461bcd60e51b815260206004820152601660248201527515d85e51d85d194e881058d8d95cdcc811195b9a595960521b604482015260640161075a565b60005b81811015610a5c57611a91838383818110611a8557611a856142d4565b90506020020135612c6f565b80611a9b81614300565b915050611a68565b609e546001600160a01b031615801590611ac75750609f546001600160a01b031615155b8015611add575060a0546001600160a01b031615155b611af95760405162461bcd60e51b815260040161075a9061422a565b8363ffffffff168563ffffffff1614158015611b1a57508363ffffffff1642105b8015611b3157508363ffffffff168563ffffffff16105b611b735760405162461bcd60e51b81526020600482015260136024820152722bb0bca3b0ba329d102a34b6b29022b93937b960691b604482015260640161075a565b611b808562015180614319565b63ffffffff168463ffffffff1611611bda5760405162461bcd60e51b815260206004820152601b60248201527f576179476174653a204d696e696d756d2074696d65206c696d69740000000000604482015260640161075a565b6040516301ffc9a760e01b81526001600160a01b038216906301ffc9a790611c0d90636cdb3d1360e11b90600401613bb4565b602060405180830381865afa158015611c2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c4e919061418e565b15611ca65760405162461bcd60e51b815260206004820152602260248201527f574159474154453a20313135352041756374696f6e7320556e737570706f7274604482015261195960f21b606482015260840161075a565b611cb28660018361244e565b600086823342604051602001611ccb94939291906141b0565b604051602081830303815290604052805190602001209050611cea3390565b6000828152609d602052604090206006810180546001600160a01b03199081166001600160a01b03948516179091556007820180549091169285169290921790915563ffffffff87811660018084019190915590871660028301556003820189905560048201869055600582018190556008909101805460ff60a81b1916600160a81b830217905550826001811115611d8557611d85613c04565b6000828152609d60205260409020600801805460ff60b01b1916600160b01b836001811115611db657611db6613c04565b0217905550609f546001600160a01b0390811690831603611ddc57611ddc8783836126bd565b611de78288836128dd565b7ff31809c46af81ad4bbace3d01f3b714d370d5313f411b865c622efcc05b7e9993382428a600189609760149054906101000a900460ff16604051611e32979695949392919061433d565b60405180910390a150505050505050565b611e4b612df9565b6000818152609d602052604090819020600781015460039091015491516301ffc9a760e01b81526001600160a01b03909116919082906301ffc9a790611e9c906380ac58cd60e01b90600401613bb4565b602060405180830381865afa158015611eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611edd919061418e565b15611f61576000838152609d602052604090819020600601549051632142170760e11b815283916001600160a01b03808416926342842e0e92611f2992309291169087906004016143c1565b600060405180830381600087803b158015611f4357600080fd5b505af1158015611f57573d6000803e3d6000fd5b5050505050611fe4565b6000838152609d60205260409081902060068101546005909101549151637921219560e11b815284926001600160a01b038085169363f242432a93611fb09330939092169188916004016143e5565b600060405180830381600087803b158015611fca57600080fd5b505af1158015611fde573d6000803e3d6000fd5b50505050505b7e38f3e47004950b890d9df255df5e1b6921cf589f4b44b2259df5009593666433604080516001600160a01b039092168252602082018490520160405180910390a150506114046001606555565b600061203e838561442a565b6000838152609d602052604090206004015490915081146120a15760405162461bcd60e51b815260206004820152601c60248201527f576179476174653a20496e73756666696369656e7420416d6f756e7400000000604482015260640161075a565b6000828152609d6020526040902060060154336001600160a01b039091160361210c5760405162461bcd60e51b815260206004820152601c60248201527f576179476174653a2043616e6e6f742053656c6620427579204e465400000000604482015260640161075a565b6000828152609d602052604090206007810154600390910154611061916001600160a01b03169033878787612e52565b6033546001600160a01b03163314610f3b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161075a565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6121f0612df9565b6000818152609d6020526040902060060154336001600160a01b039091160361225b5760405162461bcd60e51b815260206004820152601860248201527f576179476174653a2043616e6e6f742073656c66204269640000000000000000604482015260640161075a565b6000818152609d602052604090206002015442106122bb5760405162461bcd60e51b815260206004820152601a60248201527f576179476174653a2041756374696f6e2054696d65204f766572000000000000604482015260640161075a565b6000818152609d60205260409020600801546001600160a01b031615612327576000818152609d6020526040902080546008909101546001600160a01b03168184116123195760405162461bcd60e51b815260040161075a906141e2565b612324838383613510565b50505b6000818152609d6020526040902082815560080180546001600160a01b031916331790819055600190600160b01b900460ff168181111561236a5761236a613c04565b036123e6576097546001600160a01b03166323b872dd3330856040518463ffffffff1660e01b81526004016123a1939291906143c1565b6020604051808303816000875af11580156123c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e4919061418e565b505b61185a6001606555565b600054610100900460ff166124175760405162461bcd60e51b815260040161075a9061444c565b610f3b6135f1565b600054610100900460ff166124465760405162461bcd60e51b815260040161075a9061444c565b610f3b6123f0565b6040516301ffc9a760e01b81526001600160a01b038216906301ffc9a790612481906380ac58cd60e01b90600401613bb4565b602060405180830381865afa15801561249e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c2919061418e565b156125e35780600183146125275760405162461bcd60e51b815260206004820152602660248201527f576179476174653a2045524337323120646f65736e277420737570706f727420604482015265636f7069657360d01b606482015260840161075a565b336040516331a9108f60e11b8152600481018690526001600160a01b0391821691831690636352211e90602401602060405180830381865afa158015612571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125959190614497565b6001600160a01b0316146110615760405162461bcd60e51b81526020600482015260156024820152742bb0bca3b0ba329d102737ba1030b71027bbb732b960591b604482015260640161075a565b80826001600160a01b03821662fdd58e336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101889052604401602060405180830381865afa15801561263f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266391906142bb565b101580156126715750600083115b6110615760405162461bcd60e51b815260206004820152601a60248201527f455243313135353a204e6f7420656e6f75676820636f70696573000000000000604482015260640161075a565b604051633616147960e01b8152600481018490526001600160a01b03831690633616147990602401602060405180830381865afa158015612702573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061272691906142bb565b600281111561273757612737613c04565b6097805460ff60a01b1916600160a01b83600281111561275957612759613c04565b02179055506097546000828152609d60205260409020600801805460ff600160a01b93849004169260ff60a01b199091169083600281111561279d5761279d613c04565b0217905550609f546001600160a01b0390811690831603610a5c57604051634abc058d60e11b8152600481018490526001600160a01b038316906395780b1a90602401602060405180830381865afa1580156127fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612821919061418e565b15612849576000818152609d60205260409020600801805460ff60b81b1916600160b91b1790555b60405163236602f360e11b8152600481018490526001600160a01b038316906346cc05e690602401602060405180830381865afa15801561288e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b2919061418e565b15610a5c576000908152609d60205260409020600801805460ff60b81b1916600160b81b1790555050565b6128e5612df9565b6040516301ffc9a760e01b81526001600160a01b038416906301ffc9a790612918906380ac58cd60e01b90600401613bb4565b602060405180830381865afa158015612935573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612959919061418e565b15612b05576040516331a9108f60e11b81526004810183905283906001600160a01b038216906342842e0e908290636352211e90602401602060405180830381865afa1580156129ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d19190614497565b30866040518463ffffffff1660e01b81526004016129f1939291906143c1565b600060405180830381600087803b158015612a0b57600080fd5b505af1158015612a1f573d6000803e3d6000fd5b50505050806001600160a01b031663095ea7b3612a393390565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101869052604401600060405180830381600087803b158015612a8157600080fd5b505af1158015612a95573d6000803e3d6000fd5b5050609e5460405163095ea7b360e01b81526001600160a01b03918216600482015260248101879052908416925063095ea7b39150604401600060405180830381600087803b158015612ae757600080fd5b505af1158015612afb573d6000803e3d6000fd5b5050505050612c65565b6000818152609d60205260409081902060068101546005909101549151637921219560e11b815285926001600160a01b038085169363f242432a93612b55939190921691309189916004016143e5565b600060405180830381600087803b158015612b6f57600080fd5b505af1158015612b83573d6000803e3d6000fd5b50505050806001600160a01b031663a22cb465612b9d3390565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260016024820152604401600060405180830381600087803b158015612be557600080fd5b505af1158015612bf9573d6000803e3d6000fd5b5050609e5460405163a22cb46560e01b81526001600160a01b03918216600482015260016024820152908416925063a22cb4659150604401600060405180830381600087803b158015612c4b57600080fd5b505af1158015612c5f573d6000803e3d6000fd5b50505050505b610a5c6001606555565b8060016000828152609d6020526040902060080154600160a81b900460ff166002811115612c9f57612c9f613c04565b14612cbc5760405162461bcd60e51b815260040161075a90614120565b6000612cc783611694565b90506001600160a01b03811615612d86576000612ce38461070b565b6000858152609d602052604090206007810154600390910154919250612d19916001600160a01b03909116908484600189612e52565b6000848152609d6020526040908190206005015490517f92ffae31901780890e35bdc724fedb7601577492b5d4e3df85f785de59d737ab91612d7891849186919283526001600160a01b03919091166020830152604082015260600190565b60405180910390a150612d8f565b612d8f83611e43565b50506000908152609d602052604081208181556001810182905560028101829055600381018290556004810182905560058101919091556006810180546001600160a01b0319908116909155600782018054909116905560080180546001600160c01b0319169055565b600260655403612e4b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161075a565b6002606555565b612e5a612df9565b60026000828152609d6020526040902060080154600160a81b900460ff166002811115612e8957612e89613c04565b148015612ec2575060016000828152609d6020526040902060080154600160b01b900460ff166001811115612ec057612ec0613c04565b145b15612f3e576097546001600160a01b03166323b872dd3330866040518463ffffffff1660e01b8152600401612ef9939291906143c1565b6020604051808303816000875af1158015612f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f3c919061418e565b505b600080612f4a88613621565b15612fc45760405163152a902d60e11b815260048101889052602481018690526001600160a01b03891690632a55205a906044016040805180830381865afa158015612f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fbe91906144b4565b90925090505b60026000848152609d6020526040902060080154600160b81b900460ff166002811115612ff357612ff3613c04565b03613028576000838152609d602052604090206006015460a2546130289185918891859187916001600160a01b0316906136a1565b60016000848152609d6020526040902060080154600160b81b900460ff16600281111561305757613057613c04565b0361308c576000838152609d602052604090206006015460a55461308c9185918891859187916001600160a01b0316906136a1565b600080848152609d6020526040902060080154600160b81b900460ff1660028111156130ba576130ba613c04565b036131875760016000848152609d6020526040902060080154600160a01b900460ff1660028111156130ee576130ee613c04565b03613123576000838152609d602052604090206006015460a3546131239185918891859187916001600160a01b0316906136a1565b60026000848152609d6020526040902060080154600160a01b900460ff16600281111561315257613152613c04565b03613187576000838152609d602052604090206006015460a4546131879185918891859187916001600160a01b0316906136a1565b6040516301ffc9a760e01b81526001600160a01b038916906301ffc9a7906131ba906380ac58cd60e01b90600401613bb4565b602060405180830381865afa1580156131d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131fb919061418e565b156133205787600185146132515760405162461bcd60e51b815260206004820152601f60248201527f4552433732313a20446f6573204e6f7420537570706f727420436f7069657300604482015260640161075a565b604051632142170760e11b81526001600160a01b038216906342842e0e906132819030908b908d906004016143c1565b600060405180830381600087803b15801561329b57600080fd5b505af11580156132af573d6000803e3d6000fd5b5050506000858152609d602052604081208181556001810182905560028101829055600381018290556004810182905560058101919091556006810180546001600160a01b0319908116909155600782018054909116905560080180546001600160c01b0319169055506134fc9050565b6000838152609d602052604090206005015488908511156133835760405162461bcd60e51b815260206004820152601d60248201527f576179476174653a20436f70696573206e6f7420417661696c61626c65000000604482015260640161075a565b6000848152609d60205260409020600401546133a09086906144e2565b86146133ee5760405162461bcd60e51b815260206004820152601c60248201527f576179476174653a20496e73756666696369656e7420436f7069657300000000604482015260640161075a565b604051637921219560e11b81526001600160a01b0382169063f242432a906134209030908b908d908b906004016143e5565b600060405180830381600087803b15801561343a57600080fd5b505af115801561344e573d6000803e3d6000fd5b5050506000858152609d60205260408120600501549091506134719087906144f9565b90508015613492576000858152609d602052604090206005018190556134f9565b6000858152609d602052604081208181556001810182905560028101829055600381018290556004810182905560058101919091556006810180546001600160a01b0319908116909155600782018054909116905560080180546001600160c01b03191690555b50505b50506135086001606555565b505050505050565b60016000848152609d6020526040902060080154600160b01b900460ff16600181111561353f5761353f613c04565b1461357a576040516001600160a01b0382169083156108fc029084906000818181858888f19350505050158015611061573d6000803e3d6000fd5b60975460405163a9059cbb60e01b81526001600160a01b038381166004830152602482018590529091169063a9059cbb906044016020604051808303816000875af11580156135cd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611061919061418e565b600054610100900460ff166136185760405162461bcd60e51b815260040161075a9061444c565b610f3b33612196565b6040516301ffc9a760e01b815260009081906001600160a01b038416906301ffc9a7906136599063152a902d60e11b90600401613bb4565b602060405180830381865afa158015613676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061369a919061418e565b9392505050565b8460006136af888385613749565b905060006136bd8989613777565b90506136ca898888613510565b866136d5828461450c565b6136df919061450c565b6136e990846144f9565b92506136f6898487613510565b6040805183815260208101839052908101889052606081018490527f6795f3f57fc0310c79c5f5a472ef61a8b671f0e27d32244f6029f356f7a85fd69060800160405180910390a1505050505050505050565b6000806103e861375984866144e2565b613763919061442a565b905061376f858261380a565b949350505050565b60008060016000858152609d6020526040902060080154600160a01b900460ff1660028111156137a9576137a9613c04565b036137da576103e8609854846137bf91906144e2565b6137c9919061442a565b90506137d584826138f1565b613801565b6103e8609954846137eb91906144e2565b6137f5919061442a565b905061380184826138f1565b90505b92915050565b60016000838152609d6020526040902060080154600160b01b900460ff16600181111561383957613839613c04565b1461387857609b546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610a5c573d6000803e3d6000fd5b609754609a5460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303816000875af11580156138cd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5c919061418e565b609a546001600160a01b03166139685760405162461bcd60e51b815260206004820152603660248201527f5761794761746520526f79616c746965733a205365742041697264726f7020466044820152756565204469737472696275746f72204164647265737360501b606482015260840161075a565b60016000838152609d6020526040902060080154600160b01b900460ff16600181111561399757613997613c04565b1461387857609a546040516000916001600160a01b03169083908381818185875af1925050503d8060008114613508576040519150601f19603f3d011682016040523d82523d6000602084013e613508565b604051806101a0016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006002811115613a6257613a62613c04565b815260200160008152602001600081526020016000905290565b6001600160a01b038116811461140457600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613ad057613ad0613a91565b604052919050565b600082601f830112613ae957600080fd5b813567ffffffffffffffff811115613b0357613b03613a91565b613b16601f8201601f1916602001613aa7565b818152846020838601011115613b2b57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215613b5e57600080fd5b8435613b6981613a7c565b93506020850135613b7981613a7c565b925060408501359150606085013567ffffffffffffffff811115613b9c57600080fd5b613ba887828801613ad8565b91505092959194509250565b6001600160e01b031991909116815260200190565b600060208284031215613bdb57600080fd5b5035919050565b60008060408385031215613bf557600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b6003811061140457611404613c04565b613c3381613c1a565b9052565b60028110613c3357613c33613c04565b60006101a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c0830151613ca060c08401826001600160a01b03169052565b5060e0830151613cbb60e08401826001600160a01b03169052565b50610100838101516001600160a01b03169083015261012080840151613ce382850182613c2a565b505061014080840151613cf882850182613c2a565b505061016080840151613d0d82850182613c37565b505061018080840151613d2282850182613c2a565b505092915050565b60008060408385031215613d3d57600080fd5b8235613d4881613a7c565b91506020830135613d5881613a7c565b809150509250929050565b600060208284031215613d7557600080fd5b813561380181613a7c565b60008060008060808587031215613d9657600080fd5b843593506020850135613da881613a7c565b9250604085013591506060850135613dbf81613a7c565b939692955090935050565b600080600060608486031215613ddf57600080fd5b505081359360208301359350604090920135919050565b600080600080600060a08688031215613e0e57600080fd5b853594506020860135935060408601359250606086013591506080860135613e3581613a7c565b809150509295509295909350565b600082601f830112613e5457600080fd5b8135602067ffffffffffffffff821115613e7057613e70613a91565b8160051b613e7f828201613aa7565b9283528481018201928281019087851115613e9957600080fd5b83870192505b84831015613eb857823582529183019190830190613e9f565b979650505050505050565b600080600080600060a08688031215613edb57600080fd5b8535613ee681613a7c565b94506020860135613ef681613a7c565b9350604086013567ffffffffffffffff80821115613f1357600080fd5b613f1f89838a01613e43565b94506060880135915080821115613f3557600080fd5b613f4189838a01613e43565b93506080880135915080821115613f5757600080fd5b50613f6488828901613ad8565b9150509295509295909350565b60008060008060008060c08789031215613f8a57600080fd5b863595506020870135945060408701359350606087013592506080870135915060a0870135613fb881613a7c565b809150509295509295509295565b60208101613fd383613c1a565b91905290565b600080600080600060a08688031215613ff157600080fd5b8535613ffc81613a7c565b9450602086013561400c81613a7c565b93506040860135925060608601359150608086013567ffffffffffffffff81111561403657600080fd5b613f6488828901613ad8565b6000806020838503121561405557600080fd5b823567ffffffffffffffff8082111561406d57600080fd5b818501915085601f83011261408157600080fd5b81358181111561409057600080fd5b8660208260051b85010111156140a557600080fd5b60209290920196919550909350505050565b803563ffffffff8116811461173b57600080fd5b60008060008060008060c087890312156140e457600080fd5b863595506140f4602088016140b7565b9450614102604088016140b7565b9350606087013592506080870135915060a0870135613fb881613a7c565b60208082526017908201527f576179476174653a204e6f74206f6e2041756374696f6e000000000000000000604082015260600190565b6020808252601f908201527f576179476174653a20496e73756666696369656e7420416c6c6f77616e636500604082015260600190565b6000602082840312156141a057600080fd5b8151801515811461380157600080fd5b9384526bffffffffffffffffffffffff19606093841b811660208601529190921b166034830152604882015260680190565b60208082526028908201527f576179476174653a2042696420416d6f756e74203c204d696e696d756d2042696040820152671908105b5bdd5b9d60c21b606082015260800190565b60208082526023908201527f576179476174653a20506c6174666f726d20416464726573736573204e6f742060408201526214d95d60ea1b606082015260800190565b6001600160a01b03881681526020810187905260408101869052606081018590526080810184905260a0810183905260e081016142a983613c1a565b8260c083015298975050505050505050565b6000602082840312156142cd57600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201614312576143126142ea565b5060010190565b63ffffffff818116838216019080821115614336576143366142ea565b5092915050565b600061010060018060a01b038a1683528860208401528760408401528660608401528560808401528460a084015261437484613c1a565b8360c08401528060e0840152602081840152507f416363657074696e67204269647320666f722054696d65642041756374696f6e6101208301526101408201905098975050505050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a060808201819052600490820152630307830360e41b60c082015260e00190565b60008261444757634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000602082840312156144a957600080fd5b815161380181613a7c565b600080604083850312156144c757600080fd5b82516144d281613a7c565b6020939093015192949293505050565b8082028115828204841417613804576138046142ea565b81810381811115613804576138046142ea565b80820180821115613804576138046142ea56fea2646970667358221220b308872b007be89cf85dff32a2eae67b191166ac903d747d4f685bfd9e0e587064736f6c63430008110033
Deployed Bytecode
0x60806040526004361061021c5760003560e01c8063837629dc11610122578063cad62d4a116100a5578063f124667a1161006c578063f124667a14610638578063f23a6e611461067f578063f2fde38b146106ab578063f5066ba4146106cb578063ffc60089146106eb57005b8063cad62d4a146105ae578063d4196303146105c3578063e0507638146105d8578063e196ee1f146105f8578063e31beb7a1461061857005b8063b337169f116100e9578063b337169f14610519578063b9cce51814610539578063bc197c811461054f578063c3b3e0b01461057b578063c96bf8621461059957005b8063837629dc146104865780638c404e4d146104a65780638da5cb5b146104c6578063973e9b8b146104e4578063a1e09a3e146104f957005b806354c9ea62116101aa578063715018a611610171578063715018a6146104095780637193fd891461041e57806374cebc581461043e57806375aa9f0a146104515780638129fc1c1461047157005b806354c9ea621461035c5780635897b958146103895780635a1fc12c146103a95780635b135375146103c9578063660bcd14146103e957005b80633816db01116101ee5780633816db01146102e05780633ac311e7146102f65780633b7132f7146103145780633df96a441461033457806347f1e54a1461034957005b80630837f07914610225578063150b7a021461025c5780631b9a8d3c14610294578063201bbdbe146102b257005b3661022357005b005b34801561023157600080fd5b50609f546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561026857600080fd5b50610287610277366004613b48565b630a85bd0160e11b949350505050565b6040516102539190613bb4565b3480156102a057600080fd5b50609b546001600160a01b031661023f565b3480156102be57600080fd5b506102d26102cd366004613bc9565b61070b565b604051908152602001610253565b3480156102ec57600080fd5b506102d260985481565b34801561030257600080fd5b5060a0546001600160a01b031661023f565b34801561032057600080fd5b5061022361032f366004613bc9565b6107b3565b34801561034057600080fd5b5060a3546102d2565b610223610357366004613be2565b610960565b34801561036857600080fd5b5061037c610377366004613bc9565b610a61565b6040516102539190613c47565b34801561039557600080fd5b506102236103a4366004613d2a565b610bd8565b3480156103b557600080fd5b506102236103c4366004613d63565b610df5565b3480156103d557600080fd5b506102236103e4366004613be2565b610e67565b3480156103f557600080fd5b506102d2610404366004613d80565b610e7a565b34801561041557600080fd5b50610223610f29565b34801561042a57600080fd5b50610223610439366004613dca565b610f3d565b61022361044c366004613be2565b611067565b34801561045d57600080fd5b5061022361046c366004613be2565b6111cf565b34801561047d57600080fd5b506102236112ee565b34801561049257600080fd5b506102236104a1366004613df6565b611407565b3480156104b257600080fd5b506102236104c1366004613d63565b6115f1565b3480156104d257600080fd5b506033546001600160a01b031661023f565b3480156104f057600080fd5b506102d261161b565b34801561050557600080fd5b5061023f610514366004613bc9565b611694565b34801561052557600080fd5b50610223610534366004613d63565b611740565b34801561054557600080fd5b506102d260995481565b34801561055b57600080fd5b5061028761056a366004613ec3565b63bc197c8160e01b95945050505050565b34801561058757600080fd5b506097546001600160a01b031661023f565b3480156105a557600080fd5b5060a4546102d2565b3480156105ba57600080fd5b506102d261176a565b3480156105cf57600080fd5b506102d261179b565b3480156105e457600080fd5b506102236105f3366004613bc9565b6117d5565b34801561060457600080fd5b50610223610613366004613d63565b61185e565b34801561062457600080fd5b50610223610633366004613f71565b6118d9565b34801561064457600080fd5b50610672610653366004613bc9565b6000908152609d6020526040902060080154600160a81b900460ff1690565b6040516102539190613fc6565b34801561068b57600080fd5b5061028761069a366004613fd9565b63f23a6e6160e01b95945050505050565b3480156106b757600080fd5b506102236106c6366004613d63565b61199c565b3480156106d757600080fd5b506102236106e6366004614042565b611a12565b3480156106f757600080fd5b506102236107063660046140cb565b611aa3565b60008160016000828152609d6020526040902060080154600160a81b900460ff16600281111561073d5761073d613c04565b146107635760405162461bcd60e51b815260040161075a90614120565b60405180910390fd5b6000838152609d60205260409020600801546001600160a01b031661079b576000838152609d602052604090206004015491506107ad565b6000838152609d602052604090205491505b50919050565b600080828152609d6020526040902060080154600160a81b900460ff1660028111156107e1576107e1613c04565b036108245760405162461bcd60e51b815260206004820152601360248201527215d85e51d85d194e88139bdd08131a5cdd1959606a1b604482015260640161075a565b6000818152609d60205260409020600601546001600160a01b0316331461085d5760405162461bcd60e51b815260040161075a90614157565b60016000828152609d6020526040902060080154600160a81b900460ff16600281111561088c5761088c613c04565b036108ef576000818152609d60205260409020600801546001600160a01b0316156108ef5760405162461bcd60e51b815260206004820152601360248201527215d85e51d85d194e88109a591cc8119bdd5b99606a1b604482015260640161075a565b6108f881611e43565b6000908152609d602052604081208181556001810182905560028101829055600381018290556004810182905560058101919091556006810180546001600160a01b0319908116909155600782018054909116905560080180546001600160c01b0319169055565b8060026000828152609d6020526040902060080154600160a81b900460ff16600281111561099057610990613c04565b146109dd5760405162461bcd60e51b815260206004820152601b60248201527f576179476174653a204e6f74206f6e2046697865642050726963650000000000604482015260640161075a565b600080838152609d6020526040902060080154600160b01b900460ff166001811115610a0b57610a0b613c04565b14610a515760405162461bcd60e51b81526020600482015260166024820152752bb0bca3b0ba329d1024b73b30b634b2102a37b5b2b760511b604482015260640161075a565b610a5c348484612032565b505050565b610a696139e9565b6000828152609d602090815260409182902082516101a08101845281548152600182015492810192909252600280820154938301939093526003810154606083015260048101546080830152600581015460a083015260068101546001600160a01b0390811660c08401526007820154811660e0840152600882015490811661010084015291929091610120840191600160a01b90910460ff1690811115610b1357610b13613c04565b6002811115610b2457610b24613c04565b81526020016008820160159054906101000a900460ff166002811115610b4c57610b4c613c04565b6002811115610b5d57610b5d613c04565b81526020016008820160169054906101000a900460ff166001811115610b8557610b85613c04565b6001811115610b9657610b96613c04565b81526020016008820160179054906101000a900460ff166002811115610bbe57610bbe613c04565b6002811115610bcf57610bcf613c04565b90525092915050565b610be061213c565b6001600160a01b03821615801590610c0057506001600160a01b03811615155b610c475760405162461bcd60e51b8152602060048201526018602482015277576179476174653a20496e76616c6964204164647265737360401b604482015260640161075a565b6040516301ffc9a760e01b81526001600160a01b038316906301ffc9a790610c7a906380ac58cd60e01b90600401613bb4565b602060405180830381865afa158015610c97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbb919061418e565b610d075760405162461bcd60e51b815260206004820152601b60248201527f576179476174653732313a20496e76616c696420416464726573730000000000604482015260640161075a565b6040516301ffc9a760e01b81526001600160a01b038216906301ffc9a790610d3a90636cdb3d1360e11b90600401613bb4565b602060405180830381865afa158015610d57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7b919061418e565b610dc75760405162461bcd60e51b815260206004820152601c60248201527f57617947617465313135353a20496e76616c6964204164647265737300000000604482015260640161075a565b609f80546001600160a01b039384166001600160a01b03199182161790915560a08054929093169116179055565b610dfd61213c565b6001600160a01b038116610e455760405162461bcd60e51b815260206004820152600f60248201526e1859191c995cdcc81a5b9d985b1a59608a1b604482015260640161075a565b609780546001600160a01b0319166001600160a01b0392909216919091179055565b610e6f61213c565b609891909155609955565b60008085858486604051602001610e9494939291906141b0565b60408051601f1981840301815291905280516020909101209050600080828152609d6020526040902060080154600160a81b900460ff166002811115610edc57610edc613c04565b03610f205760405162461bcd60e51b8152602060048201526014602482015273576179476174653a204e6f74206f6e2053616c6560601b604482015260640161075a565b95945050505050565b610f3161213c565b610f3b6000612196565b565b8060026000828152609d6020526040902060080154600160a81b900460ff166002811115610f6d57610f6d613c04565b14610fba5760405162461bcd60e51b815260206004820152601b60248201527f576179476174653a204e6f74206f6e2046697865642050726963650000000000604482015260640161075a565b60016000838152609d6020526040902060080154600160b01b900460ff166001811115610fe957610fe9613c04565b1461102f5760405162461bcd60e51b81526020600482015260166024820152752bb0bca3b0ba329d1024b73b30b634b2102a37b5b2b760511b604482015260640161075a565b8361103861161b565b10156110565760405162461bcd60e51b815260040161075a90614157565b611061848484612032565b50505050565b8060016000828152609d6020526040902060080154600160a81b900460ff16600281111561109757611097613c04565b146110b45760405162461bcd60e51b815260040161075a90614120565b600080838152609d6020526040902060080154600160b01b900460ff1660018111156110e2576110e2613c04565b1461112f5760405162461bcd60e51b815260206004820152601b60248201527f576179476174653a204e6f742061204e617469766520546f6b656e0000000000604482015260640161075a565b600061113a8361070b565b9050808411801561114a57508334145b6111665760405162461bcd60e51b815260040161075a906141e2565b61117084846121e8565b6000838152609d602090815260409182902060030154825187815242928101929092528183015233606082015290517f379fe8bc550443c6867a021184bb0e5a961f3fcd271160873847410c7bdd0e289181900360800190a150505050565b8060016000828152609d6020526040902060080154600160a81b900460ff1660028111156111ff576111ff613c04565b1461121c5760405162461bcd60e51b815260040161075a90614120565b60016000838152609d6020526040902060080154600160b01b900460ff16600181111561124b5761124b613c04565b146112915760405162461bcd60e51b81526020600482015260166024820152752bb0bca3b0ba329d1024b73b30b63ab2102a37b5b2b760511b604482015260640161075a565b8261129a61161b565b10156112b85760405162461bcd60e51b815260040161075a90614157565b60006112c38361070b565b90508084116112e45760405162461bcd60e51b815260040161075a906141e2565b61106184846121e8565b600054610100900460ff161580801561130e5750600054600160ff909116105b806113285750303b158015611328575060005460ff166001145b61138b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161075a565b6000805460ff1916600117905580156113ae576000805461ff0019166101001790555b6113b66123f0565b6113be61241f565b8015611404576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b609e546001600160a01b03161580159061142b5750609f546001600160a01b031615155b8015611441575060a0546001600160a01b031615155b61145d5760405162461bcd60e51b815260040161075a9061422a565b61146885848361244e565b60008582334260405160200161148194939291906141b0565b6040516020818303038152906040528051906020012090506114a03390565b6000828152609d602052604090206006810180546001600160a01b03199081166001600160a01b039485161790915560078201805490911692851692909217909155600381018790556004810186905560058101859055600801805460ff60a81b1916600160a91b17905582600181111561151d5761151d613c04565b6000828152609d60205260409020600801805460ff60b01b1916600160b01b83600181111561154e5761154e613c04565b0217905550609f546001600160a01b038381169116148061157c575060a0546001600160a01b038381169116145b1561158c5761158c8683836126bd565b6115978287836128dd565b7fc5151082c13d8a8cc547bddbc104b30d2cfc53fd20ef5528ee1f6ec0b3a69fa533824289888a609760149054906101000a900460ff166040516115e1979695949392919061426d565b60405180910390a1505050505050565b6115f961213c565b609b80546001600160a01b0319166001600160a01b0392909216919091179055565b609754604051636eb1769f60e11b81523360048201523060248201526000916001600160a01b03169063dd62ed3e906044015b602060405180830381865afa15801561166b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168f91906142bb565b905090565b6000818152609d602052604081206002015442116116f45760405162461bcd60e51b815260206004820152601e60248201527f576179476174653a2041756374696f6e2054696d65204e6f74204f7665720000604482015260640161075a565b6000828152609d60205260409020600801546001600160a01b03161561173357506000908152609d60205260409020600801546001600160a01b031690565b506000919050565b919050565b61174861213c565b609a80546001600160a01b0319166001600160a01b0392909216919091179055565b6097546040516370a0823160e01b81523360048201526000916001600160a01b0316906370a082319060240161164e565b60006117a561213c565b6097546040516370a0823160e01b81523060048201526001600160a01b03909116906370a082319060240161164e565b6000818152609d6020526117e882611694565b90506001600160a01b03811633146118515760405162461bcd60e51b815260206004820152602660248201527f576179476174653a204f6e6c792048696768657374204269646465722063616e60448201526520436c61696d60d01b606482015260840161075a565b61185a82612c6f565b5050565b61186661213c565b6001600160a01b0381166118b75760405162461bcd60e51b8152602060048201526018602482015277576179476174653a20496e76616c6964204164647265737360401b604482015260640161075a565b609e80546001600160a01b0319166001600160a01b0392909216919091179055565b6118e161213c565b60a286905560a385905560a484905560a58390556040516323c8a85b60e01b8152600481018390526001600160a01b038216906323c8a85b90602401600060405180830381600087803b15801561193757600080fd5b505af115801561194b573d6000803e3d6000fd5b5050604080518981526020810189905290810187905260608101869052608081018590527f6531c3298162c6ec09641a3acda3dc02c01e5e8c5f7f6aa38f498be6254aef6a925060a00190506115e1565b6119a461213c565b6001600160a01b038116611a095760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161075a565b61140481612196565b609e546001600160a01b03163314611a655760405162461bcd60e51b815260206004820152601660248201527515d85e51d85d194e881058d8d95cdcc811195b9a595960521b604482015260640161075a565b60005b81811015610a5c57611a91838383818110611a8557611a856142d4565b90506020020135612c6f565b80611a9b81614300565b915050611a68565b609e546001600160a01b031615801590611ac75750609f546001600160a01b031615155b8015611add575060a0546001600160a01b031615155b611af95760405162461bcd60e51b815260040161075a9061422a565b8363ffffffff168563ffffffff1614158015611b1a57508363ffffffff1642105b8015611b3157508363ffffffff168563ffffffff16105b611b735760405162461bcd60e51b81526020600482015260136024820152722bb0bca3b0ba329d102a34b6b29022b93937b960691b604482015260640161075a565b611b808562015180614319565b63ffffffff168463ffffffff1611611bda5760405162461bcd60e51b815260206004820152601b60248201527f576179476174653a204d696e696d756d2074696d65206c696d69740000000000604482015260640161075a565b6040516301ffc9a760e01b81526001600160a01b038216906301ffc9a790611c0d90636cdb3d1360e11b90600401613bb4565b602060405180830381865afa158015611c2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c4e919061418e565b15611ca65760405162461bcd60e51b815260206004820152602260248201527f574159474154453a20313135352041756374696f6e7320556e737570706f7274604482015261195960f21b606482015260840161075a565b611cb28660018361244e565b600086823342604051602001611ccb94939291906141b0565b604051602081830303815290604052805190602001209050611cea3390565b6000828152609d602052604090206006810180546001600160a01b03199081166001600160a01b03948516179091556007820180549091169285169290921790915563ffffffff87811660018084019190915590871660028301556003820189905560048201869055600582018190556008909101805460ff60a81b1916600160a81b830217905550826001811115611d8557611d85613c04565b6000828152609d60205260409020600801805460ff60b01b1916600160b01b836001811115611db657611db6613c04565b0217905550609f546001600160a01b0390811690831603611ddc57611ddc8783836126bd565b611de78288836128dd565b7ff31809c46af81ad4bbace3d01f3b714d370d5313f411b865c622efcc05b7e9993382428a600189609760149054906101000a900460ff16604051611e32979695949392919061433d565b60405180910390a150505050505050565b611e4b612df9565b6000818152609d602052604090819020600781015460039091015491516301ffc9a760e01b81526001600160a01b03909116919082906301ffc9a790611e9c906380ac58cd60e01b90600401613bb4565b602060405180830381865afa158015611eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611edd919061418e565b15611f61576000838152609d602052604090819020600601549051632142170760e11b815283916001600160a01b03808416926342842e0e92611f2992309291169087906004016143c1565b600060405180830381600087803b158015611f4357600080fd5b505af1158015611f57573d6000803e3d6000fd5b5050505050611fe4565b6000838152609d60205260409081902060068101546005909101549151637921219560e11b815284926001600160a01b038085169363f242432a93611fb09330939092169188916004016143e5565b600060405180830381600087803b158015611fca57600080fd5b505af1158015611fde573d6000803e3d6000fd5b50505050505b7e38f3e47004950b890d9df255df5e1b6921cf589f4b44b2259df5009593666433604080516001600160a01b039092168252602082018490520160405180910390a150506114046001606555565b600061203e838561442a565b6000838152609d602052604090206004015490915081146120a15760405162461bcd60e51b815260206004820152601c60248201527f576179476174653a20496e73756666696369656e7420416d6f756e7400000000604482015260640161075a565b6000828152609d6020526040902060060154336001600160a01b039091160361210c5760405162461bcd60e51b815260206004820152601c60248201527f576179476174653a2043616e6e6f742053656c6620427579204e465400000000604482015260640161075a565b6000828152609d602052604090206007810154600390910154611061916001600160a01b03169033878787612e52565b6033546001600160a01b03163314610f3b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161075a565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6121f0612df9565b6000818152609d6020526040902060060154336001600160a01b039091160361225b5760405162461bcd60e51b815260206004820152601860248201527f576179476174653a2043616e6e6f742073656c66204269640000000000000000604482015260640161075a565b6000818152609d602052604090206002015442106122bb5760405162461bcd60e51b815260206004820152601a60248201527f576179476174653a2041756374696f6e2054696d65204f766572000000000000604482015260640161075a565b6000818152609d60205260409020600801546001600160a01b031615612327576000818152609d6020526040902080546008909101546001600160a01b03168184116123195760405162461bcd60e51b815260040161075a906141e2565b612324838383613510565b50505b6000818152609d6020526040902082815560080180546001600160a01b031916331790819055600190600160b01b900460ff168181111561236a5761236a613c04565b036123e6576097546001600160a01b03166323b872dd3330856040518463ffffffff1660e01b81526004016123a1939291906143c1565b6020604051808303816000875af11580156123c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e4919061418e565b505b61185a6001606555565b600054610100900460ff166124175760405162461bcd60e51b815260040161075a9061444c565b610f3b6135f1565b600054610100900460ff166124465760405162461bcd60e51b815260040161075a9061444c565b610f3b6123f0565b6040516301ffc9a760e01b81526001600160a01b038216906301ffc9a790612481906380ac58cd60e01b90600401613bb4565b602060405180830381865afa15801561249e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c2919061418e565b156125e35780600183146125275760405162461bcd60e51b815260206004820152602660248201527f576179476174653a2045524337323120646f65736e277420737570706f727420604482015265636f7069657360d01b606482015260840161075a565b336040516331a9108f60e11b8152600481018690526001600160a01b0391821691831690636352211e90602401602060405180830381865afa158015612571573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125959190614497565b6001600160a01b0316146110615760405162461bcd60e51b81526020600482015260156024820152742bb0bca3b0ba329d102737ba1030b71027bbb732b960591b604482015260640161075a565b80826001600160a01b03821662fdd58e336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101889052604401602060405180830381865afa15801561263f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266391906142bb565b101580156126715750600083115b6110615760405162461bcd60e51b815260206004820152601a60248201527f455243313135353a204e6f7420656e6f75676820636f70696573000000000000604482015260640161075a565b604051633616147960e01b8152600481018490526001600160a01b03831690633616147990602401602060405180830381865afa158015612702573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061272691906142bb565b600281111561273757612737613c04565b6097805460ff60a01b1916600160a01b83600281111561275957612759613c04565b02179055506097546000828152609d60205260409020600801805460ff600160a01b93849004169260ff60a01b199091169083600281111561279d5761279d613c04565b0217905550609f546001600160a01b0390811690831603610a5c57604051634abc058d60e11b8152600481018490526001600160a01b038316906395780b1a90602401602060405180830381865afa1580156127fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612821919061418e565b15612849576000818152609d60205260409020600801805460ff60b81b1916600160b91b1790555b60405163236602f360e11b8152600481018490526001600160a01b038316906346cc05e690602401602060405180830381865afa15801561288e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128b2919061418e565b15610a5c576000908152609d60205260409020600801805460ff60b81b1916600160b81b1790555050565b6128e5612df9565b6040516301ffc9a760e01b81526001600160a01b038416906301ffc9a790612918906380ac58cd60e01b90600401613bb4565b602060405180830381865afa158015612935573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612959919061418e565b15612b05576040516331a9108f60e11b81526004810183905283906001600160a01b038216906342842e0e908290636352211e90602401602060405180830381865afa1580156129ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d19190614497565b30866040518463ffffffff1660e01b81526004016129f1939291906143c1565b600060405180830381600087803b158015612a0b57600080fd5b505af1158015612a1f573d6000803e3d6000fd5b50505050806001600160a01b031663095ea7b3612a393390565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101869052604401600060405180830381600087803b158015612a8157600080fd5b505af1158015612a95573d6000803e3d6000fd5b5050609e5460405163095ea7b360e01b81526001600160a01b03918216600482015260248101879052908416925063095ea7b39150604401600060405180830381600087803b158015612ae757600080fd5b505af1158015612afb573d6000803e3d6000fd5b5050505050612c65565b6000818152609d60205260409081902060068101546005909101549151637921219560e11b815285926001600160a01b038085169363f242432a93612b55939190921691309189916004016143e5565b600060405180830381600087803b158015612b6f57600080fd5b505af1158015612b83573d6000803e3d6000fd5b50505050806001600160a01b031663a22cb465612b9d3390565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260016024820152604401600060405180830381600087803b158015612be557600080fd5b505af1158015612bf9573d6000803e3d6000fd5b5050609e5460405163a22cb46560e01b81526001600160a01b03918216600482015260016024820152908416925063a22cb4659150604401600060405180830381600087803b158015612c4b57600080fd5b505af1158015612c5f573d6000803e3d6000fd5b50505050505b610a5c6001606555565b8060016000828152609d6020526040902060080154600160a81b900460ff166002811115612c9f57612c9f613c04565b14612cbc5760405162461bcd60e51b815260040161075a90614120565b6000612cc783611694565b90506001600160a01b03811615612d86576000612ce38461070b565b6000858152609d602052604090206007810154600390910154919250612d19916001600160a01b03909116908484600189612e52565b6000848152609d6020526040908190206005015490517f92ffae31901780890e35bdc724fedb7601577492b5d4e3df85f785de59d737ab91612d7891849186919283526001600160a01b03919091166020830152604082015260600190565b60405180910390a150612d8f565b612d8f83611e43565b50506000908152609d602052604081208181556001810182905560028101829055600381018290556004810182905560058101919091556006810180546001600160a01b0319908116909155600782018054909116905560080180546001600160c01b0319169055565b600260655403612e4b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161075a565b6002606555565b612e5a612df9565b60026000828152609d6020526040902060080154600160a81b900460ff166002811115612e8957612e89613c04565b148015612ec2575060016000828152609d6020526040902060080154600160b01b900460ff166001811115612ec057612ec0613c04565b145b15612f3e576097546001600160a01b03166323b872dd3330866040518463ffffffff1660e01b8152600401612ef9939291906143c1565b6020604051808303816000875af1158015612f18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f3c919061418e565b505b600080612f4a88613621565b15612fc45760405163152a902d60e11b815260048101889052602481018690526001600160a01b03891690632a55205a906044016040805180830381865afa158015612f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fbe91906144b4565b90925090505b60026000848152609d6020526040902060080154600160b81b900460ff166002811115612ff357612ff3613c04565b03613028576000838152609d602052604090206006015460a2546130289185918891859187916001600160a01b0316906136a1565b60016000848152609d6020526040902060080154600160b81b900460ff16600281111561305757613057613c04565b0361308c576000838152609d602052604090206006015460a55461308c9185918891859187916001600160a01b0316906136a1565b600080848152609d6020526040902060080154600160b81b900460ff1660028111156130ba576130ba613c04565b036131875760016000848152609d6020526040902060080154600160a01b900460ff1660028111156130ee576130ee613c04565b03613123576000838152609d602052604090206006015460a3546131239185918891859187916001600160a01b0316906136a1565b60026000848152609d6020526040902060080154600160a01b900460ff16600281111561315257613152613c04565b03613187576000838152609d602052604090206006015460a4546131879185918891859187916001600160a01b0316906136a1565b6040516301ffc9a760e01b81526001600160a01b038916906301ffc9a7906131ba906380ac58cd60e01b90600401613bb4565b602060405180830381865afa1580156131d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131fb919061418e565b156133205787600185146132515760405162461bcd60e51b815260206004820152601f60248201527f4552433732313a20446f6573204e6f7420537570706f727420436f7069657300604482015260640161075a565b604051632142170760e11b81526001600160a01b038216906342842e0e906132819030908b908d906004016143c1565b600060405180830381600087803b15801561329b57600080fd5b505af11580156132af573d6000803e3d6000fd5b5050506000858152609d602052604081208181556001810182905560028101829055600381018290556004810182905560058101919091556006810180546001600160a01b0319908116909155600782018054909116905560080180546001600160c01b0319169055506134fc9050565b6000838152609d602052604090206005015488908511156133835760405162461bcd60e51b815260206004820152601d60248201527f576179476174653a20436f70696573206e6f7420417661696c61626c65000000604482015260640161075a565b6000848152609d60205260409020600401546133a09086906144e2565b86146133ee5760405162461bcd60e51b815260206004820152601c60248201527f576179476174653a20496e73756666696369656e7420436f7069657300000000604482015260640161075a565b604051637921219560e11b81526001600160a01b0382169063f242432a906134209030908b908d908b906004016143e5565b600060405180830381600087803b15801561343a57600080fd5b505af115801561344e573d6000803e3d6000fd5b5050506000858152609d60205260408120600501549091506134719087906144f9565b90508015613492576000858152609d602052604090206005018190556134f9565b6000858152609d602052604081208181556001810182905560028101829055600381018290556004810182905560058101919091556006810180546001600160a01b0319908116909155600782018054909116905560080180546001600160c01b03191690555b50505b50506135086001606555565b505050505050565b60016000848152609d6020526040902060080154600160b01b900460ff16600181111561353f5761353f613c04565b1461357a576040516001600160a01b0382169083156108fc029084906000818181858888f19350505050158015611061573d6000803e3d6000fd5b60975460405163a9059cbb60e01b81526001600160a01b038381166004830152602482018590529091169063a9059cbb906044016020604051808303816000875af11580156135cd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611061919061418e565b600054610100900460ff166136185760405162461bcd60e51b815260040161075a9061444c565b610f3b33612196565b6040516301ffc9a760e01b815260009081906001600160a01b038416906301ffc9a7906136599063152a902d60e11b90600401613bb4565b602060405180830381865afa158015613676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061369a919061418e565b9392505050565b8460006136af888385613749565b905060006136bd8989613777565b90506136ca898888613510565b866136d5828461450c565b6136df919061450c565b6136e990846144f9565b92506136f6898487613510565b6040805183815260208101839052908101889052606081018490527f6795f3f57fc0310c79c5f5a472ef61a8b671f0e27d32244f6029f356f7a85fd69060800160405180910390a1505050505050505050565b6000806103e861375984866144e2565b613763919061442a565b905061376f858261380a565b949350505050565b60008060016000858152609d6020526040902060080154600160a01b900460ff1660028111156137a9576137a9613c04565b036137da576103e8609854846137bf91906144e2565b6137c9919061442a565b90506137d584826138f1565b613801565b6103e8609954846137eb91906144e2565b6137f5919061442a565b905061380184826138f1565b90505b92915050565b60016000838152609d6020526040902060080154600160b01b900460ff16600181111561383957613839613c04565b1461387857609b546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610a5c573d6000803e3d6000fd5b609754609a5460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303816000875af11580156138cd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5c919061418e565b609a546001600160a01b03166139685760405162461bcd60e51b815260206004820152603660248201527f5761794761746520526f79616c746965733a205365742041697264726f7020466044820152756565204469737472696275746f72204164647265737360501b606482015260840161075a565b60016000838152609d6020526040902060080154600160b01b900460ff16600181111561399757613997613c04565b1461387857609a546040516000916001600160a01b03169083908381818185875af1925050503d8060008114613508576040519150601f19603f3d011682016040523d82523d6000602084013e613508565b604051806101a0016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160006002811115613a6257613a62613c04565b815260200160008152602001600081526020016000905290565b6001600160a01b038116811461140457600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613ad057613ad0613a91565b604052919050565b600082601f830112613ae957600080fd5b813567ffffffffffffffff811115613b0357613b03613a91565b613b16601f8201601f1916602001613aa7565b818152846020838601011115613b2b57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215613b5e57600080fd5b8435613b6981613a7c565b93506020850135613b7981613a7c565b925060408501359150606085013567ffffffffffffffff811115613b9c57600080fd5b613ba887828801613ad8565b91505092959194509250565b6001600160e01b031991909116815260200190565b600060208284031215613bdb57600080fd5b5035919050565b60008060408385031215613bf557600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b6003811061140457611404613c04565b613c3381613c1a565b9052565b60028110613c3357613c33613c04565b60006101a082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c0830151613ca060c08401826001600160a01b03169052565b5060e0830151613cbb60e08401826001600160a01b03169052565b50610100838101516001600160a01b03169083015261012080840151613ce382850182613c2a565b505061014080840151613cf882850182613c2a565b505061016080840151613d0d82850182613c37565b505061018080840151613d2282850182613c2a565b505092915050565b60008060408385031215613d3d57600080fd5b8235613d4881613a7c565b91506020830135613d5881613a7c565b809150509250929050565b600060208284031215613d7557600080fd5b813561380181613a7c565b60008060008060808587031215613d9657600080fd5b843593506020850135613da881613a7c565b9250604085013591506060850135613dbf81613a7c565b939692955090935050565b600080600060608486031215613ddf57600080fd5b505081359360208301359350604090920135919050565b600080600080600060a08688031215613e0e57600080fd5b853594506020860135935060408601359250606086013591506080860135613e3581613a7c565b809150509295509295909350565b600082601f830112613e5457600080fd5b8135602067ffffffffffffffff821115613e7057613e70613a91565b8160051b613e7f828201613aa7565b9283528481018201928281019087851115613e9957600080fd5b83870192505b84831015613eb857823582529183019190830190613e9f565b979650505050505050565b600080600080600060a08688031215613edb57600080fd5b8535613ee681613a7c565b94506020860135613ef681613a7c565b9350604086013567ffffffffffffffff80821115613f1357600080fd5b613f1f89838a01613e43565b94506060880135915080821115613f3557600080fd5b613f4189838a01613e43565b93506080880135915080821115613f5757600080fd5b50613f6488828901613ad8565b9150509295509295909350565b60008060008060008060c08789031215613f8a57600080fd5b863595506020870135945060408701359350606087013592506080870135915060a0870135613fb881613a7c565b809150509295509295509295565b60208101613fd383613c1a565b91905290565b600080600080600060a08688031215613ff157600080fd5b8535613ffc81613a7c565b9450602086013561400c81613a7c565b93506040860135925060608601359150608086013567ffffffffffffffff81111561403657600080fd5b613f6488828901613ad8565b6000806020838503121561405557600080fd5b823567ffffffffffffffff8082111561406d57600080fd5b818501915085601f83011261408157600080fd5b81358181111561409057600080fd5b8660208260051b85010111156140a557600080fd5b60209290920196919550909350505050565b803563ffffffff8116811461173b57600080fd5b60008060008060008060c087890312156140e457600080fd5b863595506140f4602088016140b7565b9450614102604088016140b7565b9350606087013592506080870135915060a0870135613fb881613a7c565b60208082526017908201527f576179476174653a204e6f74206f6e2041756374696f6e000000000000000000604082015260600190565b6020808252601f908201527f576179476174653a20496e73756666696369656e7420416c6c6f77616e636500604082015260600190565b6000602082840312156141a057600080fd5b8151801515811461380157600080fd5b9384526bffffffffffffffffffffffff19606093841b811660208601529190921b166034830152604882015260680190565b60208082526028908201527f576179476174653a2042696420416d6f756e74203c204d696e696d756d2042696040820152671908105b5bdd5b9d60c21b606082015260800190565b60208082526023908201527f576179476174653a20506c6174666f726d20416464726573736573204e6f742060408201526214d95d60ea1b606082015260800190565b6001600160a01b03881681526020810187905260408101869052606081018590526080810184905260a0810183905260e081016142a983613c1a565b8260c083015298975050505050505050565b6000602082840312156142cd57600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201614312576143126142ea565b5060010190565b63ffffffff818116838216019080821115614336576143366142ea565b5092915050565b600061010060018060a01b038a1683528860208401528760408401528660608401528560808401528460a084015261437484613c1a565b8360c08401528060e0840152602081840152507f416363657074696e67204269647320666f722054696d65642041756374696f6e6101208301526101408201905098975050505050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a060808201819052600490820152630307830360e41b60c082015260e00190565b60008261444757634e487b7160e01b600052601260045260246000fd5b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000602082840312156144a957600080fd5b815161380181613a7c565b600080604083850312156144c757600080fd5b82516144d281613a7c565b6020939093015192949293505050565b8082028115828204841417613804576138046142ea565b81810381811115613804576138046142ea565b80820180821115613804576138046142ea56fea2646970667358221220b308872b007be89cf85dff32a2eae67b191166ac903d747d4f685bfd9e0e587064736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.