ERC-721
Overview
Max Total Supply
1,622 BAC2
Holders
451
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
3 BAC2Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
BAC2Implementation
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 500 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "erc721a/contracts/ERC721A.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol"; import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; contract BAC2Implementation is ERC721A, AccessControl, VRFConsumerBaseV2 { enum State { InitMint, BulkMint, ComboMint, PublicMint, Paused, Complete } VRFCoordinatorV2Interface COORDINATOR; uint64 s_subscriptionId; bytes32 keyHash; uint32 callbackGasLimit = 100000; uint16 requestConfirmations = 3; uint32 numWords = 1; uint256[] public s_randomWords; uint256 public s_requestId; State public STATE; //Roles bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE"); bytes32 public constant WITHDRAWER_ROLE = keccak256("WITHDRAWER_ROLE"); uint256 constant public MAX_SUPPLY = 10000; uint256 constant public TOKENS_PER_TX = 25; address public BACV1_CONTRACT; uint256 public MINT_PRICE = 0.04 ether; //Rarities string public rarityListHash; string public reorderedListHash; string public fileKey; //ERRORS error StateError(State actual, State expected); error ContractError(); error NumberTokensError(); error ValueBelowPriceError(); error MaxSupplyError(); error NotOwnerError(); error SameTokenError(); error AlreadyUsedTokenError(); error TokenCountError(); error MaxPerWalletError(); error MaxPerTransactionError(); error ArraySizeError(); error RarityListHashError(); error ReorderedListHashError(); error FileKeyError(); //Metadata string private baseTokenURI; string private _contractURI; mapping(uint256 => address) usedTokens; //Events event PresaleMint( uint256 token1, uint256 token2, uint256 newToken ); event RandomWordsGenerated( uint256[] randomWords ); event RarityListChanged(string value); event RarityOrderedListChanged(string value); event KeyChanged(string value); event StateChanged(State value); constructor(address contractAddress, address vrfCoordinator) ERC721A("Bored Ape Comic #2", "BAC2") VRFConsumerBaseV2(vrfCoordinator) { _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(OPERATOR_ROLE, msg.sender); _grantRole(MINTER_ROLE, msg.sender); _grantRole(WITHDRAWER_ROLE, msg.sender); BACV1_CONTRACT = contractAddress; STATE = State.BulkMint; COORDINATOR = VRFCoordinatorV2Interface(vrfCoordinator); } //OpenSea function setContractURI(string memory newContractURI) external onlyRole(OPERATOR_ROLE) { _contractURI = newContractURI; } ///Returns the contract URI for OpenSea function contractURI() public view returns (string memory) { return _contractURI; } function setSubscriptionId(uint64 subscriptionId) external onlyRole(OPERATOR_ROLE) { s_subscriptionId = subscriptionId; } function setKeyHash(bytes32 _keyHash) external onlyRole(OPERATOR_ROLE) { keyHash = _keyHash; } function getCoordinator() external view returns (address) { return address(COORDINATOR); } function getKeyHash() external view returns (bytes32) { return keyHash; } function setGasLimit(uint32 _callbackGasLimit) external onlyRole(OPERATOR_ROLE) { callbackGasLimit = _callbackGasLimit; } function getGasLimit() external view returns (uint32) { return callbackGasLimit; } function setRequestConfirmations(uint16 _requestConfirmations) external onlyRole(OPERATOR_ROLE) { requestConfirmations = _requestConfirmations; } function getRequestConfirmations() external view returns (uint16) { return requestConfirmations; } function setNumWords(uint32 _numWords) external onlyRole(OPERATOR_ROLE) { numWords = _numWords; } function getNumWords() external view returns (uint32) { return numWords; } function getRandomNumber() external view returns (uint256) { if (s_randomWords.length > 0) { return s_randomWords[0] % 9999; } return 0; } function setOriginalRarityListHash(string memory _hash) external onlyRole(DEFAULT_ADMIN_ROLE) { rarityListHash = _hash; emit RarityListChanged(_hash); } function setReorderedRarityListHash(string memory _hash) external onlyRole(DEFAULT_ADMIN_ROLE) { reorderedListHash = _hash; emit RarityOrderedListChanged(_hash); } function setFileKey(string memory _fileKey) external onlyRole(DEFAULT_ADMIN_ROLE) { fileKey = _fileKey; emit KeyChanged(_fileKey); } function requestRandomWords() external onlyRole(OPERATOR_ROLE) { s_requestId = COORDINATOR.requestRandomWords( keyHash, s_subscriptionId, requestConfirmations, callbackGasLimit, numWords ); } function fulfillRandomWords( uint256, /* requestId */ uint256[] memory randomWords ) internal override { s_randomWords = randomWords; } function safeMint(address to, uint256 amount) external onlyRole(MINTER_ROLE) { if (STATE != State.BulkMint) { revert StateError(STATE, State.BulkMint); } _safeMint(to, amount, ""); } function safeMintArray(address[] calldata to, uint256[] calldata amount) external onlyRole(MINTER_ROLE) { if (STATE != State.BulkMint) { revert StateError(STATE, State.BulkMint); } if (to.length != amount.length) { revert ArraySizeError(); } for (uint256 i = 0; i < to.length; i++) { _safeMint(to[i], amount[i], ""); } } function presaleMint(uint256[] memory tokens) external payable { if (STATE != State.ComboMint) { revert StateError(STATE, State.ComboMint); } if (BACV1_CONTRACT == address(0)) { revert ContractError(); } if (tokens.length == 0 || tokens.length % 2 != 0) { revert NumberTokensError(); } uint256 tokensToMint = tokens.length / 2; if (msg.value < (MINT_PRICE * tokensToMint)) { revert ValueBelowPriceError(); } uint256 currentSupply = totalSupply(); if ((currentSupply + tokensToMint) > MAX_SUPPLY) { revert MaxSupplyError(); } for (uint256 index = 0; index < tokens.length; index += 2) { if (tokens[index] == tokens[index + 1]) { revert SameTokenError(); } if ( IERC721(BACV1_CONTRACT).ownerOf(tokens[index]) != msg.sender || IERC721(BACV1_CONTRACT).ownerOf(tokens[index + 1]) != msg.sender ) { revert NotOwnerError(); } if ( usedTokens[tokens[index]] != address(0) || usedTokens[tokens[index + 1]] != address(0) ) { revert AlreadyUsedTokenError(); } usedTokens[tokens[index]] = msg.sender; usedTokens[tokens[index + 1]] = msg.sender; currentSupply++; emit PresaleMint( tokens[index], tokens[index + 1], currentSupply ); } _safeMint(msg.sender, tokensToMint); } function publicMint(uint256 count) external payable { if (STATE != State.PublicMint) { revert StateError(STATE, State.PublicMint); } if (count == 0) { revert TokenCountError(); } if (count > TOKENS_PER_TX) { revert MaxPerTransactionError(); } if (msg.value < (MINT_PRICE * count)) { revert ValueBelowPriceError(); } uint256 currentSupply = totalSupply(); if ((currentSupply + count) > MAX_SUPPLY) { revert MaxSupplyError(); } _safeMint(_msgSender(), count); } function setPrice(uint256 price) external onlyRole(OPERATOR_ROLE) { MINT_PRICE = price; } function getPrice() external view returns (uint256) { return MINT_PRICE; } function setState(State _state) external onlyRole(OPERATOR_ROLE) { STATE = _state; emit StateChanged(_state); } function getState() external view returns (State) { return STATE; } function setContractAddress(address contractAddress) external onlyRole(OPERATOR_ROLE) { BACV1_CONTRACT = contractAddress; } function _baseURI() internal view virtual override returns (string memory) { return baseTokenURI; } function setBaseURI(string memory baseURI) public onlyRole(OPERATOR_ROLE) { baseTokenURI = baseURI; } function usedTokensFromList(uint256[] memory _tokens) external view returns (uint256[] memory) { uint256[] memory _usedTokens = new uint256[](_tokens.length); uint256 usedTokensIndex = 0; for (uint256 index = 0; index < _tokens.length; index++) { if (usedTokens[_tokens[index]] != address(0)) { _usedTokens[usedTokensIndex] = _tokens[index]; usedTokensIndex++; } } return _usedTokens; } function isTokenUsed(uint256 _token) external view returns (bool) { return usedTokens[_token] != address(0); } function withdrawAll() public payable onlyRole(WITHDRAWER_ROLE) { uint256 balance = address(this).balance; (bool sent,) = payable(msg.sender).call{value : balance}(""); require(sent, "WITHDRAW_FAILED"); } function supportsInterface(bytes4 interfaceId) public view override(ERC721A, AccessControl) returns (bool) { return super.supportsInterface(interfaceId); } function burn(uint256 tokenId) external { super._burn(tokenId, true); } }
// SPDX-License-Identifier: MIT // Creator: Chiru Labs pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@openzeppelin/contracts/utils/Context.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/utils/introspection/ERC165.sol'; error ApprovalCallerNotOwnerNorApproved(); error ApprovalQueryForNonexistentToken(); error ApproveToCaller(); error ApprovalToCurrentOwner(); error BalanceQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerQueryForNonexistentToken(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error URIQueryForNonexistentToken(); /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..). * * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply. * * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256). */ contract ERC721A is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Compiler will pack this into a single 256bit word. struct TokenOwnership { // The address of the owner. address addr; // Keeps track of the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; } // Compiler will pack this into a single 256bit word. struct AddressData { // Realistically, 2**64-1 is more than enough. uint64 balance; // Keeps track of mint count with minimal overhead for tokenomics. uint64 numberMinted; // Keeps track of burn count with minimal overhead for tokenomics. uint64 numberBurned; // For miscellaneous variable(s) pertaining to the address // (e.g. number of whitelist mint slots used). // If there are multiple variables, please pack them into a uint64. uint64 aux; } // The tokenId of the next token to be minted. uint256 internal _currentIndex; // The number of tokens burned. uint256 internal _burnCounter; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to ownership details // An empty struct value does not necessarily mean the token is unowned. See _ownershipOf implementation for details. mapping(uint256 => TokenOwnership) internal _ownerships; // Mapping owner address to address data mapping(address => AddressData) private _addressData; // 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; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _currentIndex = _startTokenId(); } /** * To change the starting tokenId, please override this function. */ function _startTokenId() internal view virtual returns (uint256) { return 0; } /** * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens. */ function totalSupply() public view returns (uint256) { // Counter underflow is impossible as _burnCounter cannot be incremented // more than _currentIndex - _startTokenId() times unchecked { return _currentIndex - _burnCounter - _startTokenId(); } } /** * Returns the total amount of tokens minted in the contract. */ function _totalMinted() internal view returns (uint256) { // Counter underflow is impossible as _currentIndex does not decrement, // and it is initialized to _startTokenId() unchecked { return _currentIndex - _startTokenId(); } } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view override returns (uint256) { if (owner == address(0)) revert BalanceQueryForZeroAddress(); return uint256(_addressData[owner].balance); } /** * Returns the number of tokens minted by `owner`. */ function _numberMinted(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberMinted); } /** * Returns the number of tokens burned by or on behalf of `owner`. */ function _numberBurned(address owner) internal view returns (uint256) { return uint256(_addressData[owner].numberBurned); } /** * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used). */ function _getAux(address owner) internal view returns (uint64) { return _addressData[owner].aux; } /** * Sets the auxillary data for `owner`. (e.g. number of whitelist mint slots used). * If there are multiple variables, please pack them into a uint64. */ function _setAux(address owner, uint64 aux) internal { _addressData[owner].aux = aux; } /** * Gas spent here starts off proportional to the maximum mint batch size. * It gradually moves to O(1) as tokens get transferred around in the collection over time. */ function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) { uint256 curr = tokenId; unchecked { if (_startTokenId() <= curr && curr < _currentIndex) { TokenOwnership memory ownership = _ownerships[curr]; if (!ownership.burned) { if (ownership.addr != address(0)) { return ownership; } // Invariant: // There will always be an ownership that has an address and is not burned // before an ownership that does not have an address and is not burned. // Hence, curr will not underflow. while (true) { curr--; ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } } revert OwnerQueryForNonexistentToken(); } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view override returns (address) { return _ownershipOf(tokenId).addr; } /** * @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) { if (!_exists(tokenId)) revert URIQueryForNonexistentToken(); 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 overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ''; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public override { address owner = ERC721A.ownerOf(tokenId); if (to == owner) revert ApprovalToCurrentOwner(); if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) { revert ApprovalCallerNotOwnerNorApproved(); } _approve(to, tokenId, owner); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view override returns (address) { if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken(); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { if (operator == _msgSender()) revert ApproveToCaller(); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_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 { _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 { _transfer(from, to, tokenId); if (to.isContract() && !_checkContractOnERC721Received(from, to, tokenId, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } /** * @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`), */ function _exists(uint256 tokenId) internal view returns (bool) { return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned; } function _safeMint(address to, uint256 quantity) internal { _safeMint(to, quantity, ''); } /** * @dev Safely mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _safeMint( address to, uint256 quantity, bytes memory _data ) internal { _mint(to, quantity, _data, true); } /** * @dev Mints `quantity` tokens and transfers them to `to`. * * Requirements: * * - `to` cannot be the zero address. * - `quantity` must be greater than 0. * * Emits a {Transfer} event. */ function _mint( address to, uint256 quantity, bytes memory _data, bool safe ) internal { uint256 startTokenId = _currentIndex; if (to == address(0)) revert MintToZeroAddress(); if (quantity == 0) revert MintZeroQuantity(); _beforeTokenTransfers(address(0), to, startTokenId, quantity); // Overflows are incredibly unrealistic. // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1 unchecked { _addressData[to].balance += uint64(quantity); _addressData[to].numberMinted += uint64(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; uint256 end = updatedIndex + quantity; if (safe && to.isContract()) { do { emit Transfer(address(0), to, updatedIndex); if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) { revert TransferToNonERC721ReceiverImplementer(); } } while (updatedIndex != end); // Reentrancy protection if (_currentIndex != startTokenId) revert(); } else { do { emit Transfer(address(0), to, updatedIndex++); } while (updatedIndex != end); } _currentIndex = updatedIndex; } _afterTokenTransfers(address(0), to, startTokenId, quantity); } /** * @dev Transfers `tokenId` from `from` to `to`. * * 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 ) private { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { _addressData[from].balance -= 1; _addressData[to].balance += 1; TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = to; currSlot.startTimestamp = uint64(block.timestamp); // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev This is equivalent to _burn(tokenId, false) */ function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId, bool approvalCheck) internal virtual { TokenOwnership memory prevOwnership = _ownershipOf(tokenId); address from = prevOwnership.addr; if (approvalCheck) { bool isApprovedOrOwner = (_msgSender() == from || isApprovedForAll(from, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); } _beforeTokenTransfers(from, address(0), tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, from); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. // Counter overflow is incredibly unrealistic as tokenId would have to be 2**256. unchecked { AddressData storage addressData = _addressData[from]; addressData.balance -= 1; addressData.numberBurned += 1; // Keep track of who burned the token, and the timestamp of burning. TokenOwnership storage currSlot = _ownerships[tokenId]; currSlot.addr = from; currSlot.startTimestamp = uint64(block.timestamp); currSlot.burned = true; // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it. // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls. uint256 nextTokenId = tokenId + 1; TokenOwnership storage nextSlot = _ownerships[nextTokenId]; if (nextSlot.addr == address(0)) { // This will suffice for checking _exists(nextTokenId), // as a burned slot cannot contain the zero address. if (nextTokenId != _currentIndex) { nextSlot.addr = from; nextSlot.startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, address(0), tokenId); _afterTokenTransfers(from, address(0), tokenId, 1); // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. unchecked { _burnCounter++; } } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve( address to, uint256 tokenId, address owner ) private { _tokenApprovals[tokenId] = to; emit Approval(owner, to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target 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 _checkContractOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert TransferToNonERC721ReceiverImplementer(); } else { assembly { revert(add(32, reason), mload(reason)) } } } } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * And also called before burning one token. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * 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, `tokenId` will be burned by `from`. * - `from` and `to` are never both zero. */ function _beforeTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} /** * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes * minting. * And also called after one token has been burned. * * startTokenId - the first token id to be transferred * quantity - the amount to be transferred * * Calling conditions: * * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been * transferred to `to`. * - When `from` is zero, `tokenId` has been minted for `to`. * - When `to` is zero, `tokenId` has been burned by `from`. * - `from` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.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 AccessControl is Context, IAccessControl, ERC165 { 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, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).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 `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 ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.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()); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface LinkTokenInterface { function allowance(address owner, address spender) external view returns (uint256 remaining); function approve(address spender, uint256 value) external returns (bool success); function balanceOf(address owner) external view returns (uint256 balance); function decimals() external view returns (uint8 decimalPlaces); function decreaseApproval(address spender, uint256 addedValue) external returns (bool success); function increaseApproval(address spender, uint256 subtractedValue) external; function name() external view returns (string memory tokenName); function symbol() external view returns (string memory tokenSymbol); function totalSupply() external view returns (uint256 totalTokensIssued); function transfer(address to, uint256 value) external returns (bool success); function transferAndCall( address to, uint256 value, bytes calldata data ) external returns (bool success); function transferFrom( address from, address to, uint256 value ) external returns (bool success); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface VRFCoordinatorV2Interface { /** * @notice Get configuration relevant for making requests * @return minimumRequestConfirmations global min for request confirmations * @return maxGasLimit global max for request gas limit * @return s_provingKeyHashes list of registered key hashes */ function getRequestConfig() external view returns ( uint16, uint32, bytes32[] memory ); /** * @notice Request a set of random words. * @param keyHash - Corresponds to a particular oracle job which uses * that key for generating the VRF proof. Different keyHash's have different gas price * ceilings, so you can select a specific one to bound your maximum per request cost. * @param subId - The ID of the VRF subscription. Must be funded * with the minimum subscription balance required for the selected keyHash. * @param minimumRequestConfirmations - How many blocks you'd like the * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS * for why you may want to request more. The acceptable range is * [minimumRequestBlockConfirmations, 200]. * @param callbackGasLimit - How much gas you'd like to receive in your * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords * may be slightly less than this amount because of gas used calling the function * (argument decoding etc.), so you may need to request slightly more than you expect * to have inside fulfillRandomWords. The acceptable range is * [0, maxGasLimit] * @param numWords - The number of uint256 random values you'd like to receive * in your fulfillRandomWords callback. Note these numbers are expanded in a * secure way by the VRFCoordinator from a single random value supplied by the oracle. * @return requestId - A unique identifier of the request. Can be used to match * a request to a response in fulfillRandomWords. */ function requestRandomWords( bytes32 keyHash, uint64 subId, uint16 minimumRequestConfirmations, uint32 callbackGasLimit, uint32 numWords ) external returns (uint256 requestId); /** * @notice Create a VRF subscription. * @return subId - A unique subscription id. * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer. * @dev Note to fund the subscription, use transferAndCall. For example * @dev LINKTOKEN.transferAndCall( * @dev address(COORDINATOR), * @dev amount, * @dev abi.encode(subId)); */ function createSubscription() external returns (uint64 subId); /** * @notice Get a VRF subscription. * @param subId - ID of the subscription * @return balance - LINK balance of the subscription in juels. * @return reqCount - number of requests for this subscription, determines fee tier. * @return owner - owner of the subscription. * @return consumers - list of consumer address which are able to use this subscription. */ function getSubscription(uint64 subId) external view returns ( uint96 balance, uint64 reqCount, address owner, address[] memory consumers ); /** * @notice Request subscription owner transfer. * @param subId - ID of the subscription * @param newOwner - proposed new owner of the subscription */ function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external; /** * @notice Request subscription owner transfer. * @param subId - ID of the subscription * @dev will revert if original owner of subId has * not requested that msg.sender become the new owner. */ function acceptSubscriptionOwnerTransfer(uint64 subId) external; /** * @notice Add a consumer to a VRF subscription. * @param subId - ID of the subscription * @param consumer - New consumer which can use the subscription */ function addConsumer(uint64 subId, address consumer) external; /** * @notice Remove a consumer from a VRF subscription. * @param subId - ID of the subscription * @param consumer - Consumer to remove from the subscription */ function removeConsumer(uint64 subId, address consumer) external; /** * @notice Cancel a subscription * @param subId - ID of the subscription * @param to - Where to send the remaining LINK to */ function cancelSubscription(uint64 subId, address to) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** **************************************************************************** * @notice Interface for contracts using VRF randomness * ***************************************************************************** * @dev PURPOSE * * @dev Reggie the Random Oracle (not his real job) wants to provide randomness * @dev to Vera the verifier in such a way that Vera can be sure he's not * @dev making his output up to suit himself. Reggie provides Vera a public key * @dev to which he knows the secret key. Each time Vera provides a seed to * @dev Reggie, he gives back a value which is computed completely * @dev deterministically from the seed and the secret key. * * @dev Reggie provides a proof by which Vera can verify that the output was * @dev correctly computed once Reggie tells it to her, but without that proof, * @dev the output is indistinguishable to her from a uniform random sample * @dev from the output space. * * @dev The purpose of this contract is to make it easy for unrelated contracts * @dev to talk to Vera the verifier about the work Reggie is doing, to provide * @dev simple access to a verifiable source of randomness. It ensures 2 things: * @dev 1. The fulfillment came from the VRFCoordinator * @dev 2. The consumer contract implements fulfillRandomWords. * ***************************************************************************** * @dev USAGE * * @dev Calling contracts must inherit from VRFConsumerBase, and can * @dev initialize VRFConsumerBase's attributes in their constructor as * @dev shown: * * @dev contract VRFConsumer { * @dev constructor(<other arguments>, address _vrfCoordinator, address _link) * @dev VRFConsumerBase(_vrfCoordinator) public { * @dev <initialization with other arguments goes here> * @dev } * @dev } * * @dev The oracle will have given you an ID for the VRF keypair they have * @dev committed to (let's call it keyHash). Create subscription, fund it * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface * @dev subscription management functions). * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations, * @dev callbackGasLimit, numWords), * @dev see (VRFCoordinatorInterface for a description of the arguments). * * @dev Once the VRFCoordinator has received and validated the oracle's response * @dev to your request, it will call your contract's fulfillRandomWords method. * * @dev The randomness argument to fulfillRandomWords is a set of random words * @dev generated from your requestId and the blockHash of the request. * * @dev If your contract could have concurrent requests open, you can use the * @dev requestId returned from requestRandomWords to track which response is associated * @dev with which randomness request. * @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind, * @dev if your contract could have multiple requests in flight simultaneously. * * @dev Colliding `requestId`s are cryptographically impossible as long as seeds * @dev differ. * * ***************************************************************************** * @dev SECURITY CONSIDERATIONS * * @dev A method with the ability to call your fulfillRandomness method directly * @dev could spoof a VRF response with any random value, so it's critical that * @dev it cannot be directly called by anything other than this base contract * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method). * * @dev For your users to trust that your contract's random behavior is free * @dev from malicious interference, it's best if you can write it so that all * @dev behaviors implied by a VRF response are executed *during* your * @dev fulfillRandomness method. If your contract must store the response (or * @dev anything derived from it) and use it later, you must ensure that any * @dev user-significant behavior which depends on that stored value cannot be * @dev manipulated by a subsequent VRF request. * * @dev Similarly, both miners and the VRF oracle itself have some influence * @dev over the order in which VRF responses appear on the blockchain, so if * @dev your contract could have multiple VRF requests in flight simultaneously, * @dev you must ensure that the order in which the VRF responses arrive cannot * @dev be used to manipulate your contract's user-significant behavior. * * @dev Since the block hash of the block which contains the requestRandomness * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful * @dev miner could, in principle, fork the blockchain to evict the block * @dev containing the request, forcing the request to be included in a * @dev different block with a different hash, and therefore a different input * @dev to the VRF. However, such an attack would incur a substantial economic * @dev cost. This cost scales with the number of blocks the VRF oracle waits * @dev until it calls responds to a request. It is for this reason that * @dev that you can signal to an oracle you'd like them to wait longer before * @dev responding to the request (however this is not enforced in the contract * @dev and so remains effective only in the case of unmodified oracle software). */ abstract contract VRFConsumerBaseV2 { error OnlyCoordinatorCanFulfill(address have, address want); address private immutable vrfCoordinator; /** * @param _vrfCoordinator address of VRFCoordinator contract */ constructor(address _vrfCoordinator) { vrfCoordinator = _vrfCoordinator; } /** * @notice fulfillRandomness handles the VRF response. Your contract must * @notice implement it. See "SECURITY CONSIDERATIONS" above for important * @notice principles to keep in mind when implementing your fulfillRandomness * @notice method. * * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this * @dev signature, and will call it once it has verified the proof * @dev associated with the randomness. (It is triggered via a call to * @dev rawFulfillRandomness, below.) * * @param requestId The Id initially returned by requestRandomness * @param randomWords the VRF output expanded to the requested number of words */ function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual; // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF // proof. rawFulfillRandomness then calls fulfillRandomness, after validating // the origin of the call function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external { if (msg.sender != vrfCoordinator) { revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator); } fulfillRandomWords(requestId, randomWords); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.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 "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.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 v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { 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 "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @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; }
{ "optimizer": { "enabled": true, "runs": 500 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"address","name":"vrfCoordinator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyUsedTokenError","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"ArraySizeError","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"ContractError","type":"error"},{"inputs":[],"name":"FileKeyError","type":"error"},{"inputs":[],"name":"MaxPerTransactionError","type":"error"},{"inputs":[],"name":"MaxPerWalletError","type":"error"},{"inputs":[],"name":"MaxSupplyError","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotOwnerError","type":"error"},{"inputs":[],"name":"NumberTokensError","type":"error"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"RarityListHashError","type":"error"},{"inputs":[],"name":"ReorderedListHashError","type":"error"},{"inputs":[],"name":"SameTokenError","type":"error"},{"inputs":[{"internalType":"enum BAC2Implementation.State","name":"actual","type":"uint8"},{"internalType":"enum BAC2Implementation.State","name":"expected","type":"uint8"}],"name":"StateError","type":"error"},{"inputs":[],"name":"TokenCountError","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ValueBelowPriceError","type":"error"},{"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":"value","type":"string"}],"name":"KeyChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"token1","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"token2","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newToken","type":"uint256"}],"name":"PresaleMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"RandomWordsGenerated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"}],"name":"RarityListChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"}],"name":"RarityOrderedListChanged","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":"enum BAC2Implementation.State","name":"value","type":"uint8"}],"name":"StateChanged","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"},{"inputs":[],"name":"BACV1_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATE","outputs":[{"internalType":"enum BAC2Implementation.State","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKENS_PER_TX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAWER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fileKey","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCoordinator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGasLimit","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNumWords","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRandomNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRequestConfirmations","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getState","outputs":[{"internalType":"enum BAC2Implementation.State","name":"","type":"uint8"}],"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":[{"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":"uint256","name":"_token","type":"uint256"}],"name":"isTokenUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokens","type":"uint256[]"}],"name":"presaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"rarityListHash","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","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":[],"name":"reorderedListHash","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"requestRandomWords","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"}],"name":"s_randomWords","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"s_requestId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"safeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amount","type":"uint256[]"}],"name":"safeMintArray","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"setContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newContractURI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_fileKey","type":"string"}],"name":"setFileKey","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_callbackGasLimit","type":"uint32"}],"name":"setGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_keyHash","type":"bytes32"}],"name":"setKeyHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_numWords","type":"uint32"}],"name":"setNumWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_hash","type":"string"}],"name":"setOriginalRarityListHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_hash","type":"string"}],"name":"setReorderedRarityListHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_requestConfirmations","type":"uint16"}],"name":"setRequestConfirmations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum BAC2Implementation.State","name":"_state","type":"uint8"}],"name":"setState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"subscriptionId","type":"uint64"}],"name":"setSubscriptionId","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":"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":"uint256[]","name":"_tokens","type":"uint256[]"}],"name":"usedTokensFromList","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"payable","type":"function"}]
Contract Creation Code
60a0604052600b80546001600160501b03191666010003000186a0179055668e1bc9bf040000600f553480156200003557600080fd5b5060405162003a6c38038062003a6c833981016040819052620000589162000318565b60408051808201825260128152712137b932b21020b8329021b7b6b4b190119960711b6020808301918252835180850190945260048452632120a19960e11b908401528151849391620000af916002919062000255565b508051620000c590600390602084019062000255565b5060008081556001600160a01b0390931660805250620000e891905033620001b0565b620001147f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92933620001b0565b620001407f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633620001b0565b6200016c7f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e433620001b0565b600e805460016001600160a81b03199091166101006001600160a01b039586160260ff191617179055600980546001600160a01b031916919092161790556200038d565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16620002515760008281526008602090815260408083206001600160a01b03851684529091529020805460ff19166001179055620002103390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b828054620002639062000350565b90600052602060002090601f016020900481019282620002875760008555620002d2565b82601f10620002a257805160ff1916838001178555620002d2565b82800160010185558215620002d2579182015b82811115620002d2578251825591602001919060010190620002b5565b50620002e0929150620002e4565b5090565b5b80821115620002e05760008155600101620002e5565b80516001600160a01b03811681146200031357600080fd5b919050565b600080604083850312156200032c57600080fd5b6200033783620002fb565b91506200034760208401620002fb565b90509250929050565b600181811c908216806200036557607f821691505b602082108114156200038757634e487b7160e01b600052602260045260246000fd5b50919050565b6080516136bc620003b060003960008181610e540152610e9601526136bc6000f3fe6080604052600436106103ce5760003560e01c80636cc831c1116101fd578063ae18907811610118578063dbdff2c1116100ab578063e985e9c51161007a578063e985e9c514610b5f578063ea7b4f7714610ba8578063f30c07d314610bc8578063f5b541a614610be8578063f6eaffc814610c0a57600080fd5b8063dbdff2c114610b0a578063e0c8628914610b1f578063e89e106a14610b34578063e8a3d48514610b4a57600080fd5b8063c87b56dd116100e7578063c87b56dd14610a69578063d17df6dc14610a89578063d539139314610ab6578063d547741f14610aea57600080fd5b8063ae189078146109e1578063b88d4fde14610a19578063c002d23d14610a39578063c486456c14610a4f57600080fd5b8063938e3d7b11610190578063a14481941161015f578063a144819414610977578063a217fddf14610997578063a22cb465146109ac578063a3ffd0f0146109cc57600080fd5b8063938e3d7b1461090d57806395d89b411461092d578063985447101461094257806398d5fdca1461096257600080fd5b806385f438c1116101cc57806385f438c1146108535780638824f5a71461088757806391b7f5ed146108a757806391d14854146108c757600080fd5b80636cc831c1146107f857806370a082311461080d57806371977fe01461082d578063853828b61461084b57600080fd5b8063331bf125116102ed57806352d84c621161028057806356de96db1161024f57806356de96db146107695780635f1b0fd8146107895780636352211e146107b8578063661b9f20146107d857600080fd5b806352d84c62146106ef57806353a2c19a1461070f5780635545fed61461073457806355f804b31461074957600080fd5b806342966c68116102bc57806342966c681461067c57806343f3c8861461069c578063477bddaa146106af57806348d6010d146106cf57600080fd5b8063331bf1251461060257806336568abe146106175780633a3eaf151461063757806342842e0e1461065c57600080fd5b80631a93d1c3116103655780632db11544116103345780632db11544146105a45780632f2ff15d146105b7578063319f50b8146105d757806332cb6b0c146105ec57600080fd5b80631a93d1c3146105085780631fe543e31461053457806323b872dd14610554578063248a9ca31461057457600080fd5b8063095ea7b3116103a1578063095ea7b314610484578063125e1287146104a457806318160ddd146104c45780631865c57d146104e757600080fd5b806301c17632146103d357806301ffc9a7146103f557806306fdde031461042a578063081812fc1461044c575b600080fd5b3480156103df57600080fd5b506103f36103ee366004612e64565b610c2a565b005b34801561040157600080fd5b50610415610410366004612ec3565b610c85565b60405190151581526020015b60405180910390f35b34801561043657600080fd5b5061043f610c96565b6040516104219190612f38565b34801561045857600080fd5b5061046c610467366004612f4b565b610d28565b6040516001600160a01b039091168152602001610421565b34801561049057600080fd5b506103f361049f366004612f79565b610d6c565b3480156104b057600080fd5b506103f36104bf366004612e64565b610dfa565b3480156104d057600080fd5b50600154600054035b604051908152602001610421565b3480156104f357600080fd5b50600e5460ff165b6040516104219190612fdd565b34801561051457600080fd5b50600b5463ffffffff165b60405163ffffffff9091168152602001610421565b34801561054057600080fd5b506103f361054f36600461306b565b610e49565b34801561056057600080fd5b506103f361056f3660046130b2565b610ed6565b34801561058057600080fd5b506104d961058f366004612f4b565b60009081526008602052604090206001015490565b6103f36105b2366004612f4b565b610ee1565b3480156105c357600080fd5b506103f36105d23660046130f3565b610fd7565b3480156105e357600080fd5b5061043f610ffd565b3480156105f857600080fd5b506104d961271081565b34801561060e57600080fd5b50600a546104d9565b34801561062357600080fd5b506103f36106323660046130f3565b61108b565b34801561064357600080fd5b50600e5461046c9061010090046001600160a01b031681565b34801561066857600080fd5b506103f36106773660046130b2565b611113565b34801561068857600080fd5b506103f3610697366004612f4b565b61112e565b6103f36106aa366004613123565b61113c565b3480156106bb57600080fd5b506103f36106ca366004613158565b611640565b3480156106db57600080fd5b506103f36106ea3660046131c1565b61168f565b3480156106fb57600080fd5b506103f361070a36600461322d565b611798565b34801561071b57600080fd5b50600b546601000000000000900463ffffffff1661051f565b34801561074057600080fd5b5061043f6117ce565b34801561075557600080fd5b506103f3610764366004612e64565b6117db565b34801561077557600080fd5b506103f3610784366004613253565b611807565b34801561079557600080fd5b50600b54640100000000900461ffff1660405161ffff9091168152602001610421565b3480156107c457600080fd5b5061046c6107d3366004612f4b565b611873565b3480156107e457600080fd5b506103f36107f3366004612e64565b611885565b34801561080457600080fd5b506104d9601981565b34801561081957600080fd5b506104d9610828366004613158565b6118d4565b34801561083957600080fd5b506009546001600160a01b031661046c565b6103f3611923565b34801561085f57600080fd5b506104d97f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e481565b34801561089357600080fd5b506103f36108a2366004613274565b6119e8565b3480156108b357600080fd5b506103f36108c2366004612f4b565b611a26565b3480156108d357600080fd5b506104156108e23660046130f3565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561091957600080fd5b506103f3610928366004612e64565b611a45565b34801561093957600080fd5b5061043f611a71565b34801561094e57600080fd5b506103f361095d366004612f4b565b611a80565b34801561096e57600080fd5b50600f546104d9565b34801561098357600080fd5b506103f3610992366004612f79565b611a9f565b3480156109a357600080fd5b506104d9600081565b3480156109b857600080fd5b506103f36109c7366004613298565b611b25565b3480156109d857600080fd5b5061043f611bbb565b3480156109ed57600080fd5b506104156109fc366004612f4b565b6000908152601560205260409020546001600160a01b0316151590565b348015610a2557600080fd5b506103f3610a343660046132cb565b611bc8565b348015610a4557600080fd5b506104d9600f5481565b348015610a5b57600080fd5b50600e546104fb9060ff1681565b348015610a7557600080fd5b5061043f610a84366004612f4b565b611c19565b348015610a9557600080fd5b50610aa9610aa4366004613123565b611c9e565b604051610421919061334b565b348015610ac257600080fd5b506104d97f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b348015610af657600080fd5b506103f3610b053660046130f3565b611d9f565b348015610b1657600080fd5b506104d9611dc5565b348015610b2b57600080fd5b506103f3611e07565b348015610b4057600080fd5b506104d9600d5481565b348015610b5657600080fd5b5061043f611ee1565b348015610b6b57600080fd5b50610415610b7a36600461338f565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610bb457600080fd5b506103f3610bc33660046133bd565b611ef0565b348015610bd457600080fd5b506103f3610be336600461322d565b611f4c565b348015610bf457600080fd5b506104d960008051602061366783398151915281565b348015610c1657600080fd5b506104d9610c25366004612f4b565b611f92565b6000610c368133611fb3565b8151610c49906011906020850190612cf2565b507ffc7c6bf0779cb417e3c554debb308475e0f64ddecab99e89926c454233f82fa582604051610c799190612f38565b60405180910390a15050565b6000610c9082612033565b92915050565b606060028054610ca5906133e7565b80601f0160208091040260200160405190810160405280929190818152602001828054610cd1906133e7565b8015610d1e5780601f10610cf357610100808354040283529160200191610d1e565b820191906000526020600020905b815481529060010190602001808311610d0157829003601f168201915b5050505050905090565b6000610d3382612058565b610d50576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610d7782611873565b9050806001600160a01b0316836001600160a01b03161415610dac5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610dcc5750610dca8133610b7a565b155b15610dea576040516367d9dca160e11b815260040160405180910390fd5b610df5838383612083565b505050565b6000610e068133611fb3565b8151610e19906012906020850190612cf2565b507f54d8e2113ab65bdd8aeae030cce69c10b7c47ef63b285af36755c96e7bc70a7482604051610c799190612f38565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610ec85760405163073e64fd60e21b81523360048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660248201526044015b60405180910390fd5b610ed282826120ec565b5050565b610df58383836120ff565b6003600e5460ff166005811115610efa57610efa612fa5565b14610f2257600e5460405163ca8dc8ed60e01b8152610ebf9160ff1690600390600401613422565b80610f40576040516342079c6d60e01b815260040160405180910390fd5b6019811115610f625760405163666aa55760e01b815260040160405180910390fd5b80600f54610f709190613453565b341015610f905760405163064975f760e41b815260040160405180910390fd5b6000610f9f6001546000540390565b9050612710610fae8383613472565b1115610fcd57604051631f6e464360e31b815260040160405180910390fd5b610ed233836122ef565b600082815260086020526040902060010154610ff38133611fb3565b610df58383612309565b6011805461100a906133e7565b80601f0160208091040260200160405190810160405280929190818152602001828054611036906133e7565b80156110835780601f1061105857610100808354040283529160200191611083565b820191906000526020600020905b81548152906001019060200180831161106657829003601f168201915b505050505081565b6001600160a01b03811633146111095760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610ebf565b610ed282826123ab565b610df583838360405180602001604052806000815250611bc8565b61113981600161242e565b50565b6002600e5460ff16600581111561115557611155612fa5565b1461117d57600e5460405163ca8dc8ed60e01b8152610ebf9160ff1690600290600401613422565b600e5461010090046001600160a01b03166111ab5760405163ae1c061f60e01b815260040160405180910390fd5b805115806111c55750600281516111c291906134a0565b15155b156111e35760405163475077d360e01b815260040160405180910390fd5b6000600282516111f391906134b4565b905080600f546112039190613453565b3410156112235760405163064975f760e41b815260040160405180910390fd5b60006112326001546000540390565b90506127106112418383613472565b111561126057604051631f6e464360e31b815260040160405180910390fd5b60005b83518110156116355783611278826001613472565b81518110611288576112886134c8565b60200260200101518482815181106112a2576112a26134c8565b602002602001015114156112c957604051633b0e2de560e21b815260040160405180910390fd5b600e548451339161010090046001600160a01b031690636352211e908790859081106112f7576112f76134c8565b60200260200101516040518263ffffffff1660e01b815260040161131d91815260200190565b602060405180830381865afa15801561133a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135e91906134de565b6001600160a01b03161415806114165750600e54339061010090046001600160a01b0316636352211e86611393856001613472565b815181106113a3576113a36134c8565b60200260200101516040518263ffffffff1660e01b81526004016113c991815260200190565b602060405180830381865afa1580156113e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140a91906134de565b6001600160a01b031614155b15611434576040516374a2152760e01b815260040160405180910390fd5b60006001600160a01b031660156000868481518110611455576114556134c8565b6020908102919091018101518252810191909152604001600020546001600160a01b03161415806114c95750600060158186611492856001613472565b815181106114a2576114a26134c8565b6020908102919091018101518252810191909152604001600020546001600160a01b031614155b156114e757604051636a3a95db60e01b815260040160405180910390fd5b33601560008684815181106114fe576114fe6134c8565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555033601560008684600161154b9190613472565b8151811061155b5761155b6134c8565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081806115a0906134fb565b9250507f9bba0a6f851aaae0e6baff2c0932e190345377436bd70b15d103bbc902f378bd8482815181106115d6576115d66134c8565b6020026020010151858360016115ec9190613472565b815181106115fc576115fc6134c8565b6020908102919091018101516040805193845291830152810184905260600160405180910390a161162e600282613472565b9050611263565b50610df533836122ef565b6000805160206136678339815191526116598133611fb3565b50600e80546001600160a01b039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66116ba8133611fb3565b6001600e5460ff1660058111156116d3576116d3612fa5565b146116fb57600e5460405163ca8dc8ed60e01b8152610ebf9160ff1690600190600401613422565b83821461171b57604051631eba291760e21b815260040160405180910390fd5b60005b848110156117905761177e86868381811061173b5761173b6134c8565b90506020020160208101906117509190613158565b858584818110611762576117626134c8565b9050602002013560405180602001604052806000815250612609565b80611788816134fb565b91505061171e565b505050505050565b6000805160206136678339815191526117b18133611fb3565b50600b805463ffffffff191663ffffffff92909216919091179055565b6010805461100a906133e7565b6000805160206136678339815191526117f48133611fb3565b8151610df5906013906020850190612cf2565b6000805160206136678339815191526118208133611fb3565b600e805483919060ff1916600183600581111561183f5761183f612fa5565b02179055507f551dc40198cc79684bb69e4931dba4ac16e4598792ee1c0a5000aeea366d7bb682604051610c799190612fdd565b600061187e82612616565b5192915050565b60006118918133611fb3565b81516118a4906010906020850190612cf2565b507f5874405043cdc346e0b75f1d26dc479a48f66ed653bd5e2feec2c2ae1fe0be5782604051610c799190612f38565b60006001600160a01b0382166118fd576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b7f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e461194e8133611fb3565b6040514790600090339083908381818185875af1925050503d8060008114611992576040519150601f19603f3d011682016040523d82523d6000602084013e611997565b606091505b5050905080610df55760405162461bcd60e51b815260206004820152600f60248201527f57495448445241575f4641494c454400000000000000000000000000000000006044820152606401610ebf565b600080516020613667833981519152611a018133611fb3565b50600b805461ffff9092166401000000000265ffff0000000019909216919091179055565b600080516020613667833981519152611a3f8133611fb3565b50600f55565b600080516020613667833981519152611a5e8133611fb3565b8151610df5906014906020850190612cf2565b606060038054610ca5906133e7565b600080516020613667833981519152611a998133611fb3565b50600a55565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6611aca8133611fb3565b6001600e5460ff166005811115611ae357611ae3612fa5565b14611b0b57600e5460405163ca8dc8ed60e01b8152610ebf9160ff1690600190600401613422565b610df5838360405180602001604052806000815250612609565b6001600160a01b038216331415611b4f5760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6012805461100a906133e7565b611bd38484846120ff565b6001600160a01b0383163b15158015611bf55750611bf384848484612732565b155b15611c13576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6060611c2482612058565b611c4157604051630a14c4b560e41b815260040160405180910390fd5b6000611c4b61281b565b9050805160001415611c6c5760405180602001604052806000815250611c97565b80611c768461282a565b604051602001611c87929190613516565b6040516020818303038152906040525b9392505050565b60606000825167ffffffffffffffff811115611cbc57611cbc612dc5565b604051908082528060200260200182016040528015611ce5578160200160208202803683370190505b5090506000805b8451811015611d965760006001600160a01b031660156000878481518110611d1657611d166134c8565b6020908102919091018101518252810191909152604001600020546001600160a01b031614611d8457848181518110611d5157611d516134c8565b6020026020010151838381518110611d6b57611d6b6134c8565b602090810291909101015281611d80816134fb565b9250505b80611d8e816134fb565b915050611cec565b50909392505050565b600082815260086020526040902060010154611dbb8133611fb3565b610df583836123ab565b600c5460009015611e015761270f600c600081548110611de757611de76134c8565b9060005260206000200154611dfc91906134a0565b905090565b50600090565b600080516020613667833981519152611e208133611fb3565b600954600a54600b546040516305d3b1d360e41b81526004810192909252600160a01b830467ffffffffffffffff166024830152640100000000810461ffff16604483015263ffffffff808216606484015266010000000000009091041660848201526001600160a01b0390911690635d3b1d309060a4016020604051808303816000875af1158015611eb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611edb9190613545565b600d5550565b606060148054610ca5906133e7565b600080516020613667833981519152611f098133611fb3565b506009805467ffffffffffffffff909216600160a01b027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b600080516020613667833981519152611f658133611fb3565b50600b805463ffffffff90921666010000000000000269ffffffff00000000000019909216919091179055565b600c8181548110611fa257600080fd5b600091825260209091200154905081565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16610ed257611ff1816001600160a01b03166014612928565b611ffc836020612928565b60405160200161200d92919061355e565b60408051601f198184030181529082905262461bcd60e51b8252610ebf91600401612f38565b60006001600160e01b03198216637965db0b60e01b1480610c905750610c9082612ad1565b6000805482108015610c90575050600090815260046020526040902054600160e01b900460ff161590565b600082815260066020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b8051610df590600c906020840190612d76565b600061210a82612616565b9050836001600160a01b031681600001516001600160a01b0316146121415760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b038616148061215f575061215f8533610b7a565b8061217a57503361216f84610d28565b6001600160a01b0316145b90508061219a57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0384166121c157604051633a954ecd60e21b815260040160405180910390fd5b6121cd60008487612083565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217835587018084529220805491939091166122a35760005482146122a3578054602086015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b610ed2828260405180602001604052806000815250612609565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16610ed25760008281526008602090815260408083206001600160a01b03851684529091529020805460ff191660011790556123673390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff1615610ed25760008281526008602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061243983612616565b8051909150821561249f576000336001600160a01b038316148061246257506124628233610b7a565b8061247d57503361247286610d28565b6001600160a01b0316145b90508061249d57604051632ce44b5f60e11b815260040160405180910390fd5b505b6124ab60008583612083565b6001600160a01b038082166000818152600560209081526040808320805470010000000000000000000000000000000060001967ffffffffffffffff80841691909101811667ffffffffffffffff19841681178390048216600190810183169093027fffffffffffffffff0000000000000000ffffffffffffffff0000000000000000909416179290921783558b86526004909452828520805460ff60e01b1942909316600160a01b026001600160e01b03199091169097179690961716600160e01b1785559189018084529220805491949091166125bf5760005482146125bf578054602087015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038716171781555b5050604051869250600091506001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4505060018054810190555050565b610df58383836001612b21565b60408051606081018252600080825260208201819052918101919091528160005481101561271957600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161515918101829052906127175780516001600160a01b0316156126ad579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff1615159281019290925215612712579392505050565b6126ad565b505b604051636f96cda160e11b815260040160405180910390fd5b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906127679033908990889088906004016135df565b6020604051808303816000875af19250505080156127a2575060408051601f3d908101601f1916820190925261279f9181019061361b565b60015b6127fd573d8080156127d0576040519150601f19603f3d011682016040523d82523d6000602084013e6127d5565b606091505b5080516127f5576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606060138054610ca5906133e7565b60608161284e5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156128785780612862816134fb565b91506128719050600a836134b4565b9150612852565b60008167ffffffffffffffff81111561289357612893612dc5565b6040519080825280601f01601f1916602001820160405280156128bd576020820181803683370190505b5090505b8415612813576128d2600183613638565b91506128df600a866134a0565b6128ea906030613472565b60f81b8183815181106128ff576128ff6134c8565b60200101906001600160f81b031916908160001a905350612921600a866134b4565b94506128c1565b60606000612937836002613453565b612942906002613472565b67ffffffffffffffff81111561295a5761295a612dc5565b6040519080825280601f01601f191660200182016040528015612984576020820181803683370190505b509050600360fc1b8160008151811061299f5761299f6134c8565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106129ce576129ce6134c8565b60200101906001600160f81b031916908160001a90535060006129f2846002613453565b6129fd906001613472565b90505b6001811115612a82577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612a3e57612a3e6134c8565b1a60f81b828281518110612a5457612a546134c8565b60200101906001600160f81b031916908160001a90535060049490941c93612a7b8161364f565b9050612a00565b508315611c975760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ebf565b60006001600160e01b031982166380ac58cd60e01b1480612b0257506001600160e01b03198216635b5e139f60e01b145b80610c9057506301ffc9a760e01b6001600160e01b0319831614610c90565b6000546001600160a01b038516612b4a57604051622e076360e81b815260040160405180910390fd5b83612b685760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff19811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b429092169190910217905580808501838015612c1a57506001600160a01b0387163b15155b15612ca3575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4612c6b6000888480600101955088612732565b612c88576040516368d2bf6b60e11b815260040160405180910390fd5b80821415612c20578260005414612c9e57600080fd5b612ce9565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415612ca4575b506000556122e8565b828054612cfe906133e7565b90600052602060002090601f016020900481019282612d205760008555612d66565b82601f10612d3957805160ff1916838001178555612d66565b82800160010185558215612d66579182015b82811115612d66578251825591602001919060010190612d4b565b50612d72929150612db0565b5090565b828054828255906000526020600020908101928215612d665791602002820182811115612d66578251825591602001919060010190612d4b565b5b80821115612d725760008155600101612db1565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612e0457612e04612dc5565b604052919050565b600067ffffffffffffffff831115612e2657612e26612dc5565b612e39601f8401601f1916602001612ddb565b9050828152838383011115612e4d57600080fd5b828260208301376000602084830101529392505050565b600060208284031215612e7657600080fd5b813567ffffffffffffffff811115612e8d57600080fd5b8201601f81018413612e9e57600080fd5b61281384823560208401612e0c565b6001600160e01b03198116811461113957600080fd5b600060208284031215612ed557600080fd5b8135611c9781612ead565b60005b83811015612efb578181015183820152602001612ee3565b83811115611c135750506000910152565b60008151808452612f24816020860160208601612ee0565b601f01601f19169290920160200192915050565b602081526000611c976020830184612f0c565b600060208284031215612f5d57600080fd5b5035919050565b6001600160a01b038116811461113957600080fd5b60008060408385031215612f8c57600080fd5b8235612f9781612f64565b946020939093013593505050565b634e487b7160e01b600052602160045260246000fd5b60068110612fd957634e487b7160e01b600052602160045260246000fd5b9052565b60208101610c908284612fbb565b600082601f830112612ffc57600080fd5b8135602067ffffffffffffffff82111561301857613018612dc5565b8160051b613027828201612ddb565b928352848101820192828101908785111561304157600080fd5b83870192505b8483101561306057823582529183019190830190613047565b979650505050505050565b6000806040838503121561307e57600080fd5b82359150602083013567ffffffffffffffff81111561309c57600080fd5b6130a885828601612feb565b9150509250929050565b6000806000606084860312156130c757600080fd5b83356130d281612f64565b925060208401356130e281612f64565b929592945050506040919091013590565b6000806040838503121561310657600080fd5b82359150602083013561311881612f64565b809150509250929050565b60006020828403121561313557600080fd5b813567ffffffffffffffff81111561314c57600080fd5b61281384828501612feb565b60006020828403121561316a57600080fd5b8135611c9781612f64565b60008083601f84011261318757600080fd5b50813567ffffffffffffffff81111561319f57600080fd5b6020830191508360208260051b85010111156131ba57600080fd5b9250929050565b600080600080604085870312156131d757600080fd5b843567ffffffffffffffff808211156131ef57600080fd5b6131fb88838901613175565b9096509450602087013591508082111561321457600080fd5b5061322187828801613175565b95989497509550505050565b60006020828403121561323f57600080fd5b813563ffffffff81168114611c9757600080fd5b60006020828403121561326557600080fd5b813560068110611c9757600080fd5b60006020828403121561328657600080fd5b813561ffff81168114611c9757600080fd5b600080604083850312156132ab57600080fd5b82356132b681612f64565b91506020830135801515811461311857600080fd5b600080600080608085870312156132e157600080fd5b84356132ec81612f64565b935060208501356132fc81612f64565b925060408501359150606085013567ffffffffffffffff81111561331f57600080fd5b8501601f8101871361333057600080fd5b61333f87823560208401612e0c565b91505092959194509250565b6020808252825182820181905260009190848201906040850190845b8181101561338357835183529284019291840191600101613367565b50909695505050505050565b600080604083850312156133a257600080fd5b82356133ad81612f64565b9150602083013561311881612f64565b6000602082840312156133cf57600080fd5b813567ffffffffffffffff81168114611c9757600080fd5b600181811c908216806133fb57607f821691505b6020821081141561341c57634e487b7160e01b600052602260045260246000fd5b50919050565b604081016134308285612fbb565b611c976020830184612fbb565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561346d5761346d61343d565b500290565b600082198211156134855761348561343d565b500190565b634e487b7160e01b600052601260045260246000fd5b6000826134af576134af61348a565b500690565b6000826134c3576134c361348a565b500490565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156134f057600080fd5b8151611c9781612f64565b600060001982141561350f5761350f61343d565b5060010190565b60008351613528818460208801612ee0565b83519083019061353c818360208801612ee0565b01949350505050565b60006020828403121561355757600080fd5b5051919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613596816017850160208801612ee0565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516135d3816028840160208801612ee0565b01602801949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526136116080830184612f0c565b9695505050505050565b60006020828403121561362d57600080fd5b8151611c9781612ead565b60008282101561364a5761364a61343d565b500390565b60008161365e5761365e61343d565b50600019019056fe97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929a26469706673582212205ae558448a21e8c6aca991799b4c0e8c9316d1f22128a76d583ceb83fe3d056064736f6c634300080b00330000000000000000000000001eb7382976077f92cf25c27cc3b900a274fd0012000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Deployed Bytecode
0x6080604052600436106103ce5760003560e01c80636cc831c1116101fd578063ae18907811610118578063dbdff2c1116100ab578063e985e9c51161007a578063e985e9c514610b5f578063ea7b4f7714610ba8578063f30c07d314610bc8578063f5b541a614610be8578063f6eaffc814610c0a57600080fd5b8063dbdff2c114610b0a578063e0c8628914610b1f578063e89e106a14610b34578063e8a3d48514610b4a57600080fd5b8063c87b56dd116100e7578063c87b56dd14610a69578063d17df6dc14610a89578063d539139314610ab6578063d547741f14610aea57600080fd5b8063ae189078146109e1578063b88d4fde14610a19578063c002d23d14610a39578063c486456c14610a4f57600080fd5b8063938e3d7b11610190578063a14481941161015f578063a144819414610977578063a217fddf14610997578063a22cb465146109ac578063a3ffd0f0146109cc57600080fd5b8063938e3d7b1461090d57806395d89b411461092d578063985447101461094257806398d5fdca1461096257600080fd5b806385f438c1116101cc57806385f438c1146108535780638824f5a71461088757806391b7f5ed146108a757806391d14854146108c757600080fd5b80636cc831c1146107f857806370a082311461080d57806371977fe01461082d578063853828b61461084b57600080fd5b8063331bf125116102ed57806352d84c621161028057806356de96db1161024f57806356de96db146107695780635f1b0fd8146107895780636352211e146107b8578063661b9f20146107d857600080fd5b806352d84c62146106ef57806353a2c19a1461070f5780635545fed61461073457806355f804b31461074957600080fd5b806342966c68116102bc57806342966c681461067c57806343f3c8861461069c578063477bddaa146106af57806348d6010d146106cf57600080fd5b8063331bf1251461060257806336568abe146106175780633a3eaf151461063757806342842e0e1461065c57600080fd5b80631a93d1c3116103655780632db11544116103345780632db11544146105a45780632f2ff15d146105b7578063319f50b8146105d757806332cb6b0c146105ec57600080fd5b80631a93d1c3146105085780631fe543e31461053457806323b872dd14610554578063248a9ca31461057457600080fd5b8063095ea7b3116103a1578063095ea7b314610484578063125e1287146104a457806318160ddd146104c45780631865c57d146104e757600080fd5b806301c17632146103d357806301ffc9a7146103f557806306fdde031461042a578063081812fc1461044c575b600080fd5b3480156103df57600080fd5b506103f36103ee366004612e64565b610c2a565b005b34801561040157600080fd5b50610415610410366004612ec3565b610c85565b60405190151581526020015b60405180910390f35b34801561043657600080fd5b5061043f610c96565b6040516104219190612f38565b34801561045857600080fd5b5061046c610467366004612f4b565b610d28565b6040516001600160a01b039091168152602001610421565b34801561049057600080fd5b506103f361049f366004612f79565b610d6c565b3480156104b057600080fd5b506103f36104bf366004612e64565b610dfa565b3480156104d057600080fd5b50600154600054035b604051908152602001610421565b3480156104f357600080fd5b50600e5460ff165b6040516104219190612fdd565b34801561051457600080fd5b50600b5463ffffffff165b60405163ffffffff9091168152602001610421565b34801561054057600080fd5b506103f361054f36600461306b565b610e49565b34801561056057600080fd5b506103f361056f3660046130b2565b610ed6565b34801561058057600080fd5b506104d961058f366004612f4b565b60009081526008602052604090206001015490565b6103f36105b2366004612f4b565b610ee1565b3480156105c357600080fd5b506103f36105d23660046130f3565b610fd7565b3480156105e357600080fd5b5061043f610ffd565b3480156105f857600080fd5b506104d961271081565b34801561060e57600080fd5b50600a546104d9565b34801561062357600080fd5b506103f36106323660046130f3565b61108b565b34801561064357600080fd5b50600e5461046c9061010090046001600160a01b031681565b34801561066857600080fd5b506103f36106773660046130b2565b611113565b34801561068857600080fd5b506103f3610697366004612f4b565b61112e565b6103f36106aa366004613123565b61113c565b3480156106bb57600080fd5b506103f36106ca366004613158565b611640565b3480156106db57600080fd5b506103f36106ea3660046131c1565b61168f565b3480156106fb57600080fd5b506103f361070a36600461322d565b611798565b34801561071b57600080fd5b50600b546601000000000000900463ffffffff1661051f565b34801561074057600080fd5b5061043f6117ce565b34801561075557600080fd5b506103f3610764366004612e64565b6117db565b34801561077557600080fd5b506103f3610784366004613253565b611807565b34801561079557600080fd5b50600b54640100000000900461ffff1660405161ffff9091168152602001610421565b3480156107c457600080fd5b5061046c6107d3366004612f4b565b611873565b3480156107e457600080fd5b506103f36107f3366004612e64565b611885565b34801561080457600080fd5b506104d9601981565b34801561081957600080fd5b506104d9610828366004613158565b6118d4565b34801561083957600080fd5b506009546001600160a01b031661046c565b6103f3611923565b34801561085f57600080fd5b506104d97f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e481565b34801561089357600080fd5b506103f36108a2366004613274565b6119e8565b3480156108b357600080fd5b506103f36108c2366004612f4b565b611a26565b3480156108d357600080fd5b506104156108e23660046130f3565b60009182526008602090815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561091957600080fd5b506103f3610928366004612e64565b611a45565b34801561093957600080fd5b5061043f611a71565b34801561094e57600080fd5b506103f361095d366004612f4b565b611a80565b34801561096e57600080fd5b50600f546104d9565b34801561098357600080fd5b506103f3610992366004612f79565b611a9f565b3480156109a357600080fd5b506104d9600081565b3480156109b857600080fd5b506103f36109c7366004613298565b611b25565b3480156109d857600080fd5b5061043f611bbb565b3480156109ed57600080fd5b506104156109fc366004612f4b565b6000908152601560205260409020546001600160a01b0316151590565b348015610a2557600080fd5b506103f3610a343660046132cb565b611bc8565b348015610a4557600080fd5b506104d9600f5481565b348015610a5b57600080fd5b50600e546104fb9060ff1681565b348015610a7557600080fd5b5061043f610a84366004612f4b565b611c19565b348015610a9557600080fd5b50610aa9610aa4366004613123565b611c9e565b604051610421919061334b565b348015610ac257600080fd5b506104d97f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b348015610af657600080fd5b506103f3610b053660046130f3565b611d9f565b348015610b1657600080fd5b506104d9611dc5565b348015610b2b57600080fd5b506103f3611e07565b348015610b4057600080fd5b506104d9600d5481565b348015610b5657600080fd5b5061043f611ee1565b348015610b6b57600080fd5b50610415610b7a36600461338f565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610bb457600080fd5b506103f3610bc33660046133bd565b611ef0565b348015610bd457600080fd5b506103f3610be336600461322d565b611f4c565b348015610bf457600080fd5b506104d960008051602061366783398151915281565b348015610c1657600080fd5b506104d9610c25366004612f4b565b611f92565b6000610c368133611fb3565b8151610c49906011906020850190612cf2565b507ffc7c6bf0779cb417e3c554debb308475e0f64ddecab99e89926c454233f82fa582604051610c799190612f38565b60405180910390a15050565b6000610c9082612033565b92915050565b606060028054610ca5906133e7565b80601f0160208091040260200160405190810160405280929190818152602001828054610cd1906133e7565b8015610d1e5780601f10610cf357610100808354040283529160200191610d1e565b820191906000526020600020905b815481529060010190602001808311610d0157829003601f168201915b5050505050905090565b6000610d3382612058565b610d50576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610d7782611873565b9050806001600160a01b0316836001600160a01b03161415610dac5760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b03821614801590610dcc5750610dca8133610b7a565b155b15610dea576040516367d9dca160e11b815260040160405180910390fd5b610df5838383612083565b505050565b6000610e068133611fb3565b8151610e19906012906020850190612cf2565b507f54d8e2113ab65bdd8aeae030cce69c10b7c47ef63b285af36755c96e7bc70a7482604051610c799190612f38565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091614610ec85760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091660248201526044015b60405180910390fd5b610ed282826120ec565b5050565b610df58383836120ff565b6003600e5460ff166005811115610efa57610efa612fa5565b14610f2257600e5460405163ca8dc8ed60e01b8152610ebf9160ff1690600390600401613422565b80610f40576040516342079c6d60e01b815260040160405180910390fd5b6019811115610f625760405163666aa55760e01b815260040160405180910390fd5b80600f54610f709190613453565b341015610f905760405163064975f760e41b815260040160405180910390fd5b6000610f9f6001546000540390565b9050612710610fae8383613472565b1115610fcd57604051631f6e464360e31b815260040160405180910390fd5b610ed233836122ef565b600082815260086020526040902060010154610ff38133611fb3565b610df58383612309565b6011805461100a906133e7565b80601f0160208091040260200160405190810160405280929190818152602001828054611036906133e7565b80156110835780601f1061105857610100808354040283529160200191611083565b820191906000526020600020905b81548152906001019060200180831161106657829003601f168201915b505050505081565b6001600160a01b03811633146111095760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610ebf565b610ed282826123ab565b610df583838360405180602001604052806000815250611bc8565b61113981600161242e565b50565b6002600e5460ff16600581111561115557611155612fa5565b1461117d57600e5460405163ca8dc8ed60e01b8152610ebf9160ff1690600290600401613422565b600e5461010090046001600160a01b03166111ab5760405163ae1c061f60e01b815260040160405180910390fd5b805115806111c55750600281516111c291906134a0565b15155b156111e35760405163475077d360e01b815260040160405180910390fd5b6000600282516111f391906134b4565b905080600f546112039190613453565b3410156112235760405163064975f760e41b815260040160405180910390fd5b60006112326001546000540390565b90506127106112418383613472565b111561126057604051631f6e464360e31b815260040160405180910390fd5b60005b83518110156116355783611278826001613472565b81518110611288576112886134c8565b60200260200101518482815181106112a2576112a26134c8565b602002602001015114156112c957604051633b0e2de560e21b815260040160405180910390fd5b600e548451339161010090046001600160a01b031690636352211e908790859081106112f7576112f76134c8565b60200260200101516040518263ffffffff1660e01b815260040161131d91815260200190565b602060405180830381865afa15801561133a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135e91906134de565b6001600160a01b03161415806114165750600e54339061010090046001600160a01b0316636352211e86611393856001613472565b815181106113a3576113a36134c8565b60200260200101516040518263ffffffff1660e01b81526004016113c991815260200190565b602060405180830381865afa1580156113e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140a91906134de565b6001600160a01b031614155b15611434576040516374a2152760e01b815260040160405180910390fd5b60006001600160a01b031660156000868481518110611455576114556134c8565b6020908102919091018101518252810191909152604001600020546001600160a01b03161415806114c95750600060158186611492856001613472565b815181106114a2576114a26134c8565b6020908102919091018101518252810191909152604001600020546001600160a01b031614155b156114e757604051636a3a95db60e01b815260040160405180910390fd5b33601560008684815181106114fe576114fe6134c8565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555033601560008684600161154b9190613472565b8151811061155b5761155b6134c8565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081806115a0906134fb565b9250507f9bba0a6f851aaae0e6baff2c0932e190345377436bd70b15d103bbc902f378bd8482815181106115d6576115d66134c8565b6020026020010151858360016115ec9190613472565b815181106115fc576115fc6134c8565b6020908102919091018101516040805193845291830152810184905260600160405180910390a161162e600282613472565b9050611263565b50610df533836122ef565b6000805160206136678339815191526116598133611fb3565b50600e80546001600160a01b039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66116ba8133611fb3565b6001600e5460ff1660058111156116d3576116d3612fa5565b146116fb57600e5460405163ca8dc8ed60e01b8152610ebf9160ff1690600190600401613422565b83821461171b57604051631eba291760e21b815260040160405180910390fd5b60005b848110156117905761177e86868381811061173b5761173b6134c8565b90506020020160208101906117509190613158565b858584818110611762576117626134c8565b9050602002013560405180602001604052806000815250612609565b80611788816134fb565b91505061171e565b505050505050565b6000805160206136678339815191526117b18133611fb3565b50600b805463ffffffff191663ffffffff92909216919091179055565b6010805461100a906133e7565b6000805160206136678339815191526117f48133611fb3565b8151610df5906013906020850190612cf2565b6000805160206136678339815191526118208133611fb3565b600e805483919060ff1916600183600581111561183f5761183f612fa5565b02179055507f551dc40198cc79684bb69e4931dba4ac16e4598792ee1c0a5000aeea366d7bb682604051610c799190612fdd565b600061187e82612616565b5192915050565b60006118918133611fb3565b81516118a4906010906020850190612cf2565b507f5874405043cdc346e0b75f1d26dc479a48f66ed653bd5e2feec2c2ae1fe0be5782604051610c799190612f38565b60006001600160a01b0382166118fd576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b7f10dac8c06a04bec0b551627dad28bc00d6516b0caacd1c7b345fcdb5211334e461194e8133611fb3565b6040514790600090339083908381818185875af1925050503d8060008114611992576040519150601f19603f3d011682016040523d82523d6000602084013e611997565b606091505b5050905080610df55760405162461bcd60e51b815260206004820152600f60248201527f57495448445241575f4641494c454400000000000000000000000000000000006044820152606401610ebf565b600080516020613667833981519152611a018133611fb3565b50600b805461ffff9092166401000000000265ffff0000000019909216919091179055565b600080516020613667833981519152611a3f8133611fb3565b50600f55565b600080516020613667833981519152611a5e8133611fb3565b8151610df5906014906020850190612cf2565b606060038054610ca5906133e7565b600080516020613667833981519152611a998133611fb3565b50600a55565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6611aca8133611fb3565b6001600e5460ff166005811115611ae357611ae3612fa5565b14611b0b57600e5460405163ca8dc8ed60e01b8152610ebf9160ff1690600190600401613422565b610df5838360405180602001604052806000815250612609565b6001600160a01b038216331415611b4f5760405163b06307db60e01b815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6012805461100a906133e7565b611bd38484846120ff565b6001600160a01b0383163b15158015611bf55750611bf384848484612732565b155b15611c13576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b6060611c2482612058565b611c4157604051630a14c4b560e41b815260040160405180910390fd5b6000611c4b61281b565b9050805160001415611c6c5760405180602001604052806000815250611c97565b80611c768461282a565b604051602001611c87929190613516565b6040516020818303038152906040525b9392505050565b60606000825167ffffffffffffffff811115611cbc57611cbc612dc5565b604051908082528060200260200182016040528015611ce5578160200160208202803683370190505b5090506000805b8451811015611d965760006001600160a01b031660156000878481518110611d1657611d166134c8565b6020908102919091018101518252810191909152604001600020546001600160a01b031614611d8457848181518110611d5157611d516134c8565b6020026020010151838381518110611d6b57611d6b6134c8565b602090810291909101015281611d80816134fb565b9250505b80611d8e816134fb565b915050611cec565b50909392505050565b600082815260086020526040902060010154611dbb8133611fb3565b610df583836123ab565b600c5460009015611e015761270f600c600081548110611de757611de76134c8565b9060005260206000200154611dfc91906134a0565b905090565b50600090565b600080516020613667833981519152611e208133611fb3565b600954600a54600b546040516305d3b1d360e41b81526004810192909252600160a01b830467ffffffffffffffff166024830152640100000000810461ffff16604483015263ffffffff808216606484015266010000000000009091041660848201526001600160a01b0390911690635d3b1d309060a4016020604051808303816000875af1158015611eb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611edb9190613545565b600d5550565b606060148054610ca5906133e7565b600080516020613667833981519152611f098133611fb3565b506009805467ffffffffffffffff909216600160a01b027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b600080516020613667833981519152611f658133611fb3565b50600b805463ffffffff90921666010000000000000269ffffffff00000000000019909216919091179055565b600c8181548110611fa257600080fd5b600091825260209091200154905081565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16610ed257611ff1816001600160a01b03166014612928565b611ffc836020612928565b60405160200161200d92919061355e565b60408051601f198184030181529082905262461bcd60e51b8252610ebf91600401612f38565b60006001600160e01b03198216637965db0b60e01b1480610c905750610c9082612ad1565b6000805482108015610c90575050600090815260046020526040902054600160e01b900460ff161590565b600082815260066020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b8051610df590600c906020840190612d76565b600061210a82612616565b9050836001600160a01b031681600001516001600160a01b0316146121415760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b038616148061215f575061215f8533610b7a565b8061217a57503361216f84610d28565b6001600160a01b0316145b90508061219a57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b0384166121c157604051633a954ecd60e21b815260040160405180910390fd5b6121cd60008487612083565b6001600160a01b038581166000908152600560209081526040808320805467ffffffffffffffff1980821667ffffffffffffffff92831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080546001600160e01b031916909417600160a01b429092169190910217835587018084529220805491939091166122a35760005482146122a3578054602086015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b610ed2828260405180602001604052806000815250612609565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff16610ed25760008281526008602090815260408083206001600160a01b03851684529091529020805460ff191660011790556123673390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526008602090815260408083206001600160a01b038516845290915290205460ff1615610ed25760008281526008602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061243983612616565b8051909150821561249f576000336001600160a01b038316148061246257506124628233610b7a565b8061247d57503361247286610d28565b6001600160a01b0316145b90508061249d57604051632ce44b5f60e11b815260040160405180910390fd5b505b6124ab60008583612083565b6001600160a01b038082166000818152600560209081526040808320805470010000000000000000000000000000000060001967ffffffffffffffff80841691909101811667ffffffffffffffff19841681178390048216600190810183169093027fffffffffffffffff0000000000000000ffffffffffffffff0000000000000000909416179290921783558b86526004909452828520805460ff60e01b1942909316600160a01b026001600160e01b03199091169097179690961716600160e01b1785559189018084529220805491949091166125bf5760005482146125bf578054602087015167ffffffffffffffff16600160a01b026001600160e01b03199091166001600160a01b038716171781555b5050604051869250600091506001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a4505060018054810190555050565b610df58383836001612b21565b60408051606081018252600080825260208201819052918101919091528160005481101561271957600081815260046020908152604091829020825160608101845290546001600160a01b0381168252600160a01b810467ffffffffffffffff1692820192909252600160e01b90910460ff161515918101829052906127175780516001600160a01b0316156126ad579392505050565b5060001901600081815260046020908152604091829020825160608101845290546001600160a01b038116808352600160a01b820467ffffffffffffffff1693830193909352600160e01b900460ff1615159281019290925215612712579392505050565b6126ad565b505b604051636f96cda160e11b815260040160405180910390fd5b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a02906127679033908990889088906004016135df565b6020604051808303816000875af19250505080156127a2575060408051601f3d908101601f1916820190925261279f9181019061361b565b60015b6127fd573d8080156127d0576040519150601f19603f3d011682016040523d82523d6000602084013e6127d5565b606091505b5080516127f5576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b606060138054610ca5906133e7565b60608161284e5750506040805180820190915260018152600360fc1b602082015290565b8160005b81156128785780612862816134fb565b91506128719050600a836134b4565b9150612852565b60008167ffffffffffffffff81111561289357612893612dc5565b6040519080825280601f01601f1916602001820160405280156128bd576020820181803683370190505b5090505b8415612813576128d2600183613638565b91506128df600a866134a0565b6128ea906030613472565b60f81b8183815181106128ff576128ff6134c8565b60200101906001600160f81b031916908160001a905350612921600a866134b4565b94506128c1565b60606000612937836002613453565b612942906002613472565b67ffffffffffffffff81111561295a5761295a612dc5565b6040519080825280601f01601f191660200182016040528015612984576020820181803683370190505b509050600360fc1b8160008151811061299f5761299f6134c8565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106129ce576129ce6134c8565b60200101906001600160f81b031916908160001a90535060006129f2846002613453565b6129fd906001613472565b90505b6001811115612a82577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110612a3e57612a3e6134c8565b1a60f81b828281518110612a5457612a546134c8565b60200101906001600160f81b031916908160001a90535060049490941c93612a7b8161364f565b9050612a00565b508315611c975760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610ebf565b60006001600160e01b031982166380ac58cd60e01b1480612b0257506001600160e01b03198216635b5e139f60e01b145b80610c9057506301ffc9a760e01b6001600160e01b0319831614610c90565b6000546001600160a01b038516612b4a57604051622e076360e81b815260040160405180910390fd5b83612b685760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080546fffffffffffffffffffffffffffffffff19811667ffffffffffffffff8083168c0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168c01811690920217909155858452600490925290912080546001600160e01b031916909217600160a01b429092169190910217905580808501838015612c1a57506001600160a01b0387163b15155b15612ca3575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4612c6b6000888480600101955088612732565b612c88576040516368d2bf6b60e11b815260040160405180910390fd5b80821415612c20578260005414612c9e57600080fd5b612ce9565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a480821415612ca4575b506000556122e8565b828054612cfe906133e7565b90600052602060002090601f016020900481019282612d205760008555612d66565b82601f10612d3957805160ff1916838001178555612d66565b82800160010185558215612d66579182015b82811115612d66578251825591602001919060010190612d4b565b50612d72929150612db0565b5090565b828054828255906000526020600020908101928215612d665791602002820182811115612d66578251825591602001919060010190612d4b565b5b80821115612d725760008155600101612db1565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612e0457612e04612dc5565b604052919050565b600067ffffffffffffffff831115612e2657612e26612dc5565b612e39601f8401601f1916602001612ddb565b9050828152838383011115612e4d57600080fd5b828260208301376000602084830101529392505050565b600060208284031215612e7657600080fd5b813567ffffffffffffffff811115612e8d57600080fd5b8201601f81018413612e9e57600080fd5b61281384823560208401612e0c565b6001600160e01b03198116811461113957600080fd5b600060208284031215612ed557600080fd5b8135611c9781612ead565b60005b83811015612efb578181015183820152602001612ee3565b83811115611c135750506000910152565b60008151808452612f24816020860160208601612ee0565b601f01601f19169290920160200192915050565b602081526000611c976020830184612f0c565b600060208284031215612f5d57600080fd5b5035919050565b6001600160a01b038116811461113957600080fd5b60008060408385031215612f8c57600080fd5b8235612f9781612f64565b946020939093013593505050565b634e487b7160e01b600052602160045260246000fd5b60068110612fd957634e487b7160e01b600052602160045260246000fd5b9052565b60208101610c908284612fbb565b600082601f830112612ffc57600080fd5b8135602067ffffffffffffffff82111561301857613018612dc5565b8160051b613027828201612ddb565b928352848101820192828101908785111561304157600080fd5b83870192505b8483101561306057823582529183019190830190613047565b979650505050505050565b6000806040838503121561307e57600080fd5b82359150602083013567ffffffffffffffff81111561309c57600080fd5b6130a885828601612feb565b9150509250929050565b6000806000606084860312156130c757600080fd5b83356130d281612f64565b925060208401356130e281612f64565b929592945050506040919091013590565b6000806040838503121561310657600080fd5b82359150602083013561311881612f64565b809150509250929050565b60006020828403121561313557600080fd5b813567ffffffffffffffff81111561314c57600080fd5b61281384828501612feb565b60006020828403121561316a57600080fd5b8135611c9781612f64565b60008083601f84011261318757600080fd5b50813567ffffffffffffffff81111561319f57600080fd5b6020830191508360208260051b85010111156131ba57600080fd5b9250929050565b600080600080604085870312156131d757600080fd5b843567ffffffffffffffff808211156131ef57600080fd5b6131fb88838901613175565b9096509450602087013591508082111561321457600080fd5b5061322187828801613175565b95989497509550505050565b60006020828403121561323f57600080fd5b813563ffffffff81168114611c9757600080fd5b60006020828403121561326557600080fd5b813560068110611c9757600080fd5b60006020828403121561328657600080fd5b813561ffff81168114611c9757600080fd5b600080604083850312156132ab57600080fd5b82356132b681612f64565b91506020830135801515811461311857600080fd5b600080600080608085870312156132e157600080fd5b84356132ec81612f64565b935060208501356132fc81612f64565b925060408501359150606085013567ffffffffffffffff81111561331f57600080fd5b8501601f8101871361333057600080fd5b61333f87823560208401612e0c565b91505092959194509250565b6020808252825182820181905260009190848201906040850190845b8181101561338357835183529284019291840191600101613367565b50909695505050505050565b600080604083850312156133a257600080fd5b82356133ad81612f64565b9150602083013561311881612f64565b6000602082840312156133cf57600080fd5b813567ffffffffffffffff81168114611c9757600080fd5b600181811c908216806133fb57607f821691505b6020821081141561341c57634e487b7160e01b600052602260045260246000fd5b50919050565b604081016134308285612fbb565b611c976020830184612fbb565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561346d5761346d61343d565b500290565b600082198211156134855761348561343d565b500190565b634e487b7160e01b600052601260045260246000fd5b6000826134af576134af61348a565b500690565b6000826134c3576134c361348a565b500490565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156134f057600080fd5b8151611c9781612f64565b600060001982141561350f5761350f61343d565b5060010190565b60008351613528818460208801612ee0565b83519083019061353c818360208801612ee0565b01949350505050565b60006020828403121561355757600080fd5b5051919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613596816017850160208801612ee0565b7f206973206d697373696e6720726f6c652000000000000000000000000000000060179184019182015283516135d3816028840160208801612ee0565b01602801949350505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526136116080830184612f0c565b9695505050505050565b60006020828403121561362d57600080fd5b8151611c9781612ead565b60008282101561364a5761364a61343d565b500390565b60008161365e5761365e61343d565b50600019019056fe97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929a26469706673582212205ae558448a21e8c6aca991799b4c0e8c9316d1f22128a76d583ceb83fe3d056064736f6c634300080b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000001eb7382976077f92cf25c27cc3b900a274fd0012000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
-----Decoded View---------------
Arg [0] : contractAddress (address): 0x1Eb7382976077f92cf25c27CC3b900a274FD0012
Arg [1] : vrfCoordinator (address): 0x271682DEB8C4E0901D1a1550aD2e64D568E69909
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000001eb7382976077f92cf25c27cc3b900a274fd0012
Arg [1] : 000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.