ERC-721
Overview
Max Total Supply
3,252 DROID
Holders
2,077
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
3 DROIDLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
NFT
Compiler Version
v0.8.13+commit.abaa5c0e
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.13; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/common/ERC2981.sol"; import "../common/Ownable.sol"; import "../staking/interfaces/IFeePool.sol"; import "../token/interfaces/IERC20.sol"; import "operator-filter-registry/src/DefaultOperatorFilterer.sol"; contract NFT is ReentrancyGuard, ERC721Enumerable, Ownable, DefaultOperatorFilterer, ERC2981 { using Strings for uint256; bool public allowMint; bool public allowAlloc; bool public allowEnergonOps; uint256 public cost; uint256 public mintCost = 0; uint256 public maxSupply = 10000; uint256 public treasuryEditionSupply = 1000; uint256 public totalAllocated; uint256 public mintedByOwner; uint256 public mintedByTreasury; uint256 public mintedBySig; uint256 public mintedByAllowlist; address public feePool; address public allocator; address public energon; address public token; string public _contractURI; string public baseURI; string public baseExtension = ".json"; mapping(uint256 => uint256) public p2pBalances; mapping(uint256 => uint256) public engBalances; mapping(address => mapping(uint256 => uint256)) public burnAllowances; mapping(address => uint256) public allowlist; mapping(address => mapping(uint256 => uint8)) public usedNonce; event UpdatedBaseExtension(string _new); event UpdatedBaseURI(string _new); event UpdatedContractURI(string _new); event UpdatedMaxMintAmount(uint256 _new); event UpdatedCost(uint256 _new); event UpdatedMintCost(uint256 _new); event Withdrawal(uint256 amt); event Allocated(address indexed sender, uint256 indexed _tokenId, uint256 amount); event AllowMint(bool allow); event AllowAlloc(bool allow); event AllowBurn(bool allow); event AllocatorUpdated(address addr); event EnergonUpdated(address addr); event TokenUpdated(address addr); event AllowAddr(address indexed addr, uint256 slot, bool add); event BurnedEnergon(address indexed owner, uint256 indexed _tokenId, uint256 _amount, bytes _purpose); event DepositedEnergon(address indexed depositor, uint256 indexed _tokenId, uint256 _amount); event WithdrawnEnergon(address indexed withdrawer, uint256 indexed _tokenId, uint256 _amount); event BurnAllowance(address indexed _owner, uint256 indexed _tokenId, address indexed _burner, uint256 _amount); constructor( string memory _name, string memory _symbol, string memory _initBaseURI, uint256 _maxSupply, uint256 _treasuryEditionSupply, address _feePool, address _allocator, address _energon, address _token ) ERC721(_name, _symbol) { baseURI = _initBaseURI; feePool = _feePool; allocator = _allocator; maxSupply = _maxSupply; treasuryEditionSupply = _treasuryEditionSupply; energon = _energon; token = _token; } /// @notice Set the FeePool contract address /// @dev Only owner can call function setFeePool(address addr) public onlyOwner { feePool = addr; } /// @notice Set the allocator address. /// @dev The allocator is the entity who can sign an allocation signature. /// @dev Only owner can call function setAllocator(address _allocator) public onlyOwner { allocator = _allocator; emit AllocatorUpdated(_allocator); } /// @notice Set the energon contract address. /// @dev Only owner can call function setEnergon(address _energon) public onlyOwner { energon = _energon; emit EnergonUpdated(_energon); } /// @notice Set the native token contract address /// @dev Only owner can call function setToken(address _token) public onlyOwner { token = _token; emit TokenUpdated(_token); } /// @dev Toggle switch to allow minting /// @dev Only owner can call function toggleAllowMint() public onlyOwner { allowMint = !allowMint; emit AllowMint(allowMint); } /// @dev Toggle switch to allow allocation /// @dev Only owner can call function toggleAllowAlloc() public onlyOwner { allowAlloc = !allowAlloc; emit AllowAlloc(allowAlloc); } /// @dev Toggle switch to allow energon operations /// @dev Only owner can call function toggleAllowEnergonOps() public onlyOwner { allowEnergonOps = !allowEnergonOps; emit AllowBurn(allowEnergonOps); } /// @notice Set the base metadata URI /// @dev Only owner can call function setBaseURI(string calldata _newBaseURI) public onlyOwner { baseURI = _newBaseURI; emit UpdatedBaseURI(_newBaseURI); } /// @notice Set the base metadata extension /// @dev Only owner can call function setBaseExtension(string calldata _newBaseExtension) public onlyOwner { baseExtension = _newBaseExtension; emit UpdatedBaseExtension(_newBaseExtension); } /// @notice Set default royalty /// @param receiver The recipient of royalties /// @param feeNumerator The basis point to use as fee function setDefaultRoyalty(address receiver, uint96 feeNumerator) public onlyOwner { _setDefaultRoyalty(receiver, feeNumerator); } /// @notice Set the cost per allocated token /// @dev Only owner can call function setCost(uint256 value) public onlyOwner { cost = value; emit UpdatedCost(value); } /// @notice Set the amount of energon required to mint /// @dev Only owner can call function setMintCost(uint256 value) public onlyOwner { mintCost = value; emit UpdatedMintCost(value); } /// @notice Set the contract URI function setContractURI(string calldata uri) public onlyOwner { _contractURI = uri; emit UpdatedContractURI(uri); } /// @notice Get contract URI function contractURI() public view returns (string memory) { return _contractURI; } /// @notice Allow an address to mint without a signature and energon /// @param addr The target address /// @param slot The amount of mint slot /// @param add Whether to add or remove the given number of slot function allowAddr( address addr, uint256 slot, bool add ) public onlyOwner { if (add) allowlist[addr] += slot; else allowlist[addr] -= slot; emit AllowAddr(addr, slot, add); } /// @dev Get the base URI function _baseURI() internal view virtual override returns (string memory) { return baseURI; } /// @notice Mint an NFT /// @param _mintAmount The amount of tokens to mint /// @param _signature The mint authorization signature (optional). If not provided, energon balance is used to pay for mint. /// @param expireAt Expiry time of the signature and also serves as a nonce for replay protection function mint( uint256 _mintAmount, bool _noEnergon, bytes calldata _signature, uint256 expireAt ) public nonReentrant { require(allowMint, "NFT: MINT_DISABLED"); uint256 supply = totalSupply(); require(_mintAmount > 0, "NFT: AMOUNT_REQ"); require((supply - mintedByTreasury) + _mintAmount <= maxSupply - treasuryEditionSupply, "NFT: SURPASSED_MAX_SUPPLY"); if (msg.sender != owner()) { if (allowlist[msg.sender] > 0) { require(_mintAmount <= allowlist[msg.sender], "NFT: ABOVE_SLOT_LIMIT"); allowlist[msg.sender] -= _mintAmount; mintedByAllowlist += _mintAmount; } else { require(_signature.length > 0, "NFT: SIG_REQUIRED"); require(usedNonce[msg.sender][expireAt] == 0, "NFT: SIG_NONCE_USED"); require(verifyMintSig(allocator, msg.sender, _mintAmount, _noEnergon, expireAt, _signature), "NFT: BAD_SIG"); require(expireAt > block.timestamp, "NFT: EXPIRED_SIG"); usedNonce[msg.sender][expireAt] = 1; mintedBySig += _mintAmount; if (!_noEnergon && mintCost > 0) IERC20(energon).transferFrom(msg.sender, address(this), mintCost); } } else { mintedByOwner += _mintAmount; } for (uint256 i = 1; i <= _mintAmount; i++) { _safeMint(msg.sender, treasuryEditionSupply + (supply - mintedByTreasury) + i); } } /// @notice Mint a treasury edition token /// @param _fromId The token id to start minting from (must not exist) /// @param _mintAmount The amount of tokens to mint function mintTE(uint256 _fromId, uint256 _mintAmount) public onlyOwner { require(_fromId + _mintAmount <= treasuryEditionSupply, "NFT: ID_OUT_OF_RANGE"); for (uint256 i = _fromId; i <= _fromId + _mintAmount; i++) { _safeMint(msg.sender, i); mintedByTreasury++; } } /// @notice Allocate tokens based on traits /// @param _tokenId The token ID /// @param _alloc The amount to allocate function allocate( uint256 _tokenId, uint256 _alloc, bytes calldata _signature ) public payable nonReentrant { require(allowAlloc, "NFT: ALLOC_DISABLED"); require(ownerOf(_tokenId) == msg.sender, "NFT: NOT_OWNER"); require(verifyAllocSig(allocator, msg.sender, _tokenId, _alloc, _signature), "NFT: BAD_SIG"); require(p2pBalances[_tokenId] == 0, "NFT: ALREADY_ALLOCATED"); require(msg.value >= cost * _alloc, "NFT: INSUFFICIENT_DEPOSIT"); totalAllocated += _alloc; p2pBalances[_tokenId] = _alloc; engBalances[_tokenId] = _alloc; IERC20(energon).mint(address(this), _alloc); IERC20(token).mint(address(this), _alloc); IFeePool(feePool).stakeNFT(_tokenId, _alloc); emit Allocated(msg.sender, _tokenId, _alloc); } /// @notice Return P2P token allocation /// @param _tokenId The token ID function p2pBalanceOf(uint256 _tokenId) external view returns (uint256) { return p2pBalances[_tokenId]; } /// @notice Return energon token allocation /// @param _tokenId The token ID function engBalanceOf(uint256 _tokenId) external view returns (uint256) { return engBalances[_tokenId]; } /// @notice Deposit energon for the given token /// @param _tokenId The token ID /// @param _amount The amount of energon to deposit function depositEnergon(uint256 _tokenId, uint256 _amount) external { require(allowEnergonOps, "NFT: DEPOSIT_DISABLED"); engBalances[_tokenId] += _amount; IERC20(energon).transferFrom(msg.sender, address(this), _amount); emit DepositedEnergon(msg.sender, _tokenId, _amount); } /// @notice Withdraw energon from a token function withdrawEnergon(uint256 _tokenId, uint256 _amount) external { require(allowEnergonOps, "NFT: WITHDRAW_DISABLED"); require(ownerOf(_tokenId) == msg.sender, "NFT: NOT_OWNER"); require(engBalances[_tokenId] >= _amount, "NFT: INSUFFICIENT_BAL"); engBalances[_tokenId] -= _amount; IERC20(energon).transfer(msg.sender, _amount); emit WithdrawnEnergon(msg.sender, _tokenId, _amount); } /// @notice Burn energon for an arbitrary purpose /// @param _tokenId The token ID /// @param _amount The amount of energon to burn /// @param _purpose The purpose of the energon being burned function burnEnergon( uint256 _tokenId, uint256 _amount, bytes calldata _purpose ) external { require(allowEnergonOps, "NFT: BURN_DISABLED"); require(ownerOf(_tokenId) == msg.sender, "NFT: NOT_OWNER"); require(engBalances[_tokenId] >= _amount, "NFT: INSUFFICIENT_BAL"); engBalances[_tokenId] -= _amount; IERC20(energon).burn(_amount); emit BurnedEnergon(msg.sender, _tokenId, _amount, _purpose); } /// @notice Approve an address to burn an token's energon /// @param _tokenId The token ID /// @param _burner The address to permit /// @param _amount The amount to permit function burnApprove( uint256 _tokenId, address _burner, uint256 _amount ) external { require(allowEnergonOps, "NFT: BURN_DISABLED"); require(ownerOf(_tokenId) == msg.sender, "NFT: NOT_OWNER"); burnAllowances[_burner][_tokenId] += _amount; emit BurnAllowance(msg.sender, _tokenId, _burner, _amount); } /// @notice Get the energon burn allowance /// @param _tokenId The token ID /// @param _burner The address of the burner function burnAllowance(uint256 _tokenId, address _burner) external view returns (uint256) { return burnAllowances[_burner][_tokenId]; } /// @notice Burn energon for a given token. /// Sender must have sufficient approved amount to burn _amount. /// @param _tokenId The token ID /// @param _amount The amount to burn. function burnFrom(uint256 _tokenId, uint256 _amount) external { require(allowEnergonOps, "NFT: BURN_DISABLED"); require(burnAllowances[msg.sender][_tokenId] >= _amount, "NFT: LOW_ALLOWANCE"); require(engBalances[_tokenId] >= _amount, "NFT: INSUFFICIENT_BAL"); engBalances[_tokenId] -= _amount; burnAllowances[msg.sender][_tokenId] -= _amount; IERC20(energon).burn(_amount); emit BurnedEnergon(msg.sender, _tokenId, _amount, bytes("")); } /// @notice Return index of tokens owned by the target account /// @param _owner The address of the target account function tokensOfOwner(address _owner) public view returns (uint256[] memory) { uint256 ownerTokenCount = balanceOf(_owner); uint256[] memory tokenIds = new uint256[](ownerTokenCount); for (uint256 i; i < ownerTokenCount; i++) { tokenIds[i] = tokenOfOwnerByIndex(_owner, i); } return tokenIds; } /// @notice Returns the token metadata URI /// @param tokenId The token ID function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory currentBaseURI = _baseURI(); return bytes(currentBaseURI).length > 0 ? string(abi.encodePacked(currentBaseURI, tokenId.toString(), baseExtension)) : ""; } /// @notice Withdraw the contract balance /// @dev Only owner can call function withdraw() public payable onlyOwner { uint256 bal = address(this).balance; (bool os, ) = payable(owner()).call{value: address(this).balance}(""); require(os); emit Withdrawal(bal); } /// @dev Construct mint message hash function getMintMessageHash( address _addr, uint256 _mintAmount, bool _noEnergon, uint256 expireAt ) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_addr, _mintAmount, _noEnergon, expireAt)); } /// @dev Construct allocation message hash function getAllocMessageHash( address _addr, uint256 _tokenId, uint256 _alloc ) internal pure returns (bytes32) { return keccak256(abi.encodePacked(_addr, _tokenId, _alloc)); } /// @dev Construct a signed message hash function getSignedMessageHash(bytes32 _messageHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", _messageHash)); } /// @dev Recover the signer function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) internal pure returns (address) { (bytes32 r, bytes32 s, uint8 v) = splitSignature(_signature); return ecrecover(_ethSignedMessageHash, v, r, s); } function splitSignature(bytes memory sig) internal pure returns ( bytes32 r, bytes32 s, uint8 v ) { require(sig.length == 65, "invalid signature length"); assembly { r := mload(add(sig, 32)) s := mload(add(sig, 64)) v := byte(0, mload(add(sig, 96))) } } /// @dev Verify mint signature function verifyMintSig( address _signer, address _addr, uint256 _mintAmount, bool _noEnergon, uint256 _expireAt, bytes memory signature ) internal pure returns (bool) { if (address(0) == _signer) return false; bytes32 messageHash = getMintMessageHash(_addr, _mintAmount, _noEnergon, _expireAt); bytes32 ethSignedMessageHash = getSignedMessageHash(messageHash); return recoverSigner(ethSignedMessageHash, signature) == _signer; } /// @dev Verify allocation signature function verifyAllocSig( address _signer, address _addr, uint256 _tokenId, uint256 _alloc, bytes calldata signature ) internal pure returns (bool) { bytes32 messageHash = getAllocMessageHash(_addr, _tokenId, _alloc); bytes32 ethSignedMessageHash = getSignedMessageHash(messageHash); return recoverSigner(ethSignedMessageHash, signature) == _signer; } function setApprovalForAll(address operator, bool approved) public override(IERC721, ERC721) onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve(address operator, uint256 tokenId) public override(IERC721, ERC721) onlyAllowedOperatorApproval(operator) { super.approve(operator, tokenId); } function transferFrom( address from, address to, uint256 tokenId ) public override(IERC721, ERC721) onlyAllowedOperator(from) { super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public override(IERC721, ERC721) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public override(IERC721, ERC721) onlyAllowedOperator(from) { super.safeTransferFrom(from, to, tokenId, data); } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable, ERC2981) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.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 IERC2981 is IERC165 { /** * @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.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.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 ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings 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. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).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 = ERC721.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 = ERC721.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 = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.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(ERC721.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(ERC721.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(ERC721.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 IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.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 { if (batchSize > 1) { if (from != address(0)) { _balances[from] -= batchSize; } if (to != address(0)) { _balances[to] += batchSize; } } } /** * @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 {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev See {ERC721-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual override { super._beforeTokenTransfer(from, to, firstTokenId, batchSize); if (batchSize > 1) { // Will only trigger during construction. Batch transferring (minting) is not available afterwards. revert("ERC721Enumerable: consecutive transfers not supported"); } uint256 tokenId = firstTokenId; if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @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.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must 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.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// 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 Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(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; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.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 ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// 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 Math { 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/Math.sol"; /** * @dev String operations. */ library Strings { 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 = Math.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, Math.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 // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.13; import "@openzeppelin/contracts/utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "OWNABLE: NOT_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), "INVALID_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); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IFeePool { function notifyWithdraw(address account, uint256 _amount) external; function notifyStake(address account, uint256 _amount) external; function notifyFeeDeposit(address token, uint256 amount) external; function stakeNFT(uint256 _tokenId, uint256 _amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IERC20 { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); function decimals() external view returns (uint8); function allowance(address owner, address spender) external view returns (uint256); function burn(uint256 amount) external; function mint(address to, uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {OperatorFilterer} from "./OperatorFilterer.sol"; /** * @title DefaultOperatorFilterer * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription. */ abstract contract DefaultOperatorFilterer is OperatorFilterer { address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6); constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IOperatorFilterRegistry { function isOperatorAllowed(address registrant, address operator) external view returns (bool); function register(address registrant) external; function registerAndSubscribe(address registrant, address subscription) external; function registerAndCopyEntries(address registrant, address registrantToCopy) external; function unregister(address addr) external; function updateOperator(address registrant, address operator, bool filtered) external; function updateOperators(address registrant, address[] calldata operators, bool filtered) external; function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external; function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external; function subscribe(address registrant, address registrantToSubscribe) external; function unsubscribe(address registrant, bool copyExistingEntries) external; function subscriptionOf(address addr) external returns (address registrant); function subscribers(address registrant) external returns (address[] memory); function subscriberAt(address registrant, uint256 index) external returns (address); function copyEntriesOf(address registrant, address registrantToCopy) external; function isOperatorFiltered(address registrant, address operator) external returns (bool); function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool); function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool); function filteredOperators(address addr) external returns (address[] memory); function filteredCodeHashes(address addr) external returns (bytes32[] memory); function filteredOperatorAt(address registrant, uint256 index) external returns (address); function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32); function isRegistered(address addr) external returns (bool); function codeHashOf(address addr) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol"; /** * @title OperatorFilterer * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another * registrant's entries in the OperatorFilterRegistry. * @dev This smart contract is meant to be inherited by token contracts so they can use the following: * - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods. * - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods. */ abstract contract OperatorFilterer { error OperatorNotAllowed(address operator); IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E); constructor(address subscriptionOrRegistrantToCopy, bool subscribe) { // If an inheriting token contract is deployed to a network without the registry deployed, the modifier // will not revert, but the contract will need to be registered with the registry once it is deployed in // order for the modifier to filter addresses. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (subscribe) { OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy); } else { if (subscriptionOrRegistrantToCopy != address(0)) { OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy); } else { OPERATOR_FILTER_REGISTRY.register(address(this)); } } } } modifier onlyAllowedOperator(address from) virtual { // Allow spending tokens from addresses with balance // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred // from an EOA. if (from != msg.sender) { _checkFilterOperator(msg.sender); } _; } modifier onlyAllowedOperatorApproval(address operator) virtual { _checkFilterOperator(operator); _; } function _checkFilterOperator(address operator) internal view virtual { // Check registry code length to facilitate testing in environments without a deployed registry. if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) { if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) { revert OperatorNotAllowed(operator); } } } }
{ "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
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_initBaseURI","type":"string"},{"internalType":"uint256","name":"_maxSupply","type":"uint256"},{"internalType":"uint256","name":"_treasuryEditionSupply","type":"uint256"},{"internalType":"address","name":"_feePool","type":"address"},{"internalType":"address","name":"_allocator","type":"address"},{"internalType":"address","name":"_energon","type":"address"},{"internalType":"address","name":"_token","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Allocated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"}],"name":"AllocatorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":false,"internalType":"bool","name":"add","type":"bool"}],"name":"AllowAddr","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"allow","type":"bool"}],"name":"AllowAlloc","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"allow","type":"bool"}],"name":"AllowBurn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"allow","type":"bool"}],"name":"AllowMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"_burner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"BurnAllowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"_purpose","type":"bytes"}],"name":"BurnedEnergon","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"DepositedEnergon","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"addr","type":"address"}],"name":"EnergonUpdated","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":"address","name":"addr","type":"address"}],"name":"TokenUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_new","type":"string"}],"name":"UpdatedBaseExtension","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_new","type":"string"}],"name":"UpdatedBaseURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_new","type":"string"}],"name":"UpdatedContractURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_new","type":"uint256"}],"name":"UpdatedCost","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_new","type":"uint256"}],"name":"UpdatedMaxMintAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_new","type":"uint256"}],"name":"UpdatedMintCost","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amt","type":"uint256"}],"name":"Withdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"WithdrawnEnergon","type":"event"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_alloc","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"allocate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"allocator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"slot","type":"uint256"},{"internalType":"bool","name":"add","type":"bool"}],"name":"allowAddr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allowAlloc","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowEnergonOps","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"allowlist","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseExtension","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_burner","type":"address"}],"name":"burnAllowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"burnAllowances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_burner","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burnApprove","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_purpose","type":"bytes"}],"name":"burnEnergon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositEnergon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"energon","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"engBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"engBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feePool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintAmount","type":"uint256"},{"internalType":"bool","name":"_noEnergon","type":"bool"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"uint256","name":"expireAt","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromId","type":"uint256"},{"internalType":"uint256","name":"_mintAmount","type":"uint256"}],"name":"mintTE","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintedByAllowlist","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintedByOwner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintedBySig","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintedByTreasury","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"p2pBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"p2pBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_allocator","type":"address"}],"name":"setAllocator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseExtension","type":"string"}],"name":"setBaseExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_energon","type":"address"}],"name":"setEnergon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setFeePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setMintCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"setToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleAllowAlloc","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleAllowEnergonOps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleAllowMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryEditionSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"usedNonce","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawEnergon","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60006010556127106011556103e860125560c06040526005608081905264173539b7b760d91b60a09081526200003991601e9190620002ea565b503480156200004757600080fd5b5060405162004d4038038062004d408339810160408190526200006a916200047a565b600160008190558951733cc6cdda760b79bafa08df41ecfa224f810dceb691908b908b90620000a09084906020850190620002ea565b508051620000b6906002906020840190620002ea565b505050620000d3620000cd6200029460201b60201c565b62000298565b6daaeb6d7670e522a718067333cd4e3b15620002185780156200016657604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200014757600080fd5b505af11580156200015c573d6000803e3d6000fd5b5050505062000218565b6001600160a01b03821615620001b75760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af2903906044016200012c565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b158015620001fe57600080fd5b505af115801562000213573d6000803e3d6000fd5b505050505b505086516200022f90601d9060208a0190620002ea565b50601880546001600160a01b03199081166001600160a01b039687161790915560198054821694861694909417909355601195909555601293909355601a8054821693831693909317909255601b8054909216921691909117905550620005a6915050565b3390565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620002f8906200056a565b90600052602060002090601f0160209004810192826200031c576000855562000367565b82601f106200033757805160ff191683800117855562000367565b8280016001018555821562000367579182015b82811115620003675782518255916020019190600101906200034a565b506200037592915062000379565b5090565b5b808211156200037557600081556001016200037a565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620003b857600080fd5b81516001600160401b0380821115620003d557620003d562000390565b604051601f8301601f19908116603f0116810190828211818310171562000400576200040062000390565b816040528381526020925086838588010111156200041d57600080fd5b600091505b8382101562000441578582018301518183018401529082019062000422565b83821115620004535760008385830101525b9695505050505050565b80516001600160a01b03811681146200047557600080fd5b919050565b60008060008060008060008060006101208a8c0312156200049a57600080fd5b89516001600160401b0380821115620004b257600080fd5b620004c08d838e01620003a6565b9a5060208c0151915080821115620004d757600080fd5b620004e58d838e01620003a6565b995060408c0151915080821115620004fc57600080fd5b506200050b8c828d01620003a6565b97505060608a0151955060808a015194506200052a60a08b016200045d565b93506200053a60c08b016200045d565b92506200054a60e08b016200045d565b91506200055b6101008b016200045d565b90509295985092959850929598565b600181811c908216806200057f57607f821691505b602082108103620005a057634e487b7160e01b600052602260045260246000fd5b50919050565b61478a80620005b66000396000f3fe6080604052600436106104265760003560e01c806370f2615711610229578063bdb4b8481161012e578063da3ef23f116100b6578063e985e9c51161007a578063e985e9c514610ca4578063f2fde38b14610ced578063f6b28e6a14610d0d578063f90a2f3014610d22578063fc0c546a14610d6f57600080fd5b8063da3ef23f14610c1c578063de9a2e0414610c3c578063df07d22a14610c4f578063e2dfcd3f14610c6f578063e8a3d48514610c8f57600080fd5b8063c6682862116100fd578063c668286214610b9b578063c87b56dd14610bb0578063c8ca9d8914610bd0578063d5abeb0114610bf0578063d5c067d514610c0657600080fd5b8063bdb4b84814610b3a578063bf83f2a214610b50578063c0e7274014610b70578063c128c67914610b8557600080fd5b80639760ca6f116101b1578063a8d34c3811610180578063a8d34c3814610a98578063aa5dcecc14610ac4578063ae2e933b14610ae4578063b88d4fde14610b04578063bc9c247414610b2457600080fd5b80639760ca6f14610a095780639af1dac014610a36578063a22cb46514610a4b578063a7cd52cb14610a6b57600080fd5b80638545f4ea116101f85780638545f4ea146109765780638769fd41146109965780638da5cb5b146109b6578063938e3d7b146109d457806395d89b41146109f457600080fd5b806370f26157146108de578063715018a6146108f4578063780e3f99146109095780638462151c1461094957600080fd5b80632f745c591161032f5780634f6ccce7116102b75780635e9cd328116102865780635e9cd3281461083d5780636352211e1461085d57806366cdb4ff1461087d5780636c0360eb146108a957806370a08231146108be57600080fd5b80634f6ccce7146107bd5780635343f3b5146107dd578063552c8735146107fd57806355f804b31461081d57600080fd5b80634174e103116102fe5780634174e1031461071857806341f434341461074557806342842e0e1461076757806344a0d68a1461078757806345f7f249146107a757600080fd5b80632f745c59146106ba57806330952299146106da5780633308c458146106fa5780633ccfd60b1461071057600080fd5b8063144fa6d7116103b25780631cd8fbc9116103815780631cd8fbc9146105ee57806323b872dd14610626578063291030db146106465780632984647b146106665780632a55205a1461067b57600080fd5b8063144fa6d71461057f57806318160ddd1461059f57806319db2228146105b45780631b8dca74146105d457600080fd5b806306fdde03116103f957806306fdde03146104c1578063081812fc146104e3578063095ea7b31461051b5780630c68efe31461053b57806313faede61461055b57600080fd5b806301ffc9a71461042b57806303b7a1b31461046057806303ea22c01461047f57806304634d8d146104a1575b600080fd5b34801561043757600080fd5b5061044b610446366004613e0a565b610d8f565b60405190151581526020015b60405180910390f35b34801561046c57600080fd5b50600e5461044b90610100900460ff1681565b34801561048b57600080fd5b5061049f61049a366004613e27565b610da0565b005b3480156104ad57600080fd5b5061049f6104bc366004613e65565b610e6e565b3480156104cd57600080fd5b506104d6610ea6565b6040516104579190613f00565b3480156104ef57600080fd5b506105036104fe366004613f13565b610f38565b6040516001600160a01b039091168152602001610457565b34801561052757600080fd5b5061049f610536366004613f2c565b610f5f565b34801561054757600080fd5b5061049f610556366004613f56565b610f73565b34801561056757600080fd5b50610571600f5481565b604051908152602001610457565b34801561058b57600080fd5b5061049f61059a366004613f8b565b61104a565b3480156105ab57600080fd5b50600954610571565b3480156105c057600080fd5b5061049f6105cf366004613f8b565b6110c9565b3480156105e057600080fd5b50600e5461044b9060ff1681565b3480156105fa57600080fd5b50610571610609366004613f2c565b602160209081526000928352604080842090915290825290205481565b34801561063257600080fd5b5061049f610641366004613fa6565b611115565b34801561065257600080fd5b5061049f610661366004613e27565b611140565b34801561067257600080fd5b5061049f6112c2565b34801561068757600080fd5b5061069b610696366004613e27565b61133a565b604080516001600160a01b039093168352602083019190915201610457565b3480156106c657600080fd5b506105716106d5366004613f2c565b6113e8565b3480156106e657600080fd5b5061049f6106f5366004613e27565b61147e565b34801561070657600080fd5b5061057160125481565b61049f6115a0565b34801561072457600080fd5b50610571610733366004613f13565b601f6020526000908152604090205481565b34801561075157600080fd5b506105036daaeb6d7670e522a718067333cd4e81565b34801561077357600080fd5b5061049f610782366004613fa6565b611674565b34801561079357600080fd5b5061049f6107a2366004613f13565b611699565b3480156107b357600080fd5b5061057160135481565b3480156107c957600080fd5b506105716107d8366004613f13565b6116f8565b3480156107e957600080fd5b5061049f6107f8366004613f8b565b61178b565b34801561080957600080fd5b5061049f610818366004613fe0565b611803565b34801561082957600080fd5b5061049f610838366004614062565b6118de565b34801561084957600080fd5b5061049f6108583660046140a4565b611946565b34801561086957600080fd5b50610503610878366004613f13565b611a97565b34801561088957600080fd5b50610571610898366004613f13565b602080526000908152604090205481565b3480156108b557600080fd5b506104d6611af7565b3480156108ca57600080fd5b506105716108d9366004613f8b565b611b85565b3480156108ea57600080fd5b5061057160155481565b34801561090057600080fd5b5061049f611c0b565b34801561091557600080fd5b506105716109243660046140f7565b6001600160a01b03166000908152602160209081526040808320938352929052205490565b34801561095557600080fd5b50610969610964366004613f8b565b611c41565b6040516104579190614123565b34801561098257600080fd5b5061049f610991366004613f13565b611ce3565b3480156109a257600080fd5b5061049f6109b1366004613e27565b611d42565b3480156109c257600080fd5b50600b546001600160a01b0316610503565b3480156109e057600080fd5b5061049f6109ef366004614062565b611ef0565b348015610a0057600080fd5b506104d6611f58565b348015610a1557600080fd5b50610571610a24366004613f13565b6000908152601f602052604090205490565b348015610a4257600080fd5b5061049f611f67565b348015610a5757600080fd5b5061049f610a66366004614167565b611feb565b348015610a7757600080fd5b50610571610a86366004613f8b565b60226020526000908152604090205481565b348015610aa457600080fd5b50610571610ab3366004613f13565b600090815260208052604090205490565b348015610ad057600080fd5b50601954610503906001600160a01b031681565b348015610af057600080fd5b50601854610503906001600160a01b031681565b348015610b1057600080fd5b5061049f610b1f3660046141a9565b611fff565b348015610b3057600080fd5b5061057160145481565b348015610b4657600080fd5b5061057160105481565b348015610b5c57600080fd5b5061049f610b6b366004613f8b565b61202c565b348015610b7c57600080fd5b506104d66120a4565b348015610b9157600080fd5b5061057160165481565b348015610ba757600080fd5b506104d66120b1565b348015610bbc57600080fd5b506104d6610bcb366004613f13565b6120be565b348015610bdc57600080fd5b5061049f610beb366004614285565b61219c565b348015610bfc57600080fd5b5061057160115481565b348015610c1257600080fd5b5061057160175481565b348015610c2857600080fd5b5061049f610c37366004614062565b612629565b61049f610c4a3660046140a4565b612691565b348015610c5b57600080fd5b50601a54610503906001600160a01b031681565b348015610c7b57600080fd5b50600e5461044b9062010000900460ff1681565b348015610c9b57600080fd5b506104d66129be565b348015610cb057600080fd5b5061044b610cbf3660046142e9565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b348015610cf957600080fd5b5061049f610d08366004613f8b565b6129cd565b348015610d1957600080fd5b5061049f612a4b565b348015610d2e57600080fd5b50610d5d610d3d366004613f2c565b602360209081526000928352604080842090915290825290205460ff1681565b60405160ff9091168152602001610457565b348015610d7b57600080fd5b50601b54610503906001600160a01b031681565b6000610d9a82612acd565b92915050565b600b546001600160a01b03163314610dd35760405162461bcd60e51b8152600401610dca90614313565b60405180910390fd5b601254610de08284614355565b1115610e255760405162461bcd60e51b81526020600482015260146024820152734e46543a2049445f4f55545f4f465f52414e474560601b6044820152606401610dca565b815b610e318284614355565b8111610e6957610e413382612af2565b60158054906000610e518361436d565b91905055508080610e619061436d565b915050610e27565b505050565b600b546001600160a01b03163314610e985760405162461bcd60e51b8152600401610dca90614313565b610ea28282612b0c565b5050565b606060018054610eb590614386565b80601f0160208091040260200160405190810160405280929190818152602001828054610ee190614386565b8015610f2e5780601f10610f0357610100808354040283529160200191610f2e565b820191906000526020600020905b815481529060010190602001808311610f1157829003601f168201915b5050505050905090565b6000610f4382612c09565b506000908152600560205260409020546001600160a01b031690565b81610f6981612c68565b610e698383612d21565b600e5462010000900460ff16610f9b5760405162461bcd60e51b8152600401610dca906143c0565b33610fa584611a97565b6001600160a01b031614610fcb5760405162461bcd60e51b8152600401610dca906143ec565b6001600160a01b038216600090815260216020908152604080832086845290915281208054839290610ffe908490614355565b90915550506040518181526001600160a01b03831690849033907f386398d4cb7b8cde915e2522cad3e37e10265f0eed0c4a971e940c8b371e9e8c9060200160405180910390a4505050565b600b546001600160a01b031633146110745760405162461bcd60e51b8152600401610dca90614313565b601b80546001600160a01b0319166001600160a01b0383169081179091556040519081527f5ba6b30cd4b2f9e9e67f4feb9b9df10d5da3b057598e6901b217b7d590345e30906020015b60405180910390a150565b600b546001600160a01b031633146110f35760405162461bcd60e51b8152600401610dca90614313565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b826001600160a01b038116331461112f5761112f33612c68565b61113a848484612e31565b50505050565b600e5462010000900460ff166111915760405162461bcd60e51b81526020600482015260166024820152751391950e8815d2551211149055d7d11254d05093115160521b6044820152606401610dca565b3361119b83611a97565b6001600160a01b0316146111c15760405162461bcd60e51b8152600401610dca906143ec565b60008281526020805260409020548111156111ee5760405162461bcd60e51b8152600401610dca90614414565b60008281526020805260408120805483929061120b908490614443565b9091555050601a5460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015611261573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611285919061445a565b50604051818152829033907fde6753f7f0a48b505d9790c63582a609562e88c7f558e0908c766fe314d1ffc7906020015b60405180910390a35050565b600b546001600160a01b031633146112ec5760405162461bcd60e51b8152600401610dca90614313565b600e805460ff8082161560ff1990921682179092556040519116151581527f44c55a34302c30c90518d704fdd11b325d41d28554b574d5b50b348129097439906020015b60405180910390a1565b6000828152600d602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916113af575060408051808201909152600c546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906113ce906001600160601b031687614477565b6113d89190614496565b91519350909150505b9250929050565b60006113f383611b85565b82106114555760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610dca565b506001600160a01b03919091166000908152600760209081526040808320938352929052205490565b600e5462010000900460ff166114ce5760405162461bcd60e51b81526020600482015260156024820152741391950e8811115413d4d25517d11254d050931151605a1b6044820152606401610dca565b6000828152602080526040812080548392906114eb908490614355565b9091555050601a546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015611547573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156b919061445a565b50604051818152829033907f178b49aa7c7a29844e726c642b89810346713fa303e2edbbc2ad8e5e51323cb4906020016112b6565b600b546001600160a01b031633146115ca5760405162461bcd60e51b8152600401610dca90614313565b4760006115df600b546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114611629576040519150601f19603f3d011682016040523d82523d6000602084013e61162e565b606091505b505090508061163c57600080fd5b6040518281527f4e70a604b23a8edee2b1d0a656e9b9c00b73ad8bb1afc2c59381ee9f69197de7906020015b60405180910390a15050565b826001600160a01b038116331461168e5761168e33612c68565b61113a848484612e62565b600b546001600160a01b031633146116c35760405162461bcd60e51b8152600401610dca90614313565b600f8190556040518181527f67a636bd521188e76be3df65432019912c3dc1f562fc0f4a50d97fbb3f0db962906020016110be565b600061170360095490565b82106117665760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610dca565b60098281548110611779576117796144b8565b90600052602060002001549050919050565b600b546001600160a01b031633146117b55760405162461bcd60e51b8152600401610dca90614313565b601a80546001600160a01b0319166001600160a01b0383169081179091556040519081527f77e797773e9e3d039cc6ef2fa97ed7e5a6cac83a7d4de7d41eae3efd34a0dde3906020016110be565b600b546001600160a01b0316331461182d5760405162461bcd60e51b8152600401610dca90614313565b8015611866576001600160a01b0383166000908152602260205260408120805484929061185b908490614355565b909155506118949050565b6001600160a01b0383166000908152602260205260408120805484929061188e908490614443565b90915550505b6040805183815282151560208201526001600160a01b038516917fc536e40c62a78823a09639b508463aabfab634c979f77ea025931639367e069d910160405180910390a2505050565b600b546001600160a01b031633146119085760405162461bcd60e51b8152600401610dca90614313565b611914601d8383613d5b565b507fe12d4d4a70d9b5c313db41dbfde977d2932dd59c55fca4a4af5181b2397c172582826040516116689291906144f7565b600e5462010000900460ff1661196e5760405162461bcd60e51b8152600401610dca906143c0565b3361197885611a97565b6001600160a01b03161461199e5760405162461bcd60e51b8152600401610dca906143ec565b60008481526020805260409020548311156119cb5760405162461bcd60e51b8152600401610dca90614414565b6000848152602080526040812080548592906119e8908490614443565b9091555050601a54604051630852cd8d60e31b8152600481018590526001600160a01b03909116906342966c6890602401600060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b5050505083336001600160a01b03167f650a3384f31fc47966ca08ca70932440d31263116d936f55a23e9e315ce43680858585604051611a899392919061450b565b60405180910390a350505050565b6000818152600360205260408120546001600160a01b031680610d9a5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610dca565b601d8054611b0490614386565b80601f0160208091040260200160405190810160405280929190818152602001828054611b3090614386565b8015611b7d5780601f10611b5257610100808354040283529160200191611b7d565b820191906000526020600020905b815481529060010190602001808311611b6057829003601f168201915b505050505081565b60006001600160a01b038216611bef5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610dca565b506001600160a01b031660009081526004602052604090205490565b600b546001600160a01b03163314611c355760405162461bcd60e51b8152600401610dca90614313565b611c3f6000612e7d565b565b60606000611c4e83611b85565b905060008167ffffffffffffffff811115611c6b57611c6b614193565b604051908082528060200260200182016040528015611c94578160200160208202803683370190505b50905060005b82811015611cdb57611cac85826113e8565b828281518110611cbe57611cbe6144b8565b602090810291909101015280611cd38161436d565b915050611c9a565b509392505050565b600b546001600160a01b03163314611d0d5760405162461bcd60e51b8152600401610dca90614313565b60108190556040518181527f3200428812d40889eb07ba80ff5097d51cfdd8e0934ac830fbaa7c17b5d02f5b906020016110be565b600e5462010000900460ff16611d6a5760405162461bcd60e51b8152600401610dca906143c0565b336000908152602160209081526040808320858452909152902054811115611dc95760405162461bcd60e51b81526020600482015260126024820152714e46543a204c4f575f414c4c4f57414e434560701b6044820152606401610dca565b6000828152602080526040902054811115611df65760405162461bcd60e51b8152600401610dca90614414565b600082815260208052604081208054839290611e13908490614443565b909155505033600090815260216020908152604080832085845290915281208054839290611e42908490614443565b9091555050601a54604051630852cd8d60e31b8152600481018390526001600160a01b03909116906342966c6890602401600060405180830381600087803b158015611e8d57600080fd5b505af1158015611ea1573d6000803e3d6000fd5b5050505081336001600160a01b03167f650a3384f31fc47966ca08ca70932440d31263116d936f55a23e9e315ce4368083604051806020016040528060008152506040516112b692919061452e565b600b546001600160a01b03163314611f1a5760405162461bcd60e51b8152600401610dca90614313565b611f26601c8383613d5b565b507f64729fba330f29cb50d748098a4dff25d203b0c55833653113fb5e80bcbd16c182826040516116689291906144f7565b606060028054610eb590614386565b600b546001600160a01b03163314611f915760405162461bcd60e51b8152600401610dca90614313565b600e805460ff62010000808304821615810262ff00001990931692909217928390556040517ff47948d009bea6a362c4d4db047b323bab46ade4a766429f1f3d871172c14a2c936113309390049091161515815260200190565b81611ff581612c68565b610e698383612ecf565b836001600160a01b03811633146120195761201933612c68565b61202585858585612eda565b5050505050565b600b546001600160a01b031633146120565760405162461bcd60e51b8152600401610dca90614313565b601980546001600160a01b0319166001600160a01b0383169081179091556040519081527f6e8caeb666a9adfb3e642b3649846a1fb3aadf89083ff3f1f7e95841d713e617906020016110be565b601c8054611b0490614386565b601e8054611b0490614386565b6000818152600360205260409020546060906001600160a01b031661213d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610dca565b6000612147612f0c565b905060008151116121675760405180602001604052806000815250612195565b8061217184612f1b565b601e60405160200161218593929190614547565b6040516020818303038152906040525b9392505050565b6121a4612fae565b600e5460ff166121eb5760405162461bcd60e51b81526020600482015260126024820152711391950e881352539517d11254d05093115160721b6044820152606401610dca565b60006121f660095490565b90506000861161223a5760405162461bcd60e51b815260206004820152600f60248201526e4e46543a20414d4f554e545f52455160881b6044820152606401610dca565b60125460115461224a9190614443565b86601554836122599190614443565b6122639190614355565b11156122b15760405162461bcd60e51b815260206004820152601960248201527f4e46543a205355525041535345445f4d41585f535550504c59000000000000006044820152606401610dca565b600b546001600160a01b031633146125ba573360009081526022602052604090205415612372573360009081526022602052604090205486111561232f5760405162461bcd60e51b81526020600482015260156024820152741391950e88105093d59157d4d313d517d312535255605a1b6044820152606401610dca565b336000908152602260205260408120805488929061234e908490614443565b9250508190555085601760008282546123679190614355565b909155506125d29050565b826123b35760405162461bcd60e51b81526020600482015260116024820152701391950e8814d251d7d491545552549151607a1b6044820152606401610dca565b33600090815260236020908152604080832085845290915290205460ff16156124145760405162461bcd60e51b81526020600482015260136024820152721391950e8814d251d7d393d390d157d554d151606a1b6044820152606401610dca565b601954604080516020601f8701819004810282018101909252858152612466926001600160a01b03169133918a918a9188918b908b908190840183828082843760009201919091525061300792505050565b6124a15760405162461bcd60e51b815260206004820152600c60248201526b4e46543a204241445f53494760a01b6044820152606401610dca565b4282116124e35760405162461bcd60e51b815260206004820152601060248201526f4e46543a20455850495245445f53494760801b6044820152606401610dca565b3360009081526023602090815260408083208584529091528120805460ff191660011790556016805488929061251a908490614355565b90915550508415801561252f57506000601054115b156125b557601a546010546040516323b872dd60e01b815233600482015230602482015260448101919091526001600160a01b03909116906323b872dd906064016020604051808303816000875af115801561258f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125b3919061445a565b505b6125d2565b85601460008282546125cc9190614355565b90915550505b60015b86811161261d5761260b3382601554856125ef9190614443565b6012546125fc9190614355565b6126069190614355565b612af2565b806126158161436d565b9150506125d5565b50506120256001600055565b600b546001600160a01b031633146126535760405162461bcd60e51b8152600401610dca90614313565b61265f601e8383613d5b565b507f585a9999016c8cbbbdf07cba52e1ef270d43c3f7a5be6a5faf01b706cd7174f182826040516116689291906144f7565b612699612fae565b600e54610100900460ff166126e65760405162461bcd60e51b81526020600482015260136024820152721391950e8810531313d0d7d11254d050931151606a1b6044820152606401610dca565b336126f085611a97565b6001600160a01b0316146127165760405162461bcd60e51b8152600401610dca906143ec565b601954612730906001600160a01b031633868686866130ad565b61276b5760405162461bcd60e51b815260206004820152600c60248201526b4e46543a204241445f53494760a01b6044820152606401610dca565b6000848152601f6020526040902054156127c05760405162461bcd60e51b81526020600482015260166024820152751391950e881053149150511657d0531313d0d055115160521b6044820152606401610dca565b82600f546127ce9190614477565b34101561281d5760405162461bcd60e51b815260206004820152601960248201527f4e46543a20494e53554646494349454e545f4445504f534954000000000000006044820152606401610dca565b826013600082825461282f9190614355565b90915550506000848152601f6020908152604080832086905590805290819020849055601a5490516340c10f1960e01b8152306004820152602481018590526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561289d57600080fd5b505af11580156128b1573d6000803e3d6000fd5b5050601b546040516340c10f1960e01b8152306004820152602481018790526001600160a01b0390911692506340c10f199150604401600060405180830381600087803b15801561290157600080fd5b505af1158015612915573d6000803e3d6000fd5b505060185460405162a39d9960e71b815260048101889052602481018790526001600160a01b0390911692506351cecc809150604401600060405180830381600087803b15801561296557600080fd5b505af1158015612979573d6000803e3d6000fd5b50506040518581528692503391507f9af9811abc6f1b9cf2234f8ed76daa9a577d4ffbbe0af66ec4b748cde6f4c39f9060200160405180910390a361113a6001600055565b6060601c8054610eb590614386565b600b546001600160a01b031633146129f75760405162461bcd60e51b8152600401610dca90614313565b6001600160a01b038116612a3f5760405162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f4144445245535360881b6044820152606401610dca565b612a4881612e7d565b50565b600b546001600160a01b03163314612a755760405162461bcd60e51b8152600401610dca90614313565b600e805460ff610100808304821615810261ff001990931692909217928390556040517fecf47d2f08f793fe090cfffc70356a979a8a34d7d5542f793657d709bbf278a2936113309390049091161515815260200190565b60006001600160e01b0319821663152a902d60e11b1480610d9a5750610d9a8261314e565b610ea2828260405180602001604052806000815250613173565b6127106001600160601b0382161115612b7a5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610dca565b6001600160a01b038216612bd05760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610dca565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600c55565b6000818152600360205260409020546001600160a01b0316612a485760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610dca565b6daaeb6d7670e522a718067333cd4e3b15612a4857604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf9919061445a565b612a4857604051633b79c77360e21b81526001600160a01b0382166004820152602401610dca565b6000612d2c82611a97565b9050806001600160a01b0316836001600160a01b031603612d995760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610dca565b336001600160a01b0382161480612db55750612db58133610cbf565b612e275760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610dca565b610e6983836131a6565b612e3b3382613214565b612e575760405162461bcd60e51b8152600401610dca9061460a565b610e69838383613293565b610e6983838360405180602001604052806000815250611fff565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610ea2338383613404565b612ee43383613214565b612f005760405162461bcd60e51b8152600401610dca9061460a565b61113a848484846134d2565b6060601d8054610eb590614386565b60606000612f2883613505565b600101905060008167ffffffffffffffff811115612f4857612f48614193565b6040519080825280601f01601f191660200182016040528015612f72576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612f7c57509392505050565b6002600054036130005760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610dca565b6002600055565b60006001600160a01b0387168103613021575060006130a3565b60408051606088901b6bffffffffffffffffffffffff19166020808301919091526034820188905286151560f81b605483015260558083018790528351808403909101815260759092019092528051910120600061307e826135dd565b9050886001600160a01b03166130948286613630565b6001600160a01b031614925050505b9695505050505050565b60408051606087901b6bffffffffffffffffffffffff191660208083019190915260348201879052605480830187905283518084039091018152607490920190925280519101206000906000613102826135dd565b9050886001600160a01b03166130948287878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061363092505050565b60006001600160e01b0319821663780e9d6360e01b1480610d9a5750610d9a826136af565b61317d83836136ff565b61318a6000848484613898565b610e695760405162461bcd60e51b8152600401610dca90614657565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906131db82611a97565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061322083611a97565b9050806001600160a01b0316846001600160a01b0316148061326757506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b8061328b5750836001600160a01b031661328084610f38565b6001600160a01b0316145b949350505050565b826001600160a01b03166132a682611a97565b6001600160a01b0316146132cc5760405162461bcd60e51b8152600401610dca906146a9565b6001600160a01b03821661332e5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610dca565b61333b8383836001613996565b826001600160a01b031661334e82611a97565b6001600160a01b0316146133745760405162461bcd60e51b8152600401610dca906146a9565b600081815260056020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260048552838620805460001901905590871680865283862080546001019055868652600390945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b816001600160a01b0316836001600160a01b0316036134655760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610dca565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6134dd848484613293565b6134e984848484613898565b61113a5760405162461bcd60e51b8152600401610dca90614657565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106135445772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613570576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061358e57662386f26fc10000830492506010015b6305f5e10083106135a6576305f5e100830492506008015b61271083106135ba57612710830492506004015b606483106135cc576064830492506002015b600a8310610d9a5760010192915050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60008060008061363f85613acf565b6040805160008152602081018083528b905260ff8316918101919091526060810184905260808101839052929550909350915060019060a0016020604051602081039080840390855afa15801561369a573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b60006001600160e01b031982166380ac58cd60e01b14806136e057506001600160e01b03198216635b5e139f60e01b145b80610d9a57506301ffc9a760e01b6001600160e01b0319831614610d9a565b6001600160a01b0382166137555760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610dca565b6000818152600360205260409020546001600160a01b0316156137ba5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610dca565b6137c8600083836001613996565b6000818152600360205260409020546001600160a01b03161561382d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610dca565b6001600160a01b038216600081815260046020908152604080832080546001019055848352600390915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561398e57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906138dc9033908990889088906004016146ee565b6020604051808303816000875af1925050508015613917575060408051601f3d908101601f1916820190925261391491810190614721565b60015b613974573d808015613945576040519150601f19603f3d011682016040523d82523d6000602084013e61394a565b606091505b50805160000361396c5760405162461bcd60e51b8152600401610dca90614657565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061328b565b50600161328b565b6139a284848484613b43565b6001811115613a115760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610dca565b816001600160a01b038516613a6d57613a6881600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b613a90565b836001600160a01b0316856001600160a01b031614613a9057613a908582613bcb565b6001600160a01b038416613aac57613aa781613c68565b612025565b846001600160a01b0316846001600160a01b031614612025576120258482613d17565b60008060008351604114613b255760405162461bcd60e51b815260206004820152601860248201527f696e76616c6964207369676e6174757265206c656e67746800000000000000006044820152606401610dca565b50505060208101516040820151606090920151909260009190911a90565b600181111561113a576001600160a01b03841615613b89576001600160a01b03841660009081526004602052604081208054839290613b83908490614443565b90915550505b6001600160a01b0383161561113a576001600160a01b03831660009081526004602052604081208054839290613bc0908490614355565b909155505050505050565b60006001613bd884611b85565b613be29190614443565b600083815260086020526040902054909150808214613c35576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b600954600090613c7a90600190614443565b6000838152600a602052604081205460098054939450909284908110613ca257613ca26144b8565b906000526020600020015490508060098381548110613cc357613cc36144b8565b6000918252602080832090910192909255828152600a90915260408082208490558582528120556009805480613cfb57613cfb61473e565b6001900381819060005260206000200160009055905550505050565b6000613d2283611b85565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b828054613d6790614386565b90600052602060002090601f016020900481019282613d895760008555613dcf565b82601f10613da25782800160ff19823516178555613dcf565b82800160010185558215613dcf579182015b82811115613dcf578235825591602001919060010190613db4565b50613ddb929150613ddf565b5090565b5b80821115613ddb5760008155600101613de0565b6001600160e01b031981168114612a4857600080fd5b600060208284031215613e1c57600080fd5b813561219581613df4565b60008060408385031215613e3a57600080fd5b50508035926020909101359150565b80356001600160a01b0381168114613e6057600080fd5b919050565b60008060408385031215613e7857600080fd5b613e8183613e49565b915060208301356001600160601b0381168114613e9d57600080fd5b809150509250929050565b60005b83811015613ec3578181015183820152602001613eab565b8381111561113a5750506000910152565b60008151808452613eec816020860160208601613ea8565b601f01601f19169290920160200192915050565b6020815260006121956020830184613ed4565b600060208284031215613f2557600080fd5b5035919050565b60008060408385031215613f3f57600080fd5b613f4883613e49565b946020939093013593505050565b600080600060608486031215613f6b57600080fd5b83359250613f7b60208501613e49565b9150604084013590509250925092565b600060208284031215613f9d57600080fd5b61219582613e49565b600080600060608486031215613fbb57600080fd5b613fc484613e49565b9250613f7b60208501613e49565b8015158114612a4857600080fd5b600080600060608486031215613ff557600080fd5b613ffe84613e49565b925060208401359150604084013561401581613fd2565b809150509250925092565b60008083601f84011261403257600080fd5b50813567ffffffffffffffff81111561404a57600080fd5b6020830191508360208285010111156113e157600080fd5b6000806020838503121561407557600080fd5b823567ffffffffffffffff81111561408c57600080fd5b61409885828601614020565b90969095509350505050565b600080600080606085870312156140ba57600080fd5b8435935060208501359250604085013567ffffffffffffffff8111156140df57600080fd5b6140eb87828801614020565b95989497509550505050565b6000806040838503121561410a57600080fd5b8235915061411a60208401613e49565b90509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561415b5783518352928401929184019160010161413f565b50909695505050505050565b6000806040838503121561417a57600080fd5b61418383613e49565b91506020830135613e9d81613fd2565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156141bf57600080fd5b6141c885613e49565b93506141d660208601613e49565b925060408501359150606085013567ffffffffffffffff808211156141fa57600080fd5b818701915087601f83011261420e57600080fd5b81358181111561422057614220614193565b604051601f8201601f19908116603f0116810190838211818310171561424857614248614193565b816040528281528a602084870101111561426157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060008060006080868803121561429d57600080fd5b8535945060208601356142af81613fd2565b9350604086013567ffffffffffffffff8111156142cb57600080fd5b6142d788828901614020565b96999598509660600135949350505050565b600080604083850312156142fc57600080fd5b61430583613e49565b915061411a60208401613e49565b60208082526012908201527127aba720a126229d102727aa2fa7aba722a960711b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082198211156143685761436861433f565b500190565b60006001820161437f5761437f61433f565b5060010190565b600181811c9082168061439a57607f821691505b6020821081036143ba57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601290820152711391950e881095549397d11254d05093115160721b604082015260600190565b6020808252600e908201526d27232a1d102727aa2fa7aba722a960911b604082015260600190565b6020808252601590820152741391950e88125394d551919250d251539517d09053605a1b604082015260600190565b6000828210156144555761445561433f565b500390565b60006020828403121561446c57600080fd5b815161219581613fd2565b60008160001904831182151516156144915761449161433f565b500290565b6000826144b357634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600061328b6020830184866144ce565b8381526040602082015260006145256040830184866144ce565b95945050505050565b82815260406020820152600061328b6040830184613ed4565b60008451602061455a8285838a01613ea8565b85519184019161456d8184848a01613ea8565b8554920191600090600181811c908083168061458a57607f831692505b85831081036145a757634e487b7160e01b85526022600452602485fd5b8080156145bb57600181146145cc576145f9565b60ff198516885283880195506145f9565b60008b81526020902060005b858110156145f15781548a8201529084019088016145d8565b505083880195505b50939b9a5050505050505050505050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906130a390830184613ed4565b60006020828403121561473357600080fd5b815161219581613df4565b634e487b7160e01b600052603160045260246000fdfea26469706673582212203a2c25d3f065703a646964eed054e03df72c202e2923e5df289faded32a4e0d864736f6c634300080d00330000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023728ece18d9e81c312a3e6121de83601117f1b60000000000000000000000007787d10f8f277bc509fb79c68bfc508d69dd41dc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000744726f6964504400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000544524f4944000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b697066733a2f2f6162632f000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106104265760003560e01c806370f2615711610229578063bdb4b8481161012e578063da3ef23f116100b6578063e985e9c51161007a578063e985e9c514610ca4578063f2fde38b14610ced578063f6b28e6a14610d0d578063f90a2f3014610d22578063fc0c546a14610d6f57600080fd5b8063da3ef23f14610c1c578063de9a2e0414610c3c578063df07d22a14610c4f578063e2dfcd3f14610c6f578063e8a3d48514610c8f57600080fd5b8063c6682862116100fd578063c668286214610b9b578063c87b56dd14610bb0578063c8ca9d8914610bd0578063d5abeb0114610bf0578063d5c067d514610c0657600080fd5b8063bdb4b84814610b3a578063bf83f2a214610b50578063c0e7274014610b70578063c128c67914610b8557600080fd5b80639760ca6f116101b1578063a8d34c3811610180578063a8d34c3814610a98578063aa5dcecc14610ac4578063ae2e933b14610ae4578063b88d4fde14610b04578063bc9c247414610b2457600080fd5b80639760ca6f14610a095780639af1dac014610a36578063a22cb46514610a4b578063a7cd52cb14610a6b57600080fd5b80638545f4ea116101f85780638545f4ea146109765780638769fd41146109965780638da5cb5b146109b6578063938e3d7b146109d457806395d89b41146109f457600080fd5b806370f26157146108de578063715018a6146108f4578063780e3f99146109095780638462151c1461094957600080fd5b80632f745c591161032f5780634f6ccce7116102b75780635e9cd328116102865780635e9cd3281461083d5780636352211e1461085d57806366cdb4ff1461087d5780636c0360eb146108a957806370a08231146108be57600080fd5b80634f6ccce7146107bd5780635343f3b5146107dd578063552c8735146107fd57806355f804b31461081d57600080fd5b80634174e103116102fe5780634174e1031461071857806341f434341461074557806342842e0e1461076757806344a0d68a1461078757806345f7f249146107a757600080fd5b80632f745c59146106ba57806330952299146106da5780633308c458146106fa5780633ccfd60b1461071057600080fd5b8063144fa6d7116103b25780631cd8fbc9116103815780631cd8fbc9146105ee57806323b872dd14610626578063291030db146106465780632984647b146106665780632a55205a1461067b57600080fd5b8063144fa6d71461057f57806318160ddd1461059f57806319db2228146105b45780631b8dca74146105d457600080fd5b806306fdde03116103f957806306fdde03146104c1578063081812fc146104e3578063095ea7b31461051b5780630c68efe31461053b57806313faede61461055b57600080fd5b806301ffc9a71461042b57806303b7a1b31461046057806303ea22c01461047f57806304634d8d146104a1575b600080fd5b34801561043757600080fd5b5061044b610446366004613e0a565b610d8f565b60405190151581526020015b60405180910390f35b34801561046c57600080fd5b50600e5461044b90610100900460ff1681565b34801561048b57600080fd5b5061049f61049a366004613e27565b610da0565b005b3480156104ad57600080fd5b5061049f6104bc366004613e65565b610e6e565b3480156104cd57600080fd5b506104d6610ea6565b6040516104579190613f00565b3480156104ef57600080fd5b506105036104fe366004613f13565b610f38565b6040516001600160a01b039091168152602001610457565b34801561052757600080fd5b5061049f610536366004613f2c565b610f5f565b34801561054757600080fd5b5061049f610556366004613f56565b610f73565b34801561056757600080fd5b50610571600f5481565b604051908152602001610457565b34801561058b57600080fd5b5061049f61059a366004613f8b565b61104a565b3480156105ab57600080fd5b50600954610571565b3480156105c057600080fd5b5061049f6105cf366004613f8b565b6110c9565b3480156105e057600080fd5b50600e5461044b9060ff1681565b3480156105fa57600080fd5b50610571610609366004613f2c565b602160209081526000928352604080842090915290825290205481565b34801561063257600080fd5b5061049f610641366004613fa6565b611115565b34801561065257600080fd5b5061049f610661366004613e27565b611140565b34801561067257600080fd5b5061049f6112c2565b34801561068757600080fd5b5061069b610696366004613e27565b61133a565b604080516001600160a01b039093168352602083019190915201610457565b3480156106c657600080fd5b506105716106d5366004613f2c565b6113e8565b3480156106e657600080fd5b5061049f6106f5366004613e27565b61147e565b34801561070657600080fd5b5061057160125481565b61049f6115a0565b34801561072457600080fd5b50610571610733366004613f13565b601f6020526000908152604090205481565b34801561075157600080fd5b506105036daaeb6d7670e522a718067333cd4e81565b34801561077357600080fd5b5061049f610782366004613fa6565b611674565b34801561079357600080fd5b5061049f6107a2366004613f13565b611699565b3480156107b357600080fd5b5061057160135481565b3480156107c957600080fd5b506105716107d8366004613f13565b6116f8565b3480156107e957600080fd5b5061049f6107f8366004613f8b565b61178b565b34801561080957600080fd5b5061049f610818366004613fe0565b611803565b34801561082957600080fd5b5061049f610838366004614062565b6118de565b34801561084957600080fd5b5061049f6108583660046140a4565b611946565b34801561086957600080fd5b50610503610878366004613f13565b611a97565b34801561088957600080fd5b50610571610898366004613f13565b602080526000908152604090205481565b3480156108b557600080fd5b506104d6611af7565b3480156108ca57600080fd5b506105716108d9366004613f8b565b611b85565b3480156108ea57600080fd5b5061057160155481565b34801561090057600080fd5b5061049f611c0b565b34801561091557600080fd5b506105716109243660046140f7565b6001600160a01b03166000908152602160209081526040808320938352929052205490565b34801561095557600080fd5b50610969610964366004613f8b565b611c41565b6040516104579190614123565b34801561098257600080fd5b5061049f610991366004613f13565b611ce3565b3480156109a257600080fd5b5061049f6109b1366004613e27565b611d42565b3480156109c257600080fd5b50600b546001600160a01b0316610503565b3480156109e057600080fd5b5061049f6109ef366004614062565b611ef0565b348015610a0057600080fd5b506104d6611f58565b348015610a1557600080fd5b50610571610a24366004613f13565b6000908152601f602052604090205490565b348015610a4257600080fd5b5061049f611f67565b348015610a5757600080fd5b5061049f610a66366004614167565b611feb565b348015610a7757600080fd5b50610571610a86366004613f8b565b60226020526000908152604090205481565b348015610aa457600080fd5b50610571610ab3366004613f13565b600090815260208052604090205490565b348015610ad057600080fd5b50601954610503906001600160a01b031681565b348015610af057600080fd5b50601854610503906001600160a01b031681565b348015610b1057600080fd5b5061049f610b1f3660046141a9565b611fff565b348015610b3057600080fd5b5061057160145481565b348015610b4657600080fd5b5061057160105481565b348015610b5c57600080fd5b5061049f610b6b366004613f8b565b61202c565b348015610b7c57600080fd5b506104d66120a4565b348015610b9157600080fd5b5061057160165481565b348015610ba757600080fd5b506104d66120b1565b348015610bbc57600080fd5b506104d6610bcb366004613f13565b6120be565b348015610bdc57600080fd5b5061049f610beb366004614285565b61219c565b348015610bfc57600080fd5b5061057160115481565b348015610c1257600080fd5b5061057160175481565b348015610c2857600080fd5b5061049f610c37366004614062565b612629565b61049f610c4a3660046140a4565b612691565b348015610c5b57600080fd5b50601a54610503906001600160a01b031681565b348015610c7b57600080fd5b50600e5461044b9062010000900460ff1681565b348015610c9b57600080fd5b506104d66129be565b348015610cb057600080fd5b5061044b610cbf3660046142e9565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b348015610cf957600080fd5b5061049f610d08366004613f8b565b6129cd565b348015610d1957600080fd5b5061049f612a4b565b348015610d2e57600080fd5b50610d5d610d3d366004613f2c565b602360209081526000928352604080842090915290825290205460ff1681565b60405160ff9091168152602001610457565b348015610d7b57600080fd5b50601b54610503906001600160a01b031681565b6000610d9a82612acd565b92915050565b600b546001600160a01b03163314610dd35760405162461bcd60e51b8152600401610dca90614313565b60405180910390fd5b601254610de08284614355565b1115610e255760405162461bcd60e51b81526020600482015260146024820152734e46543a2049445f4f55545f4f465f52414e474560601b6044820152606401610dca565b815b610e318284614355565b8111610e6957610e413382612af2565b60158054906000610e518361436d565b91905055508080610e619061436d565b915050610e27565b505050565b600b546001600160a01b03163314610e985760405162461bcd60e51b8152600401610dca90614313565b610ea28282612b0c565b5050565b606060018054610eb590614386565b80601f0160208091040260200160405190810160405280929190818152602001828054610ee190614386565b8015610f2e5780601f10610f0357610100808354040283529160200191610f2e565b820191906000526020600020905b815481529060010190602001808311610f1157829003601f168201915b5050505050905090565b6000610f4382612c09565b506000908152600560205260409020546001600160a01b031690565b81610f6981612c68565b610e698383612d21565b600e5462010000900460ff16610f9b5760405162461bcd60e51b8152600401610dca906143c0565b33610fa584611a97565b6001600160a01b031614610fcb5760405162461bcd60e51b8152600401610dca906143ec565b6001600160a01b038216600090815260216020908152604080832086845290915281208054839290610ffe908490614355565b90915550506040518181526001600160a01b03831690849033907f386398d4cb7b8cde915e2522cad3e37e10265f0eed0c4a971e940c8b371e9e8c9060200160405180910390a4505050565b600b546001600160a01b031633146110745760405162461bcd60e51b8152600401610dca90614313565b601b80546001600160a01b0319166001600160a01b0383169081179091556040519081527f5ba6b30cd4b2f9e9e67f4feb9b9df10d5da3b057598e6901b217b7d590345e30906020015b60405180910390a150565b600b546001600160a01b031633146110f35760405162461bcd60e51b8152600401610dca90614313565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b826001600160a01b038116331461112f5761112f33612c68565b61113a848484612e31565b50505050565b600e5462010000900460ff166111915760405162461bcd60e51b81526020600482015260166024820152751391950e8815d2551211149055d7d11254d05093115160521b6044820152606401610dca565b3361119b83611a97565b6001600160a01b0316146111c15760405162461bcd60e51b8152600401610dca906143ec565b60008281526020805260409020548111156111ee5760405162461bcd60e51b8152600401610dca90614414565b60008281526020805260408120805483929061120b908490614443565b9091555050601a5460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015611261573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611285919061445a565b50604051818152829033907fde6753f7f0a48b505d9790c63582a609562e88c7f558e0908c766fe314d1ffc7906020015b60405180910390a35050565b600b546001600160a01b031633146112ec5760405162461bcd60e51b8152600401610dca90614313565b600e805460ff8082161560ff1990921682179092556040519116151581527f44c55a34302c30c90518d704fdd11b325d41d28554b574d5b50b348129097439906020015b60405180910390a1565b6000828152600d602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916113af575060408051808201909152600c546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906113ce906001600160601b031687614477565b6113d89190614496565b91519350909150505b9250929050565b60006113f383611b85565b82106114555760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610dca565b506001600160a01b03919091166000908152600760209081526040808320938352929052205490565b600e5462010000900460ff166114ce5760405162461bcd60e51b81526020600482015260156024820152741391950e8811115413d4d25517d11254d050931151605a1b6044820152606401610dca565b6000828152602080526040812080548392906114eb908490614355565b9091555050601a546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015611547573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156b919061445a565b50604051818152829033907f178b49aa7c7a29844e726c642b89810346713fa303e2edbbc2ad8e5e51323cb4906020016112b6565b600b546001600160a01b031633146115ca5760405162461bcd60e51b8152600401610dca90614313565b4760006115df600b546001600160a01b031690565b6001600160a01b03164760405160006040518083038185875af1925050503d8060008114611629576040519150601f19603f3d011682016040523d82523d6000602084013e61162e565b606091505b505090508061163c57600080fd5b6040518281527f4e70a604b23a8edee2b1d0a656e9b9c00b73ad8bb1afc2c59381ee9f69197de7906020015b60405180910390a15050565b826001600160a01b038116331461168e5761168e33612c68565b61113a848484612e62565b600b546001600160a01b031633146116c35760405162461bcd60e51b8152600401610dca90614313565b600f8190556040518181527f67a636bd521188e76be3df65432019912c3dc1f562fc0f4a50d97fbb3f0db962906020016110be565b600061170360095490565b82106117665760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610dca565b60098281548110611779576117796144b8565b90600052602060002001549050919050565b600b546001600160a01b031633146117b55760405162461bcd60e51b8152600401610dca90614313565b601a80546001600160a01b0319166001600160a01b0383169081179091556040519081527f77e797773e9e3d039cc6ef2fa97ed7e5a6cac83a7d4de7d41eae3efd34a0dde3906020016110be565b600b546001600160a01b0316331461182d5760405162461bcd60e51b8152600401610dca90614313565b8015611866576001600160a01b0383166000908152602260205260408120805484929061185b908490614355565b909155506118949050565b6001600160a01b0383166000908152602260205260408120805484929061188e908490614443565b90915550505b6040805183815282151560208201526001600160a01b038516917fc536e40c62a78823a09639b508463aabfab634c979f77ea025931639367e069d910160405180910390a2505050565b600b546001600160a01b031633146119085760405162461bcd60e51b8152600401610dca90614313565b611914601d8383613d5b565b507fe12d4d4a70d9b5c313db41dbfde977d2932dd59c55fca4a4af5181b2397c172582826040516116689291906144f7565b600e5462010000900460ff1661196e5760405162461bcd60e51b8152600401610dca906143c0565b3361197885611a97565b6001600160a01b03161461199e5760405162461bcd60e51b8152600401610dca906143ec565b60008481526020805260409020548311156119cb5760405162461bcd60e51b8152600401610dca90614414565b6000848152602080526040812080548592906119e8908490614443565b9091555050601a54604051630852cd8d60e31b8152600481018590526001600160a01b03909116906342966c6890602401600060405180830381600087803b158015611a3357600080fd5b505af1158015611a47573d6000803e3d6000fd5b5050505083336001600160a01b03167f650a3384f31fc47966ca08ca70932440d31263116d936f55a23e9e315ce43680858585604051611a899392919061450b565b60405180910390a350505050565b6000818152600360205260408120546001600160a01b031680610d9a5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610dca565b601d8054611b0490614386565b80601f0160208091040260200160405190810160405280929190818152602001828054611b3090614386565b8015611b7d5780601f10611b5257610100808354040283529160200191611b7d565b820191906000526020600020905b815481529060010190602001808311611b6057829003601f168201915b505050505081565b60006001600160a01b038216611bef5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610dca565b506001600160a01b031660009081526004602052604090205490565b600b546001600160a01b03163314611c355760405162461bcd60e51b8152600401610dca90614313565b611c3f6000612e7d565b565b60606000611c4e83611b85565b905060008167ffffffffffffffff811115611c6b57611c6b614193565b604051908082528060200260200182016040528015611c94578160200160208202803683370190505b50905060005b82811015611cdb57611cac85826113e8565b828281518110611cbe57611cbe6144b8565b602090810291909101015280611cd38161436d565b915050611c9a565b509392505050565b600b546001600160a01b03163314611d0d5760405162461bcd60e51b8152600401610dca90614313565b60108190556040518181527f3200428812d40889eb07ba80ff5097d51cfdd8e0934ac830fbaa7c17b5d02f5b906020016110be565b600e5462010000900460ff16611d6a5760405162461bcd60e51b8152600401610dca906143c0565b336000908152602160209081526040808320858452909152902054811115611dc95760405162461bcd60e51b81526020600482015260126024820152714e46543a204c4f575f414c4c4f57414e434560701b6044820152606401610dca565b6000828152602080526040902054811115611df65760405162461bcd60e51b8152600401610dca90614414565b600082815260208052604081208054839290611e13908490614443565b909155505033600090815260216020908152604080832085845290915281208054839290611e42908490614443565b9091555050601a54604051630852cd8d60e31b8152600481018390526001600160a01b03909116906342966c6890602401600060405180830381600087803b158015611e8d57600080fd5b505af1158015611ea1573d6000803e3d6000fd5b5050505081336001600160a01b03167f650a3384f31fc47966ca08ca70932440d31263116d936f55a23e9e315ce4368083604051806020016040528060008152506040516112b692919061452e565b600b546001600160a01b03163314611f1a5760405162461bcd60e51b8152600401610dca90614313565b611f26601c8383613d5b565b507f64729fba330f29cb50d748098a4dff25d203b0c55833653113fb5e80bcbd16c182826040516116689291906144f7565b606060028054610eb590614386565b600b546001600160a01b03163314611f915760405162461bcd60e51b8152600401610dca90614313565b600e805460ff62010000808304821615810262ff00001990931692909217928390556040517ff47948d009bea6a362c4d4db047b323bab46ade4a766429f1f3d871172c14a2c936113309390049091161515815260200190565b81611ff581612c68565b610e698383612ecf565b836001600160a01b03811633146120195761201933612c68565b61202585858585612eda565b5050505050565b600b546001600160a01b031633146120565760405162461bcd60e51b8152600401610dca90614313565b601980546001600160a01b0319166001600160a01b0383169081179091556040519081527f6e8caeb666a9adfb3e642b3649846a1fb3aadf89083ff3f1f7e95841d713e617906020016110be565b601c8054611b0490614386565b601e8054611b0490614386565b6000818152600360205260409020546060906001600160a01b031661213d5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610dca565b6000612147612f0c565b905060008151116121675760405180602001604052806000815250612195565b8061217184612f1b565b601e60405160200161218593929190614547565b6040516020818303038152906040525b9392505050565b6121a4612fae565b600e5460ff166121eb5760405162461bcd60e51b81526020600482015260126024820152711391950e881352539517d11254d05093115160721b6044820152606401610dca565b60006121f660095490565b90506000861161223a5760405162461bcd60e51b815260206004820152600f60248201526e4e46543a20414d4f554e545f52455160881b6044820152606401610dca565b60125460115461224a9190614443565b86601554836122599190614443565b6122639190614355565b11156122b15760405162461bcd60e51b815260206004820152601960248201527f4e46543a205355525041535345445f4d41585f535550504c59000000000000006044820152606401610dca565b600b546001600160a01b031633146125ba573360009081526022602052604090205415612372573360009081526022602052604090205486111561232f5760405162461bcd60e51b81526020600482015260156024820152741391950e88105093d59157d4d313d517d312535255605a1b6044820152606401610dca565b336000908152602260205260408120805488929061234e908490614443565b9250508190555085601760008282546123679190614355565b909155506125d29050565b826123b35760405162461bcd60e51b81526020600482015260116024820152701391950e8814d251d7d491545552549151607a1b6044820152606401610dca565b33600090815260236020908152604080832085845290915290205460ff16156124145760405162461bcd60e51b81526020600482015260136024820152721391950e8814d251d7d393d390d157d554d151606a1b6044820152606401610dca565b601954604080516020601f8701819004810282018101909252858152612466926001600160a01b03169133918a918a9188918b908b908190840183828082843760009201919091525061300792505050565b6124a15760405162461bcd60e51b815260206004820152600c60248201526b4e46543a204241445f53494760a01b6044820152606401610dca565b4282116124e35760405162461bcd60e51b815260206004820152601060248201526f4e46543a20455850495245445f53494760801b6044820152606401610dca565b3360009081526023602090815260408083208584529091528120805460ff191660011790556016805488929061251a908490614355565b90915550508415801561252f57506000601054115b156125b557601a546010546040516323b872dd60e01b815233600482015230602482015260448101919091526001600160a01b03909116906323b872dd906064016020604051808303816000875af115801561258f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125b3919061445a565b505b6125d2565b85601460008282546125cc9190614355565b90915550505b60015b86811161261d5761260b3382601554856125ef9190614443565b6012546125fc9190614355565b6126069190614355565b612af2565b806126158161436d565b9150506125d5565b50506120256001600055565b600b546001600160a01b031633146126535760405162461bcd60e51b8152600401610dca90614313565b61265f601e8383613d5b565b507f585a9999016c8cbbbdf07cba52e1ef270d43c3f7a5be6a5faf01b706cd7174f182826040516116689291906144f7565b612699612fae565b600e54610100900460ff166126e65760405162461bcd60e51b81526020600482015260136024820152721391950e8810531313d0d7d11254d050931151606a1b6044820152606401610dca565b336126f085611a97565b6001600160a01b0316146127165760405162461bcd60e51b8152600401610dca906143ec565b601954612730906001600160a01b031633868686866130ad565b61276b5760405162461bcd60e51b815260206004820152600c60248201526b4e46543a204241445f53494760a01b6044820152606401610dca565b6000848152601f6020526040902054156127c05760405162461bcd60e51b81526020600482015260166024820152751391950e881053149150511657d0531313d0d055115160521b6044820152606401610dca565b82600f546127ce9190614477565b34101561281d5760405162461bcd60e51b815260206004820152601960248201527f4e46543a20494e53554646494349454e545f4445504f534954000000000000006044820152606401610dca565b826013600082825461282f9190614355565b90915550506000848152601f6020908152604080832086905590805290819020849055601a5490516340c10f1960e01b8152306004820152602481018590526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561289d57600080fd5b505af11580156128b1573d6000803e3d6000fd5b5050601b546040516340c10f1960e01b8152306004820152602481018790526001600160a01b0390911692506340c10f199150604401600060405180830381600087803b15801561290157600080fd5b505af1158015612915573d6000803e3d6000fd5b505060185460405162a39d9960e71b815260048101889052602481018790526001600160a01b0390911692506351cecc809150604401600060405180830381600087803b15801561296557600080fd5b505af1158015612979573d6000803e3d6000fd5b50506040518581528692503391507f9af9811abc6f1b9cf2234f8ed76daa9a577d4ffbbe0af66ec4b748cde6f4c39f9060200160405180910390a361113a6001600055565b6060601c8054610eb590614386565b600b546001600160a01b031633146129f75760405162461bcd60e51b8152600401610dca90614313565b6001600160a01b038116612a3f5760405162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f4144445245535360881b6044820152606401610dca565b612a4881612e7d565b50565b600b546001600160a01b03163314612a755760405162461bcd60e51b8152600401610dca90614313565b600e805460ff610100808304821615810261ff001990931692909217928390556040517fecf47d2f08f793fe090cfffc70356a979a8a34d7d5542f793657d709bbf278a2936113309390049091161515815260200190565b60006001600160e01b0319821663152a902d60e11b1480610d9a5750610d9a8261314e565b610ea2828260405180602001604052806000815250613173565b6127106001600160601b0382161115612b7a5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610dca565b6001600160a01b038216612bd05760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610dca565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600c55565b6000818152600360205260409020546001600160a01b0316612a485760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610dca565b6daaeb6d7670e522a718067333cd4e3b15612a4857604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015612cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf9919061445a565b612a4857604051633b79c77360e21b81526001600160a01b0382166004820152602401610dca565b6000612d2c82611a97565b9050806001600160a01b0316836001600160a01b031603612d995760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610dca565b336001600160a01b0382161480612db55750612db58133610cbf565b612e275760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610dca565b610e6983836131a6565b612e3b3382613214565b612e575760405162461bcd60e51b8152600401610dca9061460a565b610e69838383613293565b610e6983838360405180602001604052806000815250611fff565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610ea2338383613404565b612ee43383613214565b612f005760405162461bcd60e51b8152600401610dca9061460a565b61113a848484846134d2565b6060601d8054610eb590614386565b60606000612f2883613505565b600101905060008167ffffffffffffffff811115612f4857612f48614193565b6040519080825280601f01601f191660200182016040528015612f72576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612f7c57509392505050565b6002600054036130005760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610dca565b6002600055565b60006001600160a01b0387168103613021575060006130a3565b60408051606088901b6bffffffffffffffffffffffff19166020808301919091526034820188905286151560f81b605483015260558083018790528351808403909101815260759092019092528051910120600061307e826135dd565b9050886001600160a01b03166130948286613630565b6001600160a01b031614925050505b9695505050505050565b60408051606087901b6bffffffffffffffffffffffff191660208083019190915260348201879052605480830187905283518084039091018152607490920190925280519101206000906000613102826135dd565b9050886001600160a01b03166130948287878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061363092505050565b60006001600160e01b0319821663780e9d6360e01b1480610d9a5750610d9a826136af565b61317d83836136ff565b61318a6000848484613898565b610e695760405162461bcd60e51b8152600401610dca90614657565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906131db82611a97565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061322083611a97565b9050806001600160a01b0316846001600160a01b0316148061326757506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b8061328b5750836001600160a01b031661328084610f38565b6001600160a01b0316145b949350505050565b826001600160a01b03166132a682611a97565b6001600160a01b0316146132cc5760405162461bcd60e51b8152600401610dca906146a9565b6001600160a01b03821661332e5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610dca565b61333b8383836001613996565b826001600160a01b031661334e82611a97565b6001600160a01b0316146133745760405162461bcd60e51b8152600401610dca906146a9565b600081815260056020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260048552838620805460001901905590871680865283862080546001019055868652600390945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b816001600160a01b0316836001600160a01b0316036134655760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610dca565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6134dd848484613293565b6134e984848484613898565b61113a5760405162461bcd60e51b8152600401610dca90614657565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106135445772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613570576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061358e57662386f26fc10000830492506010015b6305f5e10083106135a6576305f5e100830492506008015b61271083106135ba57612710830492506004015b606483106135cc576064830492506002015b600a8310610d9a5760010192915050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60008060008061363f85613acf565b6040805160008152602081018083528b905260ff8316918101919091526060810184905260808101839052929550909350915060019060a0016020604051602081039080840390855afa15801561369a573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b60006001600160e01b031982166380ac58cd60e01b14806136e057506001600160e01b03198216635b5e139f60e01b145b80610d9a57506301ffc9a760e01b6001600160e01b0319831614610d9a565b6001600160a01b0382166137555760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610dca565b6000818152600360205260409020546001600160a01b0316156137ba5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610dca565b6137c8600083836001613996565b6000818152600360205260409020546001600160a01b03161561382d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610dca565b6001600160a01b038216600081815260046020908152604080832080546001019055848352600390915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b1561398e57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906138dc9033908990889088906004016146ee565b6020604051808303816000875af1925050508015613917575060408051601f3d908101601f1916820190925261391491810190614721565b60015b613974573d808015613945576040519150601f19603f3d011682016040523d82523d6000602084013e61394a565b606091505b50805160000361396c5760405162461bcd60e51b8152600401610dca90614657565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061328b565b50600161328b565b6139a284848484613b43565b6001811115613a115760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610dca565b816001600160a01b038516613a6d57613a6881600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b613a90565b836001600160a01b0316856001600160a01b031614613a9057613a908582613bcb565b6001600160a01b038416613aac57613aa781613c68565b612025565b846001600160a01b0316846001600160a01b031614612025576120258482613d17565b60008060008351604114613b255760405162461bcd60e51b815260206004820152601860248201527f696e76616c6964207369676e6174757265206c656e67746800000000000000006044820152606401610dca565b50505060208101516040820151606090920151909260009190911a90565b600181111561113a576001600160a01b03841615613b89576001600160a01b03841660009081526004602052604081208054839290613b83908490614443565b90915550505b6001600160a01b0383161561113a576001600160a01b03831660009081526004602052604081208054839290613bc0908490614355565b909155505050505050565b60006001613bd884611b85565b613be29190614443565b600083815260086020526040902054909150808214613c35576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b600954600090613c7a90600190614443565b6000838152600a602052604081205460098054939450909284908110613ca257613ca26144b8565b906000526020600020015490508060098381548110613cc357613cc36144b8565b6000918252602080832090910192909255828152600a90915260408082208490558582528120556009805480613cfb57613cfb61473e565b6001900381819060005260206000200160009055905550505050565b6000613d2283611b85565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b828054613d6790614386565b90600052602060002090601f016020900481019282613d895760008555613dcf565b82601f10613da25782800160ff19823516178555613dcf565b82800160010185558215613dcf579182015b82811115613dcf578235825591602001919060010190613db4565b50613ddb929150613ddf565b5090565b5b80821115613ddb5760008155600101613de0565b6001600160e01b031981168114612a4857600080fd5b600060208284031215613e1c57600080fd5b813561219581613df4565b60008060408385031215613e3a57600080fd5b50508035926020909101359150565b80356001600160a01b0381168114613e6057600080fd5b919050565b60008060408385031215613e7857600080fd5b613e8183613e49565b915060208301356001600160601b0381168114613e9d57600080fd5b809150509250929050565b60005b83811015613ec3578181015183820152602001613eab565b8381111561113a5750506000910152565b60008151808452613eec816020860160208601613ea8565b601f01601f19169290920160200192915050565b6020815260006121956020830184613ed4565b600060208284031215613f2557600080fd5b5035919050565b60008060408385031215613f3f57600080fd5b613f4883613e49565b946020939093013593505050565b600080600060608486031215613f6b57600080fd5b83359250613f7b60208501613e49565b9150604084013590509250925092565b600060208284031215613f9d57600080fd5b61219582613e49565b600080600060608486031215613fbb57600080fd5b613fc484613e49565b9250613f7b60208501613e49565b8015158114612a4857600080fd5b600080600060608486031215613ff557600080fd5b613ffe84613e49565b925060208401359150604084013561401581613fd2565b809150509250925092565b60008083601f84011261403257600080fd5b50813567ffffffffffffffff81111561404a57600080fd5b6020830191508360208285010111156113e157600080fd5b6000806020838503121561407557600080fd5b823567ffffffffffffffff81111561408c57600080fd5b61409885828601614020565b90969095509350505050565b600080600080606085870312156140ba57600080fd5b8435935060208501359250604085013567ffffffffffffffff8111156140df57600080fd5b6140eb87828801614020565b95989497509550505050565b6000806040838503121561410a57600080fd5b8235915061411a60208401613e49565b90509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561415b5783518352928401929184019160010161413f565b50909695505050505050565b6000806040838503121561417a57600080fd5b61418383613e49565b91506020830135613e9d81613fd2565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156141bf57600080fd5b6141c885613e49565b93506141d660208601613e49565b925060408501359150606085013567ffffffffffffffff808211156141fa57600080fd5b818701915087601f83011261420e57600080fd5b81358181111561422057614220614193565b604051601f8201601f19908116603f0116810190838211818310171561424857614248614193565b816040528281528a602084870101111561426157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060008060006080868803121561429d57600080fd5b8535945060208601356142af81613fd2565b9350604086013567ffffffffffffffff8111156142cb57600080fd5b6142d788828901614020565b96999598509660600135949350505050565b600080604083850312156142fc57600080fd5b61430583613e49565b915061411a60208401613e49565b60208082526012908201527127aba720a126229d102727aa2fa7aba722a960711b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082198211156143685761436861433f565b500190565b60006001820161437f5761437f61433f565b5060010190565b600181811c9082168061439a57607f821691505b6020821081036143ba57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601290820152711391950e881095549397d11254d05093115160721b604082015260600190565b6020808252600e908201526d27232a1d102727aa2fa7aba722a960911b604082015260600190565b6020808252601590820152741391950e88125394d551919250d251539517d09053605a1b604082015260600190565b6000828210156144555761445561433f565b500390565b60006020828403121561446c57600080fd5b815161219581613fd2565b60008160001904831182151516156144915761449161433f565b500290565b6000826144b357634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60208152600061328b6020830184866144ce565b8381526040602082015260006145256040830184866144ce565b95945050505050565b82815260406020820152600061328b6040830184613ed4565b60008451602061455a8285838a01613ea8565b85519184019161456d8184848a01613ea8565b8554920191600090600181811c908083168061458a57607f831692505b85831081036145a757634e487b7160e01b85526022600452602485fd5b8080156145bb57600181146145cc576145f9565b60ff198516885283880195506145f9565b60008b81526020902060005b858110156145f15781548a8201529084019088016145d8565b505083880195505b50939b9a5050505050505050505050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906130a390830184613ed4565b60006020828403121561473357600080fd5b815161219581613df4565b634e487b7160e01b600052603160045260246000fdfea26469706673582212203a2c25d3f065703a646964eed054e03df72c202e2923e5df289faded32a4e0d864736f6c634300080d0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023728ece18d9e81c312a3e6121de83601117f1b60000000000000000000000007787d10f8f277bc509fb79c68bfc508d69dd41dc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000744726f6964504400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000544524f4944000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b697066733a2f2f6162632f000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _name (string): DroidPD
Arg [1] : _symbol (string): DROID
Arg [2] : _initBaseURI (string): ipfs://abc/
Arg [3] : _maxSupply (uint256): 10000
Arg [4] : _treasuryEditionSupply (uint256): 1000
Arg [5] : _feePool (address): 0x0000000000000000000000000000000000000000
Arg [6] : _allocator (address): 0x23728eCe18D9E81C312a3E6121DE83601117f1b6
Arg [7] : _energon (address): 0x7787D10F8F277bC509fb79c68BFC508d69dd41dC
Arg [8] : _token (address): 0x0000000000000000000000000000000000000000
-----Encoded View---------------
15 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [2] : 00000000000000000000000000000000000000000000000000000000000001a0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000002710
Arg [4] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 00000000000000000000000023728ece18d9e81c312a3e6121de83601117f1b6
Arg [7] : 0000000000000000000000007787d10f8f277bc509fb79c68bfc508d69dd41dc
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [10] : 44726f6964504400000000000000000000000000000000000000000000000000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [12] : 44524f4944000000000000000000000000000000000000000000000000000000
Arg [13] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [14] : 697066733a2f2f6162632f000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.