Feature Tip: Add private address tag to any address under My Name Tag !
ERC-721
Overview
Max Total Supply
1,260 VOX4
Holders
590
Total Transfers
-
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:
VOXSeries4
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.11; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import "./BlackholePrevention.sol"; contract VOXSeries4 is ERC721, ERC721Enumerable, ERC721Burnable, AccessControl, ERC1155Receiver, Pausable, VRFConsumerBaseV2, BlackholePrevention { //events event onMinted(address beneficiary, uint256 tokenId); event onAllMinted( address beneficiary, uint256[] tokenIds, uint256 totalCount ); event onERC1155ReceivedExecuted( uint256 requestId, address from, uint256 value ); using Address for address payable; using Strings for uint256; struct MintRequest { address beneficiary; uint256 amount; } string public constant PROVENANCE = "0ba89c0f46c57b1c75918ee6f22525c04cbd1854c460ccfd678bead77b907163"; bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE"); uint256 public offset = 0; uint256 public maxSupply = 8888; uint256 public MAX_PURCHASE = 10; uint64 public saleStartTimestamp; address public erc1155Contract; uint256 public erc1155Token; //vrf settings bytes32 public vrfKeyHash; address public vrfCoordinator; uint16 public vrfConfirmationCount = 3; uint32 public vrfMaxGasLimit = 2500000; uint64 private vrfSubscriptionId; VRFCoordinatorV2Interface COORDINATOR; mapping(uint256 => MintRequest) public mintRequests; mapping(address => uint32) public pendingRequests; mapping(uint256 => uint256) public randomForwarder; uint256 public pending; constructor( uint64 _saleStartTimestamp, address _erc1155Contract, uint256 _erc1155Token, address _vrfCoordinator, bytes32 _vrfKeyhash, uint64 _vrfSubscriptionId ) ERC721("VOX Series 4: DreamWorks Trolls", "VOX4") VRFConsumerBaseV2(_vrfCoordinator) { saleStartTimestamp = _saleStartTimestamp; erc1155Contract = _erc1155Contract; erc1155Token = _erc1155Token; vrfKeyHash = _vrfKeyhash; vrfSubscriptionId = _vrfSubscriptionId; vrfCoordinator = _vrfCoordinator; COORDINATOR = VRFCoordinatorV2Interface(_vrfCoordinator); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(ADMIN_ROLE, msg.sender); } function onERC1155Received( address, address from, uint256 id, uint256 value, bytes memory ) public virtual override returns (bytes4) { require( block.timestamp >= saleStartTimestamp, "VOX Series 4: not started" ); require( msg.sender == erc1155Contract, "VOX Series 4: incorrect contract" ); require(id == erc1155Token, "VOX Series 4: incorrect token"); require(value > 0, "VOX Series 4: amount is zero"); require( value <= MAX_PURCHASE, "VOX Series 4: amount exceeds the max of exchange" ); require(from != address(0), "VOX Series 4: from is address(0)"); require(!paused(), "VOX Series 4: paused"); require( value + pending + totalSupply() <= maxSupply, "VOX Series 4: Cannot buy that many" ); uint256 requestId = COORDINATOR.requestRandomWords( vrfKeyHash, vrfSubscriptionId, vrfConfirmationCount, vrfMaxGasLimit, uint32(value) ); mintRequests[requestId] = MintRequest(from, value); pendingRequests[from] += uint32(value); pending += value; emit onERC1155ReceivedExecuted(requestId, from, value); return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public pure override returns (bytes4) { revert("VOX Series 4: Not allowed"); } function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { MintRequest memory request = mintRequests[requestId]; require( request.beneficiary != address(0), "VOX Series 4: Invalid request" ); uint256 remaining = maxSupply - totalSupply(); require(remaining >= request.amount, "VOX Series 4: Not enough NFTs"); uint256[] memory newTokenIds = new uint256[](request.amount); for (uint256 i = 0; i < request.amount; i++) { uint256 newId = (randomWords[i] % remaining); uint256 newTokenId = randomForwarder[newId] > 0 ? randomForwarder[newId] : newId; randomForwarder[newId] = randomForwarder[remaining - 1] > 0 ? randomForwarder[remaining - 1] : remaining - 1; _safeMint(request.beneficiary, newTokenId); newTokenIds[i] = newTokenId; emit onMinted(request.beneficiary, newTokenId); remaining--; } delete mintRequests[requestId]; pendingRequests[request.beneficiary] -= uint32(request.amount); pending -= request.amount; emit onAllMinted(request.beneficiary, newTokenIds, newTokenIds.length); } function _baseURI() internal pure override returns (string memory) { return "https://collectvox.com/metadata/trolls/"; } function pause() external onlyRole(ADMIN_ROLE) { _pause(); } function unpause() external onlyRole(ADMIN_ROLE) { _unpause(); } function updateVrfKeyHash(bytes32 _vrfKeyHash) external onlyRole(DEFAULT_ADMIN_ROLE) { vrfKeyHash = _vrfKeyHash; } function updateVrfSubscriptionId(uint64 _vrfSubscriptionId) external onlyRole(DEFAULT_ADMIN_ROLE) { vrfSubscriptionId = _vrfSubscriptionId; } function updateVrfConfirmationCount(uint16 _vrfConfirmationCount) public onlyRole(DEFAULT_ADMIN_ROLE) { vrfConfirmationCount = _vrfConfirmationCount; } function updateVrfMaxGasLimit(uint32 _vrfMaxGasLimit) public onlyRole(DEFAULT_ADMIN_ROLE) { vrfMaxGasLimit = _vrfMaxGasLimit; } function getVrfSubscriptionId() public view onlyRole(DEFAULT_ADMIN_ROLE) returns (uint64) { return vrfSubscriptionId; } function getPendingRequests(address addr) public view returns (uint32) { return pendingRequests[addr]; } function withdrawEther(address payable receiver, uint256 amount) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { _withdrawEther(receiver, amount); } function withdrawERC20( address payable receiver, address tokenAddress, uint256 amount ) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { _withdrawERC20(receiver, tokenAddress, amount); } function withdrawERC721( address payable receiver, address tokenAddress, uint256 _tokenId ) external virtual onlyRole(DEFAULT_ADMIN_ROLE) { _withdrawERC721(receiver, tokenAddress, _tokenId); } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC1155Receiver, ERC721Enumerable, AccessControl) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override(ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); } function setSaleStartDateTime(uint64 _saleStartTimestamp) public onlyRole(DEFAULT_ADMIN_ROLE) { saleStartTimestamp = _saleStartTimestamp; } function setMaxPurchase(uint256 _MAX_PURCHASE) public onlyRole(ADMIN_ROLE) { MAX_PURCHASE = _MAX_PURCHASE; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; // for WETH import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; /** * @notice Prevents ETH or Tokens from getting stuck in a contract by allowing * the Owner/DAO to pull them out on behalf of a user * This is only meant to contracts that are not expected to hold tokens, but do handle transferring them. */ contract BlackholePrevention { using Address for address payable; using SafeERC20 for IERC20; event WithdrawStuckEther(address indexed receiver, uint256 amount); event WithdrawStuckERC20( address indexed receiver, address indexed tokenAddress, uint256 amount ); event WithdrawStuckERC721( address indexed receiver, address indexed tokenAddress, uint256 indexed tokenId ); event WithdrawStuckERC1155( address indexed tokenAddress, address indexed to, uint256 indexed _erc1155TokenId, uint256 amount ); function _withdrawEther(address payable receiver, uint256 amount) internal virtual { require(receiver != address(0x0), "BHP:E-403"); if (address(this).balance >= amount) { receiver.sendValue(amount); emit WithdrawStuckEther(receiver, amount); } } function _withdrawERC20( address payable receiver, address tokenAddress, uint256 amount ) internal virtual { require(receiver != address(0x0), "BHP:E-403"); if (IERC20(tokenAddress).balanceOf(address(this)) >= amount) { IERC20(tokenAddress).safeTransfer(receiver, amount); emit WithdrawStuckERC20(receiver, tokenAddress, amount); } } function _withdrawERC721( address payable receiver, address tokenAddress, uint256 tokenId ) internal virtual { require(receiver != address(0x0), "BHP:E-403"); if (IERC721(tokenAddress).ownerOf(tokenId) == address(this)) { IERC721(tokenAddress).transferFrom( address(this), receiver, tokenId ); emit WithdrawStuckERC721(receiver, tokenAddress, tokenId); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (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 Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) 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 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 pragma solidity ^0.8.4; /** **************************************************************************** * @notice Interface for contracts using VRF randomness * ***************************************************************************** * @dev PURPOSE * * @dev Reggie the Random Oracle (not his real job) wants to provide randomness * @dev to Vera the verifier in such a way that Vera can be sure he's not * @dev making his output up to suit himself. Reggie provides Vera a public key * @dev to which he knows the secret key. Each time Vera provides a seed to * @dev Reggie, he gives back a value which is computed completely * @dev deterministically from the seed and the secret key. * * @dev Reggie provides a proof by which Vera can verify that the output was * @dev correctly computed once Reggie tells it to her, but without that proof, * @dev the output is indistinguishable to her from a uniform random sample * @dev from the output space. * * @dev The purpose of this contract is to make it easy for unrelated contracts * @dev to talk to Vera the verifier about the work Reggie is doing, to provide * @dev simple access to a verifiable source of randomness. It ensures 2 things: * @dev 1. The fulfillment came from the VRFCoordinator * @dev 2. The consumer contract implements fulfillRandomWords. * ***************************************************************************** * @dev USAGE * * @dev Calling contracts must inherit from VRFConsumerBase, and can * @dev initialize VRFConsumerBase's attributes in their constructor as * @dev shown: * * @dev contract VRFConsumer { * @dev constructor(<other arguments>, address _vrfCoordinator, address _link) * @dev VRFConsumerBase(_vrfCoordinator) public { * @dev <initialization with other arguments goes here> * @dev } * @dev } * * @dev The oracle will have given you an ID for the VRF keypair they have * @dev committed to (let's call it keyHash). Create subscription, fund it * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface * @dev subscription management functions). * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations, * @dev callbackGasLimit, numWords), * @dev see (VRFCoordinatorInterface for a description of the arguments). * * @dev Once the VRFCoordinator has received and validated the oracle's response * @dev to your request, it will call your contract's fulfillRandomWords method. * * @dev The randomness argument to fulfillRandomWords is a set of random words * @dev generated from your requestId and the blockHash of the request. * * @dev If your contract could have concurrent requests open, you can use the * @dev requestId returned from requestRandomWords to track which response is associated * @dev with which randomness request. * @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind, * @dev if your contract could have multiple requests in flight simultaneously. * * @dev Colliding `requestId`s are cryptographically impossible as long as seeds * @dev differ. * * ***************************************************************************** * @dev SECURITY CONSIDERATIONS * * @dev A method with the ability to call your fulfillRandomness method directly * @dev could spoof a VRF response with any random value, so it's critical that * @dev it cannot be directly called by anything other than this base contract * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method). * * @dev For your users to trust that your contract's random behavior is free * @dev from malicious interference, it's best if you can write it so that all * @dev behaviors implied by a VRF response are executed *during* your * @dev fulfillRandomness method. If your contract must store the response (or * @dev anything derived from it) and use it later, you must ensure that any * @dev user-significant behavior which depends on that stored value cannot be * @dev manipulated by a subsequent VRF request. * * @dev Similarly, both miners and the VRF oracle itself have some influence * @dev over the order in which VRF responses appear on the blockchain, so if * @dev your contract could have multiple VRF requests in flight simultaneously, * @dev you must ensure that the order in which the VRF responses arrive cannot * @dev be used to manipulate your contract's user-significant behavior. * * @dev Since the block hash of the block which contains the requestRandomness * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful * @dev miner could, in principle, fork the blockchain to evict the block * @dev containing the request, forcing the request to be included in a * @dev different block with a different hash, and therefore a different input * @dev to the VRF. However, such an attack would incur a substantial economic * @dev cost. This cost scales with the number of blocks the VRF oracle waits * @dev until it calls responds to a request. It is for this reason that * @dev that you can signal to an oracle you'd like them to wait longer before * @dev responding to the request (however this is not enforced in the contract * @dev and so remains effective only in the case of unmodified oracle software). */ abstract contract VRFConsumerBaseV2 { error OnlyCoordinatorCanFulfill(address have, address want); address private immutable vrfCoordinator; /** * @param _vrfCoordinator address of VRFCoordinator contract */ constructor(address _vrfCoordinator) { vrfCoordinator = _vrfCoordinator; } /** * @notice fulfillRandomness handles the VRF response. Your contract must * @notice implement it. See "SECURITY CONSIDERATIONS" above for important * @notice principles to keep in mind when implementing your fulfillRandomness * @notice method. * * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this * @dev signature, and will call it once it has verified the proof * @dev associated with the randomness. (It is triggered via a call to * @dev rawFulfillRandomness, below.) * * @param requestId The Id initially returned by requestRandomness * @param randomWords the VRF output expanded to the requested number of words */ function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual; // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF // proof. rawFulfillRandomness then calls fulfillRandomness, after validating // the origin of the call function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external { if (msg.sender != vrfCoordinator) { revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator); } fulfillRandomWords(requestId, randomWords); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/extensions/ERC721Burnable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../../utils/Context.sol"; /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be burned (destroyed). */ abstract contract ERC721Burnable is Context, ERC721 { /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _burn(tokenId); } }
// 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 // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) pragma solidity ^0.8.0; import "../IERC1155Receiver.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // 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); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// 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 (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (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. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint64","name":"_saleStartTimestamp","type":"uint64"},{"internalType":"address","name":"_erc1155Contract","type":"address"},{"internalType":"uint256","name":"_erc1155Token","type":"uint256"},{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"bytes32","name":"_vrfKeyhash","type":"bytes32"},{"internalType":"uint64","name":"_vrfSubscriptionId","type":"uint64"}],"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":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_erc1155TokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawStuckERC1155","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawStuckERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"WithdrawStuckERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawStuckEther","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"totalCount","type":"uint256"}],"name":"onAllMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"requestId","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"onERC1155ReceivedExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"onMinted","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PURCHASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROVENANCE","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"erc1155Contract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"erc1155Token","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"getPendingRequests","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVrfSubscriptionId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintRequests","outputs":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"offset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pending","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"pendingRequests","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"randomForwarder","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleStartTimestamp","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_MAX_PURCHASE","type":"uint256"}],"name":"setMaxPurchase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_saleStartTimestamp","type":"uint64"}],"name":"setSaleStartDateTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_vrfConfirmationCount","type":"uint16"}],"name":"updateVrfConfirmationCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_vrfKeyHash","type":"bytes32"}],"name":"updateVrfKeyHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_vrfMaxGasLimit","type":"uint32"}],"name":"updateVrfMaxGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_vrfSubscriptionId","type":"uint64"}],"name":"updateVrfSubscriptionId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vrfConfirmationCount","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfCoordinator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfKeyHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfMaxGasLimit","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"withdrawERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawEther","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040526000600c556122b8600d55600a600e556012805465ffffffffffff60a01b1916642625a0000360a01b1790553480156200003d57600080fd5b5060405162003d9138038062003d91833981016040819052620000609162000285565b826040518060400160405280601f81526020017f564f582053657269657320343a20447265616d576f726b732054726f6c6c7300815250604051806040016040528060048152602001631593d60d60e21b8152508160009081620000c5919062000399565b506001620000d4828262000399565b5050600b805460ff19169055506001600160a01b03908116608052600f80546001600160401b038981166001600160e01b031992831617680100000000000000008a86168102919091179093556010889055601186905560138054601280546001600160a01b031916968a169687179055918616919092161792909102919091179055620001646000336200019c565b620001907fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533620001ac565b50505050505062000465565b620001a88282620001ac565b5050565b6000828152600a602090815260408083206001600160a01b038516845290915290205460ff16620001a8576000828152600a602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200020c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b80516001600160401b03811681146200026857600080fd5b919050565b80516001600160a01b03811681146200026857600080fd5b60008060008060008060c087890312156200029f57600080fd5b620002aa8762000250565b9550620002ba602088016200026d565b945060408701519350620002d1606088016200026d565b925060808701519150620002e860a0880162000250565b90509295509295509295565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200031f57607f821691505b6020821081036200034057634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200039457600081815260208120601f850160051c810160208610156200036f5750805b601f850160051c820191505b8181101562000390578281556001016200037b565b5050505b505050565b81516001600160401b03811115620003b557620003b5620002f4565b620003cd81620003c684546200030a565b8462000346565b602080601f831160018114620004055760008415620003ec5750858301515b600019600386901b1c1916600185901b17855562000390565b600085815260208120601f198616915b82811015620004365788860151825594840194600190910190840162000415565b5085821015620004555787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080516139096200048860003960008181610ac90152610b0b01526139096000f3fe608060405234801561001057600080fd5b50600436106103785760003560e01c806371189742116101d3578063b8cc7cc211610104578063d5abeb01116100a2578063ea9d36cc1161007c578063ea9d36cc146107f4578063f05bfa7b14610807578063f23a6e6114610836578063fb22e6511461084957600080fd5b8063d5abeb01146107a6578063e20ccec3146107af578063e985e9c5146107b857600080fd5b8063c3fde3db116100de578063c3fde3db14610764578063c87b56dd14610777578063d547741f1461078a578063d55565441461079d57600080fd5b8063b8cc7cc214610708578063ba1c62f314610730578063bc197c811461073857600080fd5b806391d1485411610171578063a217fddf1161014b578063a217fddf146106c7578063a22cb465146106cf578063a3e56fa8146106e2578063b88d4fde146106f557600080fd5b806391d148541461069957806395d89b41146106ac57806398264fa6146106b457600080fd5b80637a564970116101ad5780637a564970146106515780637e85a07c1461066b5780638456cb591461067e5780638727ab171461068657600080fd5b806371189742146106205780637146bd081461063357806375b238fc1461063c57600080fd5b80633f4ba83a116102ad578063522f68151161024b5780636352211e116102255780636352211e146105d25780636373a6b1146105e557806368d5c5d7146105ed57806370a082311461060d57600080fd5b8063522f6815146105885780635c975abb1461059b5780635ffc07fd146105a657600080fd5b806342842e0e1161028757806342842e0e1461053c57806342966c681461054f57806344004cc1146105625780634f6ccce71461057557600080fd5b80633f4ba83a146104cf5780634025feb2146104d7578063424e6575146104ea57600080fd5b806321f422681161031a5780632f2ff15d116102f45780632f2ff15d1461046b5780632f745c591461047e57806336568abe146104915780633c276d86146104a457600080fd5b806321f422681461042c57806323b872dd14610435578063248a9ca31461044857600080fd5b8063081812fc11610356578063081812fc146103d1578063095ea7b3146103fc57806318160ddd146104115780631fe543e31461041957600080fd5b806301ffc9a71461037d578063041d443e146103a557806306fdde03146103bc575b600080fd5b61039061038b366004612f21565b61086f565b60405190151581526020015b60405180910390f35b6103ae60115481565b60405190815260200161039c565b6103c46108eb565b60405161039c9190612f8e565b6103e46103df366004612fa1565b61097d565b6040516001600160a01b03909116815260200161039c565b61040f61040a366004612fcf565b6109a4565b005b6008546103ae565b61040f6104273660046130b5565b610abe565b6103ae60105481565b61040f6104433660046130fb565b610b46565b6103ae610456366004612fa1565b6000908152600a602052604090206001015490565b61040f61047936600461313c565b610b78565b6103ae61048c366004612fcf565b610b9d565b61040f61049f36600461313c565b610c33565b600f546104b7906001600160401b031681565b6040516001600160401b03909116815260200161039c565b61040f610cad565b61040f6104e53660046130fb565b610cd0565b61051d6104f8366004612fa1565b601460205260009081526040902080546001909101546001600160a01b039091169082565b604080516001600160a01b03909316835260208301919091520161039c565b61040f61054a3660046130fb565b610cec565b61040f61055d366004612fa1565b610d07565b61040f6105703660046130fb565b610d35565b6103ae610583366004612fa1565b610d4b565b61040f610596366004612fcf565b610dde565b600b5460ff16610390565b6012546105bd90600160b01b900463ffffffff1681565b60405163ffffffff909116815260200161039c565b6103e46105e0366004612fa1565b610df3565b6103c4610e53565b6103ae6105fb366004612fa1565b60166020526000908152604090205481565b6103ae61061b36600461316c565b610e6f565b61040f61062e366004612fa1565b610ef5565b6103ae600e5481565b6103ae60008051602061384d83398151915281565b600f546103e490600160401b90046001600160a01b031681565b61040f610679366004613189565b610f13565b61040f610f41565b61040f6106943660046131ad565b610f61565b6103906106a736600461313c565b610f93565b6103c4610fbe565b61040f6106c2366004612fa1565b610fcd565b6103ae600081565b61040f6106dd3660046131e1565b610fde565b6012546103e4906001600160a01b031681565b61040f61070336600461327e565b610fe9565b60125461071d90600160a01b900461ffff1681565b60405161ffff909116815260200161039c565b6104b761101b565b61074b6107463660046132e9565b611038565b6040516001600160e01b0319909116815260200161039c565b61040f610772366004613396565b611083565b6103c4610785366004612fa1565b6110b2565b61040f61079836600461313c565b611119565b6103ae600c5481565b6103ae600d5481565b6103ae60175481565b6103906107c63660046133bf565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61040f610802366004613396565b61113e565b6105bd61081536600461316c565b6001600160a01b031660009081526015602052604090205463ffffffff1690565b61074b6108443660046133ed565b61116d565b6105bd61085736600461316c565b60156020526000908152604090205463ffffffff1681565b60006001600160e01b03198216630271189760e51b14806108a057506001600160e01b031982166380ac58cd60e01b145b806108bb57506001600160e01b03198216635b5e139f60e01b145b806108d657506001600160e01b03198216637965db0b60e01b145b806108e557506108e582611607565b92915050565b6060600080546108fa90613455565b80601f016020809104026020016040519081016040528092919081815260200182805461092690613455565b80156109735780601f1061094857610100808354040283529160200191610973565b820191906000526020600020905b81548152906001019060200180831161095657829003601f168201915b5050505050905090565b60006109888261162c565b506000908152600460205260409020546001600160a01b031690565b60006109af82610df3565b9050806001600160a01b0316836001600160a01b031603610a215760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610a3d5750610a3d81336107c6565b610aaf5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610a18565b610ab9838361168b565b505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b385760405163073e64fd60e21b81523360048201526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166024820152604401610a18565b610b4282826116f9565b5050565b610b51335b82611a67565b610b6d5760405162461bcd60e51b8152600401610a189061348f565b610ab9838383611ae6565b6000828152600a6020526040902060010154610b9381611c8d565b610ab98383611c97565b6000610ba883610e6f565b8210610c0a5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610a18565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6001600160a01b0381163314610ca35760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610a18565b610b428282611d1d565b60008051602061384d833981519152610cc581611c8d565b610ccd611d84565b50565b6000610cdb81611c8d565b610ce6848484611dd6565b50505050565b610ab983838360405180602001604052806000815250610fe9565b610d1033610b4b565b610d2c5760405162461bcd60e51b8152600401610a189061348f565b610ccd81611f23565b6000610d4081611c8d565b610ce6848484611fca565b6000610d5660085490565b8210610db95760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610a18565b60088281548110610dcc57610dcc6134dd565b90600052602060002001549050919050565b6000610de981611c8d565b610ab983836120c5565b6000818152600260205260408120546001600160a01b0316806108e55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610a18565b6040518060600160405280604081526020016138946040913981565b60006001600160a01b038216610ed95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610a18565b506001600160a01b031660009081526003602052604090205490565b60008051602061384d833981519152610f0d81611c8d565b50600e55565b6000610f1e81611c8d565b506012805461ffff909216600160a01b0261ffff60a01b19909216919091179055565b60008051602061384d833981519152610f5981611c8d565b610ccd61214b565b6000610f6c81611c8d565b506012805463ffffffff909216600160b01b0263ffffffff60b01b19909216919091179055565b6000918252600a602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600180546108fa90613455565b6000610fd881611c8d565b50601155565b610b42338383612188565b610ff33383611a67565b61100f5760405162461bcd60e51b8152600401610a189061348f565b610ce68484848461224e565b60008061102781611c8d565b50506013546001600160401b031690565b60405162461bcd60e51b815260206004820152601960248201527f564f582053657269657320343a204e6f7420616c6c6f776564000000000000006044820152600090606401610a18565b600061108e81611c8d565b506013805467ffffffffffffffff19166001600160401b0392909216919091179055565b60606110bd8261162c565b60006110c7612281565b905060008151116110e75760405180602001604052806000815250611112565b806110f1846122a1565b6040516020016111029291906134f3565b6040516020818303038152906040525b9392505050565b6000828152600a602052604090206001015461113481611c8d565b610ab98383611d1d565b600061114981611c8d565b50600f805467ffffffffffffffff19166001600160401b0392909216919091179055565b600f546000906001600160401b03164210156111cb5760405162461bcd60e51b815260206004820152601960248201527f564f582053657269657320343a206e6f742073746172746564000000000000006044820152606401610a18565b600f54600160401b90046001600160a01b0316331461122c5760405162461bcd60e51b815260206004820181905260248201527f564f582053657269657320343a20696e636f727265637420636f6e74726163746044820152606401610a18565b601054841461127d5760405162461bcd60e51b815260206004820152601d60248201527f564f582053657269657320343a20696e636f727265637420746f6b656e0000006044820152606401610a18565b600083116112cd5760405162461bcd60e51b815260206004820152601c60248201527f564f582053657269657320343a20616d6f756e74206973207a65726f000000006044820152606401610a18565b600e548311156113385760405162461bcd60e51b815260206004820152603060248201527f564f582053657269657320343a20616d6f756e7420657863656564732074686560448201526f206d6178206f662065786368616e676560801b6064820152608401610a18565b6001600160a01b03851661138e5760405162461bcd60e51b815260206004820181905260248201527f564f582053657269657320343a2066726f6d20697320616464726573732830296044820152606401610a18565b600b5460ff16156113d85760405162461bcd60e51b81526020600482015260146024820152731593d60814d95c9a595cc80d0e881c185d5cd95960621b6044820152606401610a18565b600d546008546017546113eb9086613538565b6113f59190613538565b111561144e5760405162461bcd60e51b815260206004820152602260248201527f564f582053657269657320343a2043616e6e6f74206275792074686174206d616044820152616e7960f01b6064820152608401610a18565b6013546011546012546040516305d3b1d360e41b815260048101929092526001600160401b0383166024830152600160a01b810461ffff166044830152600160b01b900463ffffffff908116606483015285166084820152600091600160401b90046001600160a01b031690635d3b1d309060a4016020604051808303816000875af11580156114e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611506919061354b565b6040805180820182526001600160a01b0389811680835260208084018a8152600087815260148352868120955186546001600160a01b031916951694909417855551600190940193909355815260159091529081208054929350869290919061157690849063ffffffff16613564565b92506101000a81548163ffffffff021916908363ffffffff16021790555083601760008282546115a69190613538565b9091555050604080518281526001600160a01b03881660208201529081018590527f6e67d52a6deec37ea0760af8c17d9a6c94f902dc418444a34b4ceaef124449e39060600160405180910390a15063f23a6e6160e01b9695505050505050565b60006001600160e01b03198216630271189760e51b14806108e557506108e5826123a1565b6000818152600260205260409020546001600160a01b0316610ccd5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610a18565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906116c082610df3565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082815260146020908152604091829020825180840190935280546001600160a01b03168084526001909101549183019190915261177a5760405162461bcd60e51b815260206004820152601d60248201527f564f582053657269657320343a20496e76616c696420726571756573740000006044820152606401610a18565b600061178560085490565b600d546117929190613588565b905081602001518110156117e85760405162461bcd60e51b815260206004820152601d60248201527f564f582053657269657320343a204e6f7420656e6f756768204e4654730000006044820152606401610a18565b600082602001516001600160401b0381111561180657611806612ffb565b60405190808252806020026020018201604052801561182f578160200160208202803683370190505b50905060005b836020015181101561199357600083868381518110611856576118566134dd565b602002602001015161186891906135b1565b600081815260166020526040812054919250906118855781611895565b6000828152601660205260409020545b905060006016816118a7600189613588565b815260200190815260200160002054116118cb576118c6600186613588565b6118ea565b601660006118da600188613588565b8152602001908152602001600020545b600083815260166020526040902055855161190590826123c6565b80848481518110611918576119186134dd565b602090810291909101015285516040517ff67ae65072ad205c93de02aea1573c91bafbb7205bd9481f5cf8cd76108bf04e916119699184906001600160a01b03929092168252602082015260400190565b60405180910390a18461197b816135c5565b9550505050808061198b906135dc565b915050611835565b50600085815260146020908152604080832080546001600160a01b03191681556001018390558582015186516001600160a01b03168452601590925282208054919290916119e890849063ffffffff166135f5565b92506101000a81548163ffffffff021916908363ffffffff160217905550826020015160176000828254611a1c9190613588565b9091555050825181516040517f834e7bfae8ef248f3c67003f793b500af4839a49d0cc399e6ae1d7ddf7e16b1f92611a58929091859190613612565b60405180910390a15050505050565b600080611a7383610df3565b9050806001600160a01b0316846001600160a01b03161480611aba57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80611ade5750836001600160a01b0316611ad38461097d565b6001600160a01b0316145b949350505050565b826001600160a01b0316611af982610df3565b6001600160a01b031614611b5d5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610a18565b6001600160a01b038216611bbf5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a18565b611bca8383836123e0565b611bd560008261168b565b6001600160a01b0383166000908152600360205260408120805460019290611bfe908490613588565b90915550506001600160a01b0382166000908152600360205260408120805460019290611c2c908490613538565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610ccd81336123eb565b611ca18282610f93565b610b42576000828152600a602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611cd93390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611d278282610f93565b15610b42576000828152600a602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b611d8c61244f565b600b805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038316611dfc5760405162461bcd60e51b8152600401610a1890613671565b6040516331a9108f60e11b81526004810182905230906001600160a01b03841690636352211e90602401602060405180830381865afa158015611e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e679190613694565b6001600160a01b031603610ab9576040516323b872dd60e01b81523060048201526001600160a01b038481166024830152604482018390528316906323b872dd90606401600060405180830381600087803b158015611ec557600080fd5b505af1158015611ed9573d6000803e3d6000fd5b5050505080826001600160a01b0316846001600160a01b03167ffefe036cac4ee3a4aca074a81cbcc4376e1484693289078dbec149c890101d5b60405160405180910390a4505050565b6000611f2e82610df3565b9050611f3c816000846123e0565b611f4760008361168b565b6001600160a01b0381166000908152600360205260408120805460019290611f70908490613588565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6001600160a01b038316611ff05760405162461bcd60e51b8152600401610a1890613671565b6040516370a0823160e01b815230600482015281906001600160a01b038416906370a0823190602401602060405180830381865afa158015612036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205a919061354b565b10610ab9576120736001600160a01b038316848361249a565b816001600160a01b0316836001600160a01b03167f6c9d637297625e945b296ff73a71fcfbd0a9e062652b6491a921c4c60194176b836040516120b891815260200190565b60405180910390a3505050565b6001600160a01b0382166120eb5760405162461bcd60e51b8152600401610a1890613671565b804710610b42576121056001600160a01b038316826124ec565b816001600160a01b03167eddb683bb45cd5d0ad8a200c6fae7152b1c236ee90a4a37db692407f5cc38bd8260405161213f91815260200190565b60405180910390a25050565b612153612605565b600b805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611db93390565b816001600160a01b0316836001600160a01b0316036121e95760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610a18565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191016120b8565b612259848484611ae6565b6122658484848461264b565b610ce65760405162461bcd60e51b8152600401610a18906136b1565b606060405180606001604052806027815260200161386d60279139905090565b6060816000036122c85750506040805180820190915260018152600360fc1b602082015290565b8160005b81156122f257806122dc816135dc565b91506122eb9050600a83613703565b91506122cc565b6000816001600160401b0381111561230c5761230c612ffb565b6040519080825280601f01601f191660200182016040528015612336576020820181803683370190505b5090505b8415611ade5761234b600183613588565b9150612358600a866135b1565b612363906030613538565b60f81b818381518110612378576123786134dd565b60200101906001600160f81b031916908160001a90535061239a600a86613703565b945061233a565b60006001600160e01b03198216637965db0b60e01b14806108e557506108e58261274c565b610b42828260405180602001604052806000815250612771565b610ab98383836127a4565b6123f58282610f93565b610b425761240d816001600160a01b0316601461285c565b61241883602061285c565b604051602001612429929190613717565b60408051601f198184030181529082905262461bcd60e51b8252610a1891600401612f8e565b600b5460ff166124985760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610a18565b565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ab99084906129f7565b8047101561253c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a18565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612589576040519150601f19603f3d011682016040523d82523d6000602084013e61258e565b606091505b5050905080610ab95760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610a18565b600b5460ff16156124985760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610a18565b60006001600160a01b0384163b1561274157604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061268f90339089908890889060040161378c565b6020604051808303816000875af19250505080156126ca575060408051601f3d908101601f191682019092526126c7918101906137c9565b60015b612727573d8080156126f8576040519150601f19603f3d011682016040523d82523d6000602084013e6126fd565b606091505b50805160000361271f5760405162461bcd60e51b8152600401610a18906136b1565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611ade565b506001949350505050565b60006001600160e01b0319821663780e9d6360e01b14806108e557506108e582612ac9565b61277b8383612b19565b612788600084848461264b565b610ab95760405162461bcd60e51b8152600401610a18906136b1565b6001600160a01b0383166127ff576127fa81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612822565b816001600160a01b0316836001600160a01b031614612822576128228382612c67565b6001600160a01b03821661283957610ab981612d04565b826001600160a01b0316826001600160a01b031614610ab957610ab98282612db3565b6060600061286b8360026137e6565b612876906002613538565b6001600160401b0381111561288d5761288d612ffb565b6040519080825280601f01601f1916602001820160405280156128b7576020820181803683370190505b509050600360fc1b816000815181106128d2576128d26134dd565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612901576129016134dd565b60200101906001600160f81b031916908160001a90535060006129258460026137e6565b612930906001613538565b90505b60018111156129a8576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612964576129646134dd565b1a60f81b82828151811061297a5761297a6134dd565b60200101906001600160f81b031916908160001a90535060049490941c936129a1816135c5565b9050612933565b5083156111125760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a18565b6000612a4c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612df79092919063ffffffff16565b805190915015610ab95780806020019051810190612a6a91906137fd565b610ab95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a18565b60006001600160e01b031982166380ac58cd60e01b1480612afa57506001600160e01b03198216635b5e139f60e01b145b806108e557506301ffc9a760e01b6001600160e01b03198316146108e5565b6001600160a01b038216612b6f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a18565b6000818152600260205260409020546001600160a01b031615612bd45760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a18565b612be0600083836123e0565b6001600160a01b0382166000908152600360205260408120805460019290612c09908490613538565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001612c7484610e6f565b612c7e9190613588565b600083815260076020526040902054909150808214612cd1576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090612d1690600190613588565b60008381526009602052604081205460088054939450909284908110612d3e57612d3e6134dd565b906000526020600020015490508060088381548110612d5f57612d5f6134dd565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612d9757612d9761381a565b6001900381819060005260206000200160009055905550505050565b6000612dbe83610e6f565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6060611ade8484600085856001600160a01b0385163b612e595760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a18565b600080866001600160a01b03168587604051612e759190613830565b60006040518083038185875af1925050503d8060008114612eb2576040519150601f19603f3d011682016040523d82523d6000602084013e612eb7565b606091505b5091509150612ec7828286612ed2565b979650505050505050565b60608315612ee1575081611112565b825115612ef15782518084602001fd5b8160405162461bcd60e51b8152600401610a189190612f8e565b6001600160e01b031981168114610ccd57600080fd5b600060208284031215612f3357600080fd5b813561111281612f0b565b60005b83811015612f59578181015183820152602001612f41565b50506000910152565b60008151808452612f7a816020860160208601612f3e565b601f01601f19169290920160200192915050565b6020815260006111126020830184612f62565b600060208284031215612fb357600080fd5b5035919050565b6001600160a01b0381168114610ccd57600080fd5b60008060408385031215612fe257600080fd5b8235612fed81612fba565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561303957613039612ffb565b604052919050565b600082601f83011261305257600080fd5b813560206001600160401b0382111561306d5761306d612ffb565b8160051b61307c828201613011565b928352848101820192828101908785111561309657600080fd5b83870192505b84831015612ec75782358252918301919083019061309c565b600080604083850312156130c857600080fd5b8235915060208301356001600160401b038111156130e557600080fd5b6130f185828601613041565b9150509250929050565b60008060006060848603121561311057600080fd5b833561311b81612fba565b9250602084013561312b81612fba565b929592945050506040919091013590565b6000806040838503121561314f57600080fd5b82359150602083013561316181612fba565b809150509250929050565b60006020828403121561317e57600080fd5b813561111281612fba565b60006020828403121561319b57600080fd5b813561ffff8116811461111257600080fd5b6000602082840312156131bf57600080fd5b813563ffffffff8116811461111257600080fd5b8015158114610ccd57600080fd5b600080604083850312156131f457600080fd5b82356131ff81612fba565b91506020830135613161816131d3565b600082601f83011261322057600080fd5b81356001600160401b0381111561323957613239612ffb565b61324c601f8201601f1916602001613011565b81815284602083860101111561326157600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561329457600080fd5b843561329f81612fba565b935060208501356132af81612fba565b92506040850135915060608501356001600160401b038111156132d157600080fd5b6132dd8782880161320f565b91505092959194509250565b600080600080600060a0868803121561330157600080fd5b853561330c81612fba565b9450602086013561331c81612fba565b935060408601356001600160401b038082111561333857600080fd5b61334489838a01613041565b9450606088013591508082111561335a57600080fd5b61336689838a01613041565b9350608088013591508082111561337c57600080fd5b506133898882890161320f565b9150509295509295909350565b6000602082840312156133a857600080fd5b81356001600160401b038116811461111257600080fd5b600080604083850312156133d257600080fd5b82356133dd81612fba565b9150602083013561316181612fba565b600080600080600060a0868803121561340557600080fd5b853561341081612fba565b9450602086013561342081612fba565b9350604086013592506060860135915060808601356001600160401b0381111561344957600080fd5b6133898882890161320f565b600181811c9082168061346957607f821691505b60208210810361348957634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60008351613505818460208801612f3e565b835190830190613519818360208801612f3e565b01949350505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156108e5576108e5613522565b60006020828403121561355d57600080fd5b5051919050565b63ffffffff81811683821601908082111561358157613581613522565b5092915050565b818103818111156108e5576108e5613522565b634e487b7160e01b600052601260045260246000fd5b6000826135c0576135c061359b565b500690565b6000816135d4576135d4613522565b506000190190565b6000600182016135ee576135ee613522565b5060010190565b63ffffffff82811682821603908082111561358157613581613522565b6001600160a01b038416815260606020808301829052845191830182905260009185820191906080850190845b8181101561365b5784518352938301939183019160010161363f565b5050809350505050826040830152949350505050565b6020808252600990820152684248503a452d34303360b81b604082015260600190565b6000602082840312156136a657600080fd5b815161111281612fba565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000826137125761371261359b565b500490565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161374f816017850160208801612f3e565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613780816028840160208801612f3e565b01602801949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906137bf90830184612f62565b9695505050505050565b6000602082840312156137db57600080fd5b815161111281612f0b565b80820281158282048414176108e5576108e5613522565b60006020828403121561380f57600080fd5b8151611112816131d3565b634e487b7160e01b600052603160045260246000fd5b60008251613842818460208701612f3e565b919091019291505056fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177568747470733a2f2f636f6c6c656374766f782e636f6d2f6d657461646174612f74726f6c6c732f30626138396330663436633537623163373539313865653666323235323563303463626431383534633436306363666436373862656164373762393037313633a2646970667358221220d697884384d33893daebcd07aa04b28d2a39ff062ff3d180c6279c78019c86a964736f6c63430008110033000000000000000000000000000000000000000000000000000000006363f39000000000000000000000000056f13a5385b33f7db926ceb9d17799672355e0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699099fe0eebf5e446e3c998ec9bb19951541aee00bb90ea201ae456421a2ded86805000000000000000000000000000000000000000000000000000000000000001d
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103785760003560e01c806371189742116101d3578063b8cc7cc211610104578063d5abeb01116100a2578063ea9d36cc1161007c578063ea9d36cc146107f4578063f05bfa7b14610807578063f23a6e6114610836578063fb22e6511461084957600080fd5b8063d5abeb01146107a6578063e20ccec3146107af578063e985e9c5146107b857600080fd5b8063c3fde3db116100de578063c3fde3db14610764578063c87b56dd14610777578063d547741f1461078a578063d55565441461079d57600080fd5b8063b8cc7cc214610708578063ba1c62f314610730578063bc197c811461073857600080fd5b806391d1485411610171578063a217fddf1161014b578063a217fddf146106c7578063a22cb465146106cf578063a3e56fa8146106e2578063b88d4fde146106f557600080fd5b806391d148541461069957806395d89b41146106ac57806398264fa6146106b457600080fd5b80637a564970116101ad5780637a564970146106515780637e85a07c1461066b5780638456cb591461067e5780638727ab171461068657600080fd5b806371189742146106205780637146bd081461063357806375b238fc1461063c57600080fd5b80633f4ba83a116102ad578063522f68151161024b5780636352211e116102255780636352211e146105d25780636373a6b1146105e557806368d5c5d7146105ed57806370a082311461060d57600080fd5b8063522f6815146105885780635c975abb1461059b5780635ffc07fd146105a657600080fd5b806342842e0e1161028757806342842e0e1461053c57806342966c681461054f57806344004cc1146105625780634f6ccce71461057557600080fd5b80633f4ba83a146104cf5780634025feb2146104d7578063424e6575146104ea57600080fd5b806321f422681161031a5780632f2ff15d116102f45780632f2ff15d1461046b5780632f745c591461047e57806336568abe146104915780633c276d86146104a457600080fd5b806321f422681461042c57806323b872dd14610435578063248a9ca31461044857600080fd5b8063081812fc11610356578063081812fc146103d1578063095ea7b3146103fc57806318160ddd146104115780631fe543e31461041957600080fd5b806301ffc9a71461037d578063041d443e146103a557806306fdde03146103bc575b600080fd5b61039061038b366004612f21565b61086f565b60405190151581526020015b60405180910390f35b6103ae60115481565b60405190815260200161039c565b6103c46108eb565b60405161039c9190612f8e565b6103e46103df366004612fa1565b61097d565b6040516001600160a01b03909116815260200161039c565b61040f61040a366004612fcf565b6109a4565b005b6008546103ae565b61040f6104273660046130b5565b610abe565b6103ae60105481565b61040f6104433660046130fb565b610b46565b6103ae610456366004612fa1565b6000908152600a602052604090206001015490565b61040f61047936600461313c565b610b78565b6103ae61048c366004612fcf565b610b9d565b61040f61049f36600461313c565b610c33565b600f546104b7906001600160401b031681565b6040516001600160401b03909116815260200161039c565b61040f610cad565b61040f6104e53660046130fb565b610cd0565b61051d6104f8366004612fa1565b601460205260009081526040902080546001909101546001600160a01b039091169082565b604080516001600160a01b03909316835260208301919091520161039c565b61040f61054a3660046130fb565b610cec565b61040f61055d366004612fa1565b610d07565b61040f6105703660046130fb565b610d35565b6103ae610583366004612fa1565b610d4b565b61040f610596366004612fcf565b610dde565b600b5460ff16610390565b6012546105bd90600160b01b900463ffffffff1681565b60405163ffffffff909116815260200161039c565b6103e46105e0366004612fa1565b610df3565b6103c4610e53565b6103ae6105fb366004612fa1565b60166020526000908152604090205481565b6103ae61061b36600461316c565b610e6f565b61040f61062e366004612fa1565b610ef5565b6103ae600e5481565b6103ae60008051602061384d83398151915281565b600f546103e490600160401b90046001600160a01b031681565b61040f610679366004613189565b610f13565b61040f610f41565b61040f6106943660046131ad565b610f61565b6103906106a736600461313c565b610f93565b6103c4610fbe565b61040f6106c2366004612fa1565b610fcd565b6103ae600081565b61040f6106dd3660046131e1565b610fde565b6012546103e4906001600160a01b031681565b61040f61070336600461327e565b610fe9565b60125461071d90600160a01b900461ffff1681565b60405161ffff909116815260200161039c565b6104b761101b565b61074b6107463660046132e9565b611038565b6040516001600160e01b0319909116815260200161039c565b61040f610772366004613396565b611083565b6103c4610785366004612fa1565b6110b2565b61040f61079836600461313c565b611119565b6103ae600c5481565b6103ae600d5481565b6103ae60175481565b6103906107c63660046133bf565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61040f610802366004613396565b61113e565b6105bd61081536600461316c565b6001600160a01b031660009081526015602052604090205463ffffffff1690565b61074b6108443660046133ed565b61116d565b6105bd61085736600461316c565b60156020526000908152604090205463ffffffff1681565b60006001600160e01b03198216630271189760e51b14806108a057506001600160e01b031982166380ac58cd60e01b145b806108bb57506001600160e01b03198216635b5e139f60e01b145b806108d657506001600160e01b03198216637965db0b60e01b145b806108e557506108e582611607565b92915050565b6060600080546108fa90613455565b80601f016020809104026020016040519081016040528092919081815260200182805461092690613455565b80156109735780601f1061094857610100808354040283529160200191610973565b820191906000526020600020905b81548152906001019060200180831161095657829003601f168201915b5050505050905090565b60006109888261162c565b506000908152600460205260409020546001600160a01b031690565b60006109af82610df3565b9050806001600160a01b0316836001600160a01b031603610a215760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610a3d5750610a3d81336107c6565b610aaf5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610a18565b610ab9838361168b565b505050565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091614610b385760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909166024820152604401610a18565b610b4282826116f9565b5050565b610b51335b82611a67565b610b6d5760405162461bcd60e51b8152600401610a189061348f565b610ab9838383611ae6565b6000828152600a6020526040902060010154610b9381611c8d565b610ab98383611c97565b6000610ba883610e6f565b8210610c0a5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610a18565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6001600160a01b0381163314610ca35760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610a18565b610b428282611d1d565b60008051602061384d833981519152610cc581611c8d565b610ccd611d84565b50565b6000610cdb81611c8d565b610ce6848484611dd6565b50505050565b610ab983838360405180602001604052806000815250610fe9565b610d1033610b4b565b610d2c5760405162461bcd60e51b8152600401610a189061348f565b610ccd81611f23565b6000610d4081611c8d565b610ce6848484611fca565b6000610d5660085490565b8210610db95760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610a18565b60088281548110610dcc57610dcc6134dd565b90600052602060002001549050919050565b6000610de981611c8d565b610ab983836120c5565b6000818152600260205260408120546001600160a01b0316806108e55760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610a18565b6040518060600160405280604081526020016138946040913981565b60006001600160a01b038216610ed95760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610a18565b506001600160a01b031660009081526003602052604090205490565b60008051602061384d833981519152610f0d81611c8d565b50600e55565b6000610f1e81611c8d565b506012805461ffff909216600160a01b0261ffff60a01b19909216919091179055565b60008051602061384d833981519152610f5981611c8d565b610ccd61214b565b6000610f6c81611c8d565b506012805463ffffffff909216600160b01b0263ffffffff60b01b19909216919091179055565b6000918252600a602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600180546108fa90613455565b6000610fd881611c8d565b50601155565b610b42338383612188565b610ff33383611a67565b61100f5760405162461bcd60e51b8152600401610a189061348f565b610ce68484848461224e565b60008061102781611c8d565b50506013546001600160401b031690565b60405162461bcd60e51b815260206004820152601960248201527f564f582053657269657320343a204e6f7420616c6c6f776564000000000000006044820152600090606401610a18565b600061108e81611c8d565b506013805467ffffffffffffffff19166001600160401b0392909216919091179055565b60606110bd8261162c565b60006110c7612281565b905060008151116110e75760405180602001604052806000815250611112565b806110f1846122a1565b6040516020016111029291906134f3565b6040516020818303038152906040525b9392505050565b6000828152600a602052604090206001015461113481611c8d565b610ab98383611d1d565b600061114981611c8d565b50600f805467ffffffffffffffff19166001600160401b0392909216919091179055565b600f546000906001600160401b03164210156111cb5760405162461bcd60e51b815260206004820152601960248201527f564f582053657269657320343a206e6f742073746172746564000000000000006044820152606401610a18565b600f54600160401b90046001600160a01b0316331461122c5760405162461bcd60e51b815260206004820181905260248201527f564f582053657269657320343a20696e636f727265637420636f6e74726163746044820152606401610a18565b601054841461127d5760405162461bcd60e51b815260206004820152601d60248201527f564f582053657269657320343a20696e636f727265637420746f6b656e0000006044820152606401610a18565b600083116112cd5760405162461bcd60e51b815260206004820152601c60248201527f564f582053657269657320343a20616d6f756e74206973207a65726f000000006044820152606401610a18565b600e548311156113385760405162461bcd60e51b815260206004820152603060248201527f564f582053657269657320343a20616d6f756e7420657863656564732074686560448201526f206d6178206f662065786368616e676560801b6064820152608401610a18565b6001600160a01b03851661138e5760405162461bcd60e51b815260206004820181905260248201527f564f582053657269657320343a2066726f6d20697320616464726573732830296044820152606401610a18565b600b5460ff16156113d85760405162461bcd60e51b81526020600482015260146024820152731593d60814d95c9a595cc80d0e881c185d5cd95960621b6044820152606401610a18565b600d546008546017546113eb9086613538565b6113f59190613538565b111561144e5760405162461bcd60e51b815260206004820152602260248201527f564f582053657269657320343a2043616e6e6f74206275792074686174206d616044820152616e7960f01b6064820152608401610a18565b6013546011546012546040516305d3b1d360e41b815260048101929092526001600160401b0383166024830152600160a01b810461ffff166044830152600160b01b900463ffffffff908116606483015285166084820152600091600160401b90046001600160a01b031690635d3b1d309060a4016020604051808303816000875af11580156114e2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611506919061354b565b6040805180820182526001600160a01b0389811680835260208084018a8152600087815260148352868120955186546001600160a01b031916951694909417855551600190940193909355815260159091529081208054929350869290919061157690849063ffffffff16613564565b92506101000a81548163ffffffff021916908363ffffffff16021790555083601760008282546115a69190613538565b9091555050604080518281526001600160a01b03881660208201529081018590527f6e67d52a6deec37ea0760af8c17d9a6c94f902dc418444a34b4ceaef124449e39060600160405180910390a15063f23a6e6160e01b9695505050505050565b60006001600160e01b03198216630271189760e51b14806108e557506108e5826123a1565b6000818152600260205260409020546001600160a01b0316610ccd5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610a18565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906116c082610df3565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600082815260146020908152604091829020825180840190935280546001600160a01b03168084526001909101549183019190915261177a5760405162461bcd60e51b815260206004820152601d60248201527f564f582053657269657320343a20496e76616c696420726571756573740000006044820152606401610a18565b600061178560085490565b600d546117929190613588565b905081602001518110156117e85760405162461bcd60e51b815260206004820152601d60248201527f564f582053657269657320343a204e6f7420656e6f756768204e4654730000006044820152606401610a18565b600082602001516001600160401b0381111561180657611806612ffb565b60405190808252806020026020018201604052801561182f578160200160208202803683370190505b50905060005b836020015181101561199357600083868381518110611856576118566134dd565b602002602001015161186891906135b1565b600081815260166020526040812054919250906118855781611895565b6000828152601660205260409020545b905060006016816118a7600189613588565b815260200190815260200160002054116118cb576118c6600186613588565b6118ea565b601660006118da600188613588565b8152602001908152602001600020545b600083815260166020526040902055855161190590826123c6565b80848481518110611918576119186134dd565b602090810291909101015285516040517ff67ae65072ad205c93de02aea1573c91bafbb7205bd9481f5cf8cd76108bf04e916119699184906001600160a01b03929092168252602082015260400190565b60405180910390a18461197b816135c5565b9550505050808061198b906135dc565b915050611835565b50600085815260146020908152604080832080546001600160a01b03191681556001018390558582015186516001600160a01b03168452601590925282208054919290916119e890849063ffffffff166135f5565b92506101000a81548163ffffffff021916908363ffffffff160217905550826020015160176000828254611a1c9190613588565b9091555050825181516040517f834e7bfae8ef248f3c67003f793b500af4839a49d0cc399e6ae1d7ddf7e16b1f92611a58929091859190613612565b60405180910390a15050505050565b600080611a7383610df3565b9050806001600160a01b0316846001600160a01b03161480611aba57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80611ade5750836001600160a01b0316611ad38461097d565b6001600160a01b0316145b949350505050565b826001600160a01b0316611af982610df3565b6001600160a01b031614611b5d5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610a18565b6001600160a01b038216611bbf5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a18565b611bca8383836123e0565b611bd560008261168b565b6001600160a01b0383166000908152600360205260408120805460019290611bfe908490613588565b90915550506001600160a01b0382166000908152600360205260408120805460019290611c2c908490613538565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610ccd81336123eb565b611ca18282610f93565b610b42576000828152600a602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611cd93390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b611d278282610f93565b15610b42576000828152600a602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b611d8c61244f565b600b805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b038316611dfc5760405162461bcd60e51b8152600401610a1890613671565b6040516331a9108f60e11b81526004810182905230906001600160a01b03841690636352211e90602401602060405180830381865afa158015611e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e679190613694565b6001600160a01b031603610ab9576040516323b872dd60e01b81523060048201526001600160a01b038481166024830152604482018390528316906323b872dd90606401600060405180830381600087803b158015611ec557600080fd5b505af1158015611ed9573d6000803e3d6000fd5b5050505080826001600160a01b0316846001600160a01b03167ffefe036cac4ee3a4aca074a81cbcc4376e1484693289078dbec149c890101d5b60405160405180910390a4505050565b6000611f2e82610df3565b9050611f3c816000846123e0565b611f4760008361168b565b6001600160a01b0381166000908152600360205260408120805460019290611f70908490613588565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6001600160a01b038316611ff05760405162461bcd60e51b8152600401610a1890613671565b6040516370a0823160e01b815230600482015281906001600160a01b038416906370a0823190602401602060405180830381865afa158015612036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061205a919061354b565b10610ab9576120736001600160a01b038316848361249a565b816001600160a01b0316836001600160a01b03167f6c9d637297625e945b296ff73a71fcfbd0a9e062652b6491a921c4c60194176b836040516120b891815260200190565b60405180910390a3505050565b6001600160a01b0382166120eb5760405162461bcd60e51b8152600401610a1890613671565b804710610b42576121056001600160a01b038316826124ec565b816001600160a01b03167eddb683bb45cd5d0ad8a200c6fae7152b1c236ee90a4a37db692407f5cc38bd8260405161213f91815260200190565b60405180910390a25050565b612153612605565b600b805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611db93390565b816001600160a01b0316836001600160a01b0316036121e95760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610a18565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191016120b8565b612259848484611ae6565b6122658484848461264b565b610ce65760405162461bcd60e51b8152600401610a18906136b1565b606060405180606001604052806027815260200161386d60279139905090565b6060816000036122c85750506040805180820190915260018152600360fc1b602082015290565b8160005b81156122f257806122dc816135dc565b91506122eb9050600a83613703565b91506122cc565b6000816001600160401b0381111561230c5761230c612ffb565b6040519080825280601f01601f191660200182016040528015612336576020820181803683370190505b5090505b8415611ade5761234b600183613588565b9150612358600a866135b1565b612363906030613538565b60f81b818381518110612378576123786134dd565b60200101906001600160f81b031916908160001a90535061239a600a86613703565b945061233a565b60006001600160e01b03198216637965db0b60e01b14806108e557506108e58261274c565b610b42828260405180602001604052806000815250612771565b610ab98383836127a4565b6123f58282610f93565b610b425761240d816001600160a01b0316601461285c565b61241883602061285c565b604051602001612429929190613717565b60408051601f198184030181529082905262461bcd60e51b8252610a1891600401612f8e565b600b5460ff166124985760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610a18565b565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ab99084906129f7565b8047101561253c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a18565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612589576040519150601f19603f3d011682016040523d82523d6000602084013e61258e565b606091505b5050905080610ab95760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610a18565b600b5460ff16156124985760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610a18565b60006001600160a01b0384163b1561274157604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061268f90339089908890889060040161378c565b6020604051808303816000875af19250505080156126ca575060408051601f3d908101601f191682019092526126c7918101906137c9565b60015b612727573d8080156126f8576040519150601f19603f3d011682016040523d82523d6000602084013e6126fd565b606091505b50805160000361271f5760405162461bcd60e51b8152600401610a18906136b1565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611ade565b506001949350505050565b60006001600160e01b0319821663780e9d6360e01b14806108e557506108e582612ac9565b61277b8383612b19565b612788600084848461264b565b610ab95760405162461bcd60e51b8152600401610a18906136b1565b6001600160a01b0383166127ff576127fa81600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612822565b816001600160a01b0316836001600160a01b031614612822576128228382612c67565b6001600160a01b03821661283957610ab981612d04565b826001600160a01b0316826001600160a01b031614610ab957610ab98282612db3565b6060600061286b8360026137e6565b612876906002613538565b6001600160401b0381111561288d5761288d612ffb565b6040519080825280601f01601f1916602001820160405280156128b7576020820181803683370190505b509050600360fc1b816000815181106128d2576128d26134dd565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612901576129016134dd565b60200101906001600160f81b031916908160001a90535060006129258460026137e6565b612930906001613538565b90505b60018111156129a8576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612964576129646134dd565b1a60f81b82828151811061297a5761297a6134dd565b60200101906001600160f81b031916908160001a90535060049490941c936129a1816135c5565b9050612933565b5083156111125760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a18565b6000612a4c826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612df79092919063ffffffff16565b805190915015610ab95780806020019051810190612a6a91906137fd565b610ab95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a18565b60006001600160e01b031982166380ac58cd60e01b1480612afa57506001600160e01b03198216635b5e139f60e01b145b806108e557506301ffc9a760e01b6001600160e01b03198316146108e5565b6001600160a01b038216612b6f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a18565b6000818152600260205260409020546001600160a01b031615612bd45760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a18565b612be0600083836123e0565b6001600160a01b0382166000908152600360205260408120805460019290612c09908490613538565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001612c7484610e6f565b612c7e9190613588565b600083815260076020526040902054909150808214612cd1576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090612d1690600190613588565b60008381526009602052604081205460088054939450909284908110612d3e57612d3e6134dd565b906000526020600020015490508060088381548110612d5f57612d5f6134dd565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612d9757612d9761381a565b6001900381819060005260206000200160009055905550505050565b6000612dbe83610e6f565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6060611ade8484600085856001600160a01b0385163b612e595760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a18565b600080866001600160a01b03168587604051612e759190613830565b60006040518083038185875af1925050503d8060008114612eb2576040519150601f19603f3d011682016040523d82523d6000602084013e612eb7565b606091505b5091509150612ec7828286612ed2565b979650505050505050565b60608315612ee1575081611112565b825115612ef15782518084602001fd5b8160405162461bcd60e51b8152600401610a189190612f8e565b6001600160e01b031981168114610ccd57600080fd5b600060208284031215612f3357600080fd5b813561111281612f0b565b60005b83811015612f59578181015183820152602001612f41565b50506000910152565b60008151808452612f7a816020860160208601612f3e565b601f01601f19169290920160200192915050565b6020815260006111126020830184612f62565b600060208284031215612fb357600080fd5b5035919050565b6001600160a01b0381168114610ccd57600080fd5b60008060408385031215612fe257600080fd5b8235612fed81612fba565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561303957613039612ffb565b604052919050565b600082601f83011261305257600080fd5b813560206001600160401b0382111561306d5761306d612ffb565b8160051b61307c828201613011565b928352848101820192828101908785111561309657600080fd5b83870192505b84831015612ec75782358252918301919083019061309c565b600080604083850312156130c857600080fd5b8235915060208301356001600160401b038111156130e557600080fd5b6130f185828601613041565b9150509250929050565b60008060006060848603121561311057600080fd5b833561311b81612fba565b9250602084013561312b81612fba565b929592945050506040919091013590565b6000806040838503121561314f57600080fd5b82359150602083013561316181612fba565b809150509250929050565b60006020828403121561317e57600080fd5b813561111281612fba565b60006020828403121561319b57600080fd5b813561ffff8116811461111257600080fd5b6000602082840312156131bf57600080fd5b813563ffffffff8116811461111257600080fd5b8015158114610ccd57600080fd5b600080604083850312156131f457600080fd5b82356131ff81612fba565b91506020830135613161816131d3565b600082601f83011261322057600080fd5b81356001600160401b0381111561323957613239612ffb565b61324c601f8201601f1916602001613011565b81815284602083860101111561326157600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561329457600080fd5b843561329f81612fba565b935060208501356132af81612fba565b92506040850135915060608501356001600160401b038111156132d157600080fd5b6132dd8782880161320f565b91505092959194509250565b600080600080600060a0868803121561330157600080fd5b853561330c81612fba565b9450602086013561331c81612fba565b935060408601356001600160401b038082111561333857600080fd5b61334489838a01613041565b9450606088013591508082111561335a57600080fd5b61336689838a01613041565b9350608088013591508082111561337c57600080fd5b506133898882890161320f565b9150509295509295909350565b6000602082840312156133a857600080fd5b81356001600160401b038116811461111257600080fd5b600080604083850312156133d257600080fd5b82356133dd81612fba565b9150602083013561316181612fba565b600080600080600060a0868803121561340557600080fd5b853561341081612fba565b9450602086013561342081612fba565b9350604086013592506060860135915060808601356001600160401b0381111561344957600080fd5b6133898882890161320f565b600181811c9082168061346957607f821691505b60208210810361348957634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60008351613505818460208801612f3e565b835190830190613519818360208801612f3e565b01949350505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156108e5576108e5613522565b60006020828403121561355d57600080fd5b5051919050565b63ffffffff81811683821601908082111561358157613581613522565b5092915050565b818103818111156108e5576108e5613522565b634e487b7160e01b600052601260045260246000fd5b6000826135c0576135c061359b565b500690565b6000816135d4576135d4613522565b506000190190565b6000600182016135ee576135ee613522565b5060010190565b63ffffffff82811682821603908082111561358157613581613522565b6001600160a01b038416815260606020808301829052845191830182905260009185820191906080850190845b8181101561365b5784518352938301939183019160010161363f565b5050809350505050826040830152949350505050565b6020808252600990820152684248503a452d34303360b81b604082015260600190565b6000602082840312156136a657600080fd5b815161111281612fba565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000826137125761371261359b565b500490565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161374f816017850160208801612f3e565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613780816028840160208801612f3e565b01602801949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906137bf90830184612f62565b9695505050505050565b6000602082840312156137db57600080fd5b815161111281612f0b565b80820281158282048414176108e5576108e5613522565b60006020828403121561380f57600080fd5b8151611112816131d3565b634e487b7160e01b600052603160045260246000fd5b60008251613842818460208701612f3e565b919091019291505056fea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177568747470733a2f2f636f6c6c656374766f782e636f6d2f6d657461646174612f74726f6c6c732f30626138396330663436633537623163373539313865653666323235323563303463626431383534633436306363666436373862656164373762393037313633a2646970667358221220d697884384d33893daebcd07aa04b28d2a39ff062ff3d180c6279c78019c86a964736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000006363f39000000000000000000000000056f13a5385b33f7db926ceb9d17799672355e0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699099fe0eebf5e446e3c998ec9bb19951541aee00bb90ea201ae456421a2ded86805000000000000000000000000000000000000000000000000000000000000001d
-----Decoded View---------------
Arg [0] : _saleStartTimestamp (uint64): 1667494800
Arg [1] : _erc1155Contract (address): 0x56f13a5385b33F7dB926CeB9D17799672355E040
Arg [2] : _erc1155Token (uint256): 0
Arg [3] : _vrfCoordinator (address): 0x271682DEB8C4E0901D1a1550aD2e64D568E69909
Arg [4] : _vrfKeyhash (bytes32): 0x9fe0eebf5e446e3c998ec9bb19951541aee00bb90ea201ae456421a2ded86805
Arg [5] : _vrfSubscriptionId (uint64): 29
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000006363f390
Arg [1] : 00000000000000000000000056f13a5385b33f7db926ceb9d17799672355e040
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e69909
Arg [4] : 9fe0eebf5e446e3c998ec9bb19951541aee00bb90ea201ae456421a2ded86805
Arg [5] : 000000000000000000000000000000000000000000000000000000000000001d
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.