Token
ERC-1155
Overview
Max Total Supply
0
Holders
13
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
AccessNFT_PL
Compiler Version
v0.8.0+commit.c7dfd78e
Optimization Enabled:
Yes with 800 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; // Base import { AccessNFT } from "../AccessNFT.sol"; contract AccessNFT_PL is AccessNFT { constructor( address payable _controlCenter, address _trustedForwarder, string memory _uri ) AccessNFT(_controlCenter, _trustedForwarder, _uri) {} /// @dev Ignore MINTER_ROLE function hasRole(bytes32 role, address account) public view override returns (bool) { return role == MINTER_ROLE || super.hasRole(role, account); } /// @dev Revert regular mint function mint( address, uint256, uint256, bytes memory ) public pure override { revert("AccessNFT: cannot use regular mint function."); } /// @dev Revert regular mintBatch function mintBatch( address, uint256[] memory, uint256[] memory, bytes memory ) public pure override { revert("AccessNFT: cannot use regular mintBatch function."); } /// @dev See EIP 2918 function royaltyInfo(uint256 tokenId, uint256 salePrice) external view override returns (address receiver, uint256 royaltyAmount) { receiver = nftInfo[tokenId].creator; royaltyAmount = (salePrice * royaltyBps) / controlCenter.MAX_BPS(); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; // Tokens import "./openzeppelin-presets/ERC1155PresetMinterPauser.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // Meta transactions import "@openzeppelin/contracts/metatx/ERC2771Context.sol"; // Protocol control center. import { ProtocolControl } from "./ProtocolControl.sol"; // Royalties import "@openzeppelin/contracts/interfaces/IERC2981.sol"; contract AccessNFT is ERC1155PresetMinterPauser, IERC1155Receiver, ERC2771Context, IERC2981 { /// @dev Only TRANSFER_ROLE holders can have tokens transferred from or to them, during restricted transfers. bytes32 public constant TRANSFER_ROLE = keccak256("TRANSFER_ROLE"); /// @dev Whether transfers on tokens are restricted. bool public isRestrictedTransfer; /// @dev The protocol control center. ProtocolControl internal controlCenter; /// @dev The token Id of the NFT to mint. uint256 public nextTokenId; /// @dev NFT sale royalties -- see EIP 2981 uint256 public royaltyBps; /// @dev Collection level metadata. string public _contractURI; enum UnderlyingType { None, ERC20, ERC721 } struct NftInfo { address creator; string uri; uint256 supply; bool isAccess; uint256 accessNftId; UnderlyingType underlyingType; } /// @dev Emmitted when Access NFTs are created. event AccessNFTsCreated( address indexed creator, uint256[] nftIds, string[] nftURIs, uint256[] acessNftIds, string[] accessNftURIs, uint256[] nftSupplies ); event AccessNFTRedeemed( address indexed redeemer, uint256 indexed nftTokenId, uint256 indexed accessNftId, uint256 amount ); event RoyaltyUpdated(uint256 royaltyBps); /// @dev NFT tokenId => NFT state. mapping(uint256 => NftInfo) public nftInfo; /// @dev Checks whether the protocol is paused. modifier onlyUnpausedProtocol() { require(!controlCenter.systemPaused(), "AccessNFT: The protocol is paused."); _; } /// @dev Checks whether the protocol is paused. modifier onlyProtocolAdmin() { require( controlCenter.hasRole(controlCenter.PROTOCOL_ADMIN(), _msgSender()), "AccessNFT: only a protocol admin can call this function." ); _; } constructor( address payable _controlCenter, address _trustedForwarder, string memory _uri ) ERC1155PresetMinterPauser(_uri) ERC2771Context(_trustedForwarder) { // Set the protocol control center controlCenter = ProtocolControl(_controlCenter); // Set contract URI _contractURI = _uri; _setupRole(TRANSFER_ROLE, _msgSender()); } function supportsInterface(bytes4 interfaceId) public pure override(ERC1155PresetMinterPauser, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC2981).interfaceId; } function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } /// @dev Creates pack on receiving ERC 1155 reward tokens function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) external virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } /// @notice Create native ERC 1155 NFTs. function createAccessNfts( string[] calldata _nftURIs, string[] calldata _accessNftURIs, uint256[] calldata _nftSupplies ) public onlyUnpausedProtocol returns (uint256[] memory nftIds) { require( hasRole(MINTER_ROLE, _msgSender()), "AccessNFT: Only accounts with MINTER_ROLE can call this function." ); require( _nftURIs.length == _nftSupplies.length && _nftURIs.length == _accessNftURIs.length, "AccessNFT: Must specify equal number of config values." ); require(_nftURIs.length > 0, "AccessNFT: Must create at least one NFT."); // Get tokenIds. nftIds = new uint256[](_nftURIs.length); uint256[] memory accessNftIds = new uint256[](_nftURIs.length); uint256 id = nextTokenId; // Store NFT state for each NFT. for (uint256 i = 0; i < _nftURIs.length; i++) { // Store Access NFT tokenId accessNftIds[i] = id; // Store Access NFT info nftInfo[id] = NftInfo({ creator: _msgSender(), uri: _accessNftURIs[i], supply: _nftSupplies[i], isAccess: true, accessNftId: 0, underlyingType: UnderlyingType.None }); // Update id id += 1; // Store NFT tokenId nftIds[i] = id; // Store NFT info nftInfo[id] = NftInfo({ creator: _msgSender(), uri: _nftURIs[i], supply: _nftSupplies[i], isAccess: false, accessNftId: (id - 1), underlyingType: UnderlyingType.None }); // Update id id += 1; } nextTokenId = id; // Mint Access NFTs to contract _mintBatch(address(this), accessNftIds, _nftSupplies, ""); // Mint NFTs to `_msgSender()` _mintBatch(_msgSender(), nftIds, _nftSupplies, ""); emit AccessNFTsCreated(_msgSender(), nftIds, _nftURIs, accessNftIds, _accessNftURIs, _nftSupplies); } /// @dev Creates packs with NFT. function createAccessPack( address _pack, string[] calldata _nftURIs, string[] calldata _accessNftURIs, uint256[] calldata _nftSupplies, string calldata _packURI, uint256 _secondsUntilOpenStart, uint256 _secondsUntilOpenEnd, uint256 _nftsPerOpen ) external onlyUnpausedProtocol { uint256[] memory nftIds = createAccessNfts(_nftURIs, _accessNftURIs, _nftSupplies); bytes memory args = abi.encode(_packURI, _secondsUntilOpenStart, _secondsUntilOpenEnd, _nftsPerOpen); safeBatchTransferFrom(_msgSender(), _pack, nftIds, _nftSupplies, args); } /// @dev Lets an NFT holder redeem the underlying Access NFT. function redeemAccess(uint256 _tokenId, uint256 _amount) external onlyUnpausedProtocol { require(!nftInfo[_tokenId].isAccess, "AccessNFT: This token is not redeemable for access."); // Get redeemer address redeemer = _msgSender(); require(balanceOf(redeemer, _tokenId) >= _amount, "AccessNFT: Cannot redeem more NFTs than owned."); // Burn NFTs of the 'unredeemed' state. burn(_msgSender(), _tokenId, _amount); // Get access nft Id uint256 accessNftId = nftInfo[_tokenId].accessNftId; // Transfer Access NFTs to redeemer this.safeTransferFrom(address(this), redeemer, accessNftId, _amount, ""); emit AccessNFTRedeemed(redeemer, _tokenId, accessNftId, _amount); } /// @dev Lets a protocol admin update the royalties paid on pack sales. function setRoyaltyBps(uint256 _royaltyBps) external onlyProtocolAdmin { require( _royaltyBps < (controlCenter.MAX_BPS() + controlCenter.MAX_PROVIDER_FEE_BPS()), "NFT: Bps provided must be less than 9,000" ); royaltyBps = _royaltyBps; emit RoyaltyUpdated(_royaltyBps); } /// @dev Sets contract URI for the storefront-level metadata of the contract. function setContractURI(string calldata _URI) external onlyProtocolAdmin { _contractURI = _URI; } /// @dev Lets a protocol admin restrict token transfers. function setRestrictedTransfer(bool _restrictedTransfer) external onlyProtocolAdmin { isRestrictedTransfer = _restrictedTransfer; } /// @dev Runs on every transfer. function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); if (isRestrictedTransfer) { require( hasRole(TRANSFER_ROLE, from) || hasRole(TRANSFER_ROLE, to), "AccessNFT: Transfers are restricted to TRANSFER_ROLE holders" ); } // Decrease total supply if tokens are being burned. for (uint256 i = 0; i < ids.length; i++) { if (to == address(0)) { nftInfo[ids[i]].supply -= amounts[i]; } if (nftInfo[ids[i]].isAccess) { require( from == address(0) || from == address(this), "AccessNFT: cannot transfer an access NFT that is redeemed" ); } } } /// @dev See EIP 2918 function royaltyInfo(uint256, uint256 salePrice) external view virtual override returns (address receiver, uint256 royaltyAmount) { receiver = controlCenter.ownerTreasury(); royaltyAmount = (salePrice * royaltyBps) / controlCenter.MAX_BPS(); } /// @dev See EIP 1155 function uri(uint256 _nftId) public view override returns (string memory) { return nftInfo[_nftId].uri; } /// @dev Alternative function to return a token's URI function tokenURI(uint256 _nftId) public view returns (string memory) { return nftInfo[_nftId].uri; } /// @dev Returns whether a token represents a 'redeemed' or 'not redeemed' state. function isRedeemed(uint256 _nftId) public view returns (bool) { return nftInfo[_nftId].isAccess; } /// @dev Returns the URI for the storefront-level metadata of the contract. function contractURI() public view returns (string memory) { return _contractURI; } /// @dev ERC2771Context override function _msgSender() internal view virtual override(Context, ERC2771Context) returns (address sender) { return ERC2771Context._msgSender(); } /// @dev ERC2771Context override function _msgData() internal view virtual override(Context, ERC2771Context) returns (bytes calldata) { return ERC2771Context._msgData(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; /// @dev Edit: Make `hasRole` virtual import "./access/AccessControlEnumerable.sol"; /** * @dev {ERC1155} token, including: * * - ability for holders to burn (destroy) their tokens * - a minter role that allows for token minting (creation) * - a pauser role that allows to stop all token transfers * * This contract uses {AccessControl} to lock permissioned functions using the * different roles - head to its documentation for details. * * The account that deploys the contract will be granted the minter and pauser * roles, as well as the default admin role, which will let it grant both minter * and pauser roles to other accounts. */ contract ERC1155PresetMinterPauser is Context, AccessControlEnumerable, ERC1155Burnable, ERC1155Pausable { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE`, and `PAUSER_ROLE` to the account that * deploys the contract. */ constructor(string memory uri) ERC1155(uri) { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(MINTER_ROLE, _msgSender()); _setupRole(PAUSER_ROLE, _msgSender()); } /** * @dev Creates `amount` new tokens for `to`, of token type `id`. * * See {ERC1155-_mint}. * * Requirements: * * - the caller must have the `MINTER_ROLE`. */ function mint( address to, uint256 id, uint256 amount, bytes memory data ) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "ERC1155PresetMinterPauser: must have minter role to mint"); _mint(to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] variant of {mint}. */ function mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "ERC1155PresetMinterPauser: must have minter role to mint"); _mintBatch(to, ids, amounts, data); } /** * @dev Pauses all token transfers. * * See {ERC1155Pausable} and {Pausable-_pause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */ function pause() public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), "ERC1155PresetMinterPauser: must have pauser role to pause"); _pause(); } /** * @dev Unpauses all token transfers. * * See {ERC1155Pausable} and {Pausable-_unpause}. * * Requirements: * * - the caller must have the `PAUSER_ROLE`. */ function unpause() public virtual { require(hasRole(PAUSER_ROLE, _msgSender()), "ERC1155PresetMinterPauser: must have pauser role to unpause"); _unpause(); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlEnumerable, ERC1155) returns (bool) { return super.supportsInterface(interfaceId); } function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override(ERC1155, ERC1155Pausable) { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount ) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract ERC2771Context is Context { address private _trustedForwarder; constructor(address trustedForwarder) { _trustedForwarder = trustedForwarder; } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return forwarder == _trustedForwarder; } function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return super._msgSender(); } } function _msgData() internal view virtual override returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 20]; } else { return super._msgData(); } } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; // Access Control import "@openzeppelin/contracts/access/AccessControl.sol"; // Tokens import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract ProtocolControl is AccessControl { /// @dev Admin role for protocol. bytes32 public constant PROTOCOL_ADMIN = keccak256("PROTOCOL_ADMIN"); /// @dev Admin role for protocol provider. bytes32 public constant PROTOCOL_PROVIDER = keccak256("PROTOCOL_PROVIDER"); /// @dev Protocol status. bool public systemPaused; /// @dev Protocol provider's treasury address public providerTreasury; /// @dev deployer's treasury address public ownerTreasury; /// @dev Pack protocol module names. enum ModuleType { Coin, NFTCollection, NFT, DynamicNFT, AccessNFT, Pack, Market, Other } /// @dev Module ID => Module address. mapping(bytes32 => address) public modules; /// @dev Module ID => Module type. mapping(bytes32 => ModuleType) public moduleType; ///@dev Module address => Module ID mapping(address => bytes32) public moduleIds; /// @dev Module type => Num of modules of that type. mapping(uint256 => uint256) public numOfModuleType; /// @dev Protocol provider fees uint128 public constant MAX_BPS = 10000; // 100% uint128 public constant MAX_PROVIDER_FEE_BPS = 1000; // 10% uint128 public providerFeeBps = 500; // 5% /// @dev Contract level metadata. string public _contractURI; /// @dev Events. event ModuleUpdated(bytes32 indexed moduleId, address indexed module, uint256 indexed moduleType); event FundsTransferred(address asset, address to, uint256 amount); event OwnerTreasuryUpdated(address _providerTreasury); event SystemPaused(bool isPaused); event ProviderFeeBpsUpdated(uint256 providerFeeBps); event ProviderTreasuryUpdated(address _providerTreasury); event TransferRestricted(bytes32 moduleId, address moduleAddress, bool restriction); /// @dev Check whether the caller is a protocol admin modifier onlyProtocolAdmin() { require(hasRole(PROTOCOL_ADMIN, msg.sender), "Protocol: Only protocol admins can call this function."); _; } /// @dev Check whether the caller is an protocol provider admin modifier onlyProtocolProvider() { require( hasRole(PROTOCOL_PROVIDER, msg.sender), "Protocol: Only protocol provider admins can call this function." ); _; } constructor( address _admin, address _provider, address _providerTreasury, string memory _uri ) { // Set contract URI _contractURI = _uri; // Set protocol provider treasury providerTreasury = _providerTreasury; ownerTreasury = _admin; // Set access control roles _setupRole(PROTOCOL_ADMIN, _admin); _setupRole(PROTOCOL_PROVIDER, _provider); _setRoleAdmin(PROTOCOL_ADMIN, PROTOCOL_ADMIN); _setRoleAdmin(PROTOCOL_PROVIDER, PROTOCOL_PROVIDER); emit OwnerTreasuryUpdated(_admin); emit ProviderTreasuryUpdated(_provider); } /// @dev Let the contract accept ether. receive() external payable {} /// @dev Lets a protocol admin add a module to the protocol. function addModule(address _newModuleAddress, uint8 _moduleType) external onlyProtocolAdmin returns (bytes32 moduleId) { // `moduleId` is collision resitant -- unique `_moduleType` and incrementing `numOfModuleType` moduleId = keccak256(abi.encodePacked(numOfModuleType[_moduleType], uint256(_moduleType))); numOfModuleType[_moduleType] += 1; modules[moduleId] = _newModuleAddress; moduleIds[_newModuleAddress] = moduleId; emit ModuleUpdated(moduleId, _newModuleAddress, _moduleType); } /// @dev Lets a protocol admin change the address of a module of the protocol. function updateModule(bytes32 _moduleId, address _newModuleAddress) external onlyProtocolAdmin { require(modules[_moduleId] != address(0), "ProtocolControl: a module with this ID does not exist."); modules[_moduleId] = _newModuleAddress; moduleIds[_newModuleAddress] = _moduleId; emit ModuleUpdated(_moduleId, _newModuleAddress, uint256(moduleType[_moduleId])); } /// @dev Lets a nftlabs admin change the market fee basis points. function updateProviderFeeBps(uint128 _newFeeBps) external onlyProtocolProvider { require(_newFeeBps <= MAX_PROVIDER_FEE_BPS, "ProtocolControl: provider fee cannot be greater than 10%"); providerFeeBps = _newFeeBps; emit ProviderFeeBpsUpdated(_newFeeBps); } /// @dev Lets provider admins change the address of providers tresury. function updateProviderTreasury(address _newTreasury) external onlyProtocolProvider { providerTreasury = _newTreasury; emit ProviderTreasuryUpdated(_newTreasury); } ///@dev Lets a protocol admin update the owner trasury address. function updateOwnerTreasury(address _newTreasury) external onlyProtocolAdmin { ownerTreasury = _newTreasury; emit OwnerTreasuryUpdated(_newTreasury); } /// @dev Lets a protocol admin pause the protocol. function pauseProtocol(bool _toPause) external onlyProtocolAdmin { systemPaused = _toPause; emit SystemPaused(_toPause); } /// @dev Lets a protocol admin transfer this contract's funds. function transferProtocolFunds( address _asset, address _to, uint256 _amount ) external onlyProtocolAdmin { bool success; if (_asset == address(0)) { (success, ) = (_to).call{ value: _amount }(""); } else { success = IERC20(_asset).transfer(_to, _amount); } require(success, "Protocol Control: failed to transfer protocol funds."); emit FundsTransferred(_asset, _to, _amount); } /// @dev Sets contract URI for the contract-level metadata of the contract. function setContractURI(string calldata _URI) external onlyProtocolAdmin { _contractURI = _URI; } /// @dev Returns the URI for the contract-level metadata of the contract. function contractURI() public view returns (string memory) { return _contractURI; } /// @dev Returns all addresses for a module type function getAllModulesOfType(uint256 _moduleType) external view returns (address[] memory allModules) { uint256 numOfModules = numOfModuleType[_moduleType]; allModules = new address[](numOfModules); for (uint256 i = 0; i < numOfModules; i += 1) { bytes32 moduleId = keccak256(abi.encodePacked(i, _moduleType)); allModules[i] = modules[moduleId]; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard */ interface IERC2981 is IERC165 { /** * @dev Called with the sale price to determine how much royalty is owed and to whom. * @param tokenId - the NFT asset queried for royalty information * @param salePrice - the sale price of the NFT asset specified by `tokenId` * @return receiver - address of who should be sent the royalty payment * @return royaltyAmount - the royalty payment amount for `salePrice` */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(_msgSender() != operator, "ERC1155: setting approval status for self"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `account`. * * Emits a {TransferSingle} event. * * Requirements: * * - `account` cannot be the zero address. * - If `account` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address account, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(account != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][account] += amount; emit TransferSingle(operator, address(0), account, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `account` * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens of token type `id`. */ function _burn( address account, uint256 id, uint256 amount ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 accountBalance = _balances[id][account]; require(accountBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][account] = accountBalance - amount; } emit TransferSingle(operator, account, address(0), id, amount); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address account, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, account, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 accountBalance = _balances[id][account]; require(accountBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][account] = accountBalance - amount; } } emit TransferBatch(operator, account, address(0), ids, amounts); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155Burnable is ERC1155 { function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not owner nor approved" ); _burnBatch(account, ids, values); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC1155.sol"; import "../../../security/Pausable.sol"; /** * @dev ERC1155 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. * * _Available since v3.1._ */ abstract contract ERC1155Pausable is ERC1155, Pausable { /** * @dev See {ERC1155-_beforeTokenTransfer}. * * Requirements: * * - the contract must not be paused. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); require(!paused(), "ERC1155Pausable: token transfer while paused"); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/IAccessControlEnumerable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "./AccessControl.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {grantRole} to track enumerable memberships */ function grantRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) { super.grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {revokeRole} to track enumerable memberships */ function revokeRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) { super.revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {renounceRole} to track enumerable memberships */ function renounceRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) { super.renounceRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {_setupRole} to track enumerable memberships */ function _setupRole(bytes32 role, address account) internal virtual override { super._setupRole(role, account); _roleMembers[role].add(account); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector). @param operator The address which initiated the transfer (i.e. msg.sender) @param from The address which previously owned the token @param id The ID of the token being transferred @param value The amount of tokens being transferred @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** @dev Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector). @param operator The address which initiated the batch transfer (i.e. msg.sender) @param from The address which previously owned the token @param ids An array containing ids of each token being transferred (order and length must match values array) @param values An array containing amounts of each token being transferred (order and length must match ids array) @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; 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 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 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 Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/IAccessControl.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { 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 override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ 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); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT 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 pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { 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 override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ 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); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol";
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 800 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"address payable","name":"_controlCenter","type":"address"},{"internalType":"address","name":"_trustedForwarder","type":"address"},{"internalType":"string","name":"_uri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"redeemer","type":"address"},{"indexed":true,"internalType":"uint256","name":"nftTokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"accessNftId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AccessNFTRedeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"nftIds","type":"uint256[]"},{"indexed":false,"internalType":"string[]","name":"nftURIs","type":"string[]"},{"indexed":false,"internalType":"uint256[]","name":"acessNftIds","type":"uint256[]"},{"indexed":false,"internalType":"string[]","name":"accessNftURIs","type":"string[]"},{"indexed":false,"internalType":"uint256[]","name":"nftSupplies","type":"uint256[]"}],"name":"AccessNFTsCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":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":false,"internalType":"uint256","name":"royaltyBps","type":"uint256"}],"name":"RoyaltyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRANSFER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string[]","name":"_nftURIs","type":"string[]"},{"internalType":"string[]","name":"_accessNftURIs","type":"string[]"},{"internalType":"uint256[]","name":"_nftSupplies","type":"uint256[]"}],"name":"createAccessNfts","outputs":[{"internalType":"uint256[]","name":"nftIds","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pack","type":"address"},{"internalType":"string[]","name":"_nftURIs","type":"string[]"},{"internalType":"string[]","name":"_accessNftURIs","type":"string[]"},{"internalType":"uint256[]","name":"_nftSupplies","type":"uint256[]"},{"internalType":"string","name":"_packURI","type":"string"},{"internalType":"uint256","name":"_secondsUntilOpenStart","type":"uint256"},{"internalType":"uint256","name":"_secondsUntilOpenEnd","type":"uint256"},{"internalType":"uint256","name":"_nftsPerOpen","type":"uint256"}],"name":"createAccessPack","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nftId","type":"uint256"}],"name":"isRedeemed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRestrictedTransfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"mintBatch","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"nextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftInfo","outputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"bool","name":"isAccess","type":"bool"},{"internalType":"uint256","name":"accessNftId","type":"uint256"},{"internalType":"enum AccessNFT.UnderlyingType","name":"underlyingType","type":"uint8"}],"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":"nonpayable","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":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"redeemAccess","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":[],"name":"royaltyBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_URI","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_restrictedTransfer","type":"bool"}],"name":"setRestrictedTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_royaltyBps","type":"uint256"}],"name":"setRoyaltyBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nftId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_nftId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620052dd380380620052dd833981016040819052620000349162000431565b82828281818062000045816200013d565b506005805460ff191690556200006660006200006062000156565b62000173565b62000084600080516020620052bd8339815191526200006062000156565b620000b37f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6200006062000156565b5060058054610100600160a81b0319166101006001600160a01b0393841602179055600680546001600160a01b0319169185169190911790558051620001019060099060208401906200038b565b50620001317f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c6200006062000156565b5050505050506200059a565b8051620001529060049060208401906200038b565b5050565b60006200016d620001b660201b62001efd1760201c565b90505b90565b6200018a8282620001f660201b62001f2b1760201c565b6000828152600160209081526040909120620001b191839062001f3962000202821b17901c565b505050565b6000620001c33362000222565b15620001d9575060131936013560601c62000170565b620001ee6200023b60201b62001f4e1760201c565b905062000170565b6200015282826200023f565b600062000219836001600160a01b038416620002c9565b90505b92915050565b60055461010090046001600160a01b0390811691161490565b3390565b6200024b828262000318565b62000152576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200028562000156565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620002d783836200034a565b6200030f575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200021c565b5060006200021c565b6000600080516020620052bd8339815191528314806200021957506200021983836200036260201b62001f521760201c565b60009081526001919091016020526040902054151590565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b82805462000399906200052e565b90600052602060002090601f016020900481019282620003bd576000855562000408565b82601f10620003d857805160ff191683800117855562000408565b8280016001018555821562000408579182015b8281111562000408578251825591602001919060010190620003eb565b50620004169291506200041a565b5090565b5b808211156200041657600081556001016200041b565b60008060006060848603121562000446578283fd5b8351620004538162000581565b80935050602080850151620004688162000581565b60408601519093506001600160401b038082111562000485578384fd5b818701915087601f83011262000499578384fd5b815181811115620004ae57620004ae6200056b565b604051601f8201601f1916810185018381118282101715620004d457620004d46200056b565b60405281815283820185018a1015620004eb578586fd5b8592505b818310156200050e5783830185015181840186015291840191620004ef565b818311156200051f57858583830101525b80955050505050509250925092565b6002810460018216806200054357607f821691505b602082108114156200056557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146200059757600080fd5b50565b614d1380620005aa6000396000f3fe608060405234801561001057600080fd5b50600436106102f35760003560e01c806383661b2911610191578063c63adb2b116100e3578063e63ab1e911610097578063f23a6e6111610071578063f23a6e61146105e5578063f242432a146105f8578063f5298aca1461060b576102f3565b8063e63ab1e9146105c2578063e8a3d485146105ca578063e985e9c5146105d2576102f3565b8063ca15c873116100c8578063ca15c87314610594578063d5391393146105a7578063d547741f146105af576102f3565b8063c63adb2b1461058c578063c87b56dd14610341576102f3565b806391d1485411610145578063a22cb4651161011f578063a22cb46514610551578063bc197c8114610564578063c0e7274014610584576102f3565b806391d1485414610523578063938e3d7b14610536578063a217fddf14610549576102f3565b80638aa01653116101765780638aa01653146104dd5780638ba448c2146104f05780639010d07c14610503576102f3565b806383661b29146104cd5780638456cb59146104d5576102f3565b80632f2ff15d1161024a5780634e1273f4116101fe5780636b20c454116101d85780636b20c4541461049f578063731133e9146104b257806375794a3c146104c5576102f3565b80634e1273f414610471578063572b6c05146104845780635c975abb14610497576102f3565b806336568abe1161022f57806336568abe146104365780633c16b12e146104495780633f4ba83a14610469576102f3565b80632f2ff15d1461041057806332d33cd014610423576102f3565b80631f8bc790116102ac5780632a55205a116102865780632a55205a146103c95780632e14bee8146103ea5780632eb2c2d6146103fd576102f3565b80631f8bc79014610389578063206b60f9146103ae578063248a9ca3146103b6576102f3565b80630e89341c116102dd5780630e89341c146103415780631f72d831146103615780631f7fdffa14610376576102f3565b8062fdd58e146102f857806301ffc9a714610321575b600080fd5b61030b610306366004613792565b61061e565b6040516103189190613ee3565b60405180910390f35b61033461032f366004613a3f565b61067a565b6040516103189190613ed8565b61035461034f3660046139cc565b6106ce565b6040516103189190613f49565b61037461036f3660046139cc565b610773565b005b6103746103843660046136c7565b610a0f565b61039c6103973660046139cc565b610a27565b60405161031896959493929190613d70565b61030b610af4565b61030b6103c43660046139cc565b610b18565b6103dc6103d7366004613a1e565b610b2d565b604051610318929190613dd7565b6103746103f8366004613a1e565b610bee565b61037461040b366004613446565b610dc1565b61037461041e3660046139fc565b610e1f565b6103346104313660046139cc565b610e46565b6103746104443660046139fc565b610e5e565b61045c6104573660046138fe565b610e80565b6040516103189190613df0565b610374611539565b61045c61047f366004613840565b61158b565b610334610492366004613403565b6116ab565b6103346116c4565b6103746104ad366004613656565b6116ce565b6103746104c03660046137ed565b611723565b61030b61173b565b610334611741565b610374611751565b6103746104eb36600461354f565b6117a1565b6103746104fe366004613994565b6118da565b610516610511366004613a1e565b611a29565b6040516103189190613c83565b6103346105313660046139fc565b611a48565b610374610544366004613a77565b611a7d565b61030b611b9f565b61037461055f36600461375c565b611ba4565b610577610572366004613446565b611c72565b6040516103189190613f03565b610354611c83565b61030b611d11565b61030b6105a23660046139cc565b611d17565b61030b611d2e565b6103746105bd3660046139fc565b611d52565b61030b611d5c565b610354611d80565b6103346105e036600461341d565b611e12565b6105776105f33660046134ec565b611e40565b6103746106063660046134ec565b611e51565b6103746106193660046137bb565b611ea8565b60006001600160a01b03831661064f5760405162461bcd60e51b815260040161064690614082565b60405180910390fd5b5060008181526002602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216630271189760e51b14806106ab57506001600160e01b03198216636cdb3d1360e11b145b806106c657506001600160e01b0319821663152a902d60e11b145b90505b919050565b6000818152600a602052604090206001018054606091906106ee90614bb2565b80601f016020809104026020016040519081016040528092919081815260200182805461071a90614bb2565b80156107675780601f1061073c57610100808354040283529160200191610767565b820191906000526020600020905b81548152906001019060200180831161074a57829003601f168201915b50505050509050919050565b60065460408051634a32c6bf60e11b815290516001600160a01b03909216916391d148549183916394658d7e91600480820192602092909190829003018186803b1580156107c057600080fd5b505afa1580156107d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f891906139e4565b610800611f7b565b6040518363ffffffff1660e01b815260040161081d929190613eec565b60206040518083038186803b15801561083557600080fd5b505afa158015610849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086d91906139b0565b6108895760405162461bcd60e51b815260040161064690614180565b600660009054906101000a90046001600160a01b03166001600160a01b0316635cd423156040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d757600080fd5b505afa1580156108eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090f9190613ab7565b600660009054906101000a90046001600160a01b03166001600160a01b031663fd967f476040518163ffffffff1660e01b815260040160206040518083038186803b15801561095d57600080fd5b505afa158015610971573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109959190613ab7565b61099f9190614ac9565b6fffffffffffffffffffffffffffffffff1681106109cf5760405162461bcd60e51b815260040161064690614911565b60088190556040517f244ea8d7627f5a08f4299862bd5a45752842c183aee5b0fb0d1e4887bfa605b390610a04908390613ee3565b60405180910390a150565b60405162461bcd60e51b815260040161064690614123565b600a60205260009081526040902080546001820180546001600160a01b039092169291610a5390614bb2565b80601f0160208091040260200160405190810160405280929190818152602001828054610a7f90614bb2565b8015610acc5780601f10610aa157610100808354040283529160200191610acc565b820191906000526020600020905b815481529060010190602001808311610aaf57829003601f168201915b505050506002830154600384015460048501546005909501549394919360ff91821693501686565b7f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c81565b60009081526020819052604090206001015490565b6000828152600a6020908152604080832054600654825163fd967f4760e01b815292516001600160a01b039283169594919092169263fd967f479260048083019392829003018186803b158015610b8357600080fd5b505afa158015610b97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbb9190613ab7565b6fffffffffffffffffffffffffffffffff1660085484610bdb9190614b35565b610be59190614b15565b90509250929050565b600660009054906101000a90046001600160a01b03166001600160a01b0316639d2f83f06040518163ffffffff1660e01b815260040160206040518083038186803b158015610c3c57600080fd5b505afa158015610c50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7491906139b0565b15610c915760405162461bcd60e51b815260040161064690614603565b6000828152600a602052604090206003015460ff1615610cc35760405162461bcd60e51b815260040161064690614645565b6000610ccd611f7b565b905081610cda828561061e565b1015610cf85760405162461bcd60e51b815260040161064690614297565b610d0a610d03611f7b565b8484611ea8565b6000838152600a6020526040908190206004908101549151637921219560e11b8152309163f242432a91610d46918491879187918a9101613d38565b600060405180830381600087803b158015610d6057600080fd5b505af1158015610d74573d6000803e3d6000fd5b505050508084836001600160a01b03167fa70022dc131dbd0be52c08bf87947e36b3e7d4934dce1efecf2d261c381d101786604051610db39190613ee3565b60405180910390a450505050565b610dc9611f7b565b6001600160a01b0316856001600160a01b03161480610def5750610def856105e0611f7b565b610e0b5760405162461bcd60e51b81526004016106469061444c565b610e188585858585611f8a565b5050505050565b610e29828261215e565b6000828152600160205260409020610e419082611f39565b505050565b6000908152600a602052604090206003015460ff1690565b610e688282612182565b6000828152600160205260409020610e4190826121c4565b600654604080516309d2f83f60e41b815290516060926001600160a01b031691639d2f83f0916004808301926020929190829003018186803b158015610ec557600080fd5b505afa158015610ed9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efd91906139b0565b15610f1a5760405162461bcd60e51b815260040161064690614603565b610f467f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610531611f7b565b610f625760405162461bcd60e51b8152600401610646906142f4565b8582148015610f7057508584145b610f8c5760405162461bcd60e51b8152600401610646906146a2565b85610fa95760405162461bcd60e51b815260040161064690614392565b8567ffffffffffffffff811115610fd057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610ff9578160200160208202803683370190505b50905060008667ffffffffffffffff81111561102557634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561104e578160200160208202803683370190505b5060075490915060005b88811015611430578183828151811061108157634e487b7160e01b600052603260045260246000fd5b6020026020010181815250506040518060c001604052806110a0611f7b565b6001600160a01b031681526020018989848181106110ce57634e487b7160e01b600052603260045260246000fd5b90506020028101906110e09190614a36565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060200187878481811061113a57634e487b7160e01b600052603260045260246000fd5b905060200201358152602001600115158152602001600081526020016000600281111561117757634e487b7160e01b600052602160045260246000fd5b90526000838152600a602090815260409091208251815473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0390911617815582820151805191926111cd9260018501929091019061317f565b506040820151600280830191909155606083015160038301805491151560ff199283161790556080840151600484015560a0840151600584018054919390929190911690600190849081111561123357634e487b7160e01b600052602160045260246000fd5b021790555061124791506001905083614afd565b91508184828151811061126a57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250506040518060c00160405280611289611f7b565b6001600160a01b031681526020018b8b848181106112b757634e487b7160e01b600052603260045260246000fd5b90506020028101906112c99190614a36565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060200187878481811061132357634e487b7160e01b600052603260045260246000fd5b9050602002013581526020016000151581526020016001846113459190614b54565b8152602001600090526000838152600a602090815260409091208251815473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0390911617815582820151805191926113a29260018501929091019061317f565b506040820151600280830191909155606083015160038301805491151560ff199283161790556080840151600484015560a0840151600584018054919390929190911690600190849081111561140857634e487b7160e01b600052602160045260246000fd5b021790555061141c91506001905083614afd565b91508061142881614bed565b915050611058565b508060078190555061148430838787808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250604080516020810190915290815292506121d9915050565b6114d761148f611f7b565b848787808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250604080516020810190915290815292506121d9915050565b6114df611f7b565b6001600160a01b03167fe309c6cae6e35dcc6c2f37d5da32b19e0346074be56b9722cdf852d20fced6ee848b8b868c8c8c8c604051611525989796959493929190613e03565b60405180910390a250509695505050505050565b6115657f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610531611f7b565b6115815760405162461bcd60e51b8152600401610646906146ff565b61158961235b565b565b606081518351146115ae5760405162461bcd60e51b815260040161064690614816565b6000835167ffffffffffffffff8111156115d857634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611601578160200160208202803683370190505b50905060005b84518110156116a35761166885828151811061163357634e487b7160e01b600052603260045260246000fd5b602002602001015185838151811061165b57634e487b7160e01b600052603260045260246000fd5b602002602001015161061e565b82828151811061168857634e487b7160e01b600052603260045260246000fd5b602090810291909101015261169c81614bed565b9050611607565b509392505050565b60055461010090046001600160a01b0390811691161490565b60055460ff165b90565b6116d6611f7b565b6001600160a01b0316836001600160a01b031614806116fc57506116fc836105e0611f7b565b6117185760405162461bcd60e51b81526004016106469061423a565b610e418383836123c9565b60405162461bcd60e51b81526004016106469061496e565b60075481565b600554600160a81b900460ff1681565b61177d7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610531611f7b565b6117995760405162461bcd60e51b81526004016106469061475c565b61158961256f565b600660009054906101000a90046001600160a01b03166001600160a01b0316639d2f83f06040518163ffffffff1660e01b815260040160206040518083038186803b1580156117ef57600080fd5b505afa158015611803573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182791906139b0565b156118445760405162461bcd60e51b815260040161064690614603565b60006118548c8c8c8c8c8c610e80565b905060008686868686604051602001611871959493929190613f18565b60405160208183030381529060405290506118ca61188d611f7b565b8f848c8c80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250889250610dc1915050565b5050505050505050505050505050565b60065460408051634a32c6bf60e11b815290516001600160a01b03909216916391d148549183916394658d7e91600480820192602092909190829003018186803b15801561192757600080fd5b505afa15801561193b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195f91906139e4565b611967611f7b565b6040518363ffffffff1660e01b8152600401611984929190613eec565b60206040518083038186803b15801561199c57600080fd5b505afa1580156119b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d491906139b0565b6119f05760405162461bcd60e51b815260040161064690614180565b60058054911515600160a81b027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909216919091179055565b6000828152600160205260408120611a4190836125ca565b9392505050565b60007f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6831480611a415750611a418383611f52565b60065460408051634a32c6bf60e11b815290516001600160a01b03909216916391d148549183916394658d7e91600480820192602092909190829003018186803b158015611aca57600080fd5b505afa158015611ade573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0291906139e4565b611b0a611f7b565b6040518363ffffffff1660e01b8152600401611b27929190613eec565b60206040518083038186803b158015611b3f57600080fd5b505afa158015611b53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7791906139b0565b611b935760405162461bcd60e51b815260040161064690614180565b610e4160098383613203565b600081565b816001600160a01b0316611bb6611f7b565b6001600160a01b03161415611bdd5760405162461bcd60e51b8152600401610646906147b9565b8060036000611bea611f7b565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611c2e611f7b565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611c669190613ed8565b60405180910390a35050565b63bc197c8160e01b95945050505050565b60098054611c9090614bb2565b80601f0160208091040260200160405190810160405280929190818152602001828054611cbc90614bb2565b8015611d095780601f10611cde57610100808354040283529160200191611d09565b820191906000526020600020905b815481529060010190602001808311611cec57829003601f168201915b505050505081565b60085481565b60008181526001602052604081206106c6906125d6565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610e6882826125e1565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b606060098054611d8f90614bb2565b80601f0160208091040260200160405190810160405280929190818152602001828054611dbb90614bb2565b8015611e085780601f10611ddd57610100808354040283529160200191611e08565b820191906000526020600020905b815481529060010190602001808311611deb57829003601f168201915b5050505050905090565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b63f23a6e6160e01b95945050505050565b611e59611f7b565b6001600160a01b0316856001600160a01b03161480611e7f5750611e7f856105e0611f7b565b611e9b5760405162461bcd60e51b81526004016106469061423a565b610e188585858585612600565b611eb0611f7b565b6001600160a01b0316836001600160a01b03161480611ed65750611ed6836105e0611f7b565b611ef25760405162461bcd60e51b81526004016106469061423a565b610e41838383612747565b6000611f08336116ab565b15611f1c575060131936013560601c6116cb565b611f24611f4e565b90506116cb565b611f35828261285a565b5050565b6000611a41836001600160a01b0384166128df565b3390565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000611f85611efd565b905090565b8151835114611fab5760405162461bcd60e51b815260040161064690614873565b6001600160a01b038416611fd15760405162461bcd60e51b8152600401610646906143ef565b6000611fdb611f7b565b9050611feb818787878787612929565b60005b84518110156120f057600085828151811061201957634e487b7160e01b600052603260045260246000fd5b60200260200101519050600085838151811061204557634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526002835260408082206001600160a01b038e1683529093529190912054909150818110156120965760405162461bcd60e51b815260040161064690614549565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906120d5908490614afd565b92505081905550505050806120e990614bed565b9050611fee565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612140929190613eaa565b60405180910390a4612156818787878787612ae9565b505050505050565b61216782610b18565b61217881612173611f7b565b612bf7565b610e41838361285a565b61218a611f7b565b6001600160a01b0316816001600160a01b0316146121ba5760405162461bcd60e51b8152600401610646906149cb565b611f358282612c5b565b6000611a41836001600160a01b038416612cde565b6001600160a01b0384166121ff5760405162461bcd60e51b8152600401610646906148d0565b81518351146122205760405162461bcd60e51b815260040161064690614873565b600061222a611f7b565b905061223b81600087878787612929565b60005b84518110156122f35783818151811061226757634e487b7160e01b600052603260045260246000fd5b60200260200101516002600087848151811061229357634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546122db9190614afd565b909155508190506122eb81614bed565b91505061223e565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612344929190613eaa565b60405180910390a4610e1881600087878787612ae9565b6123636116c4565b61237f5760405162461bcd60e51b81526004016106469061404b565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6123b2611f7b565b6040516123bf9190613c83565b60405180910390a1565b6001600160a01b0383166123ef5760405162461bcd60e51b815260040161064690614506565b80518251146124105760405162461bcd60e51b815260040161064690614873565b600061241a611f7b565b905061243a81856000868660405180602001604052806000815250612929565b60005b835181101561251e57600084828151811061246857634e487b7160e01b600052603260045260246000fd5b60200260200101519050600084838151811061249457634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526002835260408082206001600160a01b038c1683529093529190912054909150818110156124e55760405162461bcd60e51b8152600401610646906140df565b60009283526002602090815260408085206001600160a01b038b168652909152909220910390558061251681614bed565b91505061243d565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051610db3929190613eaa565b6125776116c4565b156125945760405162461bcd60e51b81526004016106469061435b565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586123b2611f7b565b6000611a418383612dfb565b60006106c682612e33565b6125ea82610b18565b6125f681612173611f7b565b610e418383612c5b565b6001600160a01b0384166126265760405162461bcd60e51b8152600401610646906143ef565b6000612630611f7b565b905061265081878761264188612e37565b61264a88612e37565b87612929565b60008481526002602090815260408083206001600160a01b038a168452909152902054838110156126935760405162461bcd60e51b815260040161064690614549565b60008581526002602090815260408083206001600160a01b038b81168552925280832087850390559088168252812080548692906126d2908490614afd565b92505081905550856001600160a01b0316876001600160a01b0316836001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628888604051612728929190614a28565b60405180910390a461273e828888888888612e90565b50505050505050565b6001600160a01b03831661276d5760405162461bcd60e51b815260040161064690614506565b6000612777611f7b565b90506127a78185600061278987612e37565b61279287612e37565b60405180602001604052806000815250612929565b60008381526002602090815260408083206001600160a01b0388168452909152902054828110156127ea5760405162461bcd60e51b8152600401610646906140df565b60008481526002602090815260408083206001600160a01b03808a16808652919093528184208786039055905190918516907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f629061284b9089908990614a28565b60405180910390a45050505050565b6128648282611a48565b611f35576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561289b611f7b565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006128eb8383612f61565b61292157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610674565b506000610674565b612937868686868686612f79565b600554600160a81b900460ff16156129bf576129737f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c86611a48565b806129a357506129a37f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c85611a48565b6129bf5760405162461bcd60e51b8152600401610646906145a6565b60005b835181101561273e576001600160a01b038516612a53578281815181106129f957634e487b7160e01b600052603260045260246000fd5b6020026020010151600a6000868481518110612a2557634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206002016000828254612a4d9190614b54565b90915550505b600a6000858381518110612a7757634e487b7160e01b600052603260045260246000fd5b60209081029190910181015182528101919091526040016000206003015460ff1615612ad7576001600160a01b0386161580612abb57506001600160a01b03861630145b612ad75760405162461bcd60e51b8152600401610646906144a9565b80612ae181614bed565b9150506129c2565b612afb846001600160a01b0316612f87565b156121565760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612b349089908990889088908890600401613c97565b602060405180830381600087803b158015612b4e57600080fd5b505af1925050508015612b7e575060408051601f3d908101601f19168201909252612b7b91810190613a5b565b60015b612bc757612b8a614c3a565b80612b955750612baf565b8060405162461bcd60e51b81526004016106469190613f49565b60405162461bcd60e51b815260040161064690613f5c565b6001600160e01b0319811663bc197c8160e01b1461273e5760405162461bcd60e51b815260040161064690613fee565b612c018282611a48565b611f3557612c19816001600160a01b03166014612f8d565b612c24836020612f8d565b604051602001612c35929190613c02565b60408051601f198184030181529082905262461bcd60e51b825261064691600401613f49565b612c658282611a48565b15611f35576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055612c9a611f7b565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60008181526001830160205260408120548015612df1576000612d02600183614b54565b8554909150600090612d1690600190614b54565b9050818114612d97576000866000018281548110612d4457634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080876000018481548110612d7557634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612db657634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610674565b6000915050610674565b6000826000018281548110612e2057634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b5490565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612e7f57634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b612ea2846001600160a01b0316612f87565b156121565760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612edb9089908990889088908890600401613cf5565b602060405180830381600087803b158015612ef557600080fd5b505af1925050508015612f25575060408051601f3d908101601f19168201909252612f2291810190613a5b565b60015b612f3157612b8a614c3a565b6001600160e01b0319811663f23a6e6160e01b1461273e5760405162461bcd60e51b815260040161064690613fee565b60009081526001919091016020526040902054151590565b61215686868686868661314c565b3b151590565b60606000612f9c836002614b35565b612fa7906002614afd565b67ffffffffffffffff811115612fcd57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612ff7576020820181803683370190505b509050600360fc1b8160008151811061302057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061305d57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000613081846002614b35565b61308c906001614afd565b90505b600181111561312d577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106130db57634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106130ff57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361312681614b9b565b905061308f565b508315611a415760405162461bcd60e51b815260040161064690613fb9565b61315a868686868686612156565b6131626116c4565b156121565760405162461bcd60e51b8152600401610646906141dd565b82805461318b90614bb2565b90600052602060002090601f0160209004810192826131ad57600085556131f3565b82601f106131c657805160ff19168380011785556131f3565b828001600101855582156131f3579182015b828111156131f35782518255916020019190600101906131d8565b506131ff929150613277565b5090565b82805461320f90614bb2565b90600052602060002090601f01602090048101928261323157600085556131f3565b82601f1061324a5782800160ff198235161785556131f3565b828001600101855582156131f3579182015b828111156131f357823582559160200191906001019061325c565b5b808211156131ff5760008155600101613278565b80356001600160a01b03811681146106c957600080fd5b60008083601f8401126132b4578182fd5b50813567ffffffffffffffff8111156132cb578182fd5b60208301915083602080830285010111156132e557600080fd5b9250929050565b600082601f8301126132fc578081fd5b8135602061331161330c83614aa5565b614a7b565b828152818101908583018385028701840188101561332d578586fd5b855b8581101561334b5781358452928401929084019060010161332f565b5090979650505050505050565b600082601f830112613368578081fd5b813567ffffffffffffffff81111561338257613382614c1e565b613395601f8201601f1916602001614a7b565b8181528460208386010111156133a9578283fd5b816020850160208301379081016020019190915292915050565b60008083601f8401126133d4578182fd5b50813567ffffffffffffffff8111156133eb578182fd5b6020830191508360208285010111156132e557600080fd5b600060208284031215613414578081fd5b611a418261328c565b6000806040838503121561342f578081fd5b6134388361328c565b9150610be56020840161328c565b600080600080600060a0868803121561345d578081fd5b6134668661328c565b94506134746020870161328c565b9350604086013567ffffffffffffffff80821115613490578283fd5b61349c89838a016132ec565b945060608801359150808211156134b1578283fd5b6134bd89838a016132ec565b935060808801359150808211156134d2578283fd5b506134df88828901613358565b9150509295509295909350565b600080600080600060a08688031215613503578081fd5b61350c8661328c565b945061351a6020870161328c565b93506040860135925060608601359150608086013567ffffffffffffffff811115613543578182fd5b6134df88828901613358565b6000806000806000806000806000806000806101008d8f031215613571578687fd5b61357a8d61328c565b9b5067ffffffffffffffff60208e01351115613594578687fd5b6135a48e60208f01358f016132a3565b909b50995067ffffffffffffffff60408e013511156135c1578687fd5b6135d18e60408f01358f016132a3565b909950975067ffffffffffffffff60608e013511156135ee578687fd5b6135fe8e60608f01358f016132a3565b909750955067ffffffffffffffff60808e0135111561361b578485fd5b61362b8e60808f01358f016133c3565b9c9f9b9e50999c989b979a9699959895979660a08701359660c0810135965060e00135945092505050565b60008060006060848603121561366a578081fd5b6136738461328c565b9250602084013567ffffffffffffffff8082111561368f578283fd5b61369b878388016132ec565b935060408601359150808211156136b0578283fd5b506136bd868287016132ec565b9150509250925092565b600080600080608085870312156136dc578182fd5b6136e58561328c565b9350602085013567ffffffffffffffff80821115613701578384fd5b61370d888389016132ec565b94506040870135915080821115613722578384fd5b61372e888389016132ec565b93506060870135915080821115613743578283fd5b5061375087828801613358565b91505092959194509250565b6000806040838503121561376e578182fd5b6137778361328c565b9150602083013561378781614cdf565b809150509250929050565b600080604083850312156137a4578182fd5b6137ad8361328c565b946020939093013593505050565b6000806000606084860312156137cf578081fd5b6137d88461328c565b95602085013595506040909401359392505050565b60008060008060808587031215613802578182fd5b61380b8561328c565b93506020850135925060408501359150606085013567ffffffffffffffff811115613834578182fd5b61375087828801613358565b60008060408385031215613852578182fd5b823567ffffffffffffffff80821115613869578384fd5b818501915085601f83011261387c578384fd5b8135602061388c61330c83614aa5565b82815281810190858301838502870184018b10156138a8578889fd5b8896505b848710156138d1576138bd8161328c565b8352600196909601959183019183016138ac565b50965050860135925050808211156138e7578283fd5b506138f4858286016132ec565b9150509250929050565b60008060008060008060608789031215613916578384fd5b863567ffffffffffffffff8082111561392d578586fd5b6139398a838b016132a3565b90985096506020890135915080821115613951578586fd5b61395d8a838b016132a3565b90965094506040890135915080821115613975578384fd5b5061398289828a016132a3565b979a9699509497509295939492505050565b6000602082840312156139a5578081fd5b8135611a4181614cdf565b6000602082840312156139c1578081fd5b8151611a4181614cdf565b6000602082840312156139dd578081fd5b5035919050565b6000602082840312156139f5578081fd5b5051919050565b60008060408385031215613a0e578182fd5b82359150610be56020840161328c565b60008060408385031215613a30578182fd5b50508035926020909101359150565b600060208284031215613a50578081fd5b8135611a4181614cf0565b600060208284031215613a6c578081fd5b8151611a4181614cf0565b60008060208385031215613a89578182fd5b823567ffffffffffffffff811115613a9f578283fd5b613aab858286016133c3565b90969095509350505050565b600060208284031215613ac8578081fd5b81516fffffffffffffffffffffffffffffffff81168114611a41578182fd5b818352602080840193600091908185020181018584845b87811015613b655782840389528135601e19883603018112613b1e578687fd5b8701803567ffffffffffffffff811115613b36578788fd5b803603891315613b44578788fd5b613b518682898501613bd8565b9a87019a9550505090840190600101613afe565b5091979650505050505050565b6000815180845260208085019450808401835b83811015613ba157815187529582019590820190600101613b85565b509495945050505050565b60008151808452613bc4816020860160208601614b6b565b601f01601f19169290920160200192915050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351613c3a816017850160208801614b6b565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613c77816028840160208801614b6b565b01602801949350505050565b6001600160a01b0391909116815260200190565b60006001600160a01b03808816835280871660208401525060a06040830152613cc360a0830186613b72565b8281036060840152613cd58186613b72565b90508281036080840152613ce98185613bac565b98975050505050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152613d2d60a0830184613bac565b979650505050505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b60006001600160a01b038816825260c06020830152613d9260c0830188613bac565b9050856040830152841515606083015283608083015260038310613dc657634e487b7160e01b600052602160045260246000fd5b8260a0830152979650505050505050565b6001600160a01b03929092168252602082015260400190565b600060208252611a416020830184613b72565b600060a08252613e1660a083018b613b72565b8281036020840152613e29818a8c613ae7565b90508281036040840152613e3d8189613b72565b90508281036060840152613e52818789613ae7565b905082810360808401528381527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841115613e8b578182fd5b6020840280866020840137016020019081529998505050505050505050565b600060408252613ebd6040830185613b72565b8281036020840152613ecf8185613b72565b95945050505050565b901515815260200190565b90815260200190565b9182526001600160a01b0316602082015260400190565b6001600160e01b031991909116815260200190565b600060808252613f2c608083018789613bd8565b602083019590955250604081019290925260609091015292915050565b600060208252611a416020830184613bac565b60208082526034908201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560408201527f526563656976657220696d706c656d656e746572000000000000000000000000606082015260800190565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a6563746560408201527f6420746f6b656e73000000000000000000000000000000000000000000000000606082015260800190565b60208082526014908201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604082015260600190565b6020808252602b908201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60408201527f65726f2061646472657373000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b60208082526031908201527f4163636573734e46543a2063616e6e6f742075736520726567756c6172206d6960408201527f6e7442617463682066756e6374696f6e2e000000000000000000000000000000606082015260800190565b60208082526038908201527f4163636573734e46543a206f6e6c7920612070726f746f636f6c2061646d696e60408201527f2063616e2063616c6c20746869732066756e6374696f6e2e0000000000000000606082015260800190565b6020808252602c908201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060408201527f7768696c65207061757365640000000000000000000000000000000000000000606082015260800190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201527f20617070726f7665640000000000000000000000000000000000000000000000606082015260800190565b6020808252602e908201527f4163636573734e46543a2043616e6e6f742072656465656d206d6f7265204e4660408201527f5473207468616e206f776e65642e000000000000000000000000000000000000606082015260800190565b60208082526041908201527f4163636573734e46543a204f6e6c79206163636f756e74732077697468204d4960408201527f4e5445525f524f4c452063616e2063616c6c20746869732066756e6374696f6e6060820152601760f91b608082015260a00190565b60208082526010908201527f5061757361626c653a2070617573656400000000000000000000000000000000604082015260600190565b60208082526028908201527f4163636573734e46543a204d75737420637265617465206174206c656173742060408201527f6f6e65204e46542e000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460408201527f6472657373000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526032908201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060408201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000606082015260800190565b60208082526039908201527f4163636573734e46543a2063616e6e6f74207472616e7366657220616e20616360408201527f63657373204e465420746861742069732072656465656d656400000000000000606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201527f72207472616e7366657200000000000000000000000000000000000000000000606082015260800190565b6020808252603c908201527f4163636573734e46543a205472616e736665727320617265207265737472696360408201527f74656420746f205452414e534645525f524f4c4520686f6c6465727300000000606082015260800190565b60208082526022908201527f4163636573734e46543a205468652070726f746f636f6c206973207061757365604082015261321760f11b606082015260800190565b60208082526033908201527f4163636573734e46543a205468697320746f6b656e206973206e6f742072656460408201527f65656d61626c6520666f72206163636573732e00000000000000000000000000606082015260800190565b60208082526036908201527f4163636573734e46543a204d757374207370656369667920657175616c206e7560408201527f6d626572206f6620636f6e6669672076616c7565732e00000000000000000000606082015260800190565b6020808252603b908201527f455243313135355072657365744d696e7465725061757365723a206d7573742060408201527f686176652070617573657220726f6c6520746f20756e70617573650000000000606082015260800190565b60208082526039908201527f455243313135355072657365744d696e7465725061757365723a206d7573742060408201527f686176652070617573657220726f6c6520746f20706175736500000000000000606082015260800190565b60208082526029908201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360408201527f20666f722073656c660000000000000000000000000000000000000000000000606082015260800190565b60208082526029908201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860408201527f206d69736d617463680000000000000000000000000000000000000000000000606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060408201527f6d69736d61746368000000000000000000000000000000000000000000000000606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526029908201527f4e46543a204270732070726f7669646564206d757374206265206c657373207460408201527f68616e20392c3030300000000000000000000000000000000000000000000000606082015260800190565b6020808252602c908201527f4163636573734e46543a2063616e6e6f742075736520726567756c6172206d6960408201527f6e742066756e6374696f6e2e0000000000000000000000000000000000000000606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201527f20726f6c657320666f722073656c660000000000000000000000000000000000606082015260800190565b918252602082015260400190565b6000808335601e19843603018112614a4c578283fd5b83018035915067ffffffffffffffff821115614a66578283fd5b6020019150368190038213156132e557600080fd5b60405181810167ffffffffffffffff81118282101715614a9d57614a9d614c1e565b604052919050565b600067ffffffffffffffff821115614abf57614abf614c1e565b5060209081020190565b60006fffffffffffffffffffffffffffffffff808316818516808303821115614af457614af4614c08565b01949350505050565b60008219821115614b1057614b10614c08565b500190565b600082614b3057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615614b4f57614b4f614c08565b500290565b600082821015614b6657614b66614c08565b500390565b60005b83811015614b86578181015183820152602001614b6e565b83811115614b95576000848401525b50505050565b600081614baa57614baa614c08565b506000190190565b600281046001821680614bc657607f821691505b60208210811415614be757634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614c0157614c01614c08565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60e01c90565b600060443d1015614c4a576116cb565b600481823e6308c379a0614c5e8251614c34565b14614c68576116cb565b6040513d600319016004823e80513d67ffffffffffffffff8160248401118184111715614c9857505050506116cb565b82840192508251915080821115614cb257505050506116cb565b503d83016020828401011115614cca575050506116cb565b601f01601f1916810160200160405291505090565b8015158114614ced57600080fd5b50565b6001600160e01b031981168114614ced57600080fdfea164736f6c6343000800000a9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6000000000000000000000000e5eb16a4ad2f8870112169bd37a77f30e209884c000000000000000000000000aaf2a7c715486a6a20dd8ee629c932b96c09ee6b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102f35760003560e01c806383661b2911610191578063c63adb2b116100e3578063e63ab1e911610097578063f23a6e6111610071578063f23a6e61146105e5578063f242432a146105f8578063f5298aca1461060b576102f3565b8063e63ab1e9146105c2578063e8a3d485146105ca578063e985e9c5146105d2576102f3565b8063ca15c873116100c8578063ca15c87314610594578063d5391393146105a7578063d547741f146105af576102f3565b8063c63adb2b1461058c578063c87b56dd14610341576102f3565b806391d1485411610145578063a22cb4651161011f578063a22cb46514610551578063bc197c8114610564578063c0e7274014610584576102f3565b806391d1485414610523578063938e3d7b14610536578063a217fddf14610549576102f3565b80638aa01653116101765780638aa01653146104dd5780638ba448c2146104f05780639010d07c14610503576102f3565b806383661b29146104cd5780638456cb59146104d5576102f3565b80632f2ff15d1161024a5780634e1273f4116101fe5780636b20c454116101d85780636b20c4541461049f578063731133e9146104b257806375794a3c146104c5576102f3565b80634e1273f414610471578063572b6c05146104845780635c975abb14610497576102f3565b806336568abe1161022f57806336568abe146104365780633c16b12e146104495780633f4ba83a14610469576102f3565b80632f2ff15d1461041057806332d33cd014610423576102f3565b80631f8bc790116102ac5780632a55205a116102865780632a55205a146103c95780632e14bee8146103ea5780632eb2c2d6146103fd576102f3565b80631f8bc79014610389578063206b60f9146103ae578063248a9ca3146103b6576102f3565b80630e89341c116102dd5780630e89341c146103415780631f72d831146103615780631f7fdffa14610376576102f3565b8062fdd58e146102f857806301ffc9a714610321575b600080fd5b61030b610306366004613792565b61061e565b6040516103189190613ee3565b60405180910390f35b61033461032f366004613a3f565b61067a565b6040516103189190613ed8565b61035461034f3660046139cc565b6106ce565b6040516103189190613f49565b61037461036f3660046139cc565b610773565b005b6103746103843660046136c7565b610a0f565b61039c6103973660046139cc565b610a27565b60405161031896959493929190613d70565b61030b610af4565b61030b6103c43660046139cc565b610b18565b6103dc6103d7366004613a1e565b610b2d565b604051610318929190613dd7565b6103746103f8366004613a1e565b610bee565b61037461040b366004613446565b610dc1565b61037461041e3660046139fc565b610e1f565b6103346104313660046139cc565b610e46565b6103746104443660046139fc565b610e5e565b61045c6104573660046138fe565b610e80565b6040516103189190613df0565b610374611539565b61045c61047f366004613840565b61158b565b610334610492366004613403565b6116ab565b6103346116c4565b6103746104ad366004613656565b6116ce565b6103746104c03660046137ed565b611723565b61030b61173b565b610334611741565b610374611751565b6103746104eb36600461354f565b6117a1565b6103746104fe366004613994565b6118da565b610516610511366004613a1e565b611a29565b6040516103189190613c83565b6103346105313660046139fc565b611a48565b610374610544366004613a77565b611a7d565b61030b611b9f565b61037461055f36600461375c565b611ba4565b610577610572366004613446565b611c72565b6040516103189190613f03565b610354611c83565b61030b611d11565b61030b6105a23660046139cc565b611d17565b61030b611d2e565b6103746105bd3660046139fc565b611d52565b61030b611d5c565b610354611d80565b6103346105e036600461341d565b611e12565b6105776105f33660046134ec565b611e40565b6103746106063660046134ec565b611e51565b6103746106193660046137bb565b611ea8565b60006001600160a01b03831661064f5760405162461bcd60e51b815260040161064690614082565b60405180910390fd5b5060008181526002602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216630271189760e51b14806106ab57506001600160e01b03198216636cdb3d1360e11b145b806106c657506001600160e01b0319821663152a902d60e11b145b90505b919050565b6000818152600a602052604090206001018054606091906106ee90614bb2565b80601f016020809104026020016040519081016040528092919081815260200182805461071a90614bb2565b80156107675780601f1061073c57610100808354040283529160200191610767565b820191906000526020600020905b81548152906001019060200180831161074a57829003601f168201915b50505050509050919050565b60065460408051634a32c6bf60e11b815290516001600160a01b03909216916391d148549183916394658d7e91600480820192602092909190829003018186803b1580156107c057600080fd5b505afa1580156107d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f891906139e4565b610800611f7b565b6040518363ffffffff1660e01b815260040161081d929190613eec565b60206040518083038186803b15801561083557600080fd5b505afa158015610849573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086d91906139b0565b6108895760405162461bcd60e51b815260040161064690614180565b600660009054906101000a90046001600160a01b03166001600160a01b0316635cd423156040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d757600080fd5b505afa1580156108eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090f9190613ab7565b600660009054906101000a90046001600160a01b03166001600160a01b031663fd967f476040518163ffffffff1660e01b815260040160206040518083038186803b15801561095d57600080fd5b505afa158015610971573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109959190613ab7565b61099f9190614ac9565b6fffffffffffffffffffffffffffffffff1681106109cf5760405162461bcd60e51b815260040161064690614911565b60088190556040517f244ea8d7627f5a08f4299862bd5a45752842c183aee5b0fb0d1e4887bfa605b390610a04908390613ee3565b60405180910390a150565b60405162461bcd60e51b815260040161064690614123565b600a60205260009081526040902080546001820180546001600160a01b039092169291610a5390614bb2565b80601f0160208091040260200160405190810160405280929190818152602001828054610a7f90614bb2565b8015610acc5780601f10610aa157610100808354040283529160200191610acc565b820191906000526020600020905b815481529060010190602001808311610aaf57829003601f168201915b505050506002830154600384015460048501546005909501549394919360ff91821693501686565b7f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c81565b60009081526020819052604090206001015490565b6000828152600a6020908152604080832054600654825163fd967f4760e01b815292516001600160a01b039283169594919092169263fd967f479260048083019392829003018186803b158015610b8357600080fd5b505afa158015610b97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbb9190613ab7565b6fffffffffffffffffffffffffffffffff1660085484610bdb9190614b35565b610be59190614b15565b90509250929050565b600660009054906101000a90046001600160a01b03166001600160a01b0316639d2f83f06040518163ffffffff1660e01b815260040160206040518083038186803b158015610c3c57600080fd5b505afa158015610c50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7491906139b0565b15610c915760405162461bcd60e51b815260040161064690614603565b6000828152600a602052604090206003015460ff1615610cc35760405162461bcd60e51b815260040161064690614645565b6000610ccd611f7b565b905081610cda828561061e565b1015610cf85760405162461bcd60e51b815260040161064690614297565b610d0a610d03611f7b565b8484611ea8565b6000838152600a6020526040908190206004908101549151637921219560e11b8152309163f242432a91610d46918491879187918a9101613d38565b600060405180830381600087803b158015610d6057600080fd5b505af1158015610d74573d6000803e3d6000fd5b505050508084836001600160a01b03167fa70022dc131dbd0be52c08bf87947e36b3e7d4934dce1efecf2d261c381d101786604051610db39190613ee3565b60405180910390a450505050565b610dc9611f7b565b6001600160a01b0316856001600160a01b03161480610def5750610def856105e0611f7b565b610e0b5760405162461bcd60e51b81526004016106469061444c565b610e188585858585611f8a565b5050505050565b610e29828261215e565b6000828152600160205260409020610e419082611f39565b505050565b6000908152600a602052604090206003015460ff1690565b610e688282612182565b6000828152600160205260409020610e4190826121c4565b600654604080516309d2f83f60e41b815290516060926001600160a01b031691639d2f83f0916004808301926020929190829003018186803b158015610ec557600080fd5b505afa158015610ed9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efd91906139b0565b15610f1a5760405162461bcd60e51b815260040161064690614603565b610f467f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610531611f7b565b610f625760405162461bcd60e51b8152600401610646906142f4565b8582148015610f7057508584145b610f8c5760405162461bcd60e51b8152600401610646906146a2565b85610fa95760405162461bcd60e51b815260040161064690614392565b8567ffffffffffffffff811115610fd057634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610ff9578160200160208202803683370190505b50905060008667ffffffffffffffff81111561102557634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561104e578160200160208202803683370190505b5060075490915060005b88811015611430578183828151811061108157634e487b7160e01b600052603260045260246000fd5b6020026020010181815250506040518060c001604052806110a0611f7b565b6001600160a01b031681526020018989848181106110ce57634e487b7160e01b600052603260045260246000fd5b90506020028101906110e09190614a36565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060200187878481811061113a57634e487b7160e01b600052603260045260246000fd5b905060200201358152602001600115158152602001600081526020016000600281111561117757634e487b7160e01b600052602160045260246000fd5b90526000838152600a602090815260409091208251815473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0390911617815582820151805191926111cd9260018501929091019061317f565b506040820151600280830191909155606083015160038301805491151560ff199283161790556080840151600484015560a0840151600584018054919390929190911690600190849081111561123357634e487b7160e01b600052602160045260246000fd5b021790555061124791506001905083614afd565b91508184828151811061126a57634e487b7160e01b600052603260045260246000fd5b6020026020010181815250506040518060c00160405280611289611f7b565b6001600160a01b031681526020018b8b848181106112b757634e487b7160e01b600052603260045260246000fd5b90506020028101906112c99190614a36565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060200187878481811061132357634e487b7160e01b600052603260045260246000fd5b9050602002013581526020016000151581526020016001846113459190614b54565b8152602001600090526000838152600a602090815260409091208251815473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0390911617815582820151805191926113a29260018501929091019061317f565b506040820151600280830191909155606083015160038301805491151560ff199283161790556080840151600484015560a0840151600584018054919390929190911690600190849081111561140857634e487b7160e01b600052602160045260246000fd5b021790555061141c91506001905083614afd565b91508061142881614bed565b915050611058565b508060078190555061148430838787808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250604080516020810190915290815292506121d9915050565b6114d761148f611f7b565b848787808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250604080516020810190915290815292506121d9915050565b6114df611f7b565b6001600160a01b03167fe309c6cae6e35dcc6c2f37d5da32b19e0346074be56b9722cdf852d20fced6ee848b8b868c8c8c8c604051611525989796959493929190613e03565b60405180910390a250509695505050505050565b6115657f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610531611f7b565b6115815760405162461bcd60e51b8152600401610646906146ff565b61158961235b565b565b606081518351146115ae5760405162461bcd60e51b815260040161064690614816565b6000835167ffffffffffffffff8111156115d857634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611601578160200160208202803683370190505b50905060005b84518110156116a35761166885828151811061163357634e487b7160e01b600052603260045260246000fd5b602002602001015185838151811061165b57634e487b7160e01b600052603260045260246000fd5b602002602001015161061e565b82828151811061168857634e487b7160e01b600052603260045260246000fd5b602090810291909101015261169c81614bed565b9050611607565b509392505050565b60055461010090046001600160a01b0390811691161490565b60055460ff165b90565b6116d6611f7b565b6001600160a01b0316836001600160a01b031614806116fc57506116fc836105e0611f7b565b6117185760405162461bcd60e51b81526004016106469061423a565b610e418383836123c9565b60405162461bcd60e51b81526004016106469061496e565b60075481565b600554600160a81b900460ff1681565b61177d7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610531611f7b565b6117995760405162461bcd60e51b81526004016106469061475c565b61158961256f565b600660009054906101000a90046001600160a01b03166001600160a01b0316639d2f83f06040518163ffffffff1660e01b815260040160206040518083038186803b1580156117ef57600080fd5b505afa158015611803573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061182791906139b0565b156118445760405162461bcd60e51b815260040161064690614603565b60006118548c8c8c8c8c8c610e80565b905060008686868686604051602001611871959493929190613f18565b60405160208183030381529060405290506118ca61188d611f7b565b8f848c8c80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250889250610dc1915050565b5050505050505050505050505050565b60065460408051634a32c6bf60e11b815290516001600160a01b03909216916391d148549183916394658d7e91600480820192602092909190829003018186803b15801561192757600080fd5b505afa15801561193b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061195f91906139e4565b611967611f7b565b6040518363ffffffff1660e01b8152600401611984929190613eec565b60206040518083038186803b15801561199c57600080fd5b505afa1580156119b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d491906139b0565b6119f05760405162461bcd60e51b815260040161064690614180565b60058054911515600160a81b027fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff909216919091179055565b6000828152600160205260408120611a4190836125ca565b9392505050565b60007f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6831480611a415750611a418383611f52565b60065460408051634a32c6bf60e11b815290516001600160a01b03909216916391d148549183916394658d7e91600480820192602092909190829003018186803b158015611aca57600080fd5b505afa158015611ade573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0291906139e4565b611b0a611f7b565b6040518363ffffffff1660e01b8152600401611b27929190613eec565b60206040518083038186803b158015611b3f57600080fd5b505afa158015611b53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7791906139b0565b611b935760405162461bcd60e51b815260040161064690614180565b610e4160098383613203565b600081565b816001600160a01b0316611bb6611f7b565b6001600160a01b03161415611bdd5760405162461bcd60e51b8152600401610646906147b9565b8060036000611bea611f7b565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff191692151592909217909155611c2e611f7b565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611c669190613ed8565b60405180910390a35050565b63bc197c8160e01b95945050505050565b60098054611c9090614bb2565b80601f0160208091040260200160405190810160405280929190818152602001828054611cbc90614bb2565b8015611d095780601f10611cde57610100808354040283529160200191611d09565b820191906000526020600020905b815481529060010190602001808311611cec57829003601f168201915b505050505081565b60085481565b60008181526001602052604081206106c6906125d6565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b610e6882826125e1565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b606060098054611d8f90614bb2565b80601f0160208091040260200160405190810160405280929190818152602001828054611dbb90614bb2565b8015611e085780601f10611ddd57610100808354040283529160200191611e08565b820191906000526020600020905b815481529060010190602001808311611deb57829003601f168201915b5050505050905090565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b63f23a6e6160e01b95945050505050565b611e59611f7b565b6001600160a01b0316856001600160a01b03161480611e7f5750611e7f856105e0611f7b565b611e9b5760405162461bcd60e51b81526004016106469061423a565b610e188585858585612600565b611eb0611f7b565b6001600160a01b0316836001600160a01b03161480611ed65750611ed6836105e0611f7b565b611ef25760405162461bcd60e51b81526004016106469061423a565b610e41838383612747565b6000611f08336116ab565b15611f1c575060131936013560601c6116cb565b611f24611f4e565b90506116cb565b611f35828261285a565b5050565b6000611a41836001600160a01b0384166128df565b3390565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000611f85611efd565b905090565b8151835114611fab5760405162461bcd60e51b815260040161064690614873565b6001600160a01b038416611fd15760405162461bcd60e51b8152600401610646906143ef565b6000611fdb611f7b565b9050611feb818787878787612929565b60005b84518110156120f057600085828151811061201957634e487b7160e01b600052603260045260246000fd5b60200260200101519050600085838151811061204557634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526002835260408082206001600160a01b038e1683529093529190912054909150818110156120965760405162461bcd60e51b815260040161064690614549565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b168252812080548492906120d5908490614afd565b92505081905550505050806120e990614bed565b9050611fee565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612140929190613eaa565b60405180910390a4612156818787878787612ae9565b505050505050565b61216782610b18565b61217881612173611f7b565b612bf7565b610e41838361285a565b61218a611f7b565b6001600160a01b0316816001600160a01b0316146121ba5760405162461bcd60e51b8152600401610646906149cb565b611f358282612c5b565b6000611a41836001600160a01b038416612cde565b6001600160a01b0384166121ff5760405162461bcd60e51b8152600401610646906148d0565b81518351146122205760405162461bcd60e51b815260040161064690614873565b600061222a611f7b565b905061223b81600087878787612929565b60005b84518110156122f35783818151811061226757634e487b7160e01b600052603260045260246000fd5b60200260200101516002600087848151811061229357634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546122db9190614afd565b909155508190506122eb81614bed565b91505061223e565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612344929190613eaa565b60405180910390a4610e1881600087878787612ae9565b6123636116c4565b61237f5760405162461bcd60e51b81526004016106469061404b565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6123b2611f7b565b6040516123bf9190613c83565b60405180910390a1565b6001600160a01b0383166123ef5760405162461bcd60e51b815260040161064690614506565b80518251146124105760405162461bcd60e51b815260040161064690614873565b600061241a611f7b565b905061243a81856000868660405180602001604052806000815250612929565b60005b835181101561251e57600084828151811061246857634e487b7160e01b600052603260045260246000fd5b60200260200101519050600084838151811061249457634e487b7160e01b600052603260045260246000fd5b60209081029190910181015160008481526002835260408082206001600160a01b038c1683529093529190912054909150818110156124e55760405162461bcd60e51b8152600401610646906140df565b60009283526002602090815260408085206001600160a01b038b168652909152909220910390558061251681614bed565b91505061243d565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051610db3929190613eaa565b6125776116c4565b156125945760405162461bcd60e51b81526004016106469061435b565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586123b2611f7b565b6000611a418383612dfb565b60006106c682612e33565b6125ea82610b18565b6125f681612173611f7b565b610e418383612c5b565b6001600160a01b0384166126265760405162461bcd60e51b8152600401610646906143ef565b6000612630611f7b565b905061265081878761264188612e37565b61264a88612e37565b87612929565b60008481526002602090815260408083206001600160a01b038a168452909152902054838110156126935760405162461bcd60e51b815260040161064690614549565b60008581526002602090815260408083206001600160a01b038b81168552925280832087850390559088168252812080548692906126d2908490614afd565b92505081905550856001600160a01b0316876001600160a01b0316836001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628888604051612728929190614a28565b60405180910390a461273e828888888888612e90565b50505050505050565b6001600160a01b03831661276d5760405162461bcd60e51b815260040161064690614506565b6000612777611f7b565b90506127a78185600061278987612e37565b61279287612e37565b60405180602001604052806000815250612929565b60008381526002602090815260408083206001600160a01b0388168452909152902054828110156127ea5760405162461bcd60e51b8152600401610646906140df565b60008481526002602090815260408083206001600160a01b03808a16808652919093528184208786039055905190918516907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f629061284b9089908990614a28565b60405180910390a45050505050565b6128648282611a48565b611f35576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561289b611f7b565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006128eb8383612f61565b61292157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610674565b506000610674565b612937868686868686612f79565b600554600160a81b900460ff16156129bf576129737f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c86611a48565b806129a357506129a37f8502233096d909befbda0999bb8ea2f3a6be3c138b9fbf003752a4c8bce86f6c85611a48565b6129bf5760405162461bcd60e51b8152600401610646906145a6565b60005b835181101561273e576001600160a01b038516612a53578281815181106129f957634e487b7160e01b600052603260045260246000fd5b6020026020010151600a6000868481518110612a2557634e487b7160e01b600052603260045260246000fd5b602002602001015181526020019081526020016000206002016000828254612a4d9190614b54565b90915550505b600a6000858381518110612a7757634e487b7160e01b600052603260045260246000fd5b60209081029190910181015182528101919091526040016000206003015460ff1615612ad7576001600160a01b0386161580612abb57506001600160a01b03861630145b612ad75760405162461bcd60e51b8152600401610646906144a9565b80612ae181614bed565b9150506129c2565b612afb846001600160a01b0316612f87565b156121565760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612b349089908990889088908890600401613c97565b602060405180830381600087803b158015612b4e57600080fd5b505af1925050508015612b7e575060408051601f3d908101601f19168201909252612b7b91810190613a5b565b60015b612bc757612b8a614c3a565b80612b955750612baf565b8060405162461bcd60e51b81526004016106469190613f49565b60405162461bcd60e51b815260040161064690613f5c565b6001600160e01b0319811663bc197c8160e01b1461273e5760405162461bcd60e51b815260040161064690613fee565b612c018282611a48565b611f3557612c19816001600160a01b03166014612f8d565b612c24836020612f8d565b604051602001612c35929190613c02565b60408051601f198184030181529082905262461bcd60e51b825261064691600401613f49565b612c658282611a48565b15611f35576000828152602081815260408083206001600160a01b03851684529091529020805460ff19169055612c9a611f7b565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b60008181526001830160205260408120548015612df1576000612d02600183614b54565b8554909150600090612d1690600190614b54565b9050818114612d97576000866000018281548110612d4457634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080876000018481548110612d7557634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612db657634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610674565b6000915050610674565b6000826000018281548110612e2057634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905092915050565b5490565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612e7f57634e487b7160e01b600052603260045260246000fd5b602090810291909101015292915050565b612ea2846001600160a01b0316612f87565b156121565760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612edb9089908990889088908890600401613cf5565b602060405180830381600087803b158015612ef557600080fd5b505af1925050508015612f25575060408051601f3d908101601f19168201909252612f2291810190613a5b565b60015b612f3157612b8a614c3a565b6001600160e01b0319811663f23a6e6160e01b1461273e5760405162461bcd60e51b815260040161064690613fee565b60009081526001919091016020526040902054151590565b61215686868686868661314c565b3b151590565b60606000612f9c836002614b35565b612fa7906002614afd565b67ffffffffffffffff811115612fcd57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612ff7576020820181803683370190505b509050600360fc1b8160008151811061302057634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061305d57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506000613081846002614b35565b61308c906001614afd565b90505b600181111561312d577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106130db57634e487b7160e01b600052603260045260246000fd5b1a60f81b8282815181106130ff57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361312681614b9b565b905061308f565b508315611a415760405162461bcd60e51b815260040161064690613fb9565b61315a868686868686612156565b6131626116c4565b156121565760405162461bcd60e51b8152600401610646906141dd565b82805461318b90614bb2565b90600052602060002090601f0160209004810192826131ad57600085556131f3565b82601f106131c657805160ff19168380011785556131f3565b828001600101855582156131f3579182015b828111156131f35782518255916020019190600101906131d8565b506131ff929150613277565b5090565b82805461320f90614bb2565b90600052602060002090601f01602090048101928261323157600085556131f3565b82601f1061324a5782800160ff198235161785556131f3565b828001600101855582156131f3579182015b828111156131f357823582559160200191906001019061325c565b5b808211156131ff5760008155600101613278565b80356001600160a01b03811681146106c957600080fd5b60008083601f8401126132b4578182fd5b50813567ffffffffffffffff8111156132cb578182fd5b60208301915083602080830285010111156132e557600080fd5b9250929050565b600082601f8301126132fc578081fd5b8135602061331161330c83614aa5565b614a7b565b828152818101908583018385028701840188101561332d578586fd5b855b8581101561334b5781358452928401929084019060010161332f565b5090979650505050505050565b600082601f830112613368578081fd5b813567ffffffffffffffff81111561338257613382614c1e565b613395601f8201601f1916602001614a7b565b8181528460208386010111156133a9578283fd5b816020850160208301379081016020019190915292915050565b60008083601f8401126133d4578182fd5b50813567ffffffffffffffff8111156133eb578182fd5b6020830191508360208285010111156132e557600080fd5b600060208284031215613414578081fd5b611a418261328c565b6000806040838503121561342f578081fd5b6134388361328c565b9150610be56020840161328c565b600080600080600060a0868803121561345d578081fd5b6134668661328c565b94506134746020870161328c565b9350604086013567ffffffffffffffff80821115613490578283fd5b61349c89838a016132ec565b945060608801359150808211156134b1578283fd5b6134bd89838a016132ec565b935060808801359150808211156134d2578283fd5b506134df88828901613358565b9150509295509295909350565b600080600080600060a08688031215613503578081fd5b61350c8661328c565b945061351a6020870161328c565b93506040860135925060608601359150608086013567ffffffffffffffff811115613543578182fd5b6134df88828901613358565b6000806000806000806000806000806000806101008d8f031215613571578687fd5b61357a8d61328c565b9b5067ffffffffffffffff60208e01351115613594578687fd5b6135a48e60208f01358f016132a3565b909b50995067ffffffffffffffff60408e013511156135c1578687fd5b6135d18e60408f01358f016132a3565b909950975067ffffffffffffffff60608e013511156135ee578687fd5b6135fe8e60608f01358f016132a3565b909750955067ffffffffffffffff60808e0135111561361b578485fd5b61362b8e60808f01358f016133c3565b9c9f9b9e50999c989b979a9699959895979660a08701359660c0810135965060e00135945092505050565b60008060006060848603121561366a578081fd5b6136738461328c565b9250602084013567ffffffffffffffff8082111561368f578283fd5b61369b878388016132ec565b935060408601359150808211156136b0578283fd5b506136bd868287016132ec565b9150509250925092565b600080600080608085870312156136dc578182fd5b6136e58561328c565b9350602085013567ffffffffffffffff80821115613701578384fd5b61370d888389016132ec565b94506040870135915080821115613722578384fd5b61372e888389016132ec565b93506060870135915080821115613743578283fd5b5061375087828801613358565b91505092959194509250565b6000806040838503121561376e578182fd5b6137778361328c565b9150602083013561378781614cdf565b809150509250929050565b600080604083850312156137a4578182fd5b6137ad8361328c565b946020939093013593505050565b6000806000606084860312156137cf578081fd5b6137d88461328c565b95602085013595506040909401359392505050565b60008060008060808587031215613802578182fd5b61380b8561328c565b93506020850135925060408501359150606085013567ffffffffffffffff811115613834578182fd5b61375087828801613358565b60008060408385031215613852578182fd5b823567ffffffffffffffff80821115613869578384fd5b818501915085601f83011261387c578384fd5b8135602061388c61330c83614aa5565b82815281810190858301838502870184018b10156138a8578889fd5b8896505b848710156138d1576138bd8161328c565b8352600196909601959183019183016138ac565b50965050860135925050808211156138e7578283fd5b506138f4858286016132ec565b9150509250929050565b60008060008060008060608789031215613916578384fd5b863567ffffffffffffffff8082111561392d578586fd5b6139398a838b016132a3565b90985096506020890135915080821115613951578586fd5b61395d8a838b016132a3565b90965094506040890135915080821115613975578384fd5b5061398289828a016132a3565b979a9699509497509295939492505050565b6000602082840312156139a5578081fd5b8135611a4181614cdf565b6000602082840312156139c1578081fd5b8151611a4181614cdf565b6000602082840312156139dd578081fd5b5035919050565b6000602082840312156139f5578081fd5b5051919050565b60008060408385031215613a0e578182fd5b82359150610be56020840161328c565b60008060408385031215613a30578182fd5b50508035926020909101359150565b600060208284031215613a50578081fd5b8135611a4181614cf0565b600060208284031215613a6c578081fd5b8151611a4181614cf0565b60008060208385031215613a89578182fd5b823567ffffffffffffffff811115613a9f578283fd5b613aab858286016133c3565b90969095509350505050565b600060208284031215613ac8578081fd5b81516fffffffffffffffffffffffffffffffff81168114611a41578182fd5b818352602080840193600091908185020181018584845b87811015613b655782840389528135601e19883603018112613b1e578687fd5b8701803567ffffffffffffffff811115613b36578788fd5b803603891315613b44578788fd5b613b518682898501613bd8565b9a87019a9550505090840190600101613afe565b5091979650505050505050565b6000815180845260208085019450808401835b83811015613ba157815187529582019590820190600101613b85565b509495945050505050565b60008151808452613bc4816020860160208601614b6b565b601f01601f19169290920160200192915050565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351613c3a816017850160208801614b6b565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613c77816028840160208801614b6b565b01602801949350505050565b6001600160a01b0391909116815260200190565b60006001600160a01b03808816835280871660208401525060a06040830152613cc360a0830186613b72565b8281036060840152613cd58186613b72565b90508281036080840152613ce98185613bac565b98975050505050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152613d2d60a0830184613bac565b979650505050505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260009082015260c00190565b60006001600160a01b038816825260c06020830152613d9260c0830188613bac565b9050856040830152841515606083015283608083015260038310613dc657634e487b7160e01b600052602160045260246000fd5b8260a0830152979650505050505050565b6001600160a01b03929092168252602082015260400190565b600060208252611a416020830184613b72565b600060a08252613e1660a083018b613b72565b8281036020840152613e29818a8c613ae7565b90508281036040840152613e3d8189613b72565b90508281036060840152613e52818789613ae7565b905082810360808401528381527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841115613e8b578182fd5b6020840280866020840137016020019081529998505050505050505050565b600060408252613ebd6040830185613b72565b8281036020840152613ecf8185613b72565b95945050505050565b901515815260200190565b90815260200190565b9182526001600160a01b0316602082015260400190565b6001600160e01b031991909116815260200190565b600060808252613f2c608083018789613bd8565b602083019590955250604081019290925260609091015292915050565b600060208252611a416020830184613bac565b60208082526034908201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560408201527f526563656976657220696d706c656d656e746572000000000000000000000000606082015260800190565b6020808252818101527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604082015260600190565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a6563746560408201527f6420746f6b656e73000000000000000000000000000000000000000000000000606082015260800190565b60208082526014908201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604082015260600190565b6020808252602b908201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60408201527f65726f2061646472657373000000000000000000000000000000000000000000606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b60208082526031908201527f4163636573734e46543a2063616e6e6f742075736520726567756c6172206d6960408201527f6e7442617463682066756e6374696f6e2e000000000000000000000000000000606082015260800190565b60208082526038908201527f4163636573734e46543a206f6e6c7920612070726f746f636f6c2061646d696e60408201527f2063616e2063616c6c20746869732066756e6374696f6e2e0000000000000000606082015260800190565b6020808252602c908201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060408201527f7768696c65207061757365640000000000000000000000000000000000000000606082015260800190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201527f20617070726f7665640000000000000000000000000000000000000000000000606082015260800190565b6020808252602e908201527f4163636573734e46543a2043616e6e6f742072656465656d206d6f7265204e4660408201527f5473207468616e206f776e65642e000000000000000000000000000000000000606082015260800190565b60208082526041908201527f4163636573734e46543a204f6e6c79206163636f756e74732077697468204d4960408201527f4e5445525f524f4c452063616e2063616c6c20746869732066756e6374696f6e6060820152601760f91b608082015260a00190565b60208082526010908201527f5061757361626c653a2070617573656400000000000000000000000000000000604082015260600190565b60208082526028908201527f4163636573734e46543a204d75737420637265617465206174206c656173742060408201527f6f6e65204e46542e000000000000000000000000000000000000000000000000606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460408201527f6472657373000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526032908201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060408201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000606082015260800190565b60208082526039908201527f4163636573734e46543a2063616e6e6f74207472616e7366657220616e20616360408201527f63657373204e465420746861742069732072656465656d656400000000000000606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201527f72207472616e7366657200000000000000000000000000000000000000000000606082015260800190565b6020808252603c908201527f4163636573734e46543a205472616e736665727320617265207265737472696360408201527f74656420746f205452414e534645525f524f4c4520686f6c6465727300000000606082015260800190565b60208082526022908201527f4163636573734e46543a205468652070726f746f636f6c206973207061757365604082015261321760f11b606082015260800190565b60208082526033908201527f4163636573734e46543a205468697320746f6b656e206973206e6f742072656460408201527f65656d61626c6520666f72206163636573732e00000000000000000000000000606082015260800190565b60208082526036908201527f4163636573734e46543a204d757374207370656369667920657175616c206e7560408201527f6d626572206f6620636f6e6669672076616c7565732e00000000000000000000606082015260800190565b6020808252603b908201527f455243313135355072657365744d696e7465725061757365723a206d7573742060408201527f686176652070617573657220726f6c6520746f20756e70617573650000000000606082015260800190565b60208082526039908201527f455243313135355072657365744d696e7465725061757365723a206d7573742060408201527f686176652070617573657220726f6c6520746f20706175736500000000000000606082015260800190565b60208082526029908201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360408201527f20666f722073656c660000000000000000000000000000000000000000000000606082015260800190565b60208082526029908201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860408201527f206d69736d617463680000000000000000000000000000000000000000000000606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060408201527f6d69736d61746368000000000000000000000000000000000000000000000000606082015260800190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526029908201527f4e46543a204270732070726f7669646564206d757374206265206c657373207460408201527f68616e20392c3030300000000000000000000000000000000000000000000000606082015260800190565b6020808252602c908201527f4163636573734e46543a2063616e6e6f742075736520726567756c6172206d6960408201527f6e742066756e6374696f6e2e0000000000000000000000000000000000000000606082015260800190565b6020808252602f908201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560408201527f20726f6c657320666f722073656c660000000000000000000000000000000000606082015260800190565b918252602082015260400190565b6000808335601e19843603018112614a4c578283fd5b83018035915067ffffffffffffffff821115614a66578283fd5b6020019150368190038213156132e557600080fd5b60405181810167ffffffffffffffff81118282101715614a9d57614a9d614c1e565b604052919050565b600067ffffffffffffffff821115614abf57614abf614c1e565b5060209081020190565b60006fffffffffffffffffffffffffffffffff808316818516808303821115614af457614af4614c08565b01949350505050565b60008219821115614b1057614b10614c08565b500190565b600082614b3057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615614b4f57614b4f614c08565b500290565b600082821015614b6657614b66614c08565b500390565b60005b83811015614b86578181015183820152602001614b6e565b83811115614b95576000848401525b50505050565b600081614baa57614baa614c08565b506000190190565b600281046001821680614bc657607f821691505b60208210811415614be757634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614c0157614c01614c08565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60e01c90565b600060443d1015614c4a576116cb565b600481823e6308c379a0614c5e8251614c34565b14614c68576116cb565b6040513d600319016004823e80513d67ffffffffffffffff8160248401118184111715614c9857505050506116cb565b82840192508251915080821115614cb257505050506116cb565b503d83016020828401011115614cca575050506116cb565b601f01601f1916810160200160405291505090565b8015158114614ced57600080fd5b50565b6001600160e01b031981168114614ced57600080fdfea164736f6c6343000800000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000e5eb16a4ad2f8870112169bd37a77f30e209884c000000000000000000000000aaf2a7c715486a6a20dd8ee629c932b96c09ee6b00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _controlCenter (address): 0xe5Eb16a4AD2f8870112169BD37a77f30e209884c
Arg [1] : _trustedForwarder (address): 0xaAf2a7C715486A6a20dD8eE629c932b96C09eE6B
Arg [2] : _uri (string):
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000e5eb16a4ad2f8870112169bd37a77f30e209884c
Arg [1] : 000000000000000000000000aaf2a7c715486a6a20dd8ee629c932b96c09ee6b
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
[ 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.