ERC-1155
NFT
Overview
Max Total Supply
5,720 SC:SJ
Holders
5,275
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
StarcatchersSeason
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 400 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/* ,/(######(, /################* ,/###%####(*#//, ,########/* (%%%%#, ./(##################(*. #%* .(#%%%%###########%######%#####. ,#%%%%%%%%%%%%%%###(########//##(##/, .(#%%%%%%%#%%/.. ./(%%%%%%#*. .###%%%#. *####/. *#/. #%%%%%%%%%%( .%%%%%%%( %%* *##* .#%%# #%%#. .. .(%%( #%%#*..... #%%, %%# #%%%%# %%%, (#%* *%%/ %%% #%%* /%%%%%%# ,#%# /%%* ,%%# ,%%# /%%%/ %%%% #%%# (%%* /%%%%%%/ ,%%%( %%%% .#%%, /%%* #%%%%% #%%%/ %%%# (#%###/ *%%# ,%%%%##((* %%%%* /%%%%%%%%%%%%%# (%%* ,%%%%/,,,,. /%%%, ,#%%%# .(%%# .#%% *%%, #%%%% .(%%%%/ #%%* *%%# %% /%%%%%( .#%%%#. /#(, #%%/ #%. .###*%%%* #%%##, /#(, #%%#*,,,*,,,,*. ##, *### (%%* .#%%%# *#/* #%%%%%%%%%%%%%#. ##%###(,... .###, .#%%* ,########, /((/ .%%%. */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/token/ERC1155/ERC1155.sol'; import '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol'; import '@openzeppelin/contracts/utils/Address.sol'; import '@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol'; import '@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol'; import '@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol'; import './StarcatchersInterface.sol'; contract StarcatchersSeason is ERC1155, Ownable, ERC1155Burnable, VRFConsumerBaseV2, ReentrancyGuard { using Address for address; VRFCoordinatorV2Interface vrfCoordinator; bytes32 vrfKeyHash; uint64 vrfSubscriptionId; uint16 vrfConfirmations; uint32 vrfCallbackGasLimit; LinkTokenInterface link; StarcatchersInterface starsContract; string public symbol; uint256 private _currentTokenId = 1; /* * Rinkeby * coordinator: 0x6168499c0cFfCaCD319c818142124B7A15E857ab * hash: 0xd89b2bf150e3b9e13446986e571fb9cab24b13cea0a43ea20a6049a85cc807cc * link: 0x01BE23585060835E02B77ef475b0Cc51aA1e0709 * Mainnet * coordinator: 0x271682DEB8C4E0901D1a1550aD2e64D568E69909 * hash: 0x8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef * link: 0x514910771af9ca656af840dff83e8264ecf986ca */ constructor( string memory _symbol, address _starsAddress, address _vrfCoordinatorAddress, bytes32 _vrfKeyHash, uint64 _vrfSubscriptionId, uint16 _vrfConfirmations, uint32 _vrfCallbackGasLimit, address _link ) VRFConsumerBaseV2(_vrfCoordinatorAddress) ERC1155('') { symbol = _symbol; starsContract = StarcatchersInterface(_starsAddress); vrfCoordinator = VRFCoordinatorV2Interface(_vrfCoordinatorAddress); vrfKeyHash = _vrfKeyHash; vrfSubscriptionId = _vrfSubscriptionId; vrfConfirmations = _vrfConfirmations; vrfCallbackGasLimit = _vrfCallbackGasLimit; link = LinkTokenInterface(_link); } function withdraw() public onlyOwner nonReentrant { Address.sendValue(payable(owner()), address(this).balance); } function setSymbol( string calldata _symbol ) public onlyOwner { require(bytes(_symbol).length > 0, 'Symbol required'); symbol = _symbol; } /* * VRF */ function setVRFKeyHash( bytes32 _vrfKeyHash ) public onlyOwner { vrfKeyHash = _vrfKeyHash; } function setVRFSubscriptionId( uint64 _vrfSubscriptionId ) public onlyOwner { vrfSubscriptionId = _vrfSubscriptionId; } function setVRFConfirmations( uint16 _vrfConfirmations ) public onlyOwner { vrfConfirmations = _vrfConfirmations; } function setVRFCallbackGasLimit( uint32 _vrfCallbackGasLimit ) public onlyOwner { vrfCallbackGasLimit = _vrfCallbackGasLimit; } struct MintRequest { address[] addresses; uint64 episodeId; } /* * Maps VRF Request Ids to mint requests. Mint controls handled inside * Episode minting functions for circumventing malicious actions. */ mapping(uint256 => MintRequest) public MintRequests; function _requestMint( address[] memory _addresses, uint32 _quantity, uint64 _episodeId ) internal { uint256 requestId = vrfCoordinator.requestRandomWords( vrfKeyHash, vrfSubscriptionId, vrfConfirmations, vrfCallbackGasLimit, _quantity ); MintRequests[requestId] = MintRequest(_addresses, _episodeId); } function fulfillRandomWords( uint256 _requestId, uint256[] memory _randomWords ) internal override { MintRequest memory r = MintRequests[_requestId]; Episode storage e = Episodes[r.episodeId]; for (uint16 i = 0; i < r.addresses.length; i++) { uint16 roll = uint16((_randomWords[i] % 10000) + 1); // 1-10000 for (uint16 j = 0; j < e.tokens.length; j++) { Token storage t = Tokens[e.tokens[j]]; if (roll < t.rarity && t.supply < t.maxSupply) { _mint(r.addresses[i], e.tokens[j], 1, ''); t.supply += 1; break; } } } } /* * Tokens are individual items. */ struct Token { uint128 rarity; uint128 supply; uint128 maxSupply; string uri; } mapping(uint256 => Token) public Tokens; function uri( uint256 _Id ) public view override returns (string memory) { string memory r = Tokens[_Id].uri; require(bytes(r).length > 0, 'Nonexistent token'); return r; } function setTokenURI( uint256 _Id, string calldata _uri ) public onlyOwner { require(bytes(_uri).length > 0, 'URI required'); Tokens[_Id].uri = _uri; emit URI(_uri, _Id); } function setTokenRarity( uint256 _Id, uint128 _rarity ) public onlyOwner { require(_rarity > 0 && _rarity <= 10000, 'Rarity must be >0 and <=10000'); Tokens[_Id].rarity = _rarity; } function setTokenMaxSupply( uint256 _Id, uint128 _maxSupply ) public onlyOwner { require(_maxSupply > 0, 'Max supply must be more than 0'); Tokens[_Id].maxSupply = _maxSupply; } function createToken( uint128 _rarity, uint128 _maxSupply, string calldata _uri ) public onlyOwner returns (uint256) { require(bytes(_uri).length > 0, 'URI required'); require(_maxSupply > 0, 'Max supply must be more than 0'); require(_rarity > 0 && _rarity <= 10000, 'Rarity must be >0 and <=10000'); uint256 _Id = _currentTokenId; _currentTokenId++; Tokens[_Id] = Token(_rarity, 0, _maxSupply, _uri); emit URI(_uri, _Id); return _Id; } /* * Episodes are collections of tokens. */ enum EpisodeStatus { STOPPED, STARS_MINT, PUBLIC_MINT } struct Episode { uint64[] tokens; uint64 starPriceWei; uint64 publicPriceWei; uint64 supply; uint64 maxSupply; EpisodeStatus status; mapping(uint64 => bool) starClaimed; mapping(address => bool) publicClaimed; } mapping(uint64 => Episode) public Episodes; function getStarHasMinted( uint64 _episodeId, uint64 _starId ) public view returns(bool) { return Episodes[_episodeId].starClaimed[_starId]; } function setEpisode( uint64 _episodeId, uint64[] calldata _tokens, // IMPORTANT: order low -> high based on Token.rarity uint64 _starPriceWei, uint64 _publicPriceWei, uint64 _supply, uint64 _maxSupply, EpisodeStatus _status ) public onlyOwner { Episode storage e = Episodes[_episodeId]; e.tokens = _tokens; e.starPriceWei = _starPriceWei; e.publicPriceWei = _publicPriceWei; e.supply = _supply; e.maxSupply = _maxSupply; e.status = _status; } modifier mintCompliance( uint256 _quantity, uint64 _episodeId, EpisodeStatus _expectedEpisodeStatus ) { Episode storage e = Episodes[_episodeId]; require( // O=_quantity*_tokens.length, safe for 16 tokens * 30 _quantity > 0 && _quantity <= 30, "Invalid mint amount" ); require( e.supply + _quantity <= e.maxSupply, "Maximum supply exceeded" ); require( e.tokens.length > 0, "Episode must have tokens" ); require( e.status == _expectedEpisodeStatus, "Episode in incorrect status" ); _; } function airdrop( uint64 _episodeId, address[] calldata _addresses ) external onlyOwner mintCompliance(_addresses.length, _episodeId, EpisodeStatus.STOPPED) { _requestMint(_addresses, uint32(_addresses.length), _episodeId); Episode storage e = Episodes[_episodeId]; e.supply += uint32(_addresses.length); } function adminDrop( uint64 _episodeId, uint64 _tokenId, uint64 _quantity, address[] calldata _addresses ) external onlyOwner { Episode storage e = Episodes[_episodeId]; Token storage t = Tokens[_tokenId]; require( e.supply + (_addresses.length * _quantity) <= e.maxSupply, "Episode maximum supply exceeded" ); require( t.supply + (_addresses.length * _quantity) <= t.maxSupply, "Token maximum supply exceeded" ); require( e.tokens.length > 0, "Episode must have tokens" ); require( bytes(t.uri).length > 0, "Nonexistent token" ); uint256[] memory _t = new uint256[](1); _t[0] = _tokenId; uint256[] memory _q = new uint256[](1); _q[0] = _quantity; for (uint64 i = 0; i < _addresses.length; i++) { _mintBatch(_addresses[i], _t, _q, ''); e.supply += _quantity; t.supply += _quantity; } } function starMint( uint64 _episodeId, uint64[] calldata _stars ) external payable mintCompliance(_stars.length, _episodeId, EpisodeStatus.STARS_MINT) { Episode storage e = Episodes[_episodeId]; require( msg.value == e.starPriceWei, // yes, flat fee intended "Incorrect payment" ); for (uint64 i = 0; i < _stars.length; i++) { require(!e.starClaimed[_stars[i]], 'Call includes a star which has already claimed'); require(starsContract.ownerOf(_stars[i]) == msg.sender, 'Caller does not own star'); } address[] memory req = new address[](1); req[0] = msg.sender; _requestMint(req, uint32(_stars.length), _episodeId); e.supply += uint64(_stars.length); for (uint64 i = 0; i < _stars.length; i++) { e.starClaimed[_stars[i]] = true; } } function publicMint( uint64 _episodeId ) public payable mintCompliance(1, _episodeId, EpisodeStatus.PUBLIC_MINT) { Episode storage e = Episodes[_episodeId]; require( msg.value == e.publicPriceWei, "Incorrect payment" ); require (!e.publicClaimed[msg.sender], 'Address has already claimed'); address[] memory req = new address[](1); req[0] = msg.sender; _requestMint(req, 1, _episodeId); e.supply += uint64(1); e.publicClaimed[msg.sender] = true; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155Burnable is ERC1155 { function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burnBatch(account, ids, values); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (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 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 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; import "./ERC721A.sol"; contract StarcatchersInterface is ERC721A { constructor(uint128) ERC721A("Starcatchers", "STAR") {} }
// 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 pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector). @param operator The address which initiated the transfer (i.e. msg.sender) @param from The address which previously owned the token @param id The ID of the token being transferred @param value The amount of tokens being transferred @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** @dev Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector). @param operator The address which initiated the batch transfer (i.e. msg.sender) @param from The address which previously owned the token @param ids An array containing ids of each token being transferred (order and length must match values array) @param values An array containing amounts of each token being transferred (order and length must match ids array) @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts 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 // 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/token/ERC721/extensions/IERC721Enumerable.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 MintedQueryForZeroAddress(); error MintToZeroAddress(); error MintZeroQuantity(); error OwnerIndexOutOfBounds(); error OwnerQueryForNonexistentToken(); error TokenIndexOutOfBounds(); error TransferCallerNotOwnerNorApproved(); error TransferFromIncorrectOwner(); error TransferToNonERC721ReceiverImplementer(); error TransferToZeroAddress(); error UnableDetermineTokenOwner(); error URIQueryForNonexistentToken(); /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata and Enumerable extension. Built to optimize for lower gas during batch mints. * * Assumes serials are sequentially minted starting at 0 (e.g. 0, 1, 2, 3..). * * Does not support burning tokens to address(0). * * Assumes that an owner cannot have more than the 2**128 - 1 (max value of uint128) of supply */ contract ERC721A is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; struct TokenOwnership { address addr; uint64 startTimestamp; } struct AddressData { uint128 balance; uint128 numberMinted; } uint256 internal _currentIndex; // 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_; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _currentIndex; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view override returns (uint256) { if (index >= totalSupply()) revert TokenIndexOutOfBounds(); return index; } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. * This read function is O(totalSupply). If calling from a separate contract, be sure to test gas first. * It may also degrade with extremely large collection sizes (e.g >> 10000), test for your use case. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) { if (index >= balanceOf(owner)) revert OwnerIndexOutOfBounds(); uint256 numMintedSoFar = totalSupply(); uint256 tokenIdsIdx; address currOwnershipAddr; // Counter overflow is impossible as the loop breaks when uint256 i is equal to another uint256 numMintedSoFar. unchecked { for (uint256 i; i < numMintedSoFar; i++) { TokenOwnership memory ownership = _ownerships[i]; if (ownership.addr != address(0)) { currOwnershipAddr = ownership.addr; } if (currOwnershipAddr == owner) { if (tokenIdsIdx == index) { return i; } tokenIdsIdx++; } } } // Execution should never reach this point. assert(false); } /** * @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 || interfaceId == type(IERC721Enumerable).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); } function _numberMinted(address owner) internal view returns (uint256) { if (owner == address(0)) revert MintedQueryForZeroAddress(); return uint256(_addressData[owner].numberMinted); } /** * 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) { if (!_exists(tokenId)) revert OwnerQueryForNonexistentToken(); unchecked { for (uint256 curr = tokenId;; curr--) { TokenOwnership memory ownership = _ownerships[curr]; if (ownership.addr != address(0)) { return ownership; } } } } /** * @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 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 override { _transfer(from, to, tokenId); if (!_checkOnERC721Received(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 tokenId < _currentIndex; } 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 > 3.4e38 (2**128) - 1 // updatedIndex overflows if _currentIndex + quantity > 1.56e77 (2**256) - 1 unchecked { _addressData[to].balance += uint128(quantity); _addressData[to].numberMinted += uint128(quantity); _ownerships[startTokenId].addr = to; _ownerships[startTokenId].startTimestamp = uint64(block.timestamp); uint256 updatedIndex = startTokenId; for (uint256 i; i < quantity; i++) { emit Transfer(address(0), to, updatedIndex); if (safe && !_checkOnERC721Received(address(0), to, updatedIndex, _data)) { revert TransferToNonERC721ReceiverImplementer(); } updatedIndex++; } _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); bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr || isApprovedForAll(prevOwnership.addr, _msgSender()) || getApproved(tokenId) == _msgSender()); if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved(); if (prevOwnership.addr != from) revert TransferFromIncorrectOwner(); if (to == address(0)) revert TransferToZeroAddress(); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId, prevOwnership.addr); // 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; _ownerships[tokenId].addr = to; _ownerships[tokenId].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; if (_ownerships[nextTokenId].addr == address(0)) { if (_exists(nextTokenId)) { _ownerships[nextTokenId].addr = prevOwnership.addr; _ownerships[nextTokenId].startTimestamp = prevOwnership.startTimestamp; } } } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @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 address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) revert TransferToNonERC721ReceiverImplementer(); else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * * 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`. */ 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. * * 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` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} }
// 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 v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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); } }
{ "optimizer": { "enabled": true, "runs": 400 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_starsAddress","type":"address"},{"internalType":"address","name":"_vrfCoordinatorAddress","type":"address"},{"internalType":"bytes32","name":"_vrfKeyHash","type":"bytes32"},{"internalType":"uint64","name":"_vrfSubscriptionId","type":"uint64"},{"internalType":"uint16","name":"_vrfConfirmations","type":"uint16"},{"internalType":"uint32","name":"_vrfCallbackGasLimit","type":"uint32"},{"internalType":"address","name":"_link","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"have","type":"address"},{"internalType":"address","name":"want","type":"address"}],"name":"OnlyCoordinatorCanFulfill","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"uint64","name":"","type":"uint64"}],"name":"Episodes","outputs":[{"internalType":"uint64","name":"starPriceWei","type":"uint64"},{"internalType":"uint64","name":"publicPriceWei","type":"uint64"},{"internalType":"uint64","name":"supply","type":"uint64"},{"internalType":"uint64","name":"maxSupply","type":"uint64"},{"internalType":"enum StarcatchersSeason.EpisodeStatus","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"MintRequests","outputs":[{"internalType":"uint64","name":"episodeId","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"Tokens","outputs":[{"internalType":"uint128","name":"rarity","type":"uint128"},{"internalType":"uint128","name":"supply","type":"uint128"},{"internalType":"uint128","name":"maxSupply","type":"uint128"},{"internalType":"string","name":"uri","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_episodeId","type":"uint64"},{"internalType":"uint64","name":"_tokenId","type":"uint64"},{"internalType":"uint64","name":"_quantity","type":"uint64"},{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"adminDrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_episodeId","type":"uint64"},{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_rarity","type":"uint128"},{"internalType":"uint128","name":"_maxSupply","type":"uint128"},{"internalType":"string","name":"_uri","type":"string"}],"name":"createToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_episodeId","type":"uint64"},{"internalType":"uint64","name":"_starId","type":"uint64"}],"name":"getStarHasMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_episodeId","type":"uint64"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","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":"uint64","name":"_episodeId","type":"uint64"},{"internalType":"uint64[]","name":"_tokens","type":"uint64[]"},{"internalType":"uint64","name":"_starPriceWei","type":"uint64"},{"internalType":"uint64","name":"_publicPriceWei","type":"uint64"},{"internalType":"uint64","name":"_supply","type":"uint64"},{"internalType":"uint64","name":"_maxSupply","type":"uint64"},{"internalType":"enum StarcatchersSeason.EpisodeStatus","name":"_status","type":"uint8"}],"name":"setEpisode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_symbol","type":"string"}],"name":"setSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_Id","type":"uint256"},{"internalType":"uint128","name":"_maxSupply","type":"uint128"}],"name":"setTokenMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_Id","type":"uint256"},{"internalType":"uint128","name":"_rarity","type":"uint128"}],"name":"setTokenRarity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_Id","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_vrfCallbackGasLimit","type":"uint32"}],"name":"setVRFCallbackGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_vrfConfirmations","type":"uint16"}],"name":"setVRFConfirmations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_vrfKeyHash","type":"bytes32"}],"name":"setVRFKeyHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_vrfSubscriptionId","type":"uint64"}],"name":"setVRFSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_episodeId","type":"uint64"},{"internalType":"uint64[]","name":"_stars","type":"uint64[]"}],"name":"starMint","outputs":[],"stateMutability":"payable","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":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_Id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040526001600b553480156200001657600080fd5b5060405162004e1238038062004e128339810160408190526200003991620002b2565b604080516020810190915260008152869062000055816200012e565b50620000613362000147565b6001600160a01b0316608052600160045587516200008790600a9060208b019062000199565b50600980546001600160a01b039889166001600160a01b03199182161790915560058054978916978216979097179096556006949094556007805463ffffffff9092166a01000000000000000000000263ffffffff60501b1961ffff90941668010000000000000000026001600160501b03199093166001600160401b03909516949094179190911791909116919091179055600880549190931691161790555062000447565b80516200014390600290602084019062000199565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001a7906200040a565b90600052602060002090601f016020900481019282620001cb576000855562000216565b82601f10620001e657805160ff191683800117855562000216565b8280016001018555821562000216579182015b8281111562000216578251825591602001919060010190620001f9565b506200022492915062000228565b5090565b5b8082111562000224576000815560010162000229565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200026d57600080fd5b919050565b80516001600160401b03811681146200026d57600080fd5b805161ffff811681146200026d57600080fd5b805163ffffffff811681146200026d57600080fd5b600080600080600080600080610100898b031215620002d057600080fd5b88516001600160401b0380821115620002e857600080fd5b818b0191508b601f830112620002fd57600080fd5b8151818111156200031257620003126200023f565b604051601f8201601f19908116603f011681019083821181831017156200033d576200033d6200023f565b81604052828152602093508e848487010111156200035a57600080fd5b600091505b828210156200037e57848201840151818301850152908301906200035f565b82821115620003905760008484830101525b9b50620003a29150508b820162000255565b98505050620003b460408a0162000255565b955060608901519450620003cb60808a0162000272565b9350620003db60a08a016200028a565b9250620003eb60c08a016200029d565b9150620003fb60e08a0162000255565b90509295985092959890939650565b600181811c908216806200041f57607f821691505b602082108114156200044157634e487b7160e01b600052602260045260246000fd5b50919050565b6080516149a86200046a60003960008181610dc70152610e0901526149a86000f3fe6080604052600436106101f85760003560e01c8063715018a61161010d578063d218d95d116100a0578063eb98bc141161006f578063eb98bc1414610666578063eedcf574146106b7578063f242432a146106d7578063f2fde38b146106f7578063f5298aca1461071757600080fd5b8063d218d95d146105bd578063e0549211146105dd578063e492a9dd146105fd578063e985e9c51461061d57600080fd5b806395d89b41116100dc57806395d89b4114610548578063979cf5021461055d578063a22cb4651461057d578063b84c82461461059d57600080fd5b8063715018a6146104c85780638da5cb5b146104dd5780639173c2ce14610505578063953c81331461051857600080fd5b806325e2da15116101905780634e1273f41161015f5780634e1273f41461042857806362664080146104555780636a2c727b146104755780636afcb7b0146104955780636b20c454146104a857600080fd5b806325e2da15146103b35780632974dc30146103d35780632eb2c2d6146103f35780633ccfd60b1461041357600080fd5b806310e5f86f116101cc57806310e5f86f146102af578063162094c4146102fc5780631ed77bbe1461031c5780631fe543e31461039357600080fd5b8062fdd58e146101fd57806301ffc9a71461023057806304e9d73a146102605780630e89341c14610282575b600080fd5b34801561020957600080fd5b5061021d610218366004613b26565b610737565b6040519081526020015b60405180910390f35b34801561023c57600080fd5b5061025061024b366004613b68565b6107ce565b6040519015158152602001610227565b34801561026c57600080fd5b5061028061027b366004613bf3565b610820565b005b34801561028e57600080fd5b506102a261029d366004613c68565b610bf6565b6040516102279190613cce565b3480156102bb57600080fd5b506102506102ca366004613ce1565b6001600160401b039182166000908152600e602090815260408083209390941682526003909201909152205460ff1690565b34801561030857600080fd5b50610280610317366004613d55565b610cdc565b34801561032857600080fd5b50610382610337366004613da0565b600e60205260009081526040902060018101546002909101546001600160401b0380831692600160401b8104821692600160801b8204831692600160c01b9092049091169060ff1685565b604051610227959493929190613dd1565b34801561039f57600080fd5b506102806103ae366004613efd565b610dbc565b3480156103bf57600080fd5b506102806103ce366004613f5a565b610e44565b3480156103df57600080fd5b506102806103ee366004613f7d565b610f2a565b3480156103ff57600080fd5b5061028061040e366004614014565b610f99565b34801561041f57600080fd5b5061028061103b565b34801561043457600080fd5b506104486104433660046140c1565b6110fd565b60405161022791906141be565b34801561046157600080fd5b506102806104703660046141d1565b611226565b34801561048157600080fd5b5061021d610490366004614216565b6114bd565b6102806104a3366004613da0565b611745565b3480156104b457600080fd5b506102806104c3366004614276565b611a34565b3480156104d457600080fd5b50610280611a7c565b3480156104e957600080fd5b506003546040516001600160a01b039091168152602001610227565b6102806105133660046141d1565b611ad0565b34801561052457600080fd5b50610538610533366004613c68565b611fef565b60405161022794939291906142eb565b34801561055457600080fd5b506102a26120b2565b34801561056957600080fd5b50610280610578366004614329565b612140565b34801561058957600080fd5b506102806105983660046143d7565b612248565b3480156105a957600080fd5b506102806105b8366004614415565b612253565b3480156105c957600080fd5b506102806105d8366004613da0565b6122e6565b3480156105e957600080fd5b506102806105f8366004613c68565b612351565b34801561060957600080fd5b50610280610618366004613f5a565b61239e565b34801561062957600080fd5b50610250610638366004614456565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561067257600080fd5b5061069f610681366004613c68565b600c602052600090815260409020600101546001600160401b031681565b6040516001600160401b039091168152602001610227565b3480156106c357600080fd5b506102806106d2366004614484565b612470565b3480156106e357600080fd5b506102806106f23660046144aa565b6124e5565b34801561070357600080fd5b50610280610712366004614512565b61252a565b34801561072357600080fd5b5061028061073236600461452f565b6125e3565b60006001600160a01b0383166107a85760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b14806107ff57506001600160e01b031982166303a24d0760e21b145b8061081a57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6003546001600160a01b031633146108685760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6001600160401b038086166000908152600e602090815260408083208885168452600d909252909120600182015491929091600160c01b90048116906108b09087168561457a565b60018401546108cf9190600160801b90046001600160401b0316614599565b111561091d5760405162461bcd60e51b815260206004820152601f60248201527f457069736f6465206d6178696d756d20737570706c7920657863656564656400604482015260640161079f565b60018101546001600160801b031661093e6001600160401b0387168561457a565b825461095a9190600160801b90046001600160801b0316614599565b11156109a85760405162461bcd60e51b815260206004820152601d60248201527f546f6b656e206d6178696d756d20737570706c79206578636565646564000000604482015260640161079f565b81546109f15760405162461bcd60e51b8152602060048201526018602482015277457069736f6465206d757374206861766520746f6b656e7360401b604482015260640161079f565b6000816002018054610a02906145b1565b905011610a455760405162461bcd60e51b81526020600482015260116024820152702737b732bc34b9ba32b73a103a37b5b2b760791b604482015260640161079f565b60408051600180825281830190925260009160208083019080368337019050509050866001600160401b031681600081518110610a8457610a846145ec565b6020908102919091010152604080516001808252818301909252600091816020016020820280368337019050509050866001600160401b031681600081518110610ad057610ad06145ec565b60200260200101818152505060005b6001600160401b038116861115610bea57610b3a8787836001600160401b0316818110610b0e57610b0e6145ec565b9050602002016020810190610b239190614512565b848460405180602001604052806000815250612626565b878560010160108282829054906101000a90046001600160401b0316610b609190614602565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550876001600160401b03168460000160108282829054906101000a90046001600160801b0316610bb3919061462d565b92506101000a8154816001600160801b0302191690836001600160801b031602179055508080610be29061464f565b915050610adf565b50505050505050505050565b6000818152600d6020526040812060020180546060929190610c17906145b1565b80601f0160208091040260200160405190810160405280929190818152602001828054610c43906145b1565b8015610c905780601f10610c6557610100808354040283529160200191610c90565b820191906000526020600020905b815481529060010190602001808311610c7357829003601f168201915b50505050509050600081511161081a5760405162461bcd60e51b81526020600482015260116024820152702737b732bc34b9ba32b73a103a37b5b2b760791b604482015260640161079f565b6003546001600160a01b03163314610d245760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b80610d605760405162461bcd60e51b815260206004820152600c60248201526b155492481c995c5d5a5c995960a21b604482015260640161079f565b6000838152600d60205260409020610d7c9060020183836138f3565b50827f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8383604051610daf929190614676565b60405180910390a2505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610e365760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016602482015260440161079f565b610e4082826127ab565b5050565b6003546001600160a01b03163314610e8c5760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6000816001600160801b0316118015610eb05750612710816001600160801b031611155b610efc5760405162461bcd60e51b815260206004820152601d60248201527f526172697479206d757374206265203e3020616e64203c3d3130303030000000604482015260640161079f565b6000918252600d602052604090912080546001600160801b0319166001600160801b03909216919091179055565b6003546001600160a01b03163314610f725760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6007805461ffff909216600160401b0269ffff000000000000000019909216919091179055565b6001600160a01b038516331480610fb55750610fb58533610638565b6110275760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000606482015260840161079f565b6110348585858585612a33565b5050505050565b6003546001600160a01b031633146110835760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b600260045414156110d65760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161079f565b60026004556110f66110f06003546001600160a01b031690565b47612c50565b6001600455565b606081518351146111625760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b606482015260840161079f565b600083516001600160401b0381111561117d5761117d613e27565b6040519080825280602002602001820160405280156111a6578160200160208202803683370190505b50905060005b845181101561121e576111f18582815181106111ca576111ca6145ec565b60200260200101518583815181106111e4576111e46145ec565b6020026020010151610737565b828281518110611203576112036145ec565b6020908102919091010152611217816146a5565b90506111ac565b509392505050565b6003546001600160a01b0316331461126e5760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6001600160401b0383166000908152600e6020526040812082918591831580159061129a5750601e8411155b6112dc5760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b5a5b9d08185b5bdd5b9d606a1b604482015260640161079f565b60018101546001600160401b03600160c01b8204811691611306918791600160801b900416614599565b111561134e5760405162461bcd60e51b815260206004820152601760248201527613585e1a5b5d5b481cdd5c1c1b1e48195e18d959591959604a1b604482015260640161079f565b80546113975760405162461bcd60e51b8152602060048201526018602482015277457069736f6465206d757374206861766520746f6b656e7360401b604482015260640161079f565b8160028111156113a9576113a9613dbb565b60028083015460ff16908111156113c2576113c2613dbb565b1461140f5760405162461bcd60e51b815260206004820152601b60248201527f457069736f646520696e20696e636f7272656374207374617475730000000000604482015260640161079f565b61144f8686808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508992508b9150612d699050565b6001600160401b038088166000908152600e60205260409020600181018054919263ffffffff89169260109161148f918591600160801b90910416614602565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505050505050505050565b6003546000906001600160a01b031633146115085760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b816115445760405162461bcd60e51b815260206004820152600c60248201526b155492481c995c5d5a5c995960a21b604482015260640161079f565b6000846001600160801b03161161159d5760405162461bcd60e51b815260206004820152601e60248201527f4d617820737570706c79206d757374206265206d6f7265207468616e20300000604482015260640161079f565b6000856001600160801b03161180156115c15750612710856001600160801b031611155b61160d5760405162461bcd60e51b815260206004820152601d60248201527f526172697479206d757374206265203e3020616e64203c3d3130303030000000604482015260640161079f565b600b8054908190600061161f836146a5565b91905055506040518060800160405280876001600160801b0316815260200160006001600160801b03168152602001866001600160801b0316815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250939094525050838152600d60209081526040918290208451858301516001600160801b03918216600160801b91831691909102178255928501516001820180546001600160801b0319169190941617909255606084015180519293506116fe9260028501929190910190613977565b50905050807f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8585604051611734929190614676565b60405180910390a295945050505050565b6001600160401b0381166000908152600e60205260409020600190829060029060018101546001600160401b03600160c01b820481169161178f918791600160801b900416614599565b11156117d75760405162461bcd60e51b815260206004820152601760248201527613585e1a5b5d5b481cdd5c1c1b1e48195e18d959591959604a1b604482015260640161079f565b80546118205760405162461bcd60e51b8152602060048201526018602482015277457069736f6465206d757374206861766520746f6b656e7360401b604482015260640161079f565b81600281111561183257611832613dbb565b60028083015460ff169081111561184b5761184b613dbb565b146118985760405162461bcd60e51b815260206004820152601b60248201527f457069736f646520696e20696e636f7272656374207374617475730000000000604482015260640161079f565b6001600160401b038086166000908152600e602052604090206001810154909134600160401b90920416146119035760405162461bcd60e51b8152602060048201526011602482015270125b98dbdc9c9958dd081c185e5b595b9d607a1b604482015260640161079f565b33600090815260048201602052604090205460ff16156119655760405162461bcd60e51b815260206004820152601b60248201527f416464726573732068617320616c726561647920636c61696d65640000000000604482015260640161079f565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061199b5761199b6145ec565b60200260200101906001600160a01b031690816001600160a01b0316815250506119c781600189612d69565b600182810180546010906119ec908490600160801b90046001600160401b0316614602565b82546001600160401b039182166101009390930a92830291909202199091161790555050336000908152600490910160205260409020805460ff191660011790555050505050565b6001600160a01b038316331480611a505750611a508333610638565b611a6c5760405162461bcd60e51b815260040161079f906146c0565b611a77838383612e9f565b505050565b6003546001600160a01b03163314611ac45760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b611ace6000613093565b565b6001600160401b0383166000908152600e60205260409020819084906001908315801590611aff5750601e8411155b611b415760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b5a5b9d08185b5bdd5b9d606a1b604482015260640161079f565b60018101546001600160401b03600160c01b8204811691611b6b918791600160801b900416614599565b1115611bb35760405162461bcd60e51b815260206004820152601760248201527613585e1a5b5d5b481cdd5c1c1b1e48195e18d959591959604a1b604482015260640161079f565b8054611bfc5760405162461bcd60e51b8152602060048201526018602482015277457069736f6465206d757374206861766520746f6b656e7360401b604482015260640161079f565b816002811115611c0e57611c0e613dbb565b60028083015460ff1690811115611c2757611c27613dbb565b14611c745760405162461bcd60e51b815260206004820152601b60248201527f457069736f646520696e20696e636f7272656374207374617475730000000000604482015260640161079f565b6001600160401b038781166000908152600e6020526040902060018101549091163414611cd75760405162461bcd60e51b8152602060048201526011602482015270125b98dbdc9c9958dd081c185e5b595b9d607a1b604482015260640161079f565b60005b6001600160401b038116871115611ec4578160030160008989846001600160401b0316818110611d0c57611d0c6145ec565b9050602002016020810190611d219190613da0565b6001600160401b0316815260208101919091526040016000205460ff1615611da25760405162461bcd60e51b815260206004820152602e60248201527f43616c6c20696e636c756465732061207374617220776869636820686173206160448201526d1b1c9958591e4818db185a5b595960921b606482015260840161079f565b60095433906001600160a01b0316636352211e8a8a6001600160401b038616818110611dd057611dd06145ec565b9050602002016020810190611de59190613da0565b6040516001600160e01b031960e084901b1681526001600160401b03909116600482015260240160206040518083038186803b158015611e2457600080fd5b505afa158015611e38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5c9190614709565b6001600160a01b031614611eb25760405162461bcd60e51b815260206004820152601860248201527f43616c6c657220646f6573206e6f74206f776e20737461720000000000000000604482015260640161079f565b80611ebc8161464f565b915050611cda565b50604080516001808252818301909252600091602080830190803683370190505090503381600081518110611efb57611efb6145ec565b6001600160a01b0390921660209283029190910190910152611f1e81888b612d69565b600182018054889190601090611f45908490600160801b90046001600160401b0316614602565b92506101000a8154816001600160401b0302191690836001600160401b0316021790555060005b6001600160401b038116881115610bea5760018360030160008b8b856001600160401b0316818110611fa057611fa06145ec565b9050602002016020810190611fb59190613da0565b6001600160401b031681526020810191909152604001600020805460ff191691151591909117905580611fe78161464f565b915050611f6c565b600d602052600090815260409020805460018201546002830180546001600160801b0380851695600160801b909504811694931692919061202f906145b1565b80601f016020809104026020016040519081016040528092919081815260200182805461205b906145b1565b80156120a85780601f1061207d576101008083540402835291602001916120a8565b820191906000526020600020905b81548152906001019060200180831161208b57829003601f168201915b5050505050905084565b600a80546120bf906145b1565b80601f01602080910402602001604051908101604052809291908181526020018280546120eb906145b1565b80156121385780601f1061210d57610100808354040283529160200191612138565b820191906000526020600020905b81548152906001019060200180831161211b57829003601f168201915b505050505081565b6003546001600160a01b031633146121885760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6001600160401b0388166000908152600e602052604090206121ab8189896139eb565b50600181810180546001600160401b038981166001600160801b031990921691909117600160401b89831602176001600160801b0316600160801b8883160277ffffffffffffffffffffffffffffffffffffffffffffffff1617600160c01b91871691909102179055600280830180548593919260ff199091169190849081111561223857612238613dbb565b0217905550505050505050505050565b610e403383836130e5565b6003546001600160a01b0316331461229b5760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b806122da5760405162461bcd60e51b815260206004820152600f60248201526e14de5b589bdb081c995c5d5a5c9959608a1b604482015260640161079f565b611a77600a83836138f3565b6003546001600160a01b0316331461232e5760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6007805467ffffffffffffffff19166001600160401b0392909216919091179055565b6003546001600160a01b031633146123995760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b600655565b6003546001600160a01b031633146123e65760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6000816001600160801b03161161243f5760405162461bcd60e51b815260206004820152601e60248201527f4d617820737570706c79206d757374206265206d6f7265207468616e20300000604482015260640161079f565b6000918252600d602052604090912060010180546001600160801b0319166001600160801b03909216919091179055565b6003546001600160a01b031633146124b85760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6007805463ffffffff909216600160501b026dffffffff0000000000000000000019909216919091179055565b6001600160a01b03851633148061250157506125018533610638565b61251d5760405162461bcd60e51b815260040161079f906146c0565b61103485858585856131c6565b6003546001600160a01b031633146125725760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6001600160a01b0381166125d75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161079f565b6125e081613093565b50565b6001600160a01b0383163314806125ff57506125ff8333610638565b61261b5760405162461bcd60e51b815260040161079f906146c0565b611a7783838361336d565b6001600160a01b0384166126865760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161079f565b81518351146126a75760405162461bcd60e51b815260040161079f90614726565b3360005b8451811015612743578381815181106126c6576126c66145ec565b60200260200101516000808784815181106126e3576126e36145ec565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b03168152602001908152602001600020600082825461272b9190614599565b9091555081905061273b816146a5565b9150506126ab565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161279492919061476e565b60405180910390a4611034816000878787876134e7565b6000828152600c6020908152604080832081518154606094810282018501845292810183815290939192849284919084018282801561281357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116127f5575b5050509183525050600191909101546001600160401b0390811660209283015282820151166000908152600e909152604081209192505b82515161ffff82161015611034576000612710858361ffff1681518110612873576128736145ec565b6020026020010151612885919061479c565b612890906001614599565b905060005b835461ffff82161015612a1e576000600d6000866000018461ffff16815481106128c1576128c16145ec565b6000918252602080832060048304015460039092166008026101000a9091046001600160401b03168352820192909252604001902080549091506001600160801b031661ffff84161080156129305750600181015481546001600160801b03918216600160801b909104909116105b15612a0b576129bc86600001518561ffff1681518110612952576129526145ec565b6020026020010151866000018461ffff1681548110612973576129736145ec565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03166001600160401b031660016040518060200160405280600081525061369c565b805460019082906010906129e1908490600160801b90046001600160801b031661462d565b92506101000a8154816001600160801b0302191690836001600160801b0316021790555050612a1e565b5080612a16816147be565b915050612895565b50508080612a2b906147be565b91505061284a565b8151835114612a545760405162461bcd60e51b815260040161079f90614726565b6001600160a01b038416612ab85760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161079f565b3360005b8451811015612be2576000858281518110612ad957612ad96145ec565b602002602001015190506000858381518110612af757612af76145ec565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015612b8a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161079f565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612bc7908490614599565b9250508190555050505080612bdb906146a5565b9050612abc565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612c3292919061476e565b60405180910390a4612c488187878787876134e7565b505050505050565b80471015612ca05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161079f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612ced576040519150601f19603f3d011682016040523d82523d6000602084013e612cf2565b606091505b5050905080611a775760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161079f565b6005546006546007546040516305d3b1d360e41b815260048101929092526001600160401b0381166024830152600160401b810461ffff166044830152600160501b900463ffffffff9081166064830152841660848201526000916001600160a01b031690635d3b1d309060a401602060405180830381600087803b158015612df157600080fd5b505af1158015612e05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e2991906147d6565b6040805180820182528681526001600160401b0385166020808301919091526000848152600c8252929092208151805194955091939092612e6e928492910190613aa7565b50602091909101516001909101805467ffffffffffffffff19166001600160401b0390921691909117905550505050565b6001600160a01b038316612f015760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b606482015260840161079f565b8051825114612f225760405162461bcd60e51b815260040161079f90614726565b604080516020810190915260009081905233905b8351811015613034576000848281518110612f5357612f536145ec565b602002602001015190506000848381518110612f7157612f716145ec565b602090810291909101810151600084815280835260408082206001600160a01b038c168352909352919091205490915081811015612ffd5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b606482015260840161079f565b6000928352602083815260408085206001600160a01b038b168652909152909220910390558061302c816146a5565b915050612f36565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161308592919061476e565b60405180910390a450505050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156131595760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b606482015260840161079f565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b03841661322a5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161079f565b3361324381878761323a8861379d565b6110348861379d565b6000848152602081815260408083206001600160a01b038a168452909152902054838110156132c75760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161079f565b6000858152602081815260408083206001600160a01b038b8116855292528083208785039055908816825281208054869290613304908490614599565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46133648288888888886137e8565b50505050505050565b6001600160a01b0383166133cf5760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b606482015260840161079f565b336133ff818560006133e08761379d565b6133e98761379d565b5050604080516020810190915260009052505050565b6000838152602081815260408083206001600160a01b03881684529091529020548281101561347c5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b606482015260840161079f565b6000848152602081815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b6001600160a01b0384163b15612c485760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061352b90899089908890889088906004016147ef565b602060405180830381600087803b15801561354557600080fd5b505af1925050508015613575575060408051601f3d908101601f191682019092526135729181019061484d565b60015b61362b5761358161486a565b806308c379a014156135bb5750613596614886565b806135a157506135bd565b8060405162461bcd60e51b815260040161079f9190613cce565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161079f565b6001600160e01b0319811663bc197c8160e01b146133645760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161079f565b6001600160a01b0384166136fc5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161079f565b3361370d8160008761323a8861379d565b6000848152602081815260408083206001600160a01b03891684529091528120805485929061373d908490614599565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611034816000878787876137e8565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106137d7576137d76145ec565b602090810291909101015292915050565b6001600160a01b0384163b15612c485760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061382c908990899088908890889060040161490f565b602060405180830381600087803b15801561384657600080fd5b505af1925050508015613876575060408051601f3d908101601f191682019092526138739181019061484d565b60015b6138825761358161486a565b6001600160e01b0319811663f23a6e6160e01b146133645760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161079f565b8280546138ff906145b1565b90600052602060002090601f0160209004810192826139215760008555613967565b82601f1061393a5782800160ff19823516178555613967565b82800160010185558215613967579182015b8281111561396757823582559160200191906001019061394c565b50613973929150613afc565b5090565b828054613983906145b1565b90600052602060002090601f0160209004810192826139a55760008555613967565b82601f106139be57805160ff1916838001178555613967565b82800160010185558215613967579182015b828111156139675782518255916020019190600101906139d0565b828054828255906000526020600020906003016004900481019282156139675791602002820160005b83821115613a675783356001600160401b031683826101000a8154816001600160401b0302191690836001600160401b031602179055509260200192600801602081600701049283019260010302613a14565b8015613a9a5782816101000a8154906001600160401b030219169055600801602081600701049283019260010302613a67565b5050613973929150613afc565b828054828255906000526020600020908101928215613967579160200282015b8281111561396757825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613ac7565b5b808211156139735760008155600101613afd565b6001600160a01b03811681146125e057600080fd5b60008060408385031215613b3957600080fd5b8235613b4481613b11565b946020939093013593505050565b6001600160e01b0319811681146125e057600080fd5b600060208284031215613b7a57600080fd5b8135613b8581613b52565b9392505050565b80356001600160401b0381168114613ba357600080fd5b919050565b60008083601f840112613bba57600080fd5b5081356001600160401b03811115613bd157600080fd5b6020830191508360208260051b8501011115613bec57600080fd5b9250929050565b600080600080600060808688031215613c0b57600080fd5b613c1486613b8c565b9450613c2260208701613b8c565b9350613c3060408701613b8c565b925060608601356001600160401b03811115613c4b57600080fd5b613c5788828901613ba8565b969995985093965092949392505050565b600060208284031215613c7a57600080fd5b5035919050565b6000815180845260005b81811015613ca757602081850181015186830182015201613c8b565b81811115613cb9576000602083870101525b50601f01601f19169290920160200192915050565b602081526000613b856020830184613c81565b60008060408385031215613cf457600080fd5b613cfd83613b8c565b9150613d0b60208401613b8c565b90509250929050565b60008083601f840112613d2657600080fd5b5081356001600160401b03811115613d3d57600080fd5b602083019150836020828501011115613bec57600080fd5b600080600060408486031215613d6a57600080fd5b8335925060208401356001600160401b03811115613d8757600080fd5b613d9386828701613d14565b9497909650939450505050565b600060208284031215613db257600080fd5b613b8582613b8c565b634e487b7160e01b600052602160045260246000fd5b6001600160401b038681168252858116602083015284811660408301528316606082015260a0810160038310613e1757634e487b7160e01b600052602160045260246000fd5b8260808301529695505050505050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715613e6257613e62613e27565b6040525050565b60006001600160401b03821115613e8257613e82613e27565b5060051b60200190565b600082601f830112613e9d57600080fd5b81356020613eaa82613e69565b604051613eb78282613e3d565b83815260059390931b8501820192828101915086841115613ed757600080fd5b8286015b84811015613ef25780358352918301918301613edb565b509695505050505050565b60008060408385031215613f1057600080fd5b8235915060208301356001600160401b03811115613f2d57600080fd5b613f3985828601613e8c565b9150509250929050565b80356001600160801b0381168114613ba357600080fd5b60008060408385031215613f6d57600080fd5b82359150613d0b60208401613f43565b600060208284031215613f8f57600080fd5b813561ffff81168114613b8557600080fd5b600082601f830112613fb257600080fd5b81356001600160401b03811115613fcb57613fcb613e27565b604051613fe2601f8301601f191660200182613e3d565b818152846020838601011115613ff757600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561402c57600080fd5b853561403781613b11565b9450602086013561404781613b11565b935060408601356001600160401b038082111561406357600080fd5b61406f89838a01613e8c565b9450606088013591508082111561408557600080fd5b61409189838a01613e8c565b935060808801359150808211156140a757600080fd5b506140b488828901613fa1565b9150509295509295909350565b600080604083850312156140d457600080fd5b82356001600160401b03808211156140eb57600080fd5b818501915085601f8301126140ff57600080fd5b8135602061410c82613e69565b6040516141198282613e3d565b83815260059390931b850182019282810191508984111561413957600080fd5b948201945b8386101561416057853561415181613b11565b8252948201949082019061413e565b9650508601359250508082111561417657600080fd5b50613f3985828601613e8c565b600081518084526020808501945080840160005b838110156141b357815187529582019590820190600101614197565b509495945050505050565b602081526000613b856020830184614183565b6000806000604084860312156141e657600080fd5b6141ef84613b8c565b925060208401356001600160401b0381111561420a57600080fd5b613d9386828701613ba8565b6000806000806060858703121561422c57600080fd5b61423585613f43565b935061424360208601613f43565b925060408501356001600160401b0381111561425e57600080fd5b61426a87828801613d14565b95989497509550505050565b60008060006060848603121561428b57600080fd5b833561429681613b11565b925060208401356001600160401b03808211156142b257600080fd5b6142be87838801613e8c565b935060408601359150808211156142d457600080fd5b506142e186828701613e8c565b9150509250925092565b60006001600160801b03808716835280861660208401528085166040840152506080606083015261431f6080830184613c81565b9695505050505050565b60008060008060008060008060e0898b03121561434557600080fd5b61434e89613b8c565b975060208901356001600160401b0381111561436957600080fd5b6143758b828c01613ba8565b9098509650614388905060408a01613b8c565b945061439660608a01613b8c565b93506143a460808a01613b8c565b92506143b260a08a01613b8c565b915060c0890135600381106143c657600080fd5b809150509295985092959890939650565b600080604083850312156143ea57600080fd5b82356143f581613b11565b91506020830135801515811461440a57600080fd5b809150509250929050565b6000806020838503121561442857600080fd5b82356001600160401b0381111561443e57600080fd5b61444a85828601613d14565b90969095509350505050565b6000806040838503121561446957600080fd5b823561447481613b11565b9150602083013561440a81613b11565b60006020828403121561449657600080fd5b813563ffffffff81168114613b8557600080fd5b600080600080600060a086880312156144c257600080fd5b85356144cd81613b11565b945060208601356144dd81613b11565b9350604086013592506060860135915060808601356001600160401b0381111561450657600080fd5b6140b488828901613fa1565b60006020828403121561452457600080fd5b8135613b8581613b11565b60008060006060848603121561454457600080fd5b833561454f81613b11565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561459457614594614564565b500290565b600082198211156145ac576145ac614564565b500190565b600181811c908216806145c557607f821691505b602082108114156145e657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b60006001600160401b0380831681851680830382111561462457614624614564565b01949350505050565b60006001600160801b0380831681851680830382111561462457614624614564565b60006001600160401b038083168181141561466c5761466c614564565b6001019392505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006000198214156146b9576146b9614564565b5060010190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201526808185c1c1c9bdd995960ba1b606082015260800190565b60006020828403121561471b57600080fd5b8151613b8581613b11565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b6040815260006147816040830185614183565b82810360208401526147938185614183565b95945050505050565b6000826147b957634e487b7160e01b600052601260045260246000fd5b500690565b600061ffff8083168181141561466c5761466c614564565b6000602082840312156147e857600080fd5b5051919050565b60006001600160a01b03808816835280871660208401525060a0604083015261481b60a0830186614183565b828103606084015261482d8186614183565b905082810360808401526148418185613c81565b98975050505050505050565b60006020828403121561485f57600080fd5b8151613b8581613b52565b600060033d11156148835760046000803e5060005160e01c5b90565b600060443d10156148945790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156148c357505050505090565b82850191508151818111156148db5750505050505090565b843d87010160208285010111156148f55750505050505090565b61490460208286010187613e3d565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261494760a0830184613c81565b97965050505050505056fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220c4911017cb27627e1ffff938c3d49947f1900829d3dc9f21709eed2a3102f2fb64736f6c63430008090033000000000000000000000000000000000000000000000000000000000000010000000000000000000000000069b9c98e8d715c25b330d0d4eb07e68cbb7f6cfc000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699098af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef0000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000002625a0000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000000000000000000000000000000000000000000553433a534a000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106101f85760003560e01c8063715018a61161010d578063d218d95d116100a0578063eb98bc141161006f578063eb98bc1414610666578063eedcf574146106b7578063f242432a146106d7578063f2fde38b146106f7578063f5298aca1461071757600080fd5b8063d218d95d146105bd578063e0549211146105dd578063e492a9dd146105fd578063e985e9c51461061d57600080fd5b806395d89b41116100dc57806395d89b4114610548578063979cf5021461055d578063a22cb4651461057d578063b84c82461461059d57600080fd5b8063715018a6146104c85780638da5cb5b146104dd5780639173c2ce14610505578063953c81331461051857600080fd5b806325e2da15116101905780634e1273f41161015f5780634e1273f41461042857806362664080146104555780636a2c727b146104755780636afcb7b0146104955780636b20c454146104a857600080fd5b806325e2da15146103b35780632974dc30146103d35780632eb2c2d6146103f35780633ccfd60b1461041357600080fd5b806310e5f86f116101cc57806310e5f86f146102af578063162094c4146102fc5780631ed77bbe1461031c5780631fe543e31461039357600080fd5b8062fdd58e146101fd57806301ffc9a71461023057806304e9d73a146102605780630e89341c14610282575b600080fd5b34801561020957600080fd5b5061021d610218366004613b26565b610737565b6040519081526020015b60405180910390f35b34801561023c57600080fd5b5061025061024b366004613b68565b6107ce565b6040519015158152602001610227565b34801561026c57600080fd5b5061028061027b366004613bf3565b610820565b005b34801561028e57600080fd5b506102a261029d366004613c68565b610bf6565b6040516102279190613cce565b3480156102bb57600080fd5b506102506102ca366004613ce1565b6001600160401b039182166000908152600e602090815260408083209390941682526003909201909152205460ff1690565b34801561030857600080fd5b50610280610317366004613d55565b610cdc565b34801561032857600080fd5b50610382610337366004613da0565b600e60205260009081526040902060018101546002909101546001600160401b0380831692600160401b8104821692600160801b8204831692600160c01b9092049091169060ff1685565b604051610227959493929190613dd1565b34801561039f57600080fd5b506102806103ae366004613efd565b610dbc565b3480156103bf57600080fd5b506102806103ce366004613f5a565b610e44565b3480156103df57600080fd5b506102806103ee366004613f7d565b610f2a565b3480156103ff57600080fd5b5061028061040e366004614014565b610f99565b34801561041f57600080fd5b5061028061103b565b34801561043457600080fd5b506104486104433660046140c1565b6110fd565b60405161022791906141be565b34801561046157600080fd5b506102806104703660046141d1565b611226565b34801561048157600080fd5b5061021d610490366004614216565b6114bd565b6102806104a3366004613da0565b611745565b3480156104b457600080fd5b506102806104c3366004614276565b611a34565b3480156104d457600080fd5b50610280611a7c565b3480156104e957600080fd5b506003546040516001600160a01b039091168152602001610227565b6102806105133660046141d1565b611ad0565b34801561052457600080fd5b50610538610533366004613c68565b611fef565b60405161022794939291906142eb565b34801561055457600080fd5b506102a26120b2565b34801561056957600080fd5b50610280610578366004614329565b612140565b34801561058957600080fd5b506102806105983660046143d7565b612248565b3480156105a957600080fd5b506102806105b8366004614415565b612253565b3480156105c957600080fd5b506102806105d8366004613da0565b6122e6565b3480156105e957600080fd5b506102806105f8366004613c68565b612351565b34801561060957600080fd5b50610280610618366004613f5a565b61239e565b34801561062957600080fd5b50610250610638366004614456565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b34801561067257600080fd5b5061069f610681366004613c68565b600c602052600090815260409020600101546001600160401b031681565b6040516001600160401b039091168152602001610227565b3480156106c357600080fd5b506102806106d2366004614484565b612470565b3480156106e357600080fd5b506102806106f23660046144aa565b6124e5565b34801561070357600080fd5b50610280610712366004614512565b61252a565b34801561072357600080fd5b5061028061073236600461452f565b6125e3565b60006001600160a01b0383166107a85760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b14806107ff57506001600160e01b031982166303a24d0760e21b145b8061081a57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6003546001600160a01b031633146108685760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6001600160401b038086166000908152600e602090815260408083208885168452600d909252909120600182015491929091600160c01b90048116906108b09087168561457a565b60018401546108cf9190600160801b90046001600160401b0316614599565b111561091d5760405162461bcd60e51b815260206004820152601f60248201527f457069736f6465206d6178696d756d20737570706c7920657863656564656400604482015260640161079f565b60018101546001600160801b031661093e6001600160401b0387168561457a565b825461095a9190600160801b90046001600160801b0316614599565b11156109a85760405162461bcd60e51b815260206004820152601d60248201527f546f6b656e206d6178696d756d20737570706c79206578636565646564000000604482015260640161079f565b81546109f15760405162461bcd60e51b8152602060048201526018602482015277457069736f6465206d757374206861766520746f6b656e7360401b604482015260640161079f565b6000816002018054610a02906145b1565b905011610a455760405162461bcd60e51b81526020600482015260116024820152702737b732bc34b9ba32b73a103a37b5b2b760791b604482015260640161079f565b60408051600180825281830190925260009160208083019080368337019050509050866001600160401b031681600081518110610a8457610a846145ec565b6020908102919091010152604080516001808252818301909252600091816020016020820280368337019050509050866001600160401b031681600081518110610ad057610ad06145ec565b60200260200101818152505060005b6001600160401b038116861115610bea57610b3a8787836001600160401b0316818110610b0e57610b0e6145ec565b9050602002016020810190610b239190614512565b848460405180602001604052806000815250612626565b878560010160108282829054906101000a90046001600160401b0316610b609190614602565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550876001600160401b03168460000160108282829054906101000a90046001600160801b0316610bb3919061462d565b92506101000a8154816001600160801b0302191690836001600160801b031602179055508080610be29061464f565b915050610adf565b50505050505050505050565b6000818152600d6020526040812060020180546060929190610c17906145b1565b80601f0160208091040260200160405190810160405280929190818152602001828054610c43906145b1565b8015610c905780601f10610c6557610100808354040283529160200191610c90565b820191906000526020600020905b815481529060010190602001808311610c7357829003601f168201915b50505050509050600081511161081a5760405162461bcd60e51b81526020600482015260116024820152702737b732bc34b9ba32b73a103a37b5b2b760791b604482015260640161079f565b6003546001600160a01b03163314610d245760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b80610d605760405162461bcd60e51b815260206004820152600c60248201526b155492481c995c5d5a5c995960a21b604482015260640161079f565b6000838152600d60205260409020610d7c9060020183836138f3565b50827f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8383604051610daf929190614676565b60405180910390a2505050565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091614610e365760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e6990916602482015260440161079f565b610e4082826127ab565b5050565b6003546001600160a01b03163314610e8c5760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6000816001600160801b0316118015610eb05750612710816001600160801b031611155b610efc5760405162461bcd60e51b815260206004820152601d60248201527f526172697479206d757374206265203e3020616e64203c3d3130303030000000604482015260640161079f565b6000918252600d602052604090912080546001600160801b0319166001600160801b03909216919091179055565b6003546001600160a01b03163314610f725760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6007805461ffff909216600160401b0269ffff000000000000000019909216919091179055565b6001600160a01b038516331480610fb55750610fb58533610638565b6110275760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000606482015260840161079f565b6110348585858585612a33565b5050505050565b6003546001600160a01b031633146110835760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b600260045414156110d65760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161079f565b60026004556110f66110f06003546001600160a01b031690565b47612c50565b6001600455565b606081518351146111625760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b606482015260840161079f565b600083516001600160401b0381111561117d5761117d613e27565b6040519080825280602002602001820160405280156111a6578160200160208202803683370190505b50905060005b845181101561121e576111f18582815181106111ca576111ca6145ec565b60200260200101518583815181106111e4576111e46145ec565b6020026020010151610737565b828281518110611203576112036145ec565b6020908102919091010152611217816146a5565b90506111ac565b509392505050565b6003546001600160a01b0316331461126e5760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6001600160401b0383166000908152600e6020526040812082918591831580159061129a5750601e8411155b6112dc5760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b5a5b9d08185b5bdd5b9d606a1b604482015260640161079f565b60018101546001600160401b03600160c01b8204811691611306918791600160801b900416614599565b111561134e5760405162461bcd60e51b815260206004820152601760248201527613585e1a5b5d5b481cdd5c1c1b1e48195e18d959591959604a1b604482015260640161079f565b80546113975760405162461bcd60e51b8152602060048201526018602482015277457069736f6465206d757374206861766520746f6b656e7360401b604482015260640161079f565b8160028111156113a9576113a9613dbb565b60028083015460ff16908111156113c2576113c2613dbb565b1461140f5760405162461bcd60e51b815260206004820152601b60248201527f457069736f646520696e20696e636f7272656374207374617475730000000000604482015260640161079f565b61144f8686808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508992508b9150612d699050565b6001600160401b038088166000908152600e60205260409020600181018054919263ffffffff89169260109161148f918591600160801b90910416614602565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505050505050505050565b6003546000906001600160a01b031633146115085760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b816115445760405162461bcd60e51b815260206004820152600c60248201526b155492481c995c5d5a5c995960a21b604482015260640161079f565b6000846001600160801b03161161159d5760405162461bcd60e51b815260206004820152601e60248201527f4d617820737570706c79206d757374206265206d6f7265207468616e20300000604482015260640161079f565b6000856001600160801b03161180156115c15750612710856001600160801b031611155b61160d5760405162461bcd60e51b815260206004820152601d60248201527f526172697479206d757374206265203e3020616e64203c3d3130303030000000604482015260640161079f565b600b8054908190600061161f836146a5565b91905055506040518060800160405280876001600160801b0316815260200160006001600160801b03168152602001866001600160801b0316815260200185858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250939094525050838152600d60209081526040918290208451858301516001600160801b03918216600160801b91831691909102178255928501516001820180546001600160801b0319169190941617909255606084015180519293506116fe9260028501929190910190613977565b50905050807f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8585604051611734929190614676565b60405180910390a295945050505050565b6001600160401b0381166000908152600e60205260409020600190829060029060018101546001600160401b03600160c01b820481169161178f918791600160801b900416614599565b11156117d75760405162461bcd60e51b815260206004820152601760248201527613585e1a5b5d5b481cdd5c1c1b1e48195e18d959591959604a1b604482015260640161079f565b80546118205760405162461bcd60e51b8152602060048201526018602482015277457069736f6465206d757374206861766520746f6b656e7360401b604482015260640161079f565b81600281111561183257611832613dbb565b60028083015460ff169081111561184b5761184b613dbb565b146118985760405162461bcd60e51b815260206004820152601b60248201527f457069736f646520696e20696e636f7272656374207374617475730000000000604482015260640161079f565b6001600160401b038086166000908152600e602052604090206001810154909134600160401b90920416146119035760405162461bcd60e51b8152602060048201526011602482015270125b98dbdc9c9958dd081c185e5b595b9d607a1b604482015260640161079f565b33600090815260048201602052604090205460ff16156119655760405162461bcd60e51b815260206004820152601b60248201527f416464726573732068617320616c726561647920636c61696d65640000000000604482015260640161079f565b60408051600180825281830190925260009160208083019080368337019050509050338160008151811061199b5761199b6145ec565b60200260200101906001600160a01b031690816001600160a01b0316815250506119c781600189612d69565b600182810180546010906119ec908490600160801b90046001600160401b0316614602565b82546001600160401b039182166101009390930a92830291909202199091161790555050336000908152600490910160205260409020805460ff191660011790555050505050565b6001600160a01b038316331480611a505750611a508333610638565b611a6c5760405162461bcd60e51b815260040161079f906146c0565b611a77838383612e9f565b505050565b6003546001600160a01b03163314611ac45760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b611ace6000613093565b565b6001600160401b0383166000908152600e60205260409020819084906001908315801590611aff5750601e8411155b611b415760405162461bcd60e51b8152602060048201526013602482015272125b9d985b1a59081b5a5b9d08185b5bdd5b9d606a1b604482015260640161079f565b60018101546001600160401b03600160c01b8204811691611b6b918791600160801b900416614599565b1115611bb35760405162461bcd60e51b815260206004820152601760248201527613585e1a5b5d5b481cdd5c1c1b1e48195e18d959591959604a1b604482015260640161079f565b8054611bfc5760405162461bcd60e51b8152602060048201526018602482015277457069736f6465206d757374206861766520746f6b656e7360401b604482015260640161079f565b816002811115611c0e57611c0e613dbb565b60028083015460ff1690811115611c2757611c27613dbb565b14611c745760405162461bcd60e51b815260206004820152601b60248201527f457069736f646520696e20696e636f7272656374207374617475730000000000604482015260640161079f565b6001600160401b038781166000908152600e6020526040902060018101549091163414611cd75760405162461bcd60e51b8152602060048201526011602482015270125b98dbdc9c9958dd081c185e5b595b9d607a1b604482015260640161079f565b60005b6001600160401b038116871115611ec4578160030160008989846001600160401b0316818110611d0c57611d0c6145ec565b9050602002016020810190611d219190613da0565b6001600160401b0316815260208101919091526040016000205460ff1615611da25760405162461bcd60e51b815260206004820152602e60248201527f43616c6c20696e636c756465732061207374617220776869636820686173206160448201526d1b1c9958591e4818db185a5b595960921b606482015260840161079f565b60095433906001600160a01b0316636352211e8a8a6001600160401b038616818110611dd057611dd06145ec565b9050602002016020810190611de59190613da0565b6040516001600160e01b031960e084901b1681526001600160401b03909116600482015260240160206040518083038186803b158015611e2457600080fd5b505afa158015611e38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5c9190614709565b6001600160a01b031614611eb25760405162461bcd60e51b815260206004820152601860248201527f43616c6c657220646f6573206e6f74206f776e20737461720000000000000000604482015260640161079f565b80611ebc8161464f565b915050611cda565b50604080516001808252818301909252600091602080830190803683370190505090503381600081518110611efb57611efb6145ec565b6001600160a01b0390921660209283029190910190910152611f1e81888b612d69565b600182018054889190601090611f45908490600160801b90046001600160401b0316614602565b92506101000a8154816001600160401b0302191690836001600160401b0316021790555060005b6001600160401b038116881115610bea5760018360030160008b8b856001600160401b0316818110611fa057611fa06145ec565b9050602002016020810190611fb59190613da0565b6001600160401b031681526020810191909152604001600020805460ff191691151591909117905580611fe78161464f565b915050611f6c565b600d602052600090815260409020805460018201546002830180546001600160801b0380851695600160801b909504811694931692919061202f906145b1565b80601f016020809104026020016040519081016040528092919081815260200182805461205b906145b1565b80156120a85780601f1061207d576101008083540402835291602001916120a8565b820191906000526020600020905b81548152906001019060200180831161208b57829003601f168201915b5050505050905084565b600a80546120bf906145b1565b80601f01602080910402602001604051908101604052809291908181526020018280546120eb906145b1565b80156121385780601f1061210d57610100808354040283529160200191612138565b820191906000526020600020905b81548152906001019060200180831161211b57829003601f168201915b505050505081565b6003546001600160a01b031633146121885760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6001600160401b0388166000908152600e602052604090206121ab8189896139eb565b50600181810180546001600160401b038981166001600160801b031990921691909117600160401b89831602176001600160801b0316600160801b8883160277ffffffffffffffffffffffffffffffffffffffffffffffff1617600160c01b91871691909102179055600280830180548593919260ff199091169190849081111561223857612238613dbb565b0217905550505050505050505050565b610e403383836130e5565b6003546001600160a01b0316331461229b5760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b806122da5760405162461bcd60e51b815260206004820152600f60248201526e14de5b589bdb081c995c5d5a5c9959608a1b604482015260640161079f565b611a77600a83836138f3565b6003546001600160a01b0316331461232e5760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6007805467ffffffffffffffff19166001600160401b0392909216919091179055565b6003546001600160a01b031633146123995760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b600655565b6003546001600160a01b031633146123e65760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6000816001600160801b03161161243f5760405162461bcd60e51b815260206004820152601e60248201527f4d617820737570706c79206d757374206265206d6f7265207468616e20300000604482015260640161079f565b6000918252600d602052604090912060010180546001600160801b0319166001600160801b03909216919091179055565b6003546001600160a01b031633146124b85760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6007805463ffffffff909216600160501b026dffffffff0000000000000000000019909216919091179055565b6001600160a01b03851633148061250157506125018533610638565b61251d5760405162461bcd60e51b815260040161079f906146c0565b61103485858585856131c6565b6003546001600160a01b031633146125725760405162461bcd60e51b81526020600482018190526024820152600080516020614953833981519152604482015260640161079f565b6001600160a01b0381166125d75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161079f565b6125e081613093565b50565b6001600160a01b0383163314806125ff57506125ff8333610638565b61261b5760405162461bcd60e51b815260040161079f906146c0565b611a7783838361336d565b6001600160a01b0384166126865760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161079f565b81518351146126a75760405162461bcd60e51b815260040161079f90614726565b3360005b8451811015612743578381815181106126c6576126c66145ec565b60200260200101516000808784815181106126e3576126e36145ec565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b03168152602001908152602001600020600082825461272b9190614599565b9091555081905061273b816146a5565b9150506126ab565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161279492919061476e565b60405180910390a4611034816000878787876134e7565b6000828152600c6020908152604080832081518154606094810282018501845292810183815290939192849284919084018282801561281357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116127f5575b5050509183525050600191909101546001600160401b0390811660209283015282820151166000908152600e909152604081209192505b82515161ffff82161015611034576000612710858361ffff1681518110612873576128736145ec565b6020026020010151612885919061479c565b612890906001614599565b905060005b835461ffff82161015612a1e576000600d6000866000018461ffff16815481106128c1576128c16145ec565b6000918252602080832060048304015460039092166008026101000a9091046001600160401b03168352820192909252604001902080549091506001600160801b031661ffff84161080156129305750600181015481546001600160801b03918216600160801b909104909116105b15612a0b576129bc86600001518561ffff1681518110612952576129526145ec565b6020026020010151866000018461ffff1681548110612973576129736145ec565b90600052602060002090600491828204019190066008029054906101000a90046001600160401b03166001600160401b031660016040518060200160405280600081525061369c565b805460019082906010906129e1908490600160801b90046001600160801b031661462d565b92506101000a8154816001600160801b0302191690836001600160801b0316021790555050612a1e565b5080612a16816147be565b915050612895565b50508080612a2b906147be565b91505061284a565b8151835114612a545760405162461bcd60e51b815260040161079f90614726565b6001600160a01b038416612ab85760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161079f565b3360005b8451811015612be2576000858281518110612ad957612ad96145ec565b602002602001015190506000858381518110612af757612af76145ec565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015612b8a5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161079f565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612bc7908490614599565b9250508190555050505080612bdb906146a5565b9050612abc565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612c3292919061476e565b60405180910390a4612c488187878787876134e7565b505050505050565b80471015612ca05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161079f565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612ced576040519150601f19603f3d011682016040523d82523d6000602084013e612cf2565b606091505b5050905080611a775760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161079f565b6005546006546007546040516305d3b1d360e41b815260048101929092526001600160401b0381166024830152600160401b810461ffff166044830152600160501b900463ffffffff9081166064830152841660848201526000916001600160a01b031690635d3b1d309060a401602060405180830381600087803b158015612df157600080fd5b505af1158015612e05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e2991906147d6565b6040805180820182528681526001600160401b0385166020808301919091526000848152600c8252929092208151805194955091939092612e6e928492910190613aa7565b50602091909101516001909101805467ffffffffffffffff19166001600160401b0390921691909117905550505050565b6001600160a01b038316612f015760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b606482015260840161079f565b8051825114612f225760405162461bcd60e51b815260040161079f90614726565b604080516020810190915260009081905233905b8351811015613034576000848281518110612f5357612f536145ec565b602002602001015190506000848381518110612f7157612f716145ec565b602090810291909101810151600084815280835260408082206001600160a01b038c168352909352919091205490915081811015612ffd5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b606482015260840161079f565b6000928352602083815260408085206001600160a01b038b168652909152909220910390558061302c816146a5565b915050612f36565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161308592919061476e565b60405180910390a450505050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b031614156131595760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b606482015260840161079f565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b03841661322a5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161079f565b3361324381878761323a8861379d565b6110348861379d565b6000848152602081815260408083206001600160a01b038a168452909152902054838110156132c75760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161079f565b6000858152602081815260408083206001600160a01b038b8116855292528083208785039055908816825281208054869290613304908490614599565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46133648288888888886137e8565b50505050505050565b6001600160a01b0383166133cf5760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b606482015260840161079f565b336133ff818560006133e08761379d565b6133e98761379d565b5050604080516020810190915260009052505050565b6000838152602081815260408083206001600160a01b03881684529091529020548281101561347c5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b606482015260840161079f565b6000848152602081815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b6001600160a01b0384163b15612c485760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061352b90899089908890889088906004016147ef565b602060405180830381600087803b15801561354557600080fd5b505af1925050508015613575575060408051601f3d908101601f191682019092526135729181019061484d565b60015b61362b5761358161486a565b806308c379a014156135bb5750613596614886565b806135a157506135bd565b8060405162461bcd60e51b815260040161079f9190613cce565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e746572000000000000000000000000606482015260840161079f565b6001600160e01b0319811663bc197c8160e01b146133645760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161079f565b6001600160a01b0384166136fc5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161079f565b3361370d8160008761323a8861379d565b6000848152602081815260408083206001600160a01b03891684529091528120805485929061373d908490614599565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611034816000878787876137e8565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106137d7576137d76145ec565b602090810291909101015292915050565b6001600160a01b0384163b15612c485760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061382c908990899088908890889060040161490f565b602060405180830381600087803b15801561384657600080fd5b505af1925050508015613876575060408051601f3d908101601f191682019092526138739181019061484d565b60015b6138825761358161486a565b6001600160e01b0319811663f23a6e6160e01b146133645760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b606482015260840161079f565b8280546138ff906145b1565b90600052602060002090601f0160209004810192826139215760008555613967565b82601f1061393a5782800160ff19823516178555613967565b82800160010185558215613967579182015b8281111561396757823582559160200191906001019061394c565b50613973929150613afc565b5090565b828054613983906145b1565b90600052602060002090601f0160209004810192826139a55760008555613967565b82601f106139be57805160ff1916838001178555613967565b82800160010185558215613967579182015b828111156139675782518255916020019190600101906139d0565b828054828255906000526020600020906003016004900481019282156139675791602002820160005b83821115613a675783356001600160401b031683826101000a8154816001600160401b0302191690836001600160401b031602179055509260200192600801602081600701049283019260010302613a14565b8015613a9a5782816101000a8154906001600160401b030219169055600801602081600701049283019260010302613a67565b5050613973929150613afc565b828054828255906000526020600020908101928215613967579160200282015b8281111561396757825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613ac7565b5b808211156139735760008155600101613afd565b6001600160a01b03811681146125e057600080fd5b60008060408385031215613b3957600080fd5b8235613b4481613b11565b946020939093013593505050565b6001600160e01b0319811681146125e057600080fd5b600060208284031215613b7a57600080fd5b8135613b8581613b52565b9392505050565b80356001600160401b0381168114613ba357600080fd5b919050565b60008083601f840112613bba57600080fd5b5081356001600160401b03811115613bd157600080fd5b6020830191508360208260051b8501011115613bec57600080fd5b9250929050565b600080600080600060808688031215613c0b57600080fd5b613c1486613b8c565b9450613c2260208701613b8c565b9350613c3060408701613b8c565b925060608601356001600160401b03811115613c4b57600080fd5b613c5788828901613ba8565b969995985093965092949392505050565b600060208284031215613c7a57600080fd5b5035919050565b6000815180845260005b81811015613ca757602081850181015186830182015201613c8b565b81811115613cb9576000602083870101525b50601f01601f19169290920160200192915050565b602081526000613b856020830184613c81565b60008060408385031215613cf457600080fd5b613cfd83613b8c565b9150613d0b60208401613b8c565b90509250929050565b60008083601f840112613d2657600080fd5b5081356001600160401b03811115613d3d57600080fd5b602083019150836020828501011115613bec57600080fd5b600080600060408486031215613d6a57600080fd5b8335925060208401356001600160401b03811115613d8757600080fd5b613d9386828701613d14565b9497909650939450505050565b600060208284031215613db257600080fd5b613b8582613b8c565b634e487b7160e01b600052602160045260246000fd5b6001600160401b038681168252858116602083015284811660408301528316606082015260a0810160038310613e1757634e487b7160e01b600052602160045260246000fd5b8260808301529695505050505050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715613e6257613e62613e27565b6040525050565b60006001600160401b03821115613e8257613e82613e27565b5060051b60200190565b600082601f830112613e9d57600080fd5b81356020613eaa82613e69565b604051613eb78282613e3d565b83815260059390931b8501820192828101915086841115613ed757600080fd5b8286015b84811015613ef25780358352918301918301613edb565b509695505050505050565b60008060408385031215613f1057600080fd5b8235915060208301356001600160401b03811115613f2d57600080fd5b613f3985828601613e8c565b9150509250929050565b80356001600160801b0381168114613ba357600080fd5b60008060408385031215613f6d57600080fd5b82359150613d0b60208401613f43565b600060208284031215613f8f57600080fd5b813561ffff81168114613b8557600080fd5b600082601f830112613fb257600080fd5b81356001600160401b03811115613fcb57613fcb613e27565b604051613fe2601f8301601f191660200182613e3d565b818152846020838601011115613ff757600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561402c57600080fd5b853561403781613b11565b9450602086013561404781613b11565b935060408601356001600160401b038082111561406357600080fd5b61406f89838a01613e8c565b9450606088013591508082111561408557600080fd5b61409189838a01613e8c565b935060808801359150808211156140a757600080fd5b506140b488828901613fa1565b9150509295509295909350565b600080604083850312156140d457600080fd5b82356001600160401b03808211156140eb57600080fd5b818501915085601f8301126140ff57600080fd5b8135602061410c82613e69565b6040516141198282613e3d565b83815260059390931b850182019282810191508984111561413957600080fd5b948201945b8386101561416057853561415181613b11565b8252948201949082019061413e565b9650508601359250508082111561417657600080fd5b50613f3985828601613e8c565b600081518084526020808501945080840160005b838110156141b357815187529582019590820190600101614197565b509495945050505050565b602081526000613b856020830184614183565b6000806000604084860312156141e657600080fd5b6141ef84613b8c565b925060208401356001600160401b0381111561420a57600080fd5b613d9386828701613ba8565b6000806000806060858703121561422c57600080fd5b61423585613f43565b935061424360208601613f43565b925060408501356001600160401b0381111561425e57600080fd5b61426a87828801613d14565b95989497509550505050565b60008060006060848603121561428b57600080fd5b833561429681613b11565b925060208401356001600160401b03808211156142b257600080fd5b6142be87838801613e8c565b935060408601359150808211156142d457600080fd5b506142e186828701613e8c565b9150509250925092565b60006001600160801b03808716835280861660208401528085166040840152506080606083015261431f6080830184613c81565b9695505050505050565b60008060008060008060008060e0898b03121561434557600080fd5b61434e89613b8c565b975060208901356001600160401b0381111561436957600080fd5b6143758b828c01613ba8565b9098509650614388905060408a01613b8c565b945061439660608a01613b8c565b93506143a460808a01613b8c565b92506143b260a08a01613b8c565b915060c0890135600381106143c657600080fd5b809150509295985092959890939650565b600080604083850312156143ea57600080fd5b82356143f581613b11565b91506020830135801515811461440a57600080fd5b809150509250929050565b6000806020838503121561442857600080fd5b82356001600160401b0381111561443e57600080fd5b61444a85828601613d14565b90969095509350505050565b6000806040838503121561446957600080fd5b823561447481613b11565b9150602083013561440a81613b11565b60006020828403121561449657600080fd5b813563ffffffff81168114613b8557600080fd5b600080600080600060a086880312156144c257600080fd5b85356144cd81613b11565b945060208601356144dd81613b11565b9350604086013592506060860135915060808601356001600160401b0381111561450657600080fd5b6140b488828901613fa1565b60006020828403121561452457600080fd5b8135613b8581613b11565b60008060006060848603121561454457600080fd5b833561454f81613b11565b95602085013595506040909401359392505050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561459457614594614564565b500290565b600082198211156145ac576145ac614564565b500190565b600181811c908216806145c557607f821691505b602082108114156145e657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b60006001600160401b0380831681851680830382111561462457614624614564565b01949350505050565b60006001600160801b0380831681851680830382111561462457614624614564565b60006001600160401b038083168181141561466c5761466c614564565b6001019392505050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006000198214156146b9576146b9614564565b5060010190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201526808185c1c1c9bdd995960ba1b606082015260800190565b60006020828403121561471b57600080fd5b8151613b8581613b11565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b6040815260006147816040830185614183565b82810360208401526147938185614183565b95945050505050565b6000826147b957634e487b7160e01b600052601260045260246000fd5b500690565b600061ffff8083168181141561466c5761466c614564565b6000602082840312156147e857600080fd5b5051919050565b60006001600160a01b03808816835280871660208401525060a0604083015261481b60a0830186614183565b828103606084015261482d8186614183565b905082810360808401526148418185613c81565b98975050505050505050565b60006020828403121561485f57600080fd5b8151613b8581613b52565b600060033d11156148835760046000803e5060005160e01c5b90565b600060443d10156148945790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156148c357505050505090565b82850191508151818111156148db5750505050505090565b843d87010160208285010111156148f55750505050505090565b61490460208286010187613e3d565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a0608083015261494760a0830184613c81565b97965050505050505056fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220c4911017cb27627e1ffff938c3d49947f1900829d3dc9f21709eed2a3102f2fb64736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000010000000000000000000000000069b9c98e8d715c25b330d0d4eb07e68cbb7f6cfc000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699098af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef0000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000002625a0000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000000000000000000000000000000000000000000553433a534a000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _symbol (string): SC:SJ
Arg [1] : _starsAddress (address): 0x69B9C98e8D715C25B330d0D4eB07e68CbB7F6CFC
Arg [2] : _vrfCoordinatorAddress (address): 0x271682DEB8C4E0901D1a1550aD2e64D568E69909
Arg [3] : _vrfKeyHash (bytes32): 0x8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef
Arg [4] : _vrfSubscriptionId (uint64): 86
Arg [5] : _vrfConfirmations (uint16): 3
Arg [6] : _vrfCallbackGasLimit (uint32): 2500000
Arg [7] : _link (address): 0x514910771AF9Ca656af840dff83E8264EcF986CA
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [1] : 00000000000000000000000069b9c98e8d715c25b330d0d4eb07e68cbb7f6cfc
Arg [2] : 000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Arg [3] : 8af398995b04c28e9951adb9721ef74c74f93e6a478f39e7e0777be13527e7ef
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000056
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [6] : 00000000000000000000000000000000000000000000000000000000002625a0
Arg [7] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [9] : 53433a534a000000000000000000000000000000000000000000000000000000
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.