Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
15003204 | 915 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
UniqueCollectionInitializableV1
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-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./UniqueCollectionRoyaltiesV1.sol"; /** * @title Fuel Initializable implementation of ERC721 * @author https://www.onfuel.io * @dev this contract will not be deployed directly. * New clones shall be created through `UniqueCollectionCloneFactoryV1`. * @dev this contract is designed to be controllable through * 2 accounts and 2 roles. Accounts are granted roles in the initializer. * `roleAdmin` has authority to grant and revoke roles * later on. * * Accounts: * * `roleAdmin` * - has `DEFAULT_ADMIN_ROLE`. * - Should be with a TimelockController controlled by a Gnosis Safe. * * `manager` * - has `MANAGER_ROLE`. * - is the fuel-core plattform by default. * * Roles: * * `DEFAULT_ADMIN_ROLE` * - attached to `roleAdmin` * - can {grantRole} and {revoveRole} for all roles and accounts * - can call {unpause} * - can call {withdrawNativeTokens} * - can call {recoverERC20} * * `MANAGER_ROLE` * - attached to `manager` * - can call {toggleSaleState} * - can call {setAllowListMintEndBlockHeight} * - can call {setPublicMintStartBlockHeight} * - can call {setSaleStateAndBlockHeights} * - can call {setRoyaltyRecipient} * - can call {decreaseRoyaltyPercentage} * - can call {setBaseURI} * - can call {managerMint} * - can call {pause} */ contract UniqueCollectionInitializableV1 is Initializable, ERC721Upgradeable, UniqueCollectionRoyaltiesV1, AccessControlUpgradeable, OwnableUpgradeable, PausableUpgradeable { using CountersUpgradeable for CountersUpgradeable.Counter; using SafeERC20 for IERC20; /** * @dev counter for tokenIds, should start with 1 and increment * after every mint */ CountersUpgradeable.Counter private _tokenIdCounter; /** * @dev the block.number until {allowListMint} can be called * to mint tokens with a mekle proof and ETH/MATIC. * * N > block.number -> allowListMint is enabled * N <= block.number -> allowListMint is disabled */ uint128 public allowListMintEndBlockHeight; /** * @dev the block.number at which the {publicMint} can be called * to buy tokens with ETH/MATIC. * * N == 0 -> {publicMint} is disabled * N > block.number -> {publicMint} will enable the future * N <= block.number -> {publicMint} is enabled */ uint128 public publicMintStartBlockHeight; /** * @dev following 5 storage vars should be packed in to one slot */ /** * @dev true if sale is active. See modifier {isSaleActive} * {managerMint}, {allowListMint} and {publicMint} can only be called if * this is set to true. */ bool public saleActive; /** * @dev how many tokens can be minted in total. * {managerMint}, {allowListMint} and {publicMint} can only be called if * the total balance of all the token owners is less than maxSupply * see {tokensLeft} modifier. * Can not be changed after initialized */ uint64 public maxSupply; /** * @dev how many tokens can be minted per address. * Can not be changed later. * Can not be changed after initialized */ uint56 public maxMintPerAddress; /** * @dev the native token (ETH/MATIC) price for * minting with {allowListMint} and {publicMint} in WEI. * {allowListMint} and {publicMint} can only be called * msg.value is higher than mintPrice. * max is 5,192,296,858,534,827 ETH */ uint112 public mintPrice; /** * @dev how many tokens can be minted per address during allowListMint. * 0 means no limit, limit of maxMintPerAddress is enforeced though. * period. * Can not be changed after initialized. */ uint16 public maxAllowListMintPerAddress; /** * @dev baseURI for token metadata * Can not be changed after initialized through {setBaseURI} */ string public _extendedBaseURI; /** * @dev how many tokens have been minted for one address. * Is used to check if maxMintPerAddress has been exceeded. */ mapping(address => uint256) public minted; /** * @dev merkle tree root hash for {allowListMint} * Can not be changed after initialized. */ bytes32 public allowListMerkleRoot; /** * @dev `MANAGER_ROLE` this role can call all sensitive operations. * This role is given to the manager account in the initializer. * *WARNING* this role gives full control over all sensitive operations. * *WARNING* this role can NOT grant or revoke roles. */ bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE"); /** * @dev Emitted when a `manager` activates or deactivates the sale * of the NFTs through a call to {toggleSaleState} or {setSaleStateAndBlockHeights} * `active` is a bool indicating if the sale is active (true). */ event SaleStatusChanged( bool active ); /** * @dev Emitted when a `manager` changes the allowListMintEndBlockHeight * through a call to {toggleSaleState} or {setAllowListMintEndBlockHeight}. */ event AllowListMintEndBlockHeightChanged( uint128 allowListMintEndBlockHeight ); /** * @dev Emitted when a `manager` changes the publicMintStartBlockHeight * through a call to {toggleSaleState} or {setPublicMintStartBlockHeight}. */ event PublicMintStartBlockHeightChanged( uint128 publicMintStartBlockHeight ); /** * @dev Emitted when a `manager` updated the baseURI through * a call to {setBaseURI}. * `baseURI` is a uri to the metadata of the NFT. */ event BaseURIChanged( string baseURI ); /// @custom:oz-upgrades-unsafe-allow constructor // solhint-disable-next-line no-empty-blocks constructor() initializer {} /** * @notice Struct for initializing the `UniqueCollectionInitializableV1`. * @param _roleAdmin address of the account that will have `DEFAULT_ADMIN_ROLE`. * Can grant and revoke roles to other accounts on the new `UniqueCollectionInitializableV1`. * Can NOT mint, pause, ect. on the new `UniqueCollectionInitializableV1`. * @param _manager account that will have `MANAGER_ROLE` on the new UniqueCollectionV`. * Can call all sensitive operations ({managerMint}, {toggleSaleState}...). * Must be given to a account that the fuel-core controls in order to * mint on behelve of the arist. * @param _maxSupply the maximum amount of tokens that can be minted. * Can not be changed later on. * @param _name name of the Token (e. g. 'Jane's Awsome Collection'). * Can not be changed later on. * @param _symbol symbol of the Token (e.g. 'JAC'). * Can not be changed later on. * @param baseURI the metadata base uri of the tokens * Can be changed later on. * @param royaltyPercentage royalties to be payed in percent (10000 = 100%) * @param royaltyRecipient the account to receive the royalties * @param mintPrice eth price of one token to be payed by {allowListMint} and {publicMint} * @param maxAllowListMintPerAddress how many tokens can be minted per address trough * @param allowListMerkleRoot merke root hash of allowlist for {allowListMint} * {allowListMint}. */ struct InitializeData { address roleAdmin; address manager; uint64 maxSupply; uint56 maxMintPerAddress; string name; string symbol; string baseURI; uint256 royaltyPercentage; address royaltyRecipient; uint112 mintPrice; uint16 maxAllowListMintPerAddress; bytes32 allowListMerkleRoot; } /** * @notice initialize the `UniqueCollectionInitializableV1`. * @dev clones of this contract are created by the `manager` * account of fuel-core through it's `UniqueCollectionCloneFactoryV1` contract * and are not meant to be created directly through an individual deployment. */ function initialize( InitializeData calldata _init ) public initializer { require(_init.roleAdmin != address(0), "RoleAdmin is address(0)"); require(_init.manager != address(0), "Manager is address(0)"); require(_init.maxSupply > 0, "maxSupply must be greater than 0"); __ERC721_init(_init.name, _init.symbol); __Pausable_init(); __AccessControl_init(); // we are not calling __Ownable_init() // because we don't want msg.sender to be the owner. // we will call _transferOwnership later. maxSupply = _init.maxSupply; maxMintPerAddress = _init.maxMintPerAddress; allowListMerkleRoot = _init.allowListMerkleRoot; maxAllowListMintPerAddress = _init.maxAllowListMintPerAddress; mintPrice = _init.mintPrice; _tokenIdCounter.increment(); // Ensure we start from ID 1 _extendedBaseURI = _init.baseURI; _grantRole(DEFAULT_ADMIN_ROLE, _init.roleAdmin); _grantRole(MANAGER_ROLE, _init.manager); _setTokenRoyalty(_init.royaltyPercentage, _init.royaltyRecipient); _transferOwnership(_init.manager); } modifier onlyManager() { require(hasRole(MANAGER_ROLE, msg.sender), "Caller is not manager"); _; } modifier onlyAdmin() { require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "Caller is not admin"); _; } modifier onlyProof( bytes32[] calldata _merkleProof ) { require(isProofValid(_merkleProof, _msgSender()), "invalid proof"); _; } modifier isSaleActive() { require (saleActive, "Sale is not active"); _; } modifier tokensLeft() { require(_tokenIdCounter.current() <= maxSupply, "Purchase would exceed max tokens"); _; } modifier canStillMint(address to, uint256 amount) { if (maxMintPerAddress > 0) { require( minted[to] + amount <= maxMintPerAddress, "maxMintPerAddress exceeded" ); } _; } // External functions /** * @notice publish the `UniqueCollectionInitializableV1` as active for sale. * only after this function has been called with parameter `true` a * mint can be successful. * @param _saleActive bool of the new state. `true` means on sale. */ function toggleSaleState( bool _saleActive ) external onlyManager { saleActive = _saleActive; emit SaleStatusChanged(_saleActive); } /** * @notice see {_setAllowListMintEndBlockHeight} */ function setAllowListMintEndBlockHeight( uint128 _allowListMintEndBlockHeight ) external onlyManager { _setAllowListMintEndBlockHeight(_allowListMintEndBlockHeight); } /** * @notice see {_setPublicMintStartBlockHeight} */ function setPublicMintStartBlockHeight( uint128 _publicMintStartBlockHeight ) external onlyManager { _setPublicMintStartBlockHeight(_publicMintStartBlockHeight); } /** * @notice combine {toggleSaleState}, {setAllowListMintEndBlockHeight} * & {setPublicMintStartBlockHeight} in one call. */ function setSaleStateAndBlockHeights( bool _saleActive, uint128 _allowListMintEndBlockHeight, uint128 _publicMintStartBlockHeight ) external onlyManager { saleActive = _saleActive; _setAllowListMintEndBlockHeight(_allowListMintEndBlockHeight); _setPublicMintStartBlockHeight(_publicMintStartBlockHeight); emit SaleStatusChanged(_saleActive); } /** * @notice sets the baseURI of the token metadata. * @param _newBaseURI uri of the baseURI, should be on ipfs */ function setBaseURI(string memory _newBaseURI) external onlyManager { _extendedBaseURI = _newBaseURI; emit BaseURIChanged(_newBaseURI); } /** * @notice sets a new recepient of royalties. * @param _recipient address of recepient or the royalties */ function setRoyaltyRecipient(address _recipient) external onlyManager { _setTokenRoyaltyRecipient(_recipient); } /** * @notice decreases the royalties * @param _royaltyPercentage royalties to be payed in percent (10000 = 100%) */ function decreaseRoyaltyPercentage(uint256 _royaltyPercentage) external onlyManager { require(_royaltyPercentage < royaltyPercentage, "royaltyPercentage not lower"); _setTokenRoyaltyPercentage(_royaltyPercentage); } /** * @notice Mint tokens on behalve of the creator * @dev caller needs to have `MANAGER_ROLE` which is given by * default to the `manager` account specified in the constructor. * @dev caller should be the fuel-core backend which mint's tokens * on behalve of a buyer in order to purchase tokens without native * network tokens (ETH/MATIC ect.) * @dev tokenId is auto incremented. * @dev avoids minting tokens to contracts that can not recover them * through use of the _safeMint internal function. * @param to address of the receiver of the newly minted token */ function managerMint(address to) external isSaleActive tokensLeft canStillMint(to, 1) onlyManager { uint256 tokenId = _tokenIdCounter.current(); _tokenIdCounter.increment(); minted[to]+=1; _safeMint(to, tokenId); } /** * @notice allows for minting tokens for mintPrice * if allowListMint is enabled and user provides a valid * mekle proof. * See {allowListMintEndBlockHeight} */ function allowListMint(bytes32[] calldata _merkleProof) external payable onlyProof(_merkleProof) isSaleActive tokensLeft canStillMint(_msgSender(), 1) { require( block.number < allowListMintEndBlockHeight, "not allowList sale" ); if(maxAllowListMintPerAddress > 0) { require( minted[_msgSender()] < maxAllowListMintPerAddress, "already minted" ); } require(msg.value >= mintPrice, "price too low"); minted[_msgSender()]+=1; uint256 tokenId = _tokenIdCounter.current(); _tokenIdCounter.increment(); _safeMint(_msgSender(), tokenId); } /** * @notice allows for minting tokens for mintPrice * if sale is active and public. * See {publicMintStartBlockHeight} */ function publicMint() external payable isSaleActive tokensLeft canStillMint(_msgSender(), 1) { require( publicMintStartBlockHeight > 0 && block.number >= publicMintStartBlockHeight, "not public sale" ); require(msg.value >= mintPrice, "price too low"); minted[_msgSender()]+=1; uint256 tokenId = _tokenIdCounter.current(); _tokenIdCounter.increment(); _safeMint(_msgSender(), tokenId); } /** * @notice pause the contract for all transfers */ function pause() external onlyManager { _pause(); } /** * @notice unpause the contract for all transfers */ function unpause() external onlyAdmin { _unpause(); } /** * @notice roleAdmin can withdraw * @param _to address of receiver of the tokens */ function withdrawNativeTokens( address payable _to ) external onlyAdmin { require(_to != address(0), "invalid withdraw receiver"); // solhint-disable-next-line avoid-low-level-calls (bool sent, ) = _to.call{value: address(this).balance}(""); require(sent, "Failed to send Ether"); } /** * @notice allows roleAdmin to recover tokens that have accidentally * @param _tokenAddress contract address of the ERC20 token that * one intends to recover * @param _receiver address of account that shall receiver the tokens * @param _tokenAmount amount tokens that shall be sent to the receiver */ function recoverERC20( address _tokenAddress, address _receiver, uint256 _tokenAmount ) external onlyAdmin { IERC20(_tokenAddress).safeTransfer(_receiver, _tokenAmount); } // External view functions /** * @notice tells how many tokens have been minted * @return amount of tokens that have been minted so far */ function totalSupply() external view returns (uint256) { return _tokenIdCounter.current() - 1; } // Public view functions /** * @notice test if a _merkleProof is valid * @param _merkleProof the proof for this _sender * @param _sender the sender of this _merkleProof * @return isValid true if the proof is valid in * the context of the allowListMerkleRoot in storage */ function isProofValid( bytes32[] calldata _merkleProof, address _sender ) public view returns (bool isValid) { isValid = MerkleProofUpgradeable.verify( _merkleProof, allowListMerkleRoot, keccak256(abi.encodePacked(_sender)) ); } /** * @notice informs external contracts about supported Interfaces * @param interfaceId the id of the interface in question * @return true if the interfaceId is supported */ function supportsInterface(bytes4 interfaceId) public view override(ERC721Upgradeable, RoyaltiesV1, AccessControlUpgradeable) returns (bool) { return super.supportsInterface(interfaceId) || // super is RoyaltiesV1 ERC721Upgradeable.supportsInterface(interfaceId) || AccessControlUpgradeable.supportsInterface(interfaceId); } // Internal functions /** * @notice setter for allowListMintEndBlockHeight * @param _allowListMintEndBlockHeight the block height at which * {allowListMint} will become disabled */ function _setAllowListMintEndBlockHeight( uint128 _allowListMintEndBlockHeight ) internal { allowListMintEndBlockHeight = _allowListMintEndBlockHeight; emit AllowListMintEndBlockHeightChanged(_allowListMintEndBlockHeight); } /** * @notice setter for publicMintStartBlockHeight * @param _publicMintStartBlockHeight the block.number at which * {publicMint} will become enabled. 0 means disabled. */ function _setPublicMintStartBlockHeight( uint128 _publicMintStartBlockHeight ) internal { publicMintStartBlockHeight = _publicMintStartBlockHeight; emit PublicMintStartBlockHeightChanged(_publicMintStartBlockHeight); } /** * @notice Hook to control transfer behaviour * @dev The following function override required by Pausable * @dev this is a hook that is called by all transfer functions * @dev prevents transfers when paused * @param from address of token sender * @param to address of token receiver * @param tokenId the ID of the token to be sent */ function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override { super._beforeTokenTransfer(from, to, tokenId); } // Internal view functions /** * @notice get the baseURI for NFT metadata * @return the base uri of the metadata */ function _baseURI() internal view virtual override returns (string memory) { return _extendedBaseURI; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); 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) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721Upgradeable.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); 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: transfer caller is not owner nor 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: transfer caller is not owner nor 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 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 _owners[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) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721Upgradeable.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {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 Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[44] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library CountersUpgradeable { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControlUpgradeable.sol"; import "../utils/ContextUpgradeable.sol"; import "../utils/StringsUpgradeable.sol"; import "../utils/introspection/ERC165Upgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal onlyInitializing { } function __AccessControl_init_unchained() internal onlyInitializing { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`. */ modifier initializer() { bool isTopLevelCall = _setInitializedVersion(1); if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original * initialization step. This is essential to configure modules that are added through upgrades and that require * initialization. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. */ modifier reinitializer(uint8 version) { bool isTopLevelCall = _setInitializedVersion(version); if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(version); } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. */ function _disableInitializers() internal virtual { _setInitializedVersion(type(uint8).max); } function _setInitializedVersion(uint8 version) private returns (bool) { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, and for the lowest level // of initializers, because in other contexts the contract may have been reentered. if (_initializing) { require( version == 1 && !AddressUpgradeable.isContract(address(this)), "Initializable: contract is already initialized" ); return false; } else { require(_initialized < version, "Initializable: contract is already initialized"); _initialized = version; return true; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. */ library MerkleProofUpgradeable { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = _efficientHash(computedHash, proofElement); } else { // Hash(current element of the proof + current computed hash) computedHash = _efficientHash(proofElement, computedHash); } } return computedHash; } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; import "./RoyaltiesV1.sol"; contract UniqueCollectionRoyaltiesV1 is RoyaltiesV1 { uint256 public royaltyPercentage; address public royaltyRecipient; function _setTokenRoyalty( uint256 _royalty, address _recipient ) internal { _setTokenRoyaltyPercentage(_royalty); _setTokenRoyaltyRecipient(_recipient); } function _setTokenRoyaltyRecipient( address _recipient ) internal { royaltyRecipient = _recipient; } function _setTokenRoyaltyPercentage( uint256 _royalty ) internal { require(_royalty < HUNDRED_PERCENT, "Royalties too high"); royaltyPercentage = _royalty; } function royaltyInfo(uint256, uint256 salePrice) external view override returns (address receiver, uint256 royaltyAmount) { receiver = royaltyRecipient; royaltyAmount = (salePrice * royaltyPercentage) / HUNDRED_PERCENT; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.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 functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// 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 pragma solidity ^0.8.13; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; abstract contract RoyaltiesV1 is IERC2981 { uint256 public constant HUNDRED_PERCENT = 10000; // type(IERC2981).interfaceId == 0x2a55205a function supportsInterface(bytes4 interfaceId) external view virtual override returns (bool) { return interfaceId == type(IERC2981).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); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint128","name":"allowListMintEndBlockHeight","type":"uint128"}],"name":"AllowListMintEndBlockHeightChanged","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":false,"internalType":"string","name":"baseURI","type":"string"}],"name":"BaseURIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint128","name":"publicMintStartBlockHeight","type":"uint128"}],"name":"PublicMintStartBlockHeightChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"active","type":"bool"}],"name":"SaleStatusChanged","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":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HUNDRED_PERCENT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_extendedBaseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowListMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"allowListMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"allowListMintEndBlockHeight","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","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":[{"internalType":"uint256","name":"_royaltyPercentage","type":"uint256"}],"name":"decreaseRoyaltyPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"roleAdmin","type":"address"},{"internalType":"address","name":"manager","type":"address"},{"internalType":"uint64","name":"maxSupply","type":"uint64"},{"internalType":"uint56","name":"maxMintPerAddress","type":"uint56"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"uint256","name":"royaltyPercentage","type":"uint256"},{"internalType":"address","name":"royaltyRecipient","type":"address"},{"internalType":"uint112","name":"mintPrice","type":"uint112"},{"internalType":"uint16","name":"maxAllowListMintPerAddress","type":"uint16"},{"internalType":"bytes32","name":"allowListMerkleRoot","type":"bytes32"}],"internalType":"struct UniqueCollectionInitializableV1.InitializeData","name":"_init","type":"tuple"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"},{"internalType":"address","name":"_sender","type":"address"}],"name":"isProofValid","outputs":[{"internalType":"bool","name":"isValid","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"managerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxAllowListMintPerAddress","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintPerAddress","outputs":[{"internalType":"uint56","name":"","type":"uint56"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintPrice","outputs":[{"internalType":"uint112","name":"","type":"uint112"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minted","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":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"publicMintStartBlockHeight","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[],"name":"saleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint128","name":"_allowListMintEndBlockHeight","type":"uint128"}],"name":"setAllowListMintEndBlockHeight","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":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_publicMintStartBlockHeight","type":"uint128"}],"name":"setPublicMintStartBlockHeight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"setRoyaltyRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_saleActive","type":"bool"},{"internalType":"uint128","name":"_allowListMintEndBlockHeight","type":"uint128"},{"internalType":"uint128","name":"_publicMintStartBlockHeight","type":"uint128"}],"name":"setSaleStateAndBlockHeights","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":[{"internalType":"bool","name":"_saleActive","type":"bool"}],"name":"toggleSaleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_to","type":"address"}],"name":"withdrawNativeTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b50600062000020600162000087565b9050801562000039576000805461ff0019166101001790555b801562000080576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50620001a8565b60008054610100900460ff161562000120578160ff166001148015620000c05750620000be306200019960201b620021471760201c565b155b620001185760405162461bcd60e51b815260206004820152602e6024820152600080516020620041af83398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b506000919050565b60005460ff8084169116106200017f5760405162461bcd60e51b815260206004820152602e6024820152600080516020620041af83398151915260448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200010f565b506000805460ff191660ff92909216919091179055600190565b6001600160a01b03163b151590565b613ff780620001b86000396000f3fe6080604052600436106103505760003560e01c806370a08231116101c6578063a2a62c2c116100f7578063d547741f11610095578063ec87621c1161006f578063ec87621c14610a51578063f2fde38b14610a73578063fd7d04a914610a93578063fe2f1ea214610ab357600080fd5b8063d547741f146109aa578063d5abeb01146109ca578063e985e9c514610a0857600080fd5b8063b9b01d04116100d1578063b9b01d0414610929578063bbd4333314610949578063bf51b92a14610969578063c87b56dd1461098a57600080fd5b8063a2a62c2c146108c9578063ae7435fc146108e9578063b88d4fde1461090957600080fd5b8063904ddf21116101645780639bb906e01161013e5780639bb906e01461085d578063a191ef3114610874578063a217fddf14610894578063a22cb465146108a957600080fd5b8063904ddf21146107f257806391d148541461082857806395d89b411461084857600080fd5b8063878260b4116101a0578063878260b41461075e578063888f57f01461079e5780638a71bb2d146107be5780638da5cb5b146107d457600080fd5b806370a0823114610714578063715018a6146107345780638456cb591461074957600080fd5b806336568abe116102a05780635c975abb1161023e5780636817c76c116102185780636817c76c1461068e57806368428a1b146106ce5780636ed93dd0146106e95780636ee2b2f1146106ff57600080fd5b80635c975abb146106435780635cfe6b841461065b5780636352211e1461066e57600080fd5b806342842e0e1161027a57806342842e0e146105a35780634c00de82146105c357806355f804b3146105e3578063572849c41461060357600080fd5b806336568abe1461054e5780633f4ba83a1461056e57806341e42f301461058357600080fd5b80631a64ca401161030d578063248a9ca3116102e7578063248a9ca3146104b757806326092b83146104e75780632a55205a146104ef5780632f2ff15d1461052e57600080fd5b80631a64ca40146104495780631e7269c51461046957806323b872dd1461049757600080fd5b806301ffc9a71461035557806306fdde031461038a578063081812fc146103ac578063095ea7b3146103e45780631171bda91461040657806318160ddd14610426575b600080fd5b34801561036157600080fd5b50610375610370366004613534565b610ad3565b60405190151581526020015b60405180910390f35b34801561039657600080fd5b5061039f610b02565b60405161038191906135a9565b3480156103b857600080fd5b506103cc6103c73660046135bc565b610b94565b6040516001600160a01b039091168152602001610381565b3480156103f057600080fd5b506104046103ff3660046135ea565b610c2e565b005b34801561041257600080fd5b50610404610421366004613616565b610d43565b34801561043257600080fd5b5061043b610d7e565b604051908152602001610381565b34801561045557600080fd5b5061040461046436600461366e565b610d9b565b34801561047557600080fd5b5061043b610484366004613689565b6101336020526000908152604090205481565b3480156104a357600080fd5b506104046104b2366004613616565b610ddb565b3480156104c357600080fd5b5061043b6104d23660046135bc565b60009081526099602052604090206001015490565b610404610e0c565b3480156104fb57600080fd5b5061050f61050a3660046136a6565b610fea565b604080516001600160a01b039093168352602083019190915201610381565b34801561053a57600080fd5b506104046105493660046136c8565b611020565b34801561055a57600080fd5b506104046105693660046136c8565b611045565b34801561057a57600080fd5b506104046110c3565b34801561058f57600080fd5b5061040461059e366004613689565b6110f4565b3480156105af57600080fd5b506104046105be366004613616565b611131565b3480156105cf57600080fd5b506098546103cc906001600160a01b031681565b3480156105ef57600080fd5b506104046105fe366004613783565b61114c565b34801561060f57600080fd5b506101315461062b90600160481b900466ffffffffffffff1681565b60405166ffffffffffffff9091168152602001610381565b34801561064f57600080fd5b5060fd5460ff16610375565b610404610669366004613816565b6111cf565b34801561067a57600080fd5b506103cc6106893660046135bc565b61144d565b34801561069a57600080fd5b50610131546106b690600160801b90046001600160701b031681565b6040516001600160701b039091168152602001610381565b3480156106da57600080fd5b50610131546103759060ff1681565b3480156106f557600080fd5b5061043b61271081565b34801561070b57600080fd5b5061039f6114c4565b34801561072057600080fd5b5061043b61072f366004613689565b611553565b34801561074057600080fd5b506104046115da565b34801561075557600080fd5b5061040461163e565b34801561076a57600080fd5b506101305461078690600160801b90046001600160801b031681565b6040516001600160801b039091168152602001610381565b3480156107aa57600080fd5b506104046107b936600461366e565b61167a565b3480156107ca57600080fd5b5061043b60975481565b3480156107e057600080fd5b5060cb546001600160a01b03166103cc565b3480156107fe57600080fd5b506101315461081590600160f01b900461ffff1681565b60405161ffff9091168152602001610381565b34801561083457600080fd5b506103756108433660046136c8565b6116b7565b34801561085457600080fd5b5061039f6116e2565b34801561086957600080fd5b5061043b6101345481565b34801561088057600080fd5b5061040461088f366004613857565b6116f1565b3480156108a057600080fd5b5061043b600081565b3480156108b557600080fd5b506104046108c43660046138a0565b611ab1565b3480156108d557600080fd5b506104046108e43660046138ce565b611abc565b3480156108f557600080fd5b50610404610904366004613689565b611b4b565b34801561091557600080fd5b50610404610924366004613913565b611c62565b34801561093557600080fd5b50610404610944366004613992565b611c9a565b34801561095557600080fd5b50610404610964366004613689565b611d10565b34801561097557600080fd5b5061013054610786906001600160801b031681565b34801561099657600080fd5b5061039f6109a53660046135bc565b611e70565b3480156109b657600080fd5b506104046109c53660046136c8565b611f4b565b3480156109d657600080fd5b50610131546109f09061010090046001600160401b031681565b6040516001600160401b039091168152602001610381565b348015610a1457600080fd5b50610375610a233660046139af565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b348015610a5d57600080fd5b5061043b600080516020613fa283398151915281565b348015610a7f57600080fd5b50610404610a8e366004613689565b611f70565b348015610a9f57600080fd5b50610404610aae3660046135bc565b612038565b348015610abf57600080fd5b50610375610ace3660046139dd565b6120c6565b6000610ade82612156565b80610aed5750610aed8261218b565b80610afc5750610afc82612156565b92915050565b606060658054610b1190613a33565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3d90613a33565b8015610b8a5780601f10610b5f57610100808354040283529160200191610b8a565b820191906000526020600020905b815481529060010190602001808311610b6d57829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b0316610c125760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b6000610c398261144d565b9050806001600160a01b0316836001600160a01b031603610ca65760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c09565b336001600160a01b0382161480610cc25750610cc28133610a23565b610d345760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610c09565b610d3e83836121db565b505050565b610d4e6000336116b7565b610d6a5760405162461bcd60e51b8152600401610c0990613a6d565b610d3e6001600160a01b0384168383612249565b60006001610d8c61012f5490565b610d969190613ab0565b905090565b610db3600080516020613fa2833981519152336116b7565b610dcf5760405162461bcd60e51b8152600401610c0990613ac7565b610dd88161229b565b50565b610de533826122ea565b610e015760405162461bcd60e51b8152600401610c0990613af6565b610d3e8383836123e0565b6101315460ff16610e2f5760405162461bcd60e51b8152600401610c0990613b47565b610131546001600160401b0361010090910416610e4c61012f5490565b1115610e6a5760405162461bcd60e51b8152600401610c0990613b73565b3361013154600190600160481b900466ffffffffffffff1615610ee057610131546001600160a01b03831660009081526101336020526040902054600160481b90910466ffffffffffffff1690610ec2908390613ba8565b1115610ee05760405162461bcd60e51b8152600401610c0990613bc0565b61013054600160801b90046001600160801b031615801590610f15575061013054600160801b90046001600160801b03164310155b610f535760405162461bcd60e51b815260206004820152600f60248201526e6e6f74207075626c69632073616c6560881b6044820152606401610c09565b61013154600160801b90046001600160701b0316341015610fa65760405162461bcd60e51b815260206004820152600d60248201526c707269636520746f6f206c6f7760981b6044820152606401610c09565b33600090815261013360205260408120805460019290610fc7908490613ba8565b909155505061012f54610fdf61012f80546001019055565b610d3e335b82612587565b6098546097546001600160a01b03909116906000906127109061100d9085613bf7565b6110179190613c2c565b90509250929050565b60008281526099602052604090206001015461103b816125a1565b610d3e83836125ab565b6001600160a01b03811633146110b55760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c09565b6110bf8282612631565b5050565b6110ce6000336116b7565b6110ea5760405162461bcd60e51b8152600401610c0990613a6d565b6110f2612698565b565b61110c600080516020613fa2833981519152336116b7565b6111285760405162461bcd60e51b8152600401610c0990613ac7565b610dd88161272b565b610d3e83838360405180602001604052806000815250611c62565b611164600080516020613fa2833981519152336116b7565b6111805760405162461bcd60e51b8152600401610c0990613ac7565b805161119490610132906020840190613411565b507f5411e8ebf1636d9e83d5fc4900bf80cbac82e8790da2a4c94db4895e889eedf6816040516111c491906135a9565b60405180910390a150565b81816111dc8282336120c6565b6112185760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610c09565b6101315460ff1661123b5760405162461bcd60e51b8152600401610c0990613b47565b610131546001600160401b036101009091041661125861012f5490565b11156112765760405162461bcd60e51b8152600401610c0990613b73565b3361013154600190600160481b900466ffffffffffffff16156112ec57610131546001600160a01b03831660009081526101336020526040902054600160481b90910466ffffffffffffff16906112ce908390613ba8565b11156112ec5760405162461bcd60e51b8152600401610c0990613bc0565b610130546001600160801b0316431061133c5760405162461bcd60e51b81526020600482015260126024820152716e6f7420616c6c6f774c6973742073616c6560701b6044820152606401610c09565b61013154600160f01b900461ffff16156113af57610131543360009081526101336020526040902054600160f01b90910461ffff16116113af5760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481b5a5b9d195960921b6044820152606401610c09565b61013154600160801b90046001600160701b03163410156114025760405162461bcd60e51b815260206004820152600d60248201526c707269636520746f6f206c6f7760981b6044820152606401610c09565b33600090815261013360205260408120805460019290611423908490613ba8565b909155505061012f5461143b61012f80546001019055565b61144433610fe4565b50505050505050565b6000818152606760205260408120546001600160a01b031680610afc5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610c09565b61013280546114d290613a33565b80601f01602080910402602001604051908101604052809291908181526020018280546114fe90613a33565b801561154b5780601f106115205761010080835404028352916020019161154b565b820191906000526020600020905b81548152906001019060200180831161152e57829003601f168201915b505050505081565b60006001600160a01b0382166115be5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610c09565b506001600160a01b031660009081526068602052604090205490565b60cb546001600160a01b031633146116345760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c09565b6110f2600061274d565b611656600080516020613fa2833981519152336116b7565b6116725760405162461bcd60e51b8152600401610c0990613ac7565b6110f261279f565b611692600080516020613fa2833981519152336116b7565b6116ae5760405162461bcd60e51b8152600401610c0990613ac7565b610dd88161281a565b60009182526099602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060668054610b1190613a33565b60006116fd6001612872565b90508015611715576000805461ff0019166101001790555b60006117246020840184613689565b6001600160a01b03160361177a5760405162461bcd60e51b815260206004820152601760248201527f526f6c6541646d696e20697320616464726573732830290000000000000000006044820152606401610c09565b600061178c6040840160208501613689565b6001600160a01b0316036117da5760405162461bcd60e51b81526020600482015260156024820152744d616e61676572206973206164647265737328302960581b6044820152606401610c09565b60006117ec6060840160408501613c40565b6001600160401b0316116118425760405162461bcd60e51b815260206004820181905260248201527f6d6178537570706c79206d7573742062652067726561746572207468616e20306044820152606401610c09565b6118ce6118526080840184613c69565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118949250505060a0850185613c69565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506128ff92505050565b6118d6612930565b6118de61295f565b6118ee6060830160408401613c40565b61013180546001600160401b03929092166101000268ffffffffffffffff00199092169190911790556119276080830160608401613caf565b610131805466ffffffffffffff92909216600160481b026fffffffffffffff000000000000000000199092169190911790556101608201803561013455611972906101408401613cd8565b610131805461ffff92909216600160f01b026001600160f01b039092169190911790556119a761014083016101208401613cfc565b61013160106101000a8154816001600160701b0302191690836001600160701b031602179055506119dd61012f80546001019055565b6119ea60c0830183613c69565b6119f79161013291613495565b50611a0f6000611a0a6020850185613689565b6125ab565b611a31600080516020613fa2833981519152611a0a6040850160208601613689565b611a5060e0830135611a4b61012085016101008601613689565b612986565b611a68611a636040840160208501613689565b61274d565b80156110bf576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6110bf338383612998565b611ad4600080516020613fa2833981519152336116b7565b611af05760405162461bcd60e51b8152600401610c0990613ac7565b610131805460ff1916841515179055611b088261281a565b611b118161229b565b60405183151581527ff3637cdf61687bb87179d2da614bc1f4aa93c3cbf40282ccd0a15ecad9184cc19060200160405180910390a1505050565b611b566000336116b7565b611b725760405162461bcd60e51b8152600401610c0990613a6d565b6001600160a01b038116611bc85760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964207769746864726177207265636569766572000000000000006044820152606401610c09565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114611c15576040519150601f19603f3d011682016040523d82523d6000602084013e611c1a565b606091505b50509050806110bf5760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610c09565b611c6c33836122ea565b611c885760405162461bcd60e51b8152600401610c0990613af6565b611c9484848484612a66565b50505050565b611cb2600080516020613fa2833981519152336116b7565b611cce5760405162461bcd60e51b8152600401610c0990613ac7565b610131805460ff19168215159081179091556040519081527ff3637cdf61687bb87179d2da614bc1f4aa93c3cbf40282ccd0a15ecad9184cc1906020016111c4565b6101315460ff16611d335760405162461bcd60e51b8152600401610c0990613b47565b610131546001600160401b0361010090910416611d5061012f5490565b1115611d6e5760405162461bcd60e51b8152600401610c0990613b73565b610131548190600190600160481b900466ffffffffffffff1615611de557610131546001600160a01b03831660009081526101336020526040902054600160481b90910466ffffffffffffff1690611dc7908390613ba8565b1115611de55760405162461bcd60e51b8152600401610c0990613bc0565b611dfd600080516020613fa2833981519152336116b7565b611e195760405162461bcd60e51b8152600401610c0990613ac7565b6000611e2561012f5490565b9050611e3661012f80546001019055565b6001600160a01b038416600090815261013360205260408120805460019290611e60908490613ba8565b90915550611c9490508482612587565b6000818152606760205260409020546060906001600160a01b0316611eef5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c09565b6000611ef9612a99565b90506000815111611f195760405180602001604052806000815250611f44565b80611f2384612aa9565b604051602001611f34929190613d25565b6040516020818303038152906040525b9392505050565b600082815260996020526040902060010154611f66816125a1565b610d3e8383612631565b60cb546001600160a01b03163314611fca5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c09565b6001600160a01b03811661202f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c09565b610dd88161274d565b612050600080516020613fa2833981519152336116b7565b61206c5760405162461bcd60e51b8152600401610c0990613ac7565b60975481106120bd5760405162461bcd60e51b815260206004820152601b60248201527f726f79616c747950657263656e74616765206e6f74206c6f77657200000000006044820152606401610c09565b610dd881612ba9565b600061213f84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050610134546040516bffffffffffffffffffffffff19606089901b166020820152909250603401905060405160208183030381529060405280519060200120612bf4565b949350505050565b6001600160a01b03163b151590565b60006001600160e01b03198216637965db0b60e01b1480610afc575063152a902d60e11b6001600160e01b0319831614610afc565b60006001600160e01b031982166380ac58cd60e01b14806121bc57506001600160e01b03198216635b5e139f60e01b145b80610afc57506301ffc9a760e01b6001600160e01b0319831614610afc565b600081815260696020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122108261144d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610d3e908490612c0a565b61013080546001600160801b03908116600160801b918416918202179091556040519081527f2089ddec8a19988a4028ab3e252ef067dcaa183dbb82b99568ceb77589d56d8b906020016111c4565b6000818152606760205260408120546001600160a01b03166123635760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c09565b600061236e8361144d565b9050806001600160a01b0316846001600160a01b031614806123b557506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b8061213f5750836001600160a01b03166123ce84610b94565b6001600160a01b031614949350505050565b826001600160a01b03166123f38261144d565b6001600160a01b0316146124575760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610c09565b6001600160a01b0382166124b95760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c09565b6124c4838383612cdc565b6124cf6000826121db565b6001600160a01b03831660009081526068602052604081208054600192906124f8908490613ab0565b90915550506001600160a01b0382166000908152606860205260408120805460019290612526908490613ba8565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6110bf828260405180602001604052806000815250612d22565b610dd88133612d55565b6125b582826116b7565b6110bf5760008281526099602090815260408083206001600160a01b03851684529091529020805460ff191660011790556125ed3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61263b82826116b7565b156110bf5760008281526099602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60fd5460ff166126e15760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c09565b60fd805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b60cb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fd5460ff16156127e55760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c09565b60fd805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861270e3390565b61013080546fffffffffffffffffffffffffffffffff19166001600160801b0383169081179091556040519081527f1cddf73feff457adbd78dd21c10fd586ee5203e48660d1cc489b43e6416edb85906020016111c4565b60008054610100900460ff16156128b9578160ff1660011480156128955750303b155b6128b15760405162461bcd60e51b8152600401610c0990613d54565b506000919050565b60005460ff8084169116106128e05760405162461bcd60e51b8152600401610c0990613d54565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff166129265760405162461bcd60e51b8152600401610c0990613da2565b6110bf8282612db9565b600054610100900460ff166129575760405162461bcd60e51b8152600401610c0990613da2565b6110f2612e07565b600054610100900460ff166110f25760405162461bcd60e51b8152600401610c0990613da2565b61298f82612ba9565b6110bf8161272b565b816001600160a01b0316836001600160a01b0316036129f95760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c09565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612a718484846123e0565b612a7d84848484612e3a565b611c945760405162461bcd60e51b8152600401610c0990613ded565b60606101328054610b1190613a33565b606081600003612ad05750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612afa5780612ae481613e3f565b9150612af39050600a83613c2c565b9150612ad4565b6000816001600160401b03811115612b1457612b146136f8565b6040519080825280601f01601f191660200182016040528015612b3e576020820181803683370190505b5090505b841561213f57612b53600183613ab0565b9150612b60600a86613e58565b612b6b906030613ba8565b60f81b818381518110612b8057612b80613e6c565b60200101906001600160f81b031916908160001a905350612ba2600a86613c2c565b9450612b42565b6127108110612bef5760405162461bcd60e51b81526020600482015260126024820152710a4def2c2d8e8d2cae640e8dede40d0d2ced60731b6044820152606401610c09565b609755565b600082612c018584612f3b565b14949350505050565b6000612c5f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612faf9092919063ffffffff16565b805190915015610d3e5780806020019051810190612c7d9190613e82565b610d3e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610c09565b60fd5460ff1615610d3e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c09565b612d2c8383612fbe565b612d396000848484612e3a565b610d3e5760405162461bcd60e51b8152600401610c0990613ded565b612d5f82826116b7565b6110bf57612d77816001600160a01b0316601461310c565b612d8283602061310c565b604051602001612d93929190613e9f565b60408051601f198184030181529082905262461bcd60e51b8252610c09916004016135a9565b600054610100900460ff16612de05760405162461bcd60e51b8152600401610c0990613da2565b8151612df3906065906020850190613411565b508051610d3e906066906020840190613411565b600054610100900460ff16612e2e5760405162461bcd60e51b8152600401610c0990613da2565b60fd805460ff19169055565b60006001600160a01b0384163b15612f3057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612e7e903390899088908890600401613f14565b6020604051808303816000875af1925050508015612eb9575060408051601f3d908101601f19168201909252612eb691810190613f51565b60015b612f16573d808015612ee7576040519150601f19603f3d011682016040523d82523d6000602084013e612eec565b606091505b508051600003612f0e5760405162461bcd60e51b8152600401610c0990613ded565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061213f565b506001949350505050565b600081815b8451811015612fa7576000858281518110612f5d57612f5d613e6c565b60200260200101519050808311612f835760008381526020829052604090209250612f94565b600081815260208490526040902092505b5080612f9f81613e3f565b915050612f40565b509392505050565b606061213f84846000856132a7565b6001600160a01b0382166130145760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c09565b6000818152606760205260409020546001600160a01b0316156130795760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c09565b61308560008383612cdc565b6001600160a01b03821660009081526068602052604081208054600192906130ae908490613ba8565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6060600061311b836002613bf7565b613126906002613ba8565b6001600160401b0381111561313d5761313d6136f8565b6040519080825280601f01601f191660200182016040528015613167576020820181803683370190505b509050600360fc1b8160008151811061318257613182613e6c565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106131b1576131b1613e6c565b60200101906001600160f81b031916908160001a90535060006131d5846002613bf7565b6131e0906001613ba8565b90505b6001811115613258576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061321457613214613e6c565b1a60f81b82828151811061322a5761322a613e6c565b60200101906001600160f81b031916908160001a90535060049490941c9361325181613f6e565b90506131e3565b508315611f445760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c09565b6060824710156133085760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610c09565b6001600160a01b0385163b61335f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c09565b600080866001600160a01b0316858760405161337b9190613f85565b60006040518083038185875af1925050503d80600081146133b8576040519150601f19603f3d011682016040523d82523d6000602084013e6133bd565b606091505b50915091506133cd8282866133d8565b979650505050505050565b606083156133e7575081611f44565b8251156133f75782518084602001fd5b8160405162461bcd60e51b8152600401610c0991906135a9565b82805461341d90613a33565b90600052602060002090601f01602090048101928261343f5760008555613485565b82601f1061345857805160ff1916838001178555613485565b82800160010185558215613485579182015b8281111561348557825182559160200191906001019061346a565b50613491929150613509565b5090565b8280546134a190613a33565b90600052602060002090601f0160209004810192826134c35760008555613485565b82601f106134dc5782800160ff19823516178555613485565b82800160010185558215613485579182015b828111156134855782358255916020019190600101906134ee565b5b80821115613491576000815560010161350a565b6001600160e01b031981168114610dd857600080fd5b60006020828403121561354657600080fd5b8135611f448161351e565b60005b8381101561356c578181015183820152602001613554565b83811115611c945750506000910152565b60008151808452613595816020860160208601613551565b601f01601f19169290920160200192915050565b602081526000611f44602083018461357d565b6000602082840312156135ce57600080fd5b5035919050565b6001600160a01b0381168114610dd857600080fd5b600080604083850312156135fd57600080fd5b8235613608816135d5565b946020939093013593505050565b60008060006060848603121561362b57600080fd5b8335613636816135d5565b92506020840135613646816135d5565b929592945050506040919091013590565b80356001600160801b03811681146128fa57600080fd5b60006020828403121561368057600080fd5b611f4482613657565b60006020828403121561369b57600080fd5b8135611f44816135d5565b600080604083850312156136b957600080fd5b50508035926020909101359150565b600080604083850312156136db57600080fd5b8235915060208301356136ed816135d5565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115613728576137286136f8565b604051601f8501601f19908116603f01168101908282118183101715613750576137506136f8565b8160405280935085815286868601111561376957600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561379557600080fd5b81356001600160401b038111156137ab57600080fd5b8201601f810184136137bc57600080fd5b61213f8482356020840161370e565b60008083601f8401126137dd57600080fd5b5081356001600160401b038111156137f457600080fd5b6020830191508360208260051b850101111561380f57600080fd5b9250929050565b6000806020838503121561382957600080fd5b82356001600160401b0381111561383f57600080fd5b61384b858286016137cb565b90969095509350505050565b60006020828403121561386957600080fd5b81356001600160401b0381111561387f57600080fd5b82016101808185031215611f4457600080fd5b8015158114610dd857600080fd5b600080604083850312156138b357600080fd5b82356138be816135d5565b915060208301356136ed81613892565b6000806000606084860312156138e357600080fd5b83356138ee81613892565b92506138fc60208501613657565b915061390a60408501613657565b90509250925092565b6000806000806080858703121561392957600080fd5b8435613934816135d5565b93506020850135613944816135d5565b92506040850135915060608501356001600160401b0381111561396657600080fd5b8501601f8101871361397757600080fd5b6139868782356020840161370e565b91505092959194509250565b6000602082840312156139a457600080fd5b8135611f4481613892565b600080604083850312156139c257600080fd5b82356139cd816135d5565b915060208301356136ed816135d5565b6000806000604084860312156139f257600080fd5b83356001600160401b03811115613a0857600080fd5b613a14868287016137cb565b9094509250506020840135613a28816135d5565b809150509250925092565b600181811c90821680613a4757607f821691505b602082108103613a6757634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526013908201527221b0b63632b91034b9903737ba1030b236b4b760691b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015613ac257613ac2613a9a565b500390565b60208082526015908201527421b0b63632b91034b9903737ba1036b0b730b3b2b960591b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526012908201527153616c65206973206e6f742061637469766560701b604082015260600190565b6020808252818101527f507572636861736520776f756c6420657863656564206d617820746f6b656e73604082015260600190565b60008219821115613bbb57613bbb613a9a565b500190565b6020808252601a908201527f6d61784d696e7450657241646472657373206578636565646564000000000000604082015260600190565b6000816000190483118215151615613c1157613c11613a9a565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613c3b57613c3b613c16565b500490565b600060208284031215613c5257600080fd5b81356001600160401b0381168114611f4457600080fd5b6000808335601e19843603018112613c8057600080fd5b8301803591506001600160401b03821115613c9a57600080fd5b60200191503681900382131561380f57600080fd5b600060208284031215613cc157600080fd5b813566ffffffffffffff81168114611f4457600080fd5b600060208284031215613cea57600080fd5b813561ffff81168114611f4457600080fd5b600060208284031215613d0e57600080fd5b81356001600160701b0381168114611f4457600080fd5b60008351613d37818460208801613551565b835190830190613d4b818360208801613551565b01949350505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600060018201613e5157613e51613a9a565b5060010190565b600082613e6757613e67613c16565b500690565b634e487b7160e01b600052603260045260246000fd5b600060208284031215613e9457600080fd5b8151611f4481613892565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613ed7816017850160208801613551565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613f08816028840160208801613551565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613f479083018461357d565b9695505050505050565b600060208284031215613f6357600080fd5b8151611f448161351e565b600081613f7d57613f7d613a9a565b506000190190565b60008251613f97818460208701613551565b919091019291505056fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220e80a16a2c015ad9ec57bd85c5366c1763fc27af19de3abcce4a80008ef1db25864736f6c634300080d0033496e697469616c697a61626c653a20636f6e747261637420697320616c726561
Deployed Bytecode
0x6080604052600436106103505760003560e01c806370a08231116101c6578063a2a62c2c116100f7578063d547741f11610095578063ec87621c1161006f578063ec87621c14610a51578063f2fde38b14610a73578063fd7d04a914610a93578063fe2f1ea214610ab357600080fd5b8063d547741f146109aa578063d5abeb01146109ca578063e985e9c514610a0857600080fd5b8063b9b01d04116100d1578063b9b01d0414610929578063bbd4333314610949578063bf51b92a14610969578063c87b56dd1461098a57600080fd5b8063a2a62c2c146108c9578063ae7435fc146108e9578063b88d4fde1461090957600080fd5b8063904ddf21116101645780639bb906e01161013e5780639bb906e01461085d578063a191ef3114610874578063a217fddf14610894578063a22cb465146108a957600080fd5b8063904ddf21146107f257806391d148541461082857806395d89b411461084857600080fd5b8063878260b4116101a0578063878260b41461075e578063888f57f01461079e5780638a71bb2d146107be5780638da5cb5b146107d457600080fd5b806370a0823114610714578063715018a6146107345780638456cb591461074957600080fd5b806336568abe116102a05780635c975abb1161023e5780636817c76c116102185780636817c76c1461068e57806368428a1b146106ce5780636ed93dd0146106e95780636ee2b2f1146106ff57600080fd5b80635c975abb146106435780635cfe6b841461065b5780636352211e1461066e57600080fd5b806342842e0e1161027a57806342842e0e146105a35780634c00de82146105c357806355f804b3146105e3578063572849c41461060357600080fd5b806336568abe1461054e5780633f4ba83a1461056e57806341e42f301461058357600080fd5b80631a64ca401161030d578063248a9ca3116102e7578063248a9ca3146104b757806326092b83146104e75780632a55205a146104ef5780632f2ff15d1461052e57600080fd5b80631a64ca40146104495780631e7269c51461046957806323b872dd1461049757600080fd5b806301ffc9a71461035557806306fdde031461038a578063081812fc146103ac578063095ea7b3146103e45780631171bda91461040657806318160ddd14610426575b600080fd5b34801561036157600080fd5b50610375610370366004613534565b610ad3565b60405190151581526020015b60405180910390f35b34801561039657600080fd5b5061039f610b02565b60405161038191906135a9565b3480156103b857600080fd5b506103cc6103c73660046135bc565b610b94565b6040516001600160a01b039091168152602001610381565b3480156103f057600080fd5b506104046103ff3660046135ea565b610c2e565b005b34801561041257600080fd5b50610404610421366004613616565b610d43565b34801561043257600080fd5b5061043b610d7e565b604051908152602001610381565b34801561045557600080fd5b5061040461046436600461366e565b610d9b565b34801561047557600080fd5b5061043b610484366004613689565b6101336020526000908152604090205481565b3480156104a357600080fd5b506104046104b2366004613616565b610ddb565b3480156104c357600080fd5b5061043b6104d23660046135bc565b60009081526099602052604090206001015490565b610404610e0c565b3480156104fb57600080fd5b5061050f61050a3660046136a6565b610fea565b604080516001600160a01b039093168352602083019190915201610381565b34801561053a57600080fd5b506104046105493660046136c8565b611020565b34801561055a57600080fd5b506104046105693660046136c8565b611045565b34801561057a57600080fd5b506104046110c3565b34801561058f57600080fd5b5061040461059e366004613689565b6110f4565b3480156105af57600080fd5b506104046105be366004613616565b611131565b3480156105cf57600080fd5b506098546103cc906001600160a01b031681565b3480156105ef57600080fd5b506104046105fe366004613783565b61114c565b34801561060f57600080fd5b506101315461062b90600160481b900466ffffffffffffff1681565b60405166ffffffffffffff9091168152602001610381565b34801561064f57600080fd5b5060fd5460ff16610375565b610404610669366004613816565b6111cf565b34801561067a57600080fd5b506103cc6106893660046135bc565b61144d565b34801561069a57600080fd5b50610131546106b690600160801b90046001600160701b031681565b6040516001600160701b039091168152602001610381565b3480156106da57600080fd5b50610131546103759060ff1681565b3480156106f557600080fd5b5061043b61271081565b34801561070b57600080fd5b5061039f6114c4565b34801561072057600080fd5b5061043b61072f366004613689565b611553565b34801561074057600080fd5b506104046115da565b34801561075557600080fd5b5061040461163e565b34801561076a57600080fd5b506101305461078690600160801b90046001600160801b031681565b6040516001600160801b039091168152602001610381565b3480156107aa57600080fd5b506104046107b936600461366e565b61167a565b3480156107ca57600080fd5b5061043b60975481565b3480156107e057600080fd5b5060cb546001600160a01b03166103cc565b3480156107fe57600080fd5b506101315461081590600160f01b900461ffff1681565b60405161ffff9091168152602001610381565b34801561083457600080fd5b506103756108433660046136c8565b6116b7565b34801561085457600080fd5b5061039f6116e2565b34801561086957600080fd5b5061043b6101345481565b34801561088057600080fd5b5061040461088f366004613857565b6116f1565b3480156108a057600080fd5b5061043b600081565b3480156108b557600080fd5b506104046108c43660046138a0565b611ab1565b3480156108d557600080fd5b506104046108e43660046138ce565b611abc565b3480156108f557600080fd5b50610404610904366004613689565b611b4b565b34801561091557600080fd5b50610404610924366004613913565b611c62565b34801561093557600080fd5b50610404610944366004613992565b611c9a565b34801561095557600080fd5b50610404610964366004613689565b611d10565b34801561097557600080fd5b5061013054610786906001600160801b031681565b34801561099657600080fd5b5061039f6109a53660046135bc565b611e70565b3480156109b657600080fd5b506104046109c53660046136c8565b611f4b565b3480156109d657600080fd5b50610131546109f09061010090046001600160401b031681565b6040516001600160401b039091168152602001610381565b348015610a1457600080fd5b50610375610a233660046139af565b6001600160a01b039182166000908152606a6020908152604080832093909416825291909152205460ff1690565b348015610a5d57600080fd5b5061043b600080516020613fa283398151915281565b348015610a7f57600080fd5b50610404610a8e366004613689565b611f70565b348015610a9f57600080fd5b50610404610aae3660046135bc565b612038565b348015610abf57600080fd5b50610375610ace3660046139dd565b6120c6565b6000610ade82612156565b80610aed5750610aed8261218b565b80610afc5750610afc82612156565b92915050565b606060658054610b1190613a33565b80601f0160208091040260200160405190810160405280929190818152602001828054610b3d90613a33565b8015610b8a5780601f10610b5f57610100808354040283529160200191610b8a565b820191906000526020600020905b815481529060010190602001808311610b6d57829003601f168201915b5050505050905090565b6000818152606760205260408120546001600160a01b0316610c125760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152606960205260409020546001600160a01b031690565b6000610c398261144d565b9050806001600160a01b0316836001600160a01b031603610ca65760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c09565b336001600160a01b0382161480610cc25750610cc28133610a23565b610d345760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610c09565b610d3e83836121db565b505050565b610d4e6000336116b7565b610d6a5760405162461bcd60e51b8152600401610c0990613a6d565b610d3e6001600160a01b0384168383612249565b60006001610d8c61012f5490565b610d969190613ab0565b905090565b610db3600080516020613fa2833981519152336116b7565b610dcf5760405162461bcd60e51b8152600401610c0990613ac7565b610dd88161229b565b50565b610de533826122ea565b610e015760405162461bcd60e51b8152600401610c0990613af6565b610d3e8383836123e0565b6101315460ff16610e2f5760405162461bcd60e51b8152600401610c0990613b47565b610131546001600160401b0361010090910416610e4c61012f5490565b1115610e6a5760405162461bcd60e51b8152600401610c0990613b73565b3361013154600190600160481b900466ffffffffffffff1615610ee057610131546001600160a01b03831660009081526101336020526040902054600160481b90910466ffffffffffffff1690610ec2908390613ba8565b1115610ee05760405162461bcd60e51b8152600401610c0990613bc0565b61013054600160801b90046001600160801b031615801590610f15575061013054600160801b90046001600160801b03164310155b610f535760405162461bcd60e51b815260206004820152600f60248201526e6e6f74207075626c69632073616c6560881b6044820152606401610c09565b61013154600160801b90046001600160701b0316341015610fa65760405162461bcd60e51b815260206004820152600d60248201526c707269636520746f6f206c6f7760981b6044820152606401610c09565b33600090815261013360205260408120805460019290610fc7908490613ba8565b909155505061012f54610fdf61012f80546001019055565b610d3e335b82612587565b6098546097546001600160a01b03909116906000906127109061100d9085613bf7565b6110179190613c2c565b90509250929050565b60008281526099602052604090206001015461103b816125a1565b610d3e83836125ab565b6001600160a01b03811633146110b55760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610c09565b6110bf8282612631565b5050565b6110ce6000336116b7565b6110ea5760405162461bcd60e51b8152600401610c0990613a6d565b6110f2612698565b565b61110c600080516020613fa2833981519152336116b7565b6111285760405162461bcd60e51b8152600401610c0990613ac7565b610dd88161272b565b610d3e83838360405180602001604052806000815250611c62565b611164600080516020613fa2833981519152336116b7565b6111805760405162461bcd60e51b8152600401610c0990613ac7565b805161119490610132906020840190613411565b507f5411e8ebf1636d9e83d5fc4900bf80cbac82e8790da2a4c94db4895e889eedf6816040516111c491906135a9565b60405180910390a150565b81816111dc8282336120c6565b6112185760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610c09565b6101315460ff1661123b5760405162461bcd60e51b8152600401610c0990613b47565b610131546001600160401b036101009091041661125861012f5490565b11156112765760405162461bcd60e51b8152600401610c0990613b73565b3361013154600190600160481b900466ffffffffffffff16156112ec57610131546001600160a01b03831660009081526101336020526040902054600160481b90910466ffffffffffffff16906112ce908390613ba8565b11156112ec5760405162461bcd60e51b8152600401610c0990613bc0565b610130546001600160801b0316431061133c5760405162461bcd60e51b81526020600482015260126024820152716e6f7420616c6c6f774c6973742073616c6560701b6044820152606401610c09565b61013154600160f01b900461ffff16156113af57610131543360009081526101336020526040902054600160f01b90910461ffff16116113af5760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481b5a5b9d195960921b6044820152606401610c09565b61013154600160801b90046001600160701b03163410156114025760405162461bcd60e51b815260206004820152600d60248201526c707269636520746f6f206c6f7760981b6044820152606401610c09565b33600090815261013360205260408120805460019290611423908490613ba8565b909155505061012f5461143b61012f80546001019055565b61144433610fe4565b50505050505050565b6000818152606760205260408120546001600160a01b031680610afc5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610c09565b61013280546114d290613a33565b80601f01602080910402602001604051908101604052809291908181526020018280546114fe90613a33565b801561154b5780601f106115205761010080835404028352916020019161154b565b820191906000526020600020905b81548152906001019060200180831161152e57829003601f168201915b505050505081565b60006001600160a01b0382166115be5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610c09565b506001600160a01b031660009081526068602052604090205490565b60cb546001600160a01b031633146116345760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c09565b6110f2600061274d565b611656600080516020613fa2833981519152336116b7565b6116725760405162461bcd60e51b8152600401610c0990613ac7565b6110f261279f565b611692600080516020613fa2833981519152336116b7565b6116ae5760405162461bcd60e51b8152600401610c0990613ac7565b610dd88161281a565b60009182526099602090815260408084206001600160a01b0393909316845291905290205460ff1690565b606060668054610b1190613a33565b60006116fd6001612872565b90508015611715576000805461ff0019166101001790555b60006117246020840184613689565b6001600160a01b03160361177a5760405162461bcd60e51b815260206004820152601760248201527f526f6c6541646d696e20697320616464726573732830290000000000000000006044820152606401610c09565b600061178c6040840160208501613689565b6001600160a01b0316036117da5760405162461bcd60e51b81526020600482015260156024820152744d616e61676572206973206164647265737328302960581b6044820152606401610c09565b60006117ec6060840160408501613c40565b6001600160401b0316116118425760405162461bcd60e51b815260206004820181905260248201527f6d6178537570706c79206d7573742062652067726561746572207468616e20306044820152606401610c09565b6118ce6118526080840184613c69565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506118949250505060a0850185613c69565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506128ff92505050565b6118d6612930565b6118de61295f565b6118ee6060830160408401613c40565b61013180546001600160401b03929092166101000268ffffffffffffffff00199092169190911790556119276080830160608401613caf565b610131805466ffffffffffffff92909216600160481b026fffffffffffffff000000000000000000199092169190911790556101608201803561013455611972906101408401613cd8565b610131805461ffff92909216600160f01b026001600160f01b039092169190911790556119a761014083016101208401613cfc565b61013160106101000a8154816001600160701b0302191690836001600160701b031602179055506119dd61012f80546001019055565b6119ea60c0830183613c69565b6119f79161013291613495565b50611a0f6000611a0a6020850185613689565b6125ab565b611a31600080516020613fa2833981519152611a0a6040850160208601613689565b611a5060e0830135611a4b61012085016101008601613689565b612986565b611a68611a636040840160208501613689565b61274d565b80156110bf576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6110bf338383612998565b611ad4600080516020613fa2833981519152336116b7565b611af05760405162461bcd60e51b8152600401610c0990613ac7565b610131805460ff1916841515179055611b088261281a565b611b118161229b565b60405183151581527ff3637cdf61687bb87179d2da614bc1f4aa93c3cbf40282ccd0a15ecad9184cc19060200160405180910390a1505050565b611b566000336116b7565b611b725760405162461bcd60e51b8152600401610c0990613a6d565b6001600160a01b038116611bc85760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964207769746864726177207265636569766572000000000000006044820152606401610c09565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114611c15576040519150601f19603f3d011682016040523d82523d6000602084013e611c1a565b606091505b50509050806110bf5760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610c09565b611c6c33836122ea565b611c885760405162461bcd60e51b8152600401610c0990613af6565b611c9484848484612a66565b50505050565b611cb2600080516020613fa2833981519152336116b7565b611cce5760405162461bcd60e51b8152600401610c0990613ac7565b610131805460ff19168215159081179091556040519081527ff3637cdf61687bb87179d2da614bc1f4aa93c3cbf40282ccd0a15ecad9184cc1906020016111c4565b6101315460ff16611d335760405162461bcd60e51b8152600401610c0990613b47565b610131546001600160401b0361010090910416611d5061012f5490565b1115611d6e5760405162461bcd60e51b8152600401610c0990613b73565b610131548190600190600160481b900466ffffffffffffff1615611de557610131546001600160a01b03831660009081526101336020526040902054600160481b90910466ffffffffffffff1690611dc7908390613ba8565b1115611de55760405162461bcd60e51b8152600401610c0990613bc0565b611dfd600080516020613fa2833981519152336116b7565b611e195760405162461bcd60e51b8152600401610c0990613ac7565b6000611e2561012f5490565b9050611e3661012f80546001019055565b6001600160a01b038416600090815261013360205260408120805460019290611e60908490613ba8565b90915550611c9490508482612587565b6000818152606760205260409020546060906001600160a01b0316611eef5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610c09565b6000611ef9612a99565b90506000815111611f195760405180602001604052806000815250611f44565b80611f2384612aa9565b604051602001611f34929190613d25565b6040516020818303038152906040525b9392505050565b600082815260996020526040902060010154611f66816125a1565b610d3e8383612631565b60cb546001600160a01b03163314611fca5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c09565b6001600160a01b03811661202f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c09565b610dd88161274d565b612050600080516020613fa2833981519152336116b7565b61206c5760405162461bcd60e51b8152600401610c0990613ac7565b60975481106120bd5760405162461bcd60e51b815260206004820152601b60248201527f726f79616c747950657263656e74616765206e6f74206c6f77657200000000006044820152606401610c09565b610dd881612ba9565b600061213f84848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050610134546040516bffffffffffffffffffffffff19606089901b166020820152909250603401905060405160208183030381529060405280519060200120612bf4565b949350505050565b6001600160a01b03163b151590565b60006001600160e01b03198216637965db0b60e01b1480610afc575063152a902d60e11b6001600160e01b0319831614610afc565b60006001600160e01b031982166380ac58cd60e01b14806121bc57506001600160e01b03198216635b5e139f60e01b145b80610afc57506301ffc9a760e01b6001600160e01b0319831614610afc565b600081815260696020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122108261144d565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610d3e908490612c0a565b61013080546001600160801b03908116600160801b918416918202179091556040519081527f2089ddec8a19988a4028ab3e252ef067dcaa183dbb82b99568ceb77589d56d8b906020016111c4565b6000818152606760205260408120546001600160a01b03166123635760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c09565b600061236e8361144d565b9050806001600160a01b0316846001600160a01b031614806123b557506001600160a01b038082166000908152606a602090815260408083209388168352929052205460ff165b8061213f5750836001600160a01b03166123ce84610b94565b6001600160a01b031614949350505050565b826001600160a01b03166123f38261144d565b6001600160a01b0316146124575760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610c09565b6001600160a01b0382166124b95760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c09565b6124c4838383612cdc565b6124cf6000826121db565b6001600160a01b03831660009081526068602052604081208054600192906124f8908490613ab0565b90915550506001600160a01b0382166000908152606860205260408120805460019290612526908490613ba8565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6110bf828260405180602001604052806000815250612d22565b610dd88133612d55565b6125b582826116b7565b6110bf5760008281526099602090815260408083206001600160a01b03851684529091529020805460ff191660011790556125ed3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61263b82826116b7565b156110bf5760008281526099602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60fd5460ff166126e15760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610c09565b60fd805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b609880546001600160a01b0319166001600160a01b0392909216919091179055565b60cb80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fd5460ff16156127e55760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c09565b60fd805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861270e3390565b61013080546fffffffffffffffffffffffffffffffff19166001600160801b0383169081179091556040519081527f1cddf73feff457adbd78dd21c10fd586ee5203e48660d1cc489b43e6416edb85906020016111c4565b60008054610100900460ff16156128b9578160ff1660011480156128955750303b155b6128b15760405162461bcd60e51b8152600401610c0990613d54565b506000919050565b60005460ff8084169116106128e05760405162461bcd60e51b8152600401610c0990613d54565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff166129265760405162461bcd60e51b8152600401610c0990613da2565b6110bf8282612db9565b600054610100900460ff166129575760405162461bcd60e51b8152600401610c0990613da2565b6110f2612e07565b600054610100900460ff166110f25760405162461bcd60e51b8152600401610c0990613da2565b61298f82612ba9565b6110bf8161272b565b816001600160a01b0316836001600160a01b0316036129f95760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c09565b6001600160a01b038381166000818152606a6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612a718484846123e0565b612a7d84848484612e3a565b611c945760405162461bcd60e51b8152600401610c0990613ded565b60606101328054610b1190613a33565b606081600003612ad05750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612afa5780612ae481613e3f565b9150612af39050600a83613c2c565b9150612ad4565b6000816001600160401b03811115612b1457612b146136f8565b6040519080825280601f01601f191660200182016040528015612b3e576020820181803683370190505b5090505b841561213f57612b53600183613ab0565b9150612b60600a86613e58565b612b6b906030613ba8565b60f81b818381518110612b8057612b80613e6c565b60200101906001600160f81b031916908160001a905350612ba2600a86613c2c565b9450612b42565b6127108110612bef5760405162461bcd60e51b81526020600482015260126024820152710a4def2c2d8e8d2cae640e8dede40d0d2ced60731b6044820152606401610c09565b609755565b600082612c018584612f3b565b14949350505050565b6000612c5f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612faf9092919063ffffffff16565b805190915015610d3e5780806020019051810190612c7d9190613e82565b610d3e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610c09565b60fd5460ff1615610d3e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610c09565b612d2c8383612fbe565b612d396000848484612e3a565b610d3e5760405162461bcd60e51b8152600401610c0990613ded565b612d5f82826116b7565b6110bf57612d77816001600160a01b0316601461310c565b612d8283602061310c565b604051602001612d93929190613e9f565b60408051601f198184030181529082905262461bcd60e51b8252610c09916004016135a9565b600054610100900460ff16612de05760405162461bcd60e51b8152600401610c0990613da2565b8151612df3906065906020850190613411565b508051610d3e906066906020840190613411565b600054610100900460ff16612e2e5760405162461bcd60e51b8152600401610c0990613da2565b60fd805460ff19169055565b60006001600160a01b0384163b15612f3057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612e7e903390899088908890600401613f14565b6020604051808303816000875af1925050508015612eb9575060408051601f3d908101601f19168201909252612eb691810190613f51565b60015b612f16573d808015612ee7576040519150601f19603f3d011682016040523d82523d6000602084013e612eec565b606091505b508051600003612f0e5760405162461bcd60e51b8152600401610c0990613ded565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061213f565b506001949350505050565b600081815b8451811015612fa7576000858281518110612f5d57612f5d613e6c565b60200260200101519050808311612f835760008381526020829052604090209250612f94565b600081815260208490526040902092505b5080612f9f81613e3f565b915050612f40565b509392505050565b606061213f84846000856132a7565b6001600160a01b0382166130145760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c09565b6000818152606760205260409020546001600160a01b0316156130795760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c09565b61308560008383612cdc565b6001600160a01b03821660009081526068602052604081208054600192906130ae908490613ba8565b909155505060008181526067602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6060600061311b836002613bf7565b613126906002613ba8565b6001600160401b0381111561313d5761313d6136f8565b6040519080825280601f01601f191660200182016040528015613167576020820181803683370190505b509050600360fc1b8160008151811061318257613182613e6c565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106131b1576131b1613e6c565b60200101906001600160f81b031916908160001a90535060006131d5846002613bf7565b6131e0906001613ba8565b90505b6001811115613258576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061321457613214613e6c565b1a60f81b82828151811061322a5761322a613e6c565b60200101906001600160f81b031916908160001a90535060049490941c9361325181613f6e565b90506131e3565b508315611f445760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610c09565b6060824710156133085760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610c09565b6001600160a01b0385163b61335f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c09565b600080866001600160a01b0316858760405161337b9190613f85565b60006040518083038185875af1925050503d80600081146133b8576040519150601f19603f3d011682016040523d82523d6000602084013e6133bd565b606091505b50915091506133cd8282866133d8565b979650505050505050565b606083156133e7575081611f44565b8251156133f75782518084602001fd5b8160405162461bcd60e51b8152600401610c0991906135a9565b82805461341d90613a33565b90600052602060002090601f01602090048101928261343f5760008555613485565b82601f1061345857805160ff1916838001178555613485565b82800160010185558215613485579182015b8281111561348557825182559160200191906001019061346a565b50613491929150613509565b5090565b8280546134a190613a33565b90600052602060002090601f0160209004810192826134c35760008555613485565b82601f106134dc5782800160ff19823516178555613485565b82800160010185558215613485579182015b828111156134855782358255916020019190600101906134ee565b5b80821115613491576000815560010161350a565b6001600160e01b031981168114610dd857600080fd5b60006020828403121561354657600080fd5b8135611f448161351e565b60005b8381101561356c578181015183820152602001613554565b83811115611c945750506000910152565b60008151808452613595816020860160208601613551565b601f01601f19169290920160200192915050565b602081526000611f44602083018461357d565b6000602082840312156135ce57600080fd5b5035919050565b6001600160a01b0381168114610dd857600080fd5b600080604083850312156135fd57600080fd5b8235613608816135d5565b946020939093013593505050565b60008060006060848603121561362b57600080fd5b8335613636816135d5565b92506020840135613646816135d5565b929592945050506040919091013590565b80356001600160801b03811681146128fa57600080fd5b60006020828403121561368057600080fd5b611f4482613657565b60006020828403121561369b57600080fd5b8135611f44816135d5565b600080604083850312156136b957600080fd5b50508035926020909101359150565b600080604083850312156136db57600080fd5b8235915060208301356136ed816135d5565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60006001600160401b0380841115613728576137286136f8565b604051601f8501601f19908116603f01168101908282118183101715613750576137506136f8565b8160405280935085815286868601111561376957600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561379557600080fd5b81356001600160401b038111156137ab57600080fd5b8201601f810184136137bc57600080fd5b61213f8482356020840161370e565b60008083601f8401126137dd57600080fd5b5081356001600160401b038111156137f457600080fd5b6020830191508360208260051b850101111561380f57600080fd5b9250929050565b6000806020838503121561382957600080fd5b82356001600160401b0381111561383f57600080fd5b61384b858286016137cb565b90969095509350505050565b60006020828403121561386957600080fd5b81356001600160401b0381111561387f57600080fd5b82016101808185031215611f4457600080fd5b8015158114610dd857600080fd5b600080604083850312156138b357600080fd5b82356138be816135d5565b915060208301356136ed81613892565b6000806000606084860312156138e357600080fd5b83356138ee81613892565b92506138fc60208501613657565b915061390a60408501613657565b90509250925092565b6000806000806080858703121561392957600080fd5b8435613934816135d5565b93506020850135613944816135d5565b92506040850135915060608501356001600160401b0381111561396657600080fd5b8501601f8101871361397757600080fd5b6139868782356020840161370e565b91505092959194509250565b6000602082840312156139a457600080fd5b8135611f4481613892565b600080604083850312156139c257600080fd5b82356139cd816135d5565b915060208301356136ed816135d5565b6000806000604084860312156139f257600080fd5b83356001600160401b03811115613a0857600080fd5b613a14868287016137cb565b9094509250506020840135613a28816135d5565b809150509250925092565b600181811c90821680613a4757607f821691505b602082108103613a6757634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526013908201527221b0b63632b91034b9903737ba1030b236b4b760691b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015613ac257613ac2613a9a565b500390565b60208082526015908201527421b0b63632b91034b9903737ba1036b0b730b3b2b960591b604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526012908201527153616c65206973206e6f742061637469766560701b604082015260600190565b6020808252818101527f507572636861736520776f756c6420657863656564206d617820746f6b656e73604082015260600190565b60008219821115613bbb57613bbb613a9a565b500190565b6020808252601a908201527f6d61784d696e7450657241646472657373206578636565646564000000000000604082015260600190565b6000816000190483118215151615613c1157613c11613a9a565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613c3b57613c3b613c16565b500490565b600060208284031215613c5257600080fd5b81356001600160401b0381168114611f4457600080fd5b6000808335601e19843603018112613c8057600080fd5b8301803591506001600160401b03821115613c9a57600080fd5b60200191503681900382131561380f57600080fd5b600060208284031215613cc157600080fd5b813566ffffffffffffff81168114611f4457600080fd5b600060208284031215613cea57600080fd5b813561ffff81168114611f4457600080fd5b600060208284031215613d0e57600080fd5b81356001600160701b0381168114611f4457600080fd5b60008351613d37818460208801613551565b835190830190613d4b818360208801613551565b01949350505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b600060018201613e5157613e51613a9a565b5060010190565b600082613e6757613e67613c16565b500690565b634e487b7160e01b600052603260045260246000fd5b600060208284031215613e9457600080fd5b8151611f4481613892565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613ed7816017850160208801613551565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613f08816028840160208801613551565b01602801949350505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613f479083018461357d565b9695505050505050565b600060208284031215613f6357600080fd5b8151611f448161351e565b600081613f7d57613f7d613a9a565b506000190190565b60008251613f97818460208701613551565b919091019291505056fe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220e80a16a2c015ad9ec57bd85c5366c1763fc27af19de3abcce4a80008ef1db25864736f6c634300080d0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.