ERC-1155
Source Code
Overview
Max Total Supply
0
Holders
25,831
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
GoodMindsArtDrops
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "creator-core-solidity/ERC1155Creator.sol";
contract GoodMindsArtDrops is ERC1155Creator {
constructor() ERC1155Creator() {}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "openzeppelin-contracts/token/ERC1155/ERC1155.sol";
import "libraries-solidity/access/AdminControl.sol";
import "./core/ERC1155CreatorCore.sol";
/**
* @dev ERC1155Creator implementation
*/
contract ERC1155Creator is AdminControl, ERC1155, ERC1155CreatorCore {
mapping(uint256 => uint256) private _totalSupply;
constructor() ERC1155("") {}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC1155, ERC1155CreatorCore, AdminControl)
returns (bool)
{
return
ERC1155CreatorCore.supportsInterface(interfaceId) ||
ERC1155.supportsInterface(interfaceId) ||
AdminControl.supportsInterface(interfaceId);
}
function _beforeTokenTransfer(
address,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory
) internal virtual override {
_approveTransfer(from, to, ids, amounts);
}
/**
* @dev See {ICreatorCore-registerExtension}.
*/
function registerExtension(address extension, string calldata baseURI)
external
override
adminRequired
nonBlacklistRequired(extension)
{
_registerExtension(extension, baseURI, false);
}
/**
* @dev See {ICreatorCore-registerExtension}.
*/
function registerExtension(
address extension,
string calldata baseURI,
bool baseURIIdentical
) external override adminRequired nonBlacklistRequired(extension) {
_registerExtension(extension, baseURI, baseURIIdentical);
}
/**
* @dev See {ICreatorCore-unregisterExtension}.
*/
function unregisterExtension(address extension)
external
override
adminRequired
{
_unregisterExtension(extension);
}
/**
* @dev See {ICreatorCore-blacklistExtension}.
*/
function blacklistExtension(address extension)
external
override
adminRequired
{
_blacklistExtension(extension);
}
/**
* @dev See {ICreatorCore-setBaseTokenURIExtension}.
*/
function setBaseTokenURIExtension(string calldata uri_)
external
override
extensionRequired
{
_setBaseTokenURIExtension(uri_, false);
}
/**
* @dev See {ICreatorCore-setBaseTokenURIExtension}.
*/
function setBaseTokenURIExtension(string calldata uri_, bool identical)
external
override
extensionRequired
{
_setBaseTokenURIExtension(uri_, identical);
}
/**
* @dev See {ICreatorCore-setTokenURIPrefixExtension}.
*/
function setTokenURIPrefixExtension(string calldata prefix)
external
override
extensionRequired
{
_setTokenURIPrefixExtension(prefix);
}
/**
* @dev See {ICreatorCore-setTokenURIExtension}.
*/
function setTokenURIExtension(uint256 tokenId, string calldata uri_)
external
override
extensionRequired
{
_setTokenURIExtension(tokenId, uri_);
}
/**
* @dev See {ICreatorCore-setTokenURIExtension}.
*/
function setTokenURIExtension(
uint256[] memory tokenIds,
string[] calldata uris
) external override extensionRequired {
require(tokenIds.length == uris.length, "Invalid input");
for (uint256 i = 0; i < tokenIds.length; i++) {
_setTokenURIExtension(tokenIds[i], uris[i]);
}
}
/**
* @dev See {ICreatorCore-setBaseTokenURI}.
*/
function setBaseTokenURI(string calldata uri_)
external
override
adminRequired
{
_setBaseTokenURI(uri_);
}
/**
* @dev See {ICreatorCore-setTokenURIPrefix}.
*/
function setTokenURIPrefix(string calldata prefix)
external
override
adminRequired
{
_setTokenURIPrefix(prefix);
}
/**
* @dev See {ICreatorCore-setTokenURI}.
*/
function setTokenURI(uint256 tokenId, string calldata uri_)
external
override
adminRequired
{
_setTokenURI(tokenId, uri_);
}
/**
* @dev See {ICreatorCore-setTokenURI}.
*/
function setTokenURI(uint256[] memory tokenIds, string[] calldata uris)
external
override
adminRequired
{
require(tokenIds.length == uris.length, "Invalid input");
for (uint256 i = 0; i < tokenIds.length; i++) {
_setTokenURI(tokenIds[i], uris[i]);
}
}
/**
* @dev See {ICreatorCore-setMintPermissions}.
*/
function setMintPermissions(address extension, address permissions)
external
override
adminRequired
{
_setMintPermissions(extension, permissions);
}
/**
* @dev See {IERC1155CreatorCore-mintBaseNew}.
*/
function mintBaseNew(
address[] calldata to,
uint256[] calldata amounts,
string[] calldata uris
)
public
virtual
override
nonReentrant
adminRequired
returns (uint256[] memory)
{
return _mintNew(address(this), to, amounts, uris);
}
/**
* @dev See {IERC1155CreatorCore-mintBaseExisting}.
*/
function mintBaseExisting(
address[] calldata to,
uint256[] calldata tokenIds,
uint256[] calldata amounts
) public virtual override nonReentrant adminRequired {
for (uint256 i = 0; i < tokenIds.length; i++) {
require(
_tokensExtension[tokenIds[i]] == address(this),
"A token was created by an extension"
);
}
_mintExisting(address(this), to, tokenIds, amounts);
}
/**
* @dev See {IERC1155CreatorCore-mintExtensionNew}.
*/
function mintExtensionNew(
address[] calldata to,
uint256[] calldata amounts,
string[] calldata uris
)
public
virtual
override
nonReentrant
extensionRequired
returns (uint256[] memory tokenIds)
{
return _mintNew(msg.sender, to, amounts, uris);
}
/**
* @dev See {IERC1155CreatorCore-mintExtensionExisting}.
*/
function mintExtensionExisting(
address[] calldata to,
uint256[] calldata tokenIds,
uint256[] calldata amounts
) public virtual override nonReentrant extensionRequired {
for (uint256 i = 0; i < tokenIds.length; i++) {
require(
_tokensExtension[tokenIds[i]] == address(msg.sender),
"A token was not created by this extension"
);
}
_mintExisting(msg.sender, to, tokenIds, amounts);
}
/**
* @dev Mint new tokens
*/
function _mintNew(
address extension,
address[] memory to,
uint256[] memory amounts,
string[] memory uris
) internal returns (uint256[] memory tokenIds) {
if (to.length > 1) {
// Multiple receiver. Give every receiver the same new token
tokenIds = new uint256[](1);
require(
uris.length <= 1 &&
(amounts.length == 1 || to.length == amounts.length),
"Invalid input"
);
} else {
// Single receiver. Generating multiple tokens
tokenIds = new uint256[](amounts.length);
require(
uris.length == 0 || amounts.length == uris.length,
"Invalid input"
);
}
// Assign tokenIds
for (uint256 i = 0; i < tokenIds.length; i++) {
_tokenCount++;
tokenIds[i] = _tokenCount;
// Track the extension that minted the token
_tokensExtension[_tokenCount] = extension;
}
if (extension != address(this)) {
_checkMintPermissions(to, tokenIds, amounts);
}
if (to.length == 1 && tokenIds.length == 1) {
// Single mint
_mint(to[0], tokenIds[0], amounts[0], new bytes(0));
} else if (to.length > 1) {
// Multiple receivers. Receiving the same token
if (amounts.length == 1) {
// Everyone receiving the same amount
for (uint256 i = 0; i < to.length; i++) {
_mint(to[i], tokenIds[0], amounts[0], new bytes(0));
}
} else {
// Everyone receiving different amounts
for (uint256 i = 0; i < to.length; i++) {
_mint(to[i], tokenIds[0], amounts[i], new bytes(0));
}
}
} else {
_mintBatch(to[0], tokenIds, amounts, new bytes(0));
}
for (uint256 i = 0; i < tokenIds.length; i++) {
if (i < uris.length && bytes(uris[i]).length > 0) {
_tokenURIs[tokenIds[i]] = uris[i];
}
}
return tokenIds;
}
/**
* @dev Mint existing tokens
*/
function _mintExisting(
address extension,
address[] memory to,
uint256[] memory tokenIds,
uint256[] memory amounts
) internal {
if (extension != address(this)) {
_checkMintPermissions(to, tokenIds, amounts);
}
if (to.length == 1 && tokenIds.length == 1 && amounts.length == 1) {
// Single mint
_mint(to[0], tokenIds[0], amounts[0], new bytes(0));
} else if (to.length == 1 && tokenIds.length == amounts.length) {
// Batch mint to same receiver
_mintBatch(to[0], tokenIds, amounts, new bytes(0));
} else if (tokenIds.length == 1 && amounts.length == 1) {
// Mint of the same token/token amounts to various receivers
for (uint256 i = 0; i < to.length; i++) {
_mint(to[i], tokenIds[0], amounts[0], new bytes(0));
}
} else if (tokenIds.length == 1 && to.length == amounts.length) {
// Mint of the same token with different amounts to different receivers
for (uint256 i = 0; i < to.length; i++) {
_mint(to[i], tokenIds[0], amounts[i], new bytes(0));
}
} else if (
to.length == tokenIds.length && to.length == amounts.length
) {
// Mint of different tokens and different amounts to different receivers
for (uint256 i = 0; i < to.length; i++) {
_mint(to[i], tokenIds[i], amounts[i], new bytes(0));
}
} else {
revert("Invalid input");
}
}
/**
* @dev See {IERC1155CreatorCore-tokenExtension}.
*/
function tokenExtension(uint256 tokenId)
public
view
virtual
override
returns (address)
{
return _tokenExtension(tokenId);
}
/**
* @dev See {IERC1155CreatorCore-burn}.
*/
function burn(
address account,
uint256[] memory tokenIds,
uint256[] memory amounts
) public virtual override nonReentrant {
require(
account == msg.sender || isApprovedForAll(account, msg.sender),
"Caller is not owner nor approved"
);
require(tokenIds.length == amounts.length, "Invalid input");
if (tokenIds.length == 1) {
_burn(account, tokenIds[0], amounts[0]);
} else {
_burnBatch(account, tokenIds, amounts);
}
_postBurn(account, tokenIds, amounts);
}
/**
* @dev See {ICreatorCore-setRoyalties}.
*/
function setRoyalties(
address payable[] calldata receivers,
uint256[] calldata basisPoints
) external override adminRequired {
_setRoyaltiesExtension(address(this), receivers, basisPoints);
}
/**
* @dev See {ICreatorCore-setRoyalties}.
*/
function setRoyalties(
uint256 tokenId,
address payable[] calldata receivers,
uint256[] calldata basisPoints
) external override adminRequired {
_setRoyalties(tokenId, receivers, basisPoints);
}
/**
* @dev See {ICreatorCore-setRoyaltiesExtension}.
*/
function setRoyaltiesExtension(
address extension,
address payable[] calldata receivers,
uint256[] calldata basisPoints
) external override adminRequired {
_setRoyaltiesExtension(extension, receivers, basisPoints);
}
/**
* @dev See {ICreatorCore-getRoyalties}.
*/
function getRoyalties(uint256 tokenId)
external
view
virtual
override
returns (address payable[] memory, uint256[] memory)
{
return _getRoyalties(tokenId);
}
/**
* @dev See {ICreatorCore-getFees}.
*/
function getFees(uint256 tokenId)
external
view
virtual
override
returns (address payable[] memory, uint256[] memory)
{
return _getRoyalties(tokenId);
}
/**
* @dev See {ICreatorCore-getFeeRecipients}.
*/
function getFeeRecipients(uint256 tokenId)
external
view
virtual
override
returns (address payable[] memory)
{
return _getRoyaltyReceivers(tokenId);
}
/**
* @dev See {ICreatorCore-getFeeBps}.
*/
function getFeeBps(uint256 tokenId)
external
view
virtual
override
returns (uint256[] memory)
{
return _getRoyaltyBPS(tokenId);
}
/**
* @dev See {ICreatorCore-royaltyInfo}.
*/
function royaltyInfo(uint256 tokenId, uint256 value)
external
view
virtual
override
returns (address, uint256)
{
return _getRoyaltyInfo(tokenId, value);
}
/**
* @dev See {IERC1155-uri}.
*/
function uri(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
return _tokenURI(tokenId);
}
/**
* @dev Total amount of tokens in with a given id.
*/
function totalSupply(uint256 tokenId)
external
view
virtual
override
returns (uint256)
{
return _totalSupply[tokenId];
}
/**
* @dev See {ERC1155-_mint}.
*/
function _mint(
address account,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual override {
super._mint(account, id, amount, data);
_totalSupply[id] += amount;
}
/**
* @dev See {ERC1155-_mintBatch}.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
super._mintBatch(to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
_totalSupply[ids[i]] += amounts[i];
}
}
/**
* @dev See {ERC1155-_burn}.
*/
function _burn(
address account,
uint256 id,
uint256 amount
) internal virtual override {
super._burn(account, id, amount);
_totalSupply[id] -= amount;
}
/**
* @dev See {ERC1155-_burnBatch}.
*/
function _burnBatch(
address account,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual override {
super._burnBatch(account, ids, amounts);
for (uint256 i = 0; i < ids.length; ++i) {
_totalSupply[ids[i]] -= amounts[i];
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri_) {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: address zero is not a valid owner");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner or 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: caller is not token owner or 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();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, to, ids, amounts, 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);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_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);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* 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 _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);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `ids` and `amounts` 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 {}
/**
* @dev Hook that is called after 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 _afterTokenTransfer(
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;
/// @author: manifold.xyz
import "openzeppelin-contracts/utils/introspection/ERC165.sol";
import "openzeppelin-contracts/utils/structs/EnumerableSet.sol";
import "openzeppelin-contracts/access/Ownable.sol";
import "./IAdminControl.sol";
abstract contract AdminControl is Ownable, IAdminControl, ERC165 {
using EnumerableSet for EnumerableSet.AddressSet;
// Track registered admins
EnumerableSet.AddressSet private _admins;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
return
interfaceId == type(IAdminControl).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev Only allows approved admins to call the specified function
*/
modifier adminRequired() {
require(
owner() == msg.sender || _admins.contains(msg.sender),
"AdminControl: Must be owner or admin"
);
_;
}
/**
* @dev See {IAdminControl-getAdmins}.
*/
function getAdmins()
external
view
override
returns (address[] memory admins)
{
admins = new address[](_admins.length());
for (uint256 i = 0; i < _admins.length(); i++) {
admins[i] = _admins.at(i);
}
return admins;
}
/**
* @dev See {IAdminControl-approveAdmin}.
*/
function approveAdmin(address admin) external override onlyOwner {
if (!_admins.contains(admin)) {
emit AdminApproved(admin, msg.sender);
_admins.add(admin);
}
}
/**
* @dev See {IAdminControl-revokeAdmin}.
*/
function revokeAdmin(address admin) external override onlyOwner {
if (_admins.contains(admin)) {
emit AdminRevoked(admin, msg.sender);
_admins.remove(admin);
}
}
/**
* @dev See {IAdminControl-isAdmin}.
*/
function isAdmin(address admin) public view override returns (bool) {
return (owner() == admin || _admins.contains(admin));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "openzeppelin-contracts/utils/structs/EnumerableSet.sol";
import "../extensions/ERC1155/IERC1155CreatorExtensionApproveTransfer.sol";
import "../extensions/ERC1155/IERC1155CreatorExtensionBurnable.sol";
import "../permissions/ERC1155/IERC1155CreatorMintPermissions.sol";
import "./IERC1155CreatorCore.sol";
import "./CreatorCore.sol";
/**
* @dev Core ERC1155 creator implementation
*/
abstract contract ERC1155CreatorCore is CreatorCore, IERC1155CreatorCore {
using EnumerableSet for EnumerableSet.AddressSet;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(CreatorCore, IERC165)
returns (bool)
{
return
interfaceId == type(IERC1155CreatorCore).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {ICreatorCore-setApproveTransferExtension}.
*/
function setApproveTransferExtension(bool enabled)
external
override
extensionRequired
{
require(
!enabled ||
ERC165Checker.supportsInterface(
msg.sender,
type(IERC1155CreatorExtensionApproveTransfer).interfaceId
),
"Extension must implement IERC1155CreatorExtensionApproveTransfer"
);
if (_extensionApproveTransfers[msg.sender] != enabled) {
_extensionApproveTransfers[msg.sender] = enabled;
emit ExtensionApproveTransferUpdated(msg.sender, enabled);
}
}
/**
* @dev Set mint permissions for an extension
*/
function _setMintPermissions(address extension, address permissions)
internal
{
require(_extensions.contains(extension), "Invalid extension");
require(
permissions == address(0x0) ||
ERC165Checker.supportsInterface(
permissions,
type(IERC1155CreatorMintPermissions).interfaceId
),
"Invalid address"
);
if (_extensionPermissions[extension] != permissions) {
_extensionPermissions[extension] = permissions;
emit MintPermissionsUpdated(extension, permissions, msg.sender);
}
}
/**
* Check if an extension can mint
*/
function _checkMintPermissions(
address[] memory to,
uint256[] memory tokenIds,
uint256[] memory amounts
) internal {
if (_extensionPermissions[msg.sender] != address(0x0)) {
IERC1155CreatorMintPermissions(_extensionPermissions[msg.sender])
.approveMint(msg.sender, to, tokenIds, amounts);
}
}
/**
* Post burn actions
*/
function _postBurn(
address owner,
uint256[] memory tokenIds,
uint256[] memory amounts
) internal virtual {
require(tokenIds.length > 0, "Invalid input");
address extension = _tokensExtension[tokenIds[0]];
for (uint256 i = 0; i < tokenIds.length; i++) {
require(
_tokensExtension[tokenIds[i]] == extension,
"Mismatched token originators"
);
}
// Callback to originating extension if needed
if (extension != address(this)) {
if (
ERC165Checker.supportsInterface(
extension,
type(IERC1155CreatorExtensionBurnable).interfaceId
)
) {
IERC1155CreatorExtensionBurnable(extension).onBurn(
owner,
tokenIds,
amounts
);
}
}
}
/**
* Approve a transfer
*/
function _approveTransfer(
address from,
address to,
uint256[] memory tokenIds,
uint256[] memory amounts
) internal {
require(tokenIds.length > 0, "Invalid input");
address extension = _tokensExtension[tokenIds[0]];
for (uint256 i = 0; i < tokenIds.length; i++) {
require(
_tokensExtension[tokenIds[i]] == extension,
"Mismatched token originators"
);
}
if (_extensionApproveTransfers[extension]) {
require(
IERC1155CreatorExtensionApproveTransfer(extension)
.approveTransfer(from, to, tokenIds, amounts),
"Extension approval failure"
);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
import "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or 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 {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)
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.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
* ====
*/
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) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// 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;
/// @solidity memory-safe-assembly
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 in 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;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "openzeppelin-contracts/utils/introspection/IERC165.sol";
/**
* @dev Interface for admin control
*/
interface IAdminControl is IERC165 {
event AdminApproved(address indexed account, address indexed sender);
event AdminRevoked(address indexed account, address indexed sender);
/**
* @dev gets address of all admins
*/
function getAdmins() external view returns (address[] memory);
/**
* @dev add an admin. Can only be called by contract owner.
*/
function approveAdmin(address admin) external;
/**
* @dev remove an admin. Can only be called by contract owner.
*/
function revokeAdmin(address admin) external;
/**
* @dev checks whether or not given address is an admin
* Returns True if they are
*/
function isAdmin(address admin) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "openzeppelin-contracts/utils/introspection/IERC165.sol";
/**
* Implement this if you want your extension to approve a transfer
*/
interface IERC1155CreatorExtensionApproveTransfer is IERC165 {
/**
* @dev Set whether or not the creator contract will check the extension for approval of token transfer
*/
function setApproveTransfer(address creator, bool enabled) external;
/**
* @dev Called by creator contract to approve a transfer
*/
function approveTransfer(
address from,
address to,
uint256[] calldata tokenIds,
uint256[] calldata amounts
) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "openzeppelin-contracts/utils/introspection/IERC165.sol";
/**
* @dev Your extension is required to implement this interface if it wishes
* to receive the onBurn callback whenever a token the extension created is
* burned
*/
interface IERC1155CreatorExtensionBurnable is IERC165 {
/**
* @dev callback handler for burn events
*/
function onBurn(
address owner,
uint256[] calldata tokenIds,
uint256[] calldata amounts
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "openzeppelin-contracts/utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155Creator compliant extension contracts.
*/
interface IERC1155CreatorMintPermissions is IERC165 {
/**
* @dev get approval to mint
*/
function approveMint(
address extension,
address[] calldata to,
uint256[] calldata tokenIds,
uint256[] calldata amounts
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "./CreatorCore.sol";
/**
* @dev Core ERC1155 creator interface
*/
interface IERC1155CreatorCore is ICreatorCore {
/**
* @dev mint a token with no extension. Can only be called by an admin.
*
* @param to - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients)
* @param amounts - Can be a single element array (all recipients get the same amount) or a multi-element array
* @param uris - If no elements, all tokens use the default uri.
* If any element is an empty string, the corresponding token uses the default uri.
*
*
* Requirements: If to is a multi-element array, then uris must be empty or single element array
* If to is a multi-element array, then amounts must be a single element array or a multi-element array of the same size
* If to is a single element array, uris must be empty or the same length as amounts
*
* Examples:
* mintBaseNew(['0x....1', '0x....2'], [1], [])
* Mints a single new token, and gives 1 each to '0x....1' and '0x....2'. Token uses default uri.
*
* mintBaseNew(['0x....1', '0x....2'], [1, 2], [])
* Mints a single new token, and gives 1 to '0x....1' and 2 to '0x....2'. Token uses default uri.
*
* mintBaseNew(['0x....1'], [1, 2], ["", "http://token2.com"])
* Mints two new tokens to '0x....1'. 1 of the first token, 2 of the second. 1st token uses default uri, second uses "http://token2.com".
*
* @return Returns list of tokenIds minted
*/
function mintBaseNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) external returns (uint256[] memory);
/**
* @dev batch mint existing token with no extension. Can only be called by an admin.
*
* @param to - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients)
* @param tokenIds - Can be a single element array (all recipients get the same token) or a multi-element array
* @param amounts - Can be a single element array (all recipients get the same amount) or a multi-element array
*
* Requirements: If any of the parameters are multi-element arrays, they need to be the same length as other multi-element arrays
*
* Examples:
* mintBaseExisting(['0x....1', '0x....2'], [1], [10])
* Mints 10 of tokenId 1 to each of '0x....1' and '0x....2'.
*
* mintBaseExisting(['0x....1', '0x....2'], [1, 2], [10, 20])
* Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 2 to '0x....2'.
*
* mintBaseExisting(['0x....1'], [1, 2], [10, 20])
* Mints 10 of tokenId 1 and 20 of tokenId 2 to '0x....1'.
*
* mintBaseExisting(['0x....1', '0x....2'], [1], [10, 20])
* Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 1 to '0x....2'.
*
*/
function mintBaseExisting(address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) external;
/**
* @dev mint a token from an extension. Can only be called by a registered extension.
*
* @param to - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients)
* @param amounts - Can be a single element array (all recipients get the same amount) or a multi-element array
* @param uris - If no elements, all tokens use the default uri.
* If any element is an empty string, the corresponding token uses the default uri.
*
*
* Requirements: If to is a multi-element array, then uris must be empty or single element array
* If to is a multi-element array, then amounts must be a single element array or a multi-element array of the same size
* If to is a single element array, uris must be empty or the same length as amounts
*
* Examples:
* mintExtensionNew(['0x....1', '0x....2'], [1], [])
* Mints a single new token, and gives 1 each to '0x....1' and '0x....2'. Token uses default uri.
*
* mintExtensionNew(['0x....1', '0x....2'], [1, 2], [])
* Mints a single new token, and gives 1 to '0x....1' and 2 to '0x....2'. Token uses default uri.
*
* mintExtensionNew(['0x....1'], [1, 2], ["", "http://token2.com"])
* Mints two new tokens to '0x....1'. 1 of the first token, 2 of the second. 1st token uses default uri, second uses "http://token2.com".
*
* @return Returns list of tokenIds minted
*/
function mintExtensionNew(address[] calldata to, uint256[] calldata amounts, string[] calldata uris) external returns (uint256[] memory);
/**
* @dev batch mint existing token from extension. Can only be called by a registered extension.
*
* @param to - Can be a single element array (all tokens go to same address) or multi-element array (single token to many recipients)
* @param tokenIds - Can be a single element array (all recipients get the same token) or a multi-element array
* @param amounts - Can be a single element array (all recipients get the same amount) or a multi-element array
*
* Requirements: If any of the parameters are multi-element arrays, they need to be the same length as other multi-element arrays
*
* Examples:
* mintExtensionExisting(['0x....1', '0x....2'], [1], [10])
* Mints 10 of tokenId 1 to each of '0x....1' and '0x....2'.
*
* mintExtensionExisting(['0x....1', '0x....2'], [1, 2], [10, 20])
* Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 2 to '0x....2'.
*
* mintExtensionExisting(['0x....1'], [1, 2], [10, 20])
* Mints 10 of tokenId 1 and 20 of tokenId 2 to '0x....1'.
*
* mintExtensionExisting(['0x....1', '0x....2'], [1], [10, 20])
* Mints 10 of tokenId 1 to '0x....1' and 20 of tokenId 1 to '0x....2'.
*
*/
function mintExtensionExisting(address[] calldata to, uint256[] calldata tokenIds, uint256[] calldata amounts) external;
/**
* @dev burn tokens. Can only be called by token owner or approved address.
* On burn, calls back to the registered extension's onBurn method
*/
function burn(address account, uint256[] calldata tokenIds, uint256[] calldata amounts) external;
/**
* @dev Total amount of tokens in with a given tokenId.
*/
function totalSupply(uint256 tokenId) external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "openzeppelin-contracts/security/ReentrancyGuard.sol";
import "openzeppelin-contracts/utils/Strings.sol";
import "openzeppelin-contracts/utils/introspection/ERC165.sol";
import "openzeppelin-contracts/utils/introspection/ERC165Checker.sol";
import "openzeppelin-contracts/utils/structs/EnumerableSet.sol";
import "openzeppelin-contracts-upgradeable/utils/AddressUpgradeable.sol";
import "../extensions/ICreatorExtensionTokenURI.sol";
import "./ICreatorCore.sol";
/**
* @dev Core creator implementation
*/
abstract contract CreatorCore is ReentrancyGuard, ICreatorCore, ERC165 {
using Strings for uint256;
using EnumerableSet for EnumerableSet.AddressSet;
using AddressUpgradeable for address;
uint256 _tokenCount = 0;
// Track registered extensions data
EnumerableSet.AddressSet internal _extensions;
EnumerableSet.AddressSet internal _blacklistedExtensions;
mapping(address => address) internal _extensionPermissions;
mapping(address => bool) internal _extensionApproveTransfers;
// For tracking which extension a token was minted by
mapping(uint256 => address) internal _tokensExtension;
// The baseURI for a given extension
mapping(address => string) private _extensionBaseURI;
mapping(address => bool) private _extensionBaseURIIdentical;
// The prefix for any tokens with a uri configured
mapping(address => string) private _extensionURIPrefix;
// Mapping for individual token URIs
mapping(uint256 => string) internal _tokenURIs;
// Royalty configurations
mapping(address => address payable[]) internal _extensionRoyaltyReceivers;
mapping(address => uint256[]) internal _extensionRoyaltyBPS;
mapping(uint256 => address payable[]) internal _tokenRoyaltyReceivers;
mapping(uint256 => uint256[]) internal _tokenRoyaltyBPS;
/**
* External interface identifiers for royalties
*/
/**
* @dev CreatorCore
*
* bytes4(keccak256('getRoyalties(uint256)')) == 0xbb3bafd6
*
* => 0xbb3bafd6 = 0xbb3bafd6
*/
bytes4 private constant _INTERFACE_ID_ROYALTIES_CREATORCORE = 0xbb3bafd6;
/**
* @dev Rarible: RoyaltiesV1
*
* bytes4(keccak256('getFeeRecipients(uint256)')) == 0xb9c4d9fb
* bytes4(keccak256('getFeeBps(uint256)')) == 0x0ebd4c7f
*
* => 0xb9c4d9fb ^ 0x0ebd4c7f = 0xb7799584
*/
bytes4 private constant _INTERFACE_ID_ROYALTIES_RARIBLE = 0xb7799584;
/**
* @dev Foundation
*
* bytes4(keccak256('getFees(uint256)')) == 0xd5a06d4c
*
* => 0xd5a06d4c = 0xd5a06d4c
*/
bytes4 private constant _INTERFACE_ID_ROYALTIES_FOUNDATION = 0xd5a06d4c;
/**
* @dev EIP-2981
*
* bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a
*
* => 0x2a55205a = 0x2a55205a
*/
bytes4 private constant _INTERFACE_ID_ROYALTIES_EIP2981 = 0x2a55205a;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
return
interfaceId == type(ICreatorCore).interfaceId ||
super.supportsInterface(interfaceId) ||
interfaceId == _INTERFACE_ID_ROYALTIES_CREATORCORE ||
interfaceId == _INTERFACE_ID_ROYALTIES_RARIBLE ||
interfaceId == _INTERFACE_ID_ROYALTIES_FOUNDATION ||
interfaceId == _INTERFACE_ID_ROYALTIES_EIP2981;
}
/**
* @dev Only allows registered extensions to call the specified function
*/
modifier extensionRequired() {
require(
_extensions.contains(msg.sender),
"Must be registered extension"
);
_;
}
/**
* @dev Only allows non-blacklisted extensions
*/
modifier nonBlacklistRequired(address extension) {
require(
!_blacklistedExtensions.contains(extension),
"Extension blacklisted"
);
_;
}
/**
* @dev See {ICreatorCore-getExtensions}.
*/
function getExtensions()
external
view
override
returns (address[] memory extensions)
{
extensions = new address[](_extensions.length());
for (uint256 i = 0; i < _extensions.length(); i++) {
extensions[i] = _extensions.at(i);
}
return extensions;
}
/**
* @dev Register an extension
*/
function _registerExtension(
address extension,
string calldata baseURI,
bool baseURIIdentical
) internal {
require(extension != address(this), "Creator: Invalid");
require(
extension.isContract(),
"Creator: Extension must be a contract"
);
if (!_extensions.contains(extension)) {
_extensionBaseURI[extension] = baseURI;
_extensionBaseURIIdentical[extension] = baseURIIdentical;
emit ExtensionRegistered(extension, msg.sender);
_extensions.add(extension);
}
}
/**
* @dev Unregister an extension
*/
function _unregisterExtension(address extension) internal {
if (_extensions.contains(extension)) {
emit ExtensionUnregistered(extension, msg.sender);
_extensions.remove(extension);
}
}
/**
* @dev Blacklist an extension
*/
function _blacklistExtension(address extension) internal {
require(extension != address(this), "Cannot blacklist yourself");
if (_extensions.contains(extension)) {
emit ExtensionUnregistered(extension, msg.sender);
_extensions.remove(extension);
}
if (!_blacklistedExtensions.contains(extension)) {
emit ExtensionBlacklisted(extension, msg.sender);
_blacklistedExtensions.add(extension);
}
}
/**
* @dev Set base token uri for an extension
*/
function _setBaseTokenURIExtension(string calldata uri, bool identical)
internal
{
_extensionBaseURI[msg.sender] = uri;
_extensionBaseURIIdentical[msg.sender] = identical;
}
/**
* @dev Set token uri prefix for an extension
*/
function _setTokenURIPrefixExtension(string calldata prefix) internal {
_extensionURIPrefix[msg.sender] = prefix;
}
/**
* @dev Set token uri for a token of an extension
*/
function _setTokenURIExtension(uint256 tokenId, string calldata uri)
internal
{
require(_tokensExtension[tokenId] == msg.sender, "Invalid token");
_tokenURIs[tokenId] = uri;
}
/**
* @dev Set base token uri for tokens with no extension
*/
function _setBaseTokenURI(string memory uri) internal {
_extensionBaseURI[address(this)] = uri;
}
/**
* @dev Set token uri prefix for tokens with no extension
*/
function _setTokenURIPrefix(string calldata prefix) internal {
_extensionURIPrefix[address(this)] = prefix;
}
/**
* @dev Set token uri for a token with no extension
*/
function _setTokenURI(uint256 tokenId, string calldata uri) internal {
require(_tokensExtension[tokenId] == address(this), "Invalid token");
_tokenURIs[tokenId] = uri;
}
/**
* @dev Retrieve a token's URI
*/
function _tokenURI(uint256 tokenId) internal view returns (string memory) {
address extension = _tokensExtension[tokenId];
require(
!_blacklistedExtensions.contains(extension),
"Extension blacklisted"
);
if (bytes(_tokenURIs[tokenId]).length != 0) {
if (bytes(_extensionURIPrefix[extension]).length != 0) {
return
string(
abi.encodePacked(
_extensionURIPrefix[extension],
_tokenURIs[tokenId]
)
);
}
return _tokenURIs[tokenId];
}
if (
ERC165Checker.supportsInterface(
extension,
type(ICreatorExtensionTokenURI).interfaceId
)
) {
return
ICreatorExtensionTokenURI(extension).tokenURI(
address(this),
tokenId
);
}
if (!_extensionBaseURIIdentical[extension]) {
return
string(
abi.encodePacked(
_extensionBaseURI[extension],
tokenId.toString()
)
);
} else {
return _extensionBaseURI[extension];
}
}
/**
* Get token extension
*/
function _tokenExtension(uint256 tokenId)
internal
view
returns (address extension)
{
extension = _tokensExtension[tokenId];
require(extension != address(this), "No extension for token");
require(
!_blacklistedExtensions.contains(extension),
"Extension blacklisted"
);
return extension;
}
/**
* Helper to get royalties for a token
*/
function _getRoyalties(uint256 tokenId)
internal
view
returns (address payable[] storage, uint256[] storage)
{
return (_getRoyaltyReceivers(tokenId), _getRoyaltyBPS(tokenId));
}
/**
* Helper to get royalty receivers for a token
*/
function _getRoyaltyReceivers(uint256 tokenId)
internal
view
returns (address payable[] storage)
{
if (_tokenRoyaltyReceivers[tokenId].length > 0) {
return _tokenRoyaltyReceivers[tokenId];
} else if (
_extensionRoyaltyReceivers[_tokensExtension[tokenId]].length > 0
) {
return _extensionRoyaltyReceivers[_tokensExtension[tokenId]];
}
return _extensionRoyaltyReceivers[address(this)];
}
/**
* Helper to get royalty basis points for a token
*/
function _getRoyaltyBPS(uint256 tokenId)
internal
view
returns (uint256[] storage)
{
if (_tokenRoyaltyBPS[tokenId].length > 0) {
return _tokenRoyaltyBPS[tokenId];
} else if (_extensionRoyaltyBPS[_tokensExtension[tokenId]].length > 0) {
return _extensionRoyaltyBPS[_tokensExtension[tokenId]];
}
return _extensionRoyaltyBPS[address(this)];
}
function _getRoyaltyInfo(uint256 tokenId, uint256 value)
internal
view
returns (address receiver, uint256 amount)
{
address payable[] storage receivers = _getRoyaltyReceivers(tokenId);
require(receivers.length <= 1, "More than 1 royalty receiver");
if (receivers.length == 0) {
return (address(this), 0);
}
return (receivers[0], (_getRoyaltyBPS(tokenId)[0] * value) / 10000);
}
/**
* Set royalties for a token
*/
function _setRoyalties(
uint256 tokenId,
address payable[] calldata receivers,
uint256[] calldata basisPoints
) internal {
require(receivers.length == basisPoints.length, "Invalid input");
uint256 totalBasisPoints;
for (uint256 i = 0; i < basisPoints.length; i++) {
totalBasisPoints += basisPoints[i];
}
require(totalBasisPoints < 10000, "Invalid total royalties");
_tokenRoyaltyReceivers[tokenId] = receivers;
_tokenRoyaltyBPS[tokenId] = basisPoints;
emit RoyaltiesUpdated(tokenId, receivers, basisPoints);
}
/**
* Set royalties for all tokens of an extension
*/
function _setRoyaltiesExtension(
address extension,
address payable[] calldata receivers,
uint256[] calldata basisPoints
) internal {
require(receivers.length == basisPoints.length, "Invalid input");
uint256 totalBasisPoints;
for (uint256 i = 0; i < basisPoints.length; i++) {
totalBasisPoints += basisPoints[i];
}
require(totalBasisPoints < 10000, "Invalid total royalties");
_extensionRoyaltyReceivers[extension] = receivers;
_extensionRoyaltyBPS[extension] = basisPoints;
if (extension == address(this)) {
emit DefaultRoyaltiesUpdated(receivers, basisPoints);
} else {
emit ExtensionRoyaltiesUpdated(extension, receivers, basisPoints);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Checker.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Library used to query support of an interface declared via {IERC165}.
*
* Note that these functions return the actual result of the query: they do not
* `revert` if an interface is not supported. It is up to the caller to decide
* what to do in these cases.
*/
library ERC165Checker {
// As per the EIP-165 spec, no interface should ever match 0xffffffff
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
/**
* @dev Returns true if `account` supports the {IERC165} interface,
*/
function supportsERC165(address account) internal view returns (bool) {
// Any contract that implements ERC165 must explicitly indicate support of
// InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
return
supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) &&
!supportsERC165InterfaceUnchecked(account, _INTERFACE_ID_INVALID);
}
/**
* @dev Returns true if `account` supports the interface defined by
* `interfaceId`. Support for {IERC165} itself is queried automatically.
*
* See {IERC165-supportsInterface}.
*/
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
// query support of both ERC165 as per the spec and support of _interfaceId
return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId);
}
/**
* @dev Returns a boolean array where each value corresponds to the
* interfaces passed in and whether they're supported or not. This allows
* you to batch check interfaces for a contract where your expectation
* is that some interfaces may not be supported.
*
* See {IERC165-supportsInterface}.
*
* _Available since v3.4._
*/
function getSupportedInterfaces(address account, bytes4[] memory interfaceIds)
internal
view
returns (bool[] memory)
{
// an array of booleans corresponding to interfaceIds and whether they're supported or not
bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);
// query support of ERC165 itself
if (supportsERC165(account)) {
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]);
}
}
return interfaceIdsSupported;
}
/**
* @dev Returns true if `account` supports all the interfaces defined in
* `interfaceIds`. Support for {IERC165} itself is queried automatically.
*
* Batch-querying can lead to gas savings by skipping repeated checks for
* {IERC165} support.
*
* See {IERC165-supportsInterface}.
*/
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
// query support of ERC165 itself
if (!supportsERC165(account)) {
return false;
}
// query support of each interface in _interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) {
return false;
}
}
// all interfaces supported
return true;
}
/**
* @notice Query if a contract implements an interface, does not check ERC165 support
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return true if the contract at account indicates support of the interface with
* identifier interfaceId, false otherwise
* @dev Assumes that account contains a contract that supports ERC165, otherwise
* the behavior of this method is undefined. This precondition can be checked
* with {supportsERC165}.
* Interface identification is specified in ERC-165.
*/
function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) {
// prepare call
bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);
// perform static call
bool success;
uint256 returnSize;
uint256 returnValue;
assembly {
success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
returnSize := returndatasize()
returnValue := mload(0x00)
}
return success && returnSize >= 0x20 && returnValue > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or 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 {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "openzeppelin-contracts/utils/introspection/IERC165.sol";
/**
* @dev Implement this if you want your extension to have overloadable URI's
*/
interface ICreatorExtensionTokenURI is IERC165 {
/**
* Get the uri for a given creator/tokenId
*/
function tokenURI(address creator, uint256 tokenId)
external
view
returns (string memory);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @author: manifold.xyz
import "openzeppelin-contracts/utils/introspection/IERC165.sol";
/**
* @dev Core creator interface
*/
interface ICreatorCore is IERC165 {
event ExtensionRegistered(
address indexed extension,
address indexed sender
);
event ExtensionUnregistered(
address indexed extension,
address indexed sender
);
event ExtensionBlacklisted(
address indexed extension,
address indexed sender
);
event MintPermissionsUpdated(
address indexed extension,
address indexed permissions,
address indexed sender
);
event RoyaltiesUpdated(
uint256 indexed tokenId,
address payable[] receivers,
uint256[] basisPoints
);
event DefaultRoyaltiesUpdated(
address payable[] receivers,
uint256[] basisPoints
);
event ExtensionRoyaltiesUpdated(
address indexed extension,
address payable[] receivers,
uint256[] basisPoints
);
event ExtensionApproveTransferUpdated(
address indexed extension,
bool enabled
);
/**
* @dev gets address of all extensions
*/
function getExtensions() external view returns (address[] memory);
/**
* @dev add an extension. Can only be called by contract owner or admin.
* extension address must point to a contract implementing ICreatorExtension.
* Returns True if newly added, False if already added.
*/
function registerExtension(address extension, string calldata baseURI)
external;
/**
* @dev add an extension. Can only be called by contract owner or admin.
* extension address must point to a contract implementing ICreatorExtension.
* Returns True if newly added, False if already added.
*/
function registerExtension(
address extension,
string calldata baseURI,
bool baseURIIdentical
) external;
/**
* @dev add an extension. Can only be called by contract owner or admin.
* Returns True if removed, False if already removed.
*/
function unregisterExtension(address extension) external;
/**
* @dev blacklist an extension. Can only be called by contract owner or admin.
* This function will destroy all ability to reference the metadata of any tokens created
* by the specified extension. It will also unregister the extension if needed.
* Returns True if removed, False if already removed.
*/
function blacklistExtension(address extension) external;
/**
* @dev set the baseTokenURI of an extension. Can only be called by extension.
*/
function setBaseTokenURIExtension(string calldata uri) external;
/**
* @dev set the baseTokenURI of an extension. Can only be called by extension.
* For tokens with no uri configured, tokenURI will return "uri+tokenId"
*/
function setBaseTokenURIExtension(string calldata uri, bool identical)
external;
/**
* @dev set the common prefix of an extension. Can only be called by extension.
* If configured, and a token has a uri set, tokenURI will return "prefixURI+tokenURI"
* Useful if you want to use ipfs/arweave
*/
function setTokenURIPrefixExtension(string calldata prefix) external;
/**
* @dev set the tokenURI of a token extension. Can only be called by extension that minted token.
*/
function setTokenURIExtension(uint256 tokenId, string calldata uri)
external;
/**
* @dev set the tokenURI of a token extension for multiple tokens. Can only be called by extension that minted token.
*/
function setTokenURIExtension(
uint256[] memory tokenId,
string[] calldata uri
) external;
/**
* @dev set the baseTokenURI for tokens with no extension. Can only be called by owner/admin.
* For tokens with no uri configured, tokenURI will return "uri+tokenId"
*/
function setBaseTokenURI(string calldata uri) external;
/**
* @dev set the common prefix for tokens with no extension. Can only be called by owner/admin.
* If configured, and a token has a uri set, tokenURI will return "prefixURI+tokenURI"
* Useful if you want to use ipfs/arweave
*/
function setTokenURIPrefix(string calldata prefix) external;
/**
* @dev set the tokenURI of a token with no extension. Can only be called by owner/admin.
*/
function setTokenURI(uint256 tokenId, string calldata uri) external;
/**
* @dev set the tokenURI of multiple tokens with no extension. Can only be called by owner/admin.
*/
function setTokenURI(uint256[] memory tokenIds, string[] calldata uris)
external;
/**
* @dev set a permissions contract for an extension. Used to control minting.
*/
function setMintPermissions(address extension, address permissions)
external;
/**
* @dev Configure so transfers of tokens created by the caller (must be extension) gets approval
* from the extension before transferring
*/
function setApproveTransferExtension(bool enabled) external;
/**
* @dev get the extension of a given token
*/
function tokenExtension(uint256 tokenId) external view returns (address);
/**
* @dev Set default royalties
*/
function setRoyalties(
address payable[] calldata receivers,
uint256[] calldata basisPoints
) external;
/**
* @dev Set royalties of a token
*/
function setRoyalties(
uint256 tokenId,
address payable[] calldata receivers,
uint256[] calldata basisPoints
) external;
/**
* @dev Set royalties of an extension
*/
function setRoyaltiesExtension(
address extension,
address payable[] calldata receivers,
uint256[] calldata basisPoints
) external;
/**
* @dev Get royalites of a token. Returns list of receivers and basisPoints
*/
function getRoyalties(uint256 tokenId)
external
view
returns (address payable[] memory, uint256[] memory);
// Royalty support for various other standards
function getFeeRecipients(uint256 tokenId)
external
view
returns (address payable[] memory);
function getFeeBps(uint256 tokenId)
external
view
returns (uint256[] memory);
function getFees(uint256 tokenId)
external
view
returns (address payable[] memory, uint256[] memory);
function royaltyInfo(uint256 tokenId, uint256 value)
external
view
returns (address, uint256);
}{
"remappings": [
"creator-core-solidity/=lib/creator-core-solidity/contracts/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"libraries-solidity/=lib/libraries-solidity/contracts/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/src/",
"script/=script/",
"src/=src/",
"test/=test/",
"src/=src/",
"test/=test/",
"script/=script/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"bytecodeHash": "ipfs"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminRevoked","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 payable[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"DefaultRoyaltiesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"ExtensionApproveTransferUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"ExtensionBlacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"ExtensionRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":false,"internalType":"address payable[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"ExtensionRoyaltiesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"ExtensionUnregistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"extension","type":"address"},{"indexed":true,"internalType":"address","name":"permissions","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"MintPermissionsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address payable[]","name":"receivers","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"RoyaltiesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"approveAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"}],"name":"blacklistExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAdmins","outputs":[{"internalType":"address[]","name":"admins","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getExtensions","outputs":[{"internalType":"address[]","name":"extensions","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getFeeBps","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getFeeRecipients","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getFees","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getRoyalties","outputs":[{"internalType":"address payable[]","name":"","type":"address[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isAdmin","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":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mintBaseExisting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"mintBaseNew","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mintExtensionExisting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"mintExtensionNew","outputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"},{"internalType":"string","name":"baseURI","type":"string"}],"name":"registerExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"},{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"bool","name":"baseURIIdentical","type":"bool"}],"name":"registerExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"revokeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"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":"bool","name":"enabled","type":"bool"}],"name":"setApproveTransferExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setBaseTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setBaseTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"},{"internalType":"bool","name":"identical","type":"bool"}],"name":"setBaseTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"},{"internalType":"address","name":"permissions","type":"address"}],"name":"setMintPermissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address payable[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"setRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"setRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"},{"internalType":"address payable[]","name":"receivers","type":"address[]"},{"internalType":"uint256[]","name":"basisPoints","type":"uint256[]"}],"name":"setRoyaltiesExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri_","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"string[]","name":"uris","type":"string[]"}],"name":"setTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri_","type":"string"}],"name":"setTokenURIExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"prefix","type":"string"}],"name":"setTokenURIPrefix","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"prefix","type":"string"}],"name":"setTokenURIPrefixExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenExtension","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"extension","type":"address"}],"name":"unregisterExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405260006007553480156200001657600080fd5b50604080516020810190915260008152620000313362000047565b60018055620000408162000097565b5062000192565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8051620000ac906006906020840190620000b0565b5050565b828054620000be9062000156565b90600052602060002090601f016020900481019282620000e257600085556200012d565b82601f10620000fd57805160ff19168380011785556200012d565b828001600101855582156200012d579182015b828111156200012d57825182559160200191906001019062000110565b506200013b9291506200013f565b5090565b5b808211156200013b576000815560010162000140565b600181811c908216806200016b57607f821691505b6020821081036200018c57634e487b7160e01b600052602260045260246000fd5b50919050565b615a7c80620001a26000396000f3fe608060405234801561001057600080fd5b50600436106102895760003560e01c80636d73e6691161015c578063b9c4d9fb116100ce578063e92a89f611610087578063e92a89f6146105ee578063e985e9c514610601578063f0cdc4991461063d578063f242432a14610650578063f2fde38b14610663578063feeb5a9a1461067657600080fd5b8063b9c4d9fb14610574578063bb3bafd614610587578063bd85b039146105a8578063ce8aee9d146105c8578063d5a06d4c14610587578063e6c884dc146105db57600080fd5b80638da5cb5b116101205780638da5cb5b1461050457806399e0dd7c14610515578063a22cb46514610528578063aafb2d441461053b578063ac0c8cfa1461054e578063b0fe87c91461056157600080fd5b80636d73e669146104bb578063715018a6146104ce57806382dcc0c8146104d657806383b7db63146104e95780638c6e8472146104f157600080fd5b80632eb2c2d6116102005780633e6134b8116101b95780633e6134b8146104495780633f0f37f61461045c5780634e1273f41461046f57806361e5bc6b1461048257806366d1e9d014610495578063695c96e6146104a857600080fd5b80632eb2c2d6146103d557806330176e13146103e85780633071a0f9146103fb57806331ae450b1461040e578063332dd1ae146104235780633db0f8ab1461043657600080fd5b8063162094c411610252578063162094c41461032c57806320e4afe21461033f578063239be3171461035257806324d7806c1461037d5780632a55205a146103905780632d345670146103c257600080fd5b8062fdd58e1461028e57806301ffc9a7146102b457806302e7afb7146102d75780630e89341c146102ec5780630ebd4c7f1461030c575b600080fd5b6102a161029c3660046146e3565b610689565b6040519081526020015b60405180910390f35b6102c76102c2366004614725565b610724565b60405190151581526020016102ab565b6102ea6102e5366004614742565b61074d565b005b6102ff6102fa36600461475f565b6107a3565b6040516102ab91906147d0565b61031f61031a36600461475f565b6107ae565b6040516102ab919061481e565b6102ea61033a366004614872565b61080f565b6102ea61034d366004614901565b610869565b61036561036036600461475f565b6108c7565b6040516001600160a01b0390911681526020016102ab565b6102c761038b366004614742565b6108d2565b6103a361039e36600461497a565b61090b565b604080516001600160a01b0390931683526020830191909152016102ab565b6102ea6103d0366004614742565b610924565b6102ea6103e3366004614aff565b610981565b6102ea6103f6366004614bac565b6109c6565b6102ea610409366004614bed565b610a4f565b610416610ad5565b6040516102ab9190614c61565b6102ea610431366004614c74565b610b83565b6102ea610444366004614cdf565b610bda565b6102ea610457366004614bac565b610cf5565b6102ea61046a366004614d62565b610d28565b61031f61047d366004614dc9565b610da7565b6102ea610490366004614e95565b610ed0565b6102ea6104a3366004614bac565b610f7b565b6102ea6104b6366004614ef0565b610fac565b6102ea6104c9366004614742565b61115f565b6102ea6111b7565b6102ea6104e4366004614f89565b6111cb565b6104166111fd565b61031f6104ff366004614ef0565b6112a7565b6000546001600160a01b0316610365565b6102ea610523366004614bac565b611367565b6102ea610536366004614fdf565b6113bb565b6102ea610549366004614e95565b6113c6565b6102ea61055c366004615018565b611494565b6102ea61056f366004615035565b6115ba565b61041661058236600461475f565b611611565b61059a61059536600461475f565b61167b565b6040516102ab929190615074565b6102a16105b636600461475f565b60009081526017602052604090205490565b6102ea6105d6366004614742565b61173a565b6102ea6105e9366004614ef0565b61178d565b6102ea6105fc366004614872565b611912565b6102c761060f3660046150a2565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102ea61064b3660046150a2565b611944565b6102ea61065e3660046150d0565b611998565b6102ea610671366004614742565b6119dd565b61031f610684366004614ef0565b611a53565b60006001600160a01b0383166106f95760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526004602090815260408083206001600160a01b03861684529091529020545b92915050565b600061072f82611b1c565b8061073e575061073e82611b41565b8061071e575061071e82611b7c565b336107606000546001600160a01b031690565b6001600160a01b0316148061077b575061077b600233611bb1565b6107975760405162461bcd60e51b81526004016106f090615138565b6107a081611bd6565b50565b606061071e82611cd1565b60606107b982611f4b565b80548060200260200160405190810160405280929190818152602001828054801561080357602002820191906000526020600020905b8154815260200190600101908083116107ef575b50505050509050919050565b336108226000546001600160a01b031690565b6001600160a01b0316148061083d575061083d600233611bb1565b6108595760405162461bcd60e51b81526004016106f090615138565b610864838383611fd7565b505050565b3361087c6000546001600160a01b031690565b6001600160a01b031614806108975750610897600233611bb1565b6108b35760405162461bcd60e51b81526004016106f090615138565b6108c08585858585612046565b5050505050565b600061071e8261216f565b6000816001600160a01b03166108f06000546001600160a01b031690565b6001600160a01b0316148061071e575061071e600283611bb1565b60008061091884846121fc565b915091505b9250929050565b61092c6122e7565b610937600282611bb1565b156107a05760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a361097d600282612341565b5050565b6001600160a01b03851633148061099d575061099d853361060f565b6109b95760405162461bcd60e51b81526004016106f09061517c565b6108c08585858585612356565b336109d96000546001600160a01b031690565b6001600160a01b031614806109f457506109f4600233611bb1565b610a105760405162461bcd60e51b81526004016106f090615138565b61097d82828080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124fb92505050565b33610a626000546001600160a01b031690565b6001600160a01b03161480610a7d5750610a7d600233611bb1565b610a995760405162461bcd60e51b81526004016106f090615138565b82610aa5600a82611bb1565b15610ac25760405162461bcd60e51b81526004016106f0906151ca565b610acf848484600061251b565b50505050565b6060610ae16002612655565b6001600160401b03811115610af857610af861499c565b604051908082528060200260200182016040528015610b21578160200160208202803683370190505b50905060005b610b316002612655565b811015610b7f57610b4360028261265f565b828281518110610b5557610b556151f9565b6001600160a01b039092166020928302919091019091015280610b7781615225565b915050610b27565b5090565b33610b966000546001600160a01b031690565b6001600160a01b03161480610bb15750610bb1600233611bb1565b610bcd5760405162461bcd60e51b81526004016106f090615138565b610acf308585858561266b565b610be26127f3565b6001600160a01b038316331480610c1c57506001600160a01b038316600090815260056020908152604080832033845290915290205460ff165b610c685760405162461bcd60e51b815260206004820181905260248201527f43616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656460448201526064016106f0565b8051825114610c895760405162461bcd60e51b81526004016106f09061523e565b8151600103610cd657610cd18383600081518110610ca957610ca96151f9565b602002602001015183600081518110610cc457610cc46151f9565b602002602001015161284c565b610ce1565b610ce183838361287f565b610cec838383612901565b61086460018055565b610d00600833611bb1565b610d1c5760405162461bcd60e51b81526004016106f090615265565b61097d82826000612aa5565b33610d3b6000546001600160a01b031690565b6001600160a01b03161480610d565750610d56600233611bb1565b610d725760405162461bcd60e51b81526004016106f090615138565b83610d7e600a82611bb1565b15610d9b5760405162461bcd60e51b81526004016106f0906151ca565b6108c08585858561251b565b60608151835114610e0c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016106f0565b600083516001600160401b03811115610e2757610e2761499c565b604051908082528060200260200182016040528015610e50578160200160208202803683370190505b50905060005b8451811015610ec857610e9b858281518110610e7457610e746151f9565b6020026020010151858381518110610e8e57610e8e6151f9565b6020026020010151610689565b828281518110610ead57610ead6151f9565b6020908102919091010152610ec181615225565b9050610e56565b509392505050565b610edb600833611bb1565b610ef75760405162461bcd60e51b81526004016106f090615265565b82518114610f175760405162461bcd60e51b81526004016106f09061523e565b60005b8351811015610acf57610f69848281518110610f3857610f386151f9565b6020026020010151848484818110610f5257610f526151f9565b9050602002810190610f64919061529c565b612ae2565b80610f7381615225565b915050610f1a565b610f86600833611bb1565b610fa25760405162461bcd60e51b81526004016106f090615265565b61097d8282612b38565b610fb46127f3565b33610fc76000546001600160a01b031690565b6001600160a01b03161480610fe25750610fe2600233611bb1565b610ffe5760405162461bcd60e51b81526004016106f090615138565b60005b838110156110ae5730600e6000878785818110611020576110206151f9565b60209081029290920135835250810191909152604001600020546001600160a01b03161461109c5760405162461bcd60e51b815260206004820152602360248201527f4120746f6b656e20776173206372656174656420627920616e20657874656e7360448201526234b7b760e91b60648201526084016106f0565b806110a681615225565b915050611001565b5061114e3087878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250612b5292505050565b61115760018055565b505050505050565b6111676122e7565b611172600282611bb1565b6107a05760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a361097d600282612e34565b6111bf6122e7565b6111c96000612e49565b565b6111d6600833611bb1565b6111f25760405162461bcd60e51b81526004016106f090615265565b610864838383612aa5565b60606112096008612655565b6001600160401b038111156112205761122061499c565b604051908082528060200260200182016040528015611249578160200160208202803683370190505b50905060005b6112596008612655565b811015610b7f5761126b60088261265f565b82828151811061127d5761127d6151f9565b6001600160a01b03909216602092830291909101909101528061129f81615225565b91505061124f565b60606112b16127f3565b6112bc600833611bb1565b6112d85760405162461bcd60e51b81526004016106f090615265565b6113523388888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a91829185019084908082843760009201919091525061134d92508891508990506152e2565b612e99565b905061135d60018055565b9695505050505050565b3361137a6000546001600160a01b031690565b6001600160a01b031614806113955750611395600233611bb1565b6113b15760405162461bcd60e51b81526004016106f090615138565b61097d828261324f565b61097d338383613269565b336113d96000546001600160a01b031690565b6001600160a01b031614806113f457506113f4600233611bb1565b6114105760405162461bcd60e51b81526004016106f090615138565b825181146114305760405162461bcd60e51b81526004016106f09061523e565b60005b8351811015610acf57611482848281518110611451576114516151f9565b602002602001015184848481811061146b5761146b6151f9565b905060200281019061147d919061529c565b611fd7565b8061148c81615225565b915050611433565b61149f600833611bb1565b6114bb5760405162461bcd60e51b81526004016106f090615265565b8015806114d457506114d4336324ea02c560e21b613349565b611548576040805162461bcd60e51b81526020600482015260248101919091527f457874656e73696f6e206d75737420696d706c656d656e74204945524331313560448201527f3543726561746f72457874656e73696f6e417070726f76655472616e7366657260648201526084016106f0565b336000908152600d602052604090205460ff161515811515146107a057336000818152600d6020908152604091829020805460ff191685151590811790915591519182527f072a7592283e2c2d1d56d21517ff6013325e0f55483f4828373ff4d98b0a1a36910160405180910390a250565b336115cd6000546001600160a01b031690565b6001600160a01b031614806115e857506115e8600233611bb1565b6116045760405162461bcd60e51b81526004016106f090615138565b6108c0858585858561266b565b606061161c82613365565b80548060200260200160405190810160405280929190818152602001828054801561080357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116116525750505050509050919050565b606080611687836133f1565b8154604080516020808402820181019092528281529184918301828280156116d857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116116ba575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561172a57602002820191906000526020600020905b815481526020019060010190808311611716575b5050505050905091509150915091565b3361174d6000546001600160a01b031690565b6001600160a01b031614806117685750611768600233611bb1565b6117845760405162461bcd60e51b81526004016106f090615138565b6107a08161340f565b6117956127f3565b6117a0600833611bb1565b6117bc5760405162461bcd60e51b81526004016106f090615265565b60005b838110156118725733600e60008787858181106117de576117de6151f9565b60209081029290920135835250810191909152604001600020546001600160a01b0316146118605760405162461bcd60e51b815260206004820152602960248201527f4120746f6b656e20776173206e6f74206372656174656420627920746869732060448201526832bc3a32b739b4b7b760b91b60648201526084016106f0565b8061186a81615225565b9150506117bf565b5061114e3387878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250612b5292505050565b61191d600833611bb1565b6119395760405162461bcd60e51b81526004016106f090615265565b610864838383612ae2565b336119576000546001600160a01b031690565b6001600160a01b031614806119725750611972600233611bb1565b61198e5760405162461bcd60e51b81526004016106f090615138565b61097d8282613460565b6001600160a01b0385163314806119b457506119b4853361060f565b6119d05760405162461bcd60e51b81526004016106f09061517c565b6108c08585858585613589565b6119e56122e7565b6001600160a01b038116611a4a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106f0565b6107a081612e49565b6060611a5d6127f3565b33611a706000546001600160a01b031690565b6001600160a01b03161480611a8b5750611a8b600233611bb1565b611aa75760405162461bcd60e51b81526004016106f090615138565b6113523088888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a91829185019084908082843760009201919091525061134d92508891508990506152e2565b60006001600160e01b031982166301f4921160e61b148061071e575061071e826136c5565b60006001600160e01b03198216636cdb3d1360e11b148061073e57506001600160e01b031982166303a24d0760e21b148061071e575061071e825b60006001600160e01b03198216632a9f3abf60e11b148061071e57506301ffc9a760e01b6001600160e01b031983161461071e565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b306001600160a01b03821603611c2e5760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f7420626c61636b6c69737420796f757273656c660000000000000060448201526064016106f0565b611c39600882611bb1565b15611c815760405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a7890147990600090a3611c7f600882612341565b505b611c8c600a82611bb1565b6107a05760405133906001600160a01b038316907f05ac7bc5a606cd92a63365f9fda244499b9add0526b22d99937b6bd88181059c90600090a361097d600a82612e34565b6000818152600e60205260409020546060906001600160a01b0316611cf7600a82611bb1565b15611d145760405162461bcd60e51b81526004016106f0906151ca565b60008381526012602052604090208054611d2d90615373565b159050611e47576001600160a01b03811660009081526011602052604090208054611d5790615373565b159050611da8576001600160a01b038116600090815260116020908152604080832086845260128352928190209051611d91939201615440565b604051602081830303815290604052915050919050565b60008381526012602052604090208054611dc190615373565b80601f0160208091040260200160405190810160405280929190818152602001828054611ded90615373565b8015611e3a5780601f10611e0f57610100808354040283529160200191611e3a565b820191906000526020600020905b815481529060010190602001808311611e1d57829003601f168201915b5050505050915050919050565b611e588163e9dc637560e01b613349565b15611ed05760405163e9dc637560e01b8152306004820152602481018490526001600160a01b0382169063e9dc637590604401600060405180830381865afa158015611ea8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bcf9190810190615455565b6001600160a01b03811660009081526010602052604090205460ff16611f22576001600160a01b0381166000908152600f60205260409020611f118461375b565b604051602001611d919291906154cc565b6001600160a01b0381166000908152600f602052604090208054611dc190615373565b50919050565b60008181526016602052604081205415611f715750600090815260166020526040902090565b6000828152600e60209081526040808320546001600160a01b03168352601490915290205415611fc357506000908152600e60209081526040808320546001600160a01b031683526014909152902090565b505030600090815260146020526040902090565b6000838152600e60205260409020546001600160a01b0316301461202d5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b60448201526064016106f0565b6000838152601260205260409020610acf908383614538565b8281146120655760405162461bcd60e51b81526004016106f09061523e565b6000805b828110156120a957838382818110612083576120836151f9565b905060200201358261209591906154f1565b9150806120a181615225565b915050612069565b5061271081106120f55760405162461bcd60e51b8152602060048201526017602482015276496e76616c696420746f74616c20726f79616c7469657360481b60448201526064016106f0565b600086815260156020526040902061210e9086866145b8565b50600086815260166020526040902061212890848461460b565b50857fabb46fe0761d77584bde75697647804ffd8113abd4d8d06bc664150395eccdee8686868660405161215f9493929190615509565b60405180910390a2505050505050565b6000818152600e60205260409020546001600160a01b03163081036121cf5760405162461bcd60e51b815260206004820152601660248201527527379032bc3a32b739b4b7b7103337b9103a37b5b2b760511b60448201526064016106f0565b6121da600a82611bb1565b156121f75760405162461bcd60e51b81526004016106f0906151ca565b919050565b600080600061220a85613365565b80549091506001101561225f5760405162461bcd60e51b815260206004820152601c60248201527f4d6f7265207468616e203120726f79616c74792072656365697665720000000060448201526064016106f0565b805460000361227557306000925092505061091d565b80600081548110612288576122886151f9565b6000918252602090912001546001600160a01b0316612710856122aa88611f4b565b6000815481106122bc576122bc6151f9565b90600052602060002001546122d1919061558d565b6122db91906155c2565b92509250509250929050565b6000546001600160a01b031633146111c95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106f0565b6000611bcf836001600160a01b038416613863565b81518351146123775760405162461bcd60e51b81526004016106f0906155d6565b6001600160a01b03841661239d5760405162461bcd60e51b81526004016106f09061561e565b336123ac818787878787613956565b60005b84518110156124955760008582815181106123cc576123cc6151f9565b6020026020010151905060008583815181106123ea576123ea6151f9565b60209081029190910181015160008481526004835260408082206001600160a01b038e16835290935291909120549091508181101561243b5760405162461bcd60e51b81526004016106f090615663565b60008381526004602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061247a9084906154f1565b925050819055505050508061248e90615225565b90506123af565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516124e59291906156ad565b60405180910390a4611157818787878787613962565b306000908152600f60209081526040909120825161097d92840190614645565b306001600160a01b038516036125665760405162461bcd60e51b815260206004820152601060248201526f10dc99585d1bdc8e88125b9d985b1a5960821b60448201526064016106f0565b6001600160a01b0384163b6125cb5760405162461bcd60e51b815260206004820152602560248201527f43726561746f723a20457874656e73696f6e206d757374206265206120636f6e6044820152641d1c9858dd60da1b60648201526084016106f0565b6125d6600885611bb1565b610acf576001600160a01b0384166000908152600f602052604090206125fd908484614538565b506001600160a01b038416600081815260106020526040808220805460ff1916851515179055513392917fd8cb8ba4086944eabf43c5535b7712015e4d4c714b24bf812c040ea5b7a3e42a91a36108c0600885612e34565b600061071e825490565b6000611bcf8383613ac6565b82811461268a5760405162461bcd60e51b81526004016106f09061523e565b6000805b828110156126ce578383828181106126a8576126a86151f9565b90506020020135826126ba91906154f1565b9150806126c681615225565b91505061268e565b50612710811061271a5760405162461bcd60e51b8152602060048201526017602482015276496e76616c696420746f74616c20726f79616c7469657360481b60448201526064016106f0565b6001600160a01b038616600090815260136020526040902061273d9086866145b8565b506001600160a01b038616600090815260146020526040902061276190848461460b565b50306001600160a01b038716036127b4577f2b6849d5976d799a5b0ca4dfd6b40a3d7afe9ea72c091fa01a958594f9a2659b858585856040516127a79493929190615509565b60405180910390a1611157565b856001600160a01b03167f535a93d2cb000582c0ebeaa9be4890ec6a287f98eb2df00c54c300612fd78d8f8686868660405161215f9493929190615509565b6002600154036128455760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106f0565b6002600155565b612857838383613af0565b600082815260176020526040812080548392906128759084906156c0565b9091555050505050565b61288a838383613c0c565b60005b8251811015610acf578181815181106128a8576128a86151f9565b6020026020010151601760008584815181106128c6576128c66151f9565b6020026020010151815260200190815260200160002060008282546128eb91906156c0565b909155506128fa905081615225565b905061288d565b60008251116129225760405162461bcd60e51b81526004016106f09061523e565b6000600e60008460008151811061293b5761293b6151f9565b6020026020010151815260200190815260200160002060009054906101000a90046001600160a01b0316905060005b8351811015612a1657816001600160a01b0316600e6000868481518110612993576129936151f9565b6020908102919091018101518252810191909152604001600020546001600160a01b031614612a045760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f72730000000060448201526064016106f0565b80612a0e81615225565b91505061296a565b506001600160a01b0381163014610acf57612a38816303dc6f6560e51b613349565b15610acf576040516303dc6f6560e51b81526001600160a01b03821690637b8deca090612a6d908790879087906004016156d7565b600060405180830381600087803b158015612a8757600080fd5b505af1158015612a9b573d6000803e3d6000fd5b5050505050505050565b336000908152600f60205260409020612abf908484614538565b50336000908152601060205260409020805460ff19169115159190911790555050565b6000838152600e60205260409020546001600160a01b0316331461202d5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b60448201526064016106f0565b336000908152601160205260409020610864908383614538565b6001600160a01b0384163014612b6d57612b6d838383613dab565b82516001148015612b7f575081516001145b8015612b8c575080516001145b15612c3357612c2e83600081518110612ba757612ba76151f9565b602002602001015183600081518110612bc257612bc26151f9565b602002602001015183600081518110612bdd57612bdd6151f9565b602002602001015160006001600160401b03811115612bfe57612bfe61499c565b6040519080825280601f01601f191660200182016040528015612c28576020820181803683370190505b50613e3a565b610acf565b82516001148015612c45575080518251145b15612cb357612c2e83600081518110612c6057612c606151f9565b6020026020010151838360006001600160401b03811115612c8357612c8361499c565b6040519080825280601f01601f191660200182016040528015612cad576020820181803683370190505b50613e6f565b81516001148015612cc5575080516001145b15612d395760005b8351811015612d3357612d21848281518110612ceb57612ceb6151f9565b602002602001015184600081518110612d0657612d066151f9565b602002602001015184600081518110612bdd57612bdd6151f9565b80612d2b81615225565b915050612ccd565b50610acf565b81516001148015612d4b575080518351145b15612db85760005b8351811015612d3357612da6848281518110612d7157612d716151f9565b602002602001015184600081518110612d8c57612d8c6151f9565b6020026020010151848481518110612bdd57612bdd6151f9565b80612db081615225565b915050612d53565b81518351148015612dca575080518351145b15612e1c5760005b8351811015612d3357612e0a848281518110612df057612df06151f9565b6020026020010151848381518110612d8c57612d8c6151f9565b80612e1481615225565b915050612dd2565b60405162461bcd60e51b81526004016106f09061523e565b6000611bcf836001600160a01b038416613ef2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060600184511115612f045760408051600180825281830190925290602080830190803683370190505090506001825111158015612ee35750825160011480612ee3575082518451145b612eff5760405162461bcd60e51b81526004016106f09061523e565b612f76565b82516001600160401b03811115612f1d57612f1d61499c565b604051908082528060200260200182016040528015612f46578160200160208202803683370190505b509050815160001480612f5a575081518351145b612f765760405162461bcd60e51b81526004016106f09061523e565b60005b8151811015612ff75760078054906000612f9283615225565b9190505550600754828281518110612fac57612fac6151f9565b6020908102919091018101919091526007546000908152600e9091526040902080546001600160a01b0319166001600160a01b03881617905580612fef81615225565b915050612f79565b506001600160a01b038516301461301357613013848285613dab565b83516001148015613025575080516001145b1561307b5761307684600081518110613040576130406151f9565b60200260200101518260008151811061305b5761305b6151f9565b602002602001015185600081518110612bdd57612bdd6151f9565b61319e565b6001845111156131655782516001036130fd5760005b84518110156130f7576130e58582815181106130af576130af6151f9565b6020026020010151836000815181106130ca576130ca6151f9565b602002602001015186600081518110612bdd57612bdd6151f9565b806130ef81615225565b915050613091565b5061319e565b60005b84518110156130f75761315385828151811061311e5761311e6151f9565b602002602001015183600081518110613139576131396151f9565b6020026020010151868481518110612bdd57612bdd6151f9565b8061315d81615225565b915050613100565b61319e8460008151811061317b5761317b6151f9565b6020026020010151828560006001600160401b03811115612c8357612c8361499c565b60005b8151811015613246578251811080156131d4575060008382815181106131c9576131c96151f9565b602002602001015151115b15613234578281815181106131eb576131eb6151f9565b602002602001015160126000848481518110613209576132096151f9565b602002602001015181526020019081526020016000209080519060200190613232929190614645565b505b8061323e81615225565b9150506131a1565b50949350505050565b306000908152601160205260409020610864908383614538565b816001600160a01b0316836001600160a01b0316036132dc5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016106f0565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b600061335483613f41565b8015611bcf5750611bcf8383613f74565b6000818152601560205260408120541561338b5750600090815260156020526040902090565b6000828152600e60209081526040808320546001600160a01b031683526013909152902054156133dd57506000908152600e60209081526040808320546001600160a01b031683526013909152902090565b505030600090815260136020526040902090565b6000806133fd83613365565b61340684611f4b565b91509150915091565b61341a600882611bb1565b156107a05760405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a7890147990600090a361097d600882612341565b61346b600883611bb1565b6134ab5760405162461bcd60e51b815260206004820152601160248201527024b73b30b634b21032bc3a32b739b4b7b760791b60448201526064016106f0565b6001600160a01b03811615806134cd57506134cd816378ea2a9760e11b613349565b61350b5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016106f0565b6001600160a01b038281166000908152600c602052604090205481169082161461097d576001600160a01b038281166000818152600c602052604080822080546001600160a01b031916948616948517905551339392917f6a835c4fcf7e0d398db3762332fdaa1471814ad39f1e2d6d0b3fdabf8efee3e091a45050565b6001600160a01b0384166135af5760405162461bcd60e51b81526004016106f09061561e565b3360006135bb85613ffd565b905060006135c885613ffd565b90506135d8838989858589613956565b60008681526004602090815260408083206001600160a01b038c1684529091529020548581101561361b5760405162461bcd60e51b81526004016106f090615663565b60008781526004602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061365a9084906154f1565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46136ba848a8a8a8a8a614048565b505050505050505050565b60006001600160e01b031982166328f10a2160e01b14806136ea57506136ea82611b41565b8061370557506001600160e01b03198216635d9dd7eb60e11b145b8061372057506001600160e01b03198216632dde656160e21b145b8061373b57506001600160e01b031982166335681b5360e21b145b8061071e57506001600160e01b0319821663152a902d60e11b1492915050565b6060816000036137825750506040805180820190915260018152600360fc1b602082015290565b8160005b81156137ac578061379681615225565b91506137a59050600a836155c2565b9150613786565b6000816001600160401b038111156137c6576137c661499c565b6040519080825280601f01601f1916602001820160405280156137f0576020820181803683370190505b5090505b841561385b576138056001836156c0565b9150613812600a8661570d565b61381d9060306154f1565b60f81b818381518110613832576138326151f9565b60200101906001600160f81b031916908160001a905350613854600a866155c2565b94506137f4565b949350505050565b6000818152600183016020526040812054801561394c5760006138876001836156c0565b855490915060009061389b906001906156c0565b90508181146139005760008660000182815481106138bb576138bb6151f9565b90600052602060002001549050808760000184815481106138de576138de6151f9565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061391157613911615721565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061071e565b600091505061071e565b61115785858585614103565b6001600160a01b0384163b156111575760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906139a69089908990889088908890600401615737565b6020604051808303816000875af19250505080156139e1575060408051601f3d908101601f191682019092526139de91810190615795565b60015b613a8d576139ed6157b2565b806308c379a003613a265750613a016157ce565b80613a0c5750613a28565b8060405162461bcd60e51b81526004016106f091906147d0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016106f0565b6001600160e01b0319811663bc197c8160e01b14613abd5760405162461bcd60e51b81526004016106f090615857565b50505050505050565b6000826000018281548110613add57613add6151f9565b9060005260206000200154905092915050565b6001600160a01b038316613b165760405162461bcd60e51b81526004016106f09061589f565b336000613b2284613ffd565b90506000613b2f84613ffd565b9050613b4f83876000858560405180602001604052806000815250613956565b60008581526004602090815260408083206001600160a01b038a16845290915290205484811015613b925760405162461bcd60e51b81526004016106f0906158e2565b60008681526004602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052613abd565b6001600160a01b038316613c325760405162461bcd60e51b81526004016106f09061589f565b8051825114613c535760405162461bcd60e51b81526004016106f0906155d6565b6000339050613c7681856000868660405180602001604052806000815250613956565b60005b8351811015613d3e576000848281518110613c9657613c966151f9565b602002602001015190506000848381518110613cb457613cb46151f9565b60209081029190910181015160008481526004835260408082206001600160a01b038c168352909352919091205490915081811015613d055760405162461bcd60e51b81526004016106f0906158e2565b60009283526004602090815260408085206001600160a01b038b1686529091529092209103905580613d3681615225565b915050613c79565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051613d8f9291906156ad565b60405180910390a4604080516020810190915260009052610acf565b336000908152600c60205260409020546001600160a01b03161561086457336000818152600c6020526040908190205490516378ea2a9760e11b81526001600160a01b039091169163f1d4552e91613e0c9190879087908790600401615926565b600060405180830381600087803b158015613e2657600080fd5b505af1158015613abd573d6000803e3d6000fd5b613e46848484846142fb565b60008381526017602052604081208054849290613e649084906154f1565b909155505050505050565b613e7b848484846143dd565b60005b83518110156108c057828181518110613e9957613e996151f9565b602002602001015160176000868481518110613eb757613eb76151f9565b602002602001015181526020019081526020016000206000828254613edc91906154f1565b90915550613eeb905081615225565b9050613e7e565b6000818152600183016020526040812054613f395750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561071e565b50600061071e565b6000613f54826301ffc9a760e01b613f74565b801561071e5750613f6d826001600160e01b0319613f74565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d91506000519050828015613fe6575060208210155b8015613ff25750600081115b979650505050505050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110614037576140376151f9565b602090810291909101015292915050565b6001600160a01b0384163b156111575760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061408c9089908990889088908890600401615970565b6020604051808303816000875af19250505080156140c7575060408051601f3d908101601f191682019092526140c491810190615795565b60015b6140d3576139ed6157b2565b6001600160e01b0319811663f23a6e6160e01b14613abd5760405162461bcd60e51b81526004016106f090615857565b60008251116141245760405162461bcd60e51b81526004016106f09061523e565b6000600e60008460008151811061413d5761413d6151f9565b6020026020010151815260200190815260200160002060009054906101000a90046001600160a01b0316905060005b835181101561421857816001600160a01b0316600e6000868481518110614195576141956151f9565b6020908102919091018101518252810191909152604001600020546001600160a01b0316146142065760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f72730000000060448201526064016106f0565b8061421081615225565b91505061416c565b506001600160a01b0381166000908152600d602052604090205460ff16156108c05760405163883da93360e01b81526001600160a01b0382169063883da9339061426c9088908890889088906004016159aa565b6020604051808303816000875af115801561428b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142af91906159e8565b6108c05760405162461bcd60e51b815260206004820152601a60248201527f457874656e73696f6e20617070726f76616c206661696c75726500000000000060448201526064016106f0565b6001600160a01b0384166143215760405162461bcd60e51b81526004016106f090615a05565b33600061432d85613ffd565b9050600061433a85613ffd565b905061434b83600089858589613956565b60008681526004602090815260408083206001600160a01b038b1684529091528120805487929061437d9084906154f1565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613abd83600089898989614048565b6001600160a01b0384166144035760405162461bcd60e51b81526004016106f090615a05565b81518351146144245760405162461bcd60e51b81526004016106f0906155d6565b3361443481600087878787613956565b60005b84518110156144d057838181518110614452576144526151f9565b602002602001015160046000878481518110614470576144706151f9565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546144b891906154f1565b909155508190506144c881615225565b915050614437565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516145219291906156ad565b60405180910390a46108c081600087878787613962565b82805461454490615373565b90600052602060002090601f01602090048101928261456657600085556145ac565b82601f1061457f5782800160ff198235161785556145ac565b828001600101855582156145ac579182015b828111156145ac578235825591602001919060010190614591565b50610b7f9291506146b9565b8280548282559060005260206000209081019282156145ac579160200282015b828111156145ac5781546001600160a01b0319166001600160a01b038435161782556020909201916001909101906145d8565b8280548282559060005260206000209081019282156145ac57916020028201828111156145ac578235825591602001919060010190614591565b82805461465190615373565b90600052602060002090601f01602090048101928261467357600085556145ac565b82601f1061468c57805160ff19168380011785556145ac565b828001600101855582156145ac579182015b828111156145ac57825182559160200191906001019061469e565b5b80821115610b7f57600081556001016146ba565b6001600160a01b03811681146107a057600080fd5b600080604083850312156146f657600080fd5b8235614701816146ce565b946020939093013593505050565b6001600160e01b0319811681146107a057600080fd5b60006020828403121561473757600080fd5b8135611bcf8161470f565b60006020828403121561475457600080fd5b8135611bcf816146ce565b60006020828403121561477157600080fd5b5035919050565b60005b8381101561479357818101518382015260200161477b565b83811115610acf5750506000910152565b600081518084526147bc816020860160208601614778565b601f01601f19169290920160200192915050565b602081526000611bcf60208301846147a4565b600081518084526020808501945080840160005b83811015614813578151875295820195908201906001016147f7565b509495945050505050565b602081526000611bcf60208301846147e3565b60008083601f84011261484357600080fd5b5081356001600160401b0381111561485a57600080fd5b60208301915083602082850101111561091d57600080fd5b60008060006040848603121561488757600080fd5b8335925060208401356001600160401b038111156148a457600080fd5b6148b086828701614831565b9497909650939450505050565b60008083601f8401126148cf57600080fd5b5081356001600160401b038111156148e657600080fd5b6020830191508360208260051b850101111561091d57600080fd5b60008060008060006060868803121561491957600080fd5b8535945060208601356001600160401b038082111561493757600080fd5b61494389838a016148bd565b9096509450604088013591508082111561495c57600080fd5b50614969888289016148bd565b969995985093965092949392505050565b6000806040838503121561498d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156149d7576149d761499c565b6040525050565b60006001600160401b038211156149f7576149f761499c565b5060051b60200190565b600082601f830112614a1257600080fd5b81356020614a1f826149de565b604051614a2c82826149b2565b83815260059390931b8501820192828101915086841115614a4c57600080fd5b8286015b84811015614a675780358352918301918301614a50565b509695505050505050565b60006001600160401b03821115614a8b57614a8b61499c565b50601f01601f191660200190565b6000614aa483614a72565b604051614ab182826149b2565b809250848152858585011115614ac657600080fd5b8484602083013760006020868301015250509392505050565b600082601f830112614af057600080fd5b611bcf83833560208501614a99565b600080600080600060a08688031215614b1757600080fd5b8535614b22816146ce565b94506020860135614b32816146ce565b935060408601356001600160401b0380821115614b4e57600080fd5b614b5a89838a01614a01565b94506060880135915080821115614b7057600080fd5b614b7c89838a01614a01565b93506080880135915080821115614b9257600080fd5b50614b9f88828901614adf565b9150509295509295909350565b60008060208385031215614bbf57600080fd5b82356001600160401b03811115614bd557600080fd5b614be185828601614831565b90969095509350505050565b600080600060408486031215614c0257600080fd5b8335614c0d816146ce565b925060208401356001600160401b038111156148a457600080fd5b600081518084526020808501945080840160005b838110156148135781516001600160a01b031687529582019590820190600101614c3c565b602081526000611bcf6020830184614c28565b60008060008060408587031215614c8a57600080fd5b84356001600160401b0380821115614ca157600080fd5b614cad888389016148bd565b90965094506020870135915080821115614cc657600080fd5b50614cd3878288016148bd565b95989497509550505050565b600080600060608486031215614cf457600080fd5b8335614cff816146ce565b925060208401356001600160401b0380821115614d1b57600080fd5b614d2787838801614a01565b93506040860135915080821115614d3d57600080fd5b50614d4a86828701614a01565b9150509250925092565b80151581146107a057600080fd5b60008060008060608587031215614d7857600080fd5b8435614d83816146ce565b935060208501356001600160401b03811115614d9e57600080fd5b614daa87828801614831565b9094509250506040850135614dbe81614d54565b939692955090935050565b60008060408385031215614ddc57600080fd5b82356001600160401b0380821115614df357600080fd5b818501915085601f830112614e0757600080fd5b81356020614e14826149de565b604051614e2182826149b2565b83815260059390931b8501820192828101915089841115614e4157600080fd5b948201945b83861015614e68578535614e59816146ce565b82529482019490820190614e46565b96505086013592505080821115614e7e57600080fd5b50614e8b85828601614a01565b9150509250929050565b600080600060408486031215614eaa57600080fd5b83356001600160401b0380821115614ec157600080fd5b614ecd87838801614a01565b94506020860135915080821115614ee357600080fd5b506148b0868287016148bd565b60008060008060008060608789031215614f0957600080fd5b86356001600160401b0380821115614f2057600080fd5b614f2c8a838b016148bd565b90985096506020890135915080821115614f4557600080fd5b614f518a838b016148bd565b90965094506040890135915080821115614f6a57600080fd5b50614f7789828a016148bd565b979a9699509497509295939492505050565b600080600060408486031215614f9e57600080fd5b83356001600160401b03811115614fb457600080fd5b614fc086828701614831565b9094509250506020840135614fd481614d54565b809150509250925092565b60008060408385031215614ff257600080fd5b8235614ffd816146ce565b9150602083013561500d81614d54565b809150509250929050565b60006020828403121561502a57600080fd5b8135611bcf81614d54565b60008060008060006060868803121561504d57600080fd5b8535615058816146ce565b945060208601356001600160401b038082111561493757600080fd5b6040815260006150876040830185614c28565b828103602084015261509981856147e3565b95945050505050565b600080604083850312156150b557600080fd5b82356150c0816146ce565b9150602083013561500d816146ce565b600080600080600060a086880312156150e857600080fd5b85356150f3816146ce565b94506020860135615103816146ce565b9350604086013592506060860135915060808601356001600160401b0381111561512c57600080fd5b614b9f88828901614adf565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b602080825260159082015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016152375761523761520f565b5060010190565b6020808252600d908201526c125b9d985b1a59081a5b9c1d5d609a1b604082015260600190565b6020808252601c908201527f4d757374206265207265676973746572656420657874656e73696f6e00000000604082015260600190565b6000808335601e198436030181126152b357600080fd5b8301803591506001600160401b038211156152cd57600080fd5b60200191503681900382131561091d57600080fd5b60006152ed836149de565b6040516152fa82826149b2565b84815260208082019250600586901b85013681111561531857600080fd5b855b818110156153675780356001600160401b038111156153395760008081fd5b870136601f82011261534b5760008081fd5b615359368235868401614a99565b86525093820193820161531a565b50919695505050505050565b600181811c9082168061538757607f821691505b602082108103611f4557634e487b7160e01b600052602260045260246000fd5b8054600090600181811c90808316806153c157607f831692505b602080841082036153e257634e487b7160e01b600052602260045260246000fd5b8180156153f6576001811461540757615434565b60ff19861689528489019650615434565b60008881526020902060005b8681101561542c5781548b820152908501908301615413565b505084890196505b50505050505092915050565b600061385b61544f83866153a7565b846153a7565b60006020828403121561546757600080fd5b81516001600160401b0381111561547d57600080fd5b8201601f8101841361548e57600080fd5b805161549981614a72565b6040516154a682826149b2565b8281528660208486010111156154bb57600080fd5b61135d836020830160208701614778565b60006154d882856153a7565b83516154e8818360208801614778565b01949350505050565b600082198211156155045761550461520f565b500190565b6040808252810184905260008560608301825b8781101561554c57823561552f816146ce565b6001600160a01b031682526020928301929091019060010161551c565b5083810360208501528481526001600160fb1b0385111561556c57600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60008160001904831182151516156155a7576155a761520f565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826155d1576155d16155ac565b500490565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60408152600061508760408301856147e3565b6000828210156156d2576156d261520f565b500390565b6001600160a01b03841681526060602082018190526000906156fb908301856147e3565b828103604084015261135d81856147e3565b60008261571c5761571c6155ac565b500690565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0386811682528516602082015260a060408201819052600090615763908301866147e3565b828103606084015261577581866147e3565b9050828103608084015261578981856147a4565b98975050505050505050565b6000602082840312156157a757600080fd5b8151611bcf8161470f565b600060033d11156157cb5760046000803e5060005160e01c5b90565b600060443d10156157dc5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561580b57505050505090565b82850191508151818111156158235750505050505090565b843d870101602082850101111561583d5750505050505090565b61584c602082860101876149b2565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b038516815260806020820181905260009061594a90830186614c28565b828103604084015261595c81866147e3565b90508281036060840152613ff281856147e3565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613ff2908301846147a4565b6001600160a01b038581168252841660208201526080604082018190526000906159d6908301856147e3565b8281036060840152613ff281856147e3565b6000602082840312156159fa57600080fd5b8151611bcf81614d54565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b60608201526080019056fea2646970667358221220f7c825404635380e0ddaa9ab351c8fcd56bc59415e6e31424569353475668fcd64736f6c634300080d0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102895760003560e01c80636d73e6691161015c578063b9c4d9fb116100ce578063e92a89f611610087578063e92a89f6146105ee578063e985e9c514610601578063f0cdc4991461063d578063f242432a14610650578063f2fde38b14610663578063feeb5a9a1461067657600080fd5b8063b9c4d9fb14610574578063bb3bafd614610587578063bd85b039146105a8578063ce8aee9d146105c8578063d5a06d4c14610587578063e6c884dc146105db57600080fd5b80638da5cb5b116101205780638da5cb5b1461050457806399e0dd7c14610515578063a22cb46514610528578063aafb2d441461053b578063ac0c8cfa1461054e578063b0fe87c91461056157600080fd5b80636d73e669146104bb578063715018a6146104ce57806382dcc0c8146104d657806383b7db63146104e95780638c6e8472146104f157600080fd5b80632eb2c2d6116102005780633e6134b8116101b95780633e6134b8146104495780633f0f37f61461045c5780634e1273f41461046f57806361e5bc6b1461048257806366d1e9d014610495578063695c96e6146104a857600080fd5b80632eb2c2d6146103d557806330176e13146103e85780633071a0f9146103fb57806331ae450b1461040e578063332dd1ae146104235780633db0f8ab1461043657600080fd5b8063162094c411610252578063162094c41461032c57806320e4afe21461033f578063239be3171461035257806324d7806c1461037d5780632a55205a146103905780632d345670146103c257600080fd5b8062fdd58e1461028e57806301ffc9a7146102b457806302e7afb7146102d75780630e89341c146102ec5780630ebd4c7f1461030c575b600080fd5b6102a161029c3660046146e3565b610689565b6040519081526020015b60405180910390f35b6102c76102c2366004614725565b610724565b60405190151581526020016102ab565b6102ea6102e5366004614742565b61074d565b005b6102ff6102fa36600461475f565b6107a3565b6040516102ab91906147d0565b61031f61031a36600461475f565b6107ae565b6040516102ab919061481e565b6102ea61033a366004614872565b61080f565b6102ea61034d366004614901565b610869565b61036561036036600461475f565b6108c7565b6040516001600160a01b0390911681526020016102ab565b6102c761038b366004614742565b6108d2565b6103a361039e36600461497a565b61090b565b604080516001600160a01b0390931683526020830191909152016102ab565b6102ea6103d0366004614742565b610924565b6102ea6103e3366004614aff565b610981565b6102ea6103f6366004614bac565b6109c6565b6102ea610409366004614bed565b610a4f565b610416610ad5565b6040516102ab9190614c61565b6102ea610431366004614c74565b610b83565b6102ea610444366004614cdf565b610bda565b6102ea610457366004614bac565b610cf5565b6102ea61046a366004614d62565b610d28565b61031f61047d366004614dc9565b610da7565b6102ea610490366004614e95565b610ed0565b6102ea6104a3366004614bac565b610f7b565b6102ea6104b6366004614ef0565b610fac565b6102ea6104c9366004614742565b61115f565b6102ea6111b7565b6102ea6104e4366004614f89565b6111cb565b6104166111fd565b61031f6104ff366004614ef0565b6112a7565b6000546001600160a01b0316610365565b6102ea610523366004614bac565b611367565b6102ea610536366004614fdf565b6113bb565b6102ea610549366004614e95565b6113c6565b6102ea61055c366004615018565b611494565b6102ea61056f366004615035565b6115ba565b61041661058236600461475f565b611611565b61059a61059536600461475f565b61167b565b6040516102ab929190615074565b6102a16105b636600461475f565b60009081526017602052604090205490565b6102ea6105d6366004614742565b61173a565b6102ea6105e9366004614ef0565b61178d565b6102ea6105fc366004614872565b611912565b6102c761060f3660046150a2565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6102ea61064b3660046150a2565b611944565b6102ea61065e3660046150d0565b611998565b6102ea610671366004614742565b6119dd565b61031f610684366004614ef0565b611a53565b60006001600160a01b0383166106f95760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526004602090815260408083206001600160a01b03861684529091529020545b92915050565b600061072f82611b1c565b8061073e575061073e82611b41565b8061071e575061071e82611b7c565b336107606000546001600160a01b031690565b6001600160a01b0316148061077b575061077b600233611bb1565b6107975760405162461bcd60e51b81526004016106f090615138565b6107a081611bd6565b50565b606061071e82611cd1565b60606107b982611f4b565b80548060200260200160405190810160405280929190818152602001828054801561080357602002820191906000526020600020905b8154815260200190600101908083116107ef575b50505050509050919050565b336108226000546001600160a01b031690565b6001600160a01b0316148061083d575061083d600233611bb1565b6108595760405162461bcd60e51b81526004016106f090615138565b610864838383611fd7565b505050565b3361087c6000546001600160a01b031690565b6001600160a01b031614806108975750610897600233611bb1565b6108b35760405162461bcd60e51b81526004016106f090615138565b6108c08585858585612046565b5050505050565b600061071e8261216f565b6000816001600160a01b03166108f06000546001600160a01b031690565b6001600160a01b0316148061071e575061071e600283611bb1565b60008061091884846121fc565b915091505b9250929050565b61092c6122e7565b610937600282611bb1565b156107a05760405133906001600160a01b038316907f7c0c3c84c67c85fcac635147348bfe374c24a1a93d0366d1cfe9d8853cbf89d590600090a361097d600282612341565b5050565b6001600160a01b03851633148061099d575061099d853361060f565b6109b95760405162461bcd60e51b81526004016106f09061517c565b6108c08585858585612356565b336109d96000546001600160a01b031690565b6001600160a01b031614806109f457506109f4600233611bb1565b610a105760405162461bcd60e51b81526004016106f090615138565b61097d82828080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124fb92505050565b33610a626000546001600160a01b031690565b6001600160a01b03161480610a7d5750610a7d600233611bb1565b610a995760405162461bcd60e51b81526004016106f090615138565b82610aa5600a82611bb1565b15610ac25760405162461bcd60e51b81526004016106f0906151ca565b610acf848484600061251b565b50505050565b6060610ae16002612655565b6001600160401b03811115610af857610af861499c565b604051908082528060200260200182016040528015610b21578160200160208202803683370190505b50905060005b610b316002612655565b811015610b7f57610b4360028261265f565b828281518110610b5557610b556151f9565b6001600160a01b039092166020928302919091019091015280610b7781615225565b915050610b27565b5090565b33610b966000546001600160a01b031690565b6001600160a01b03161480610bb15750610bb1600233611bb1565b610bcd5760405162461bcd60e51b81526004016106f090615138565b610acf308585858561266b565b610be26127f3565b6001600160a01b038316331480610c1c57506001600160a01b038316600090815260056020908152604080832033845290915290205460ff165b610c685760405162461bcd60e51b815260206004820181905260248201527f43616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656460448201526064016106f0565b8051825114610c895760405162461bcd60e51b81526004016106f09061523e565b8151600103610cd657610cd18383600081518110610ca957610ca96151f9565b602002602001015183600081518110610cc457610cc46151f9565b602002602001015161284c565b610ce1565b610ce183838361287f565b610cec838383612901565b61086460018055565b610d00600833611bb1565b610d1c5760405162461bcd60e51b81526004016106f090615265565b61097d82826000612aa5565b33610d3b6000546001600160a01b031690565b6001600160a01b03161480610d565750610d56600233611bb1565b610d725760405162461bcd60e51b81526004016106f090615138565b83610d7e600a82611bb1565b15610d9b5760405162461bcd60e51b81526004016106f0906151ca565b6108c08585858561251b565b60608151835114610e0c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016106f0565b600083516001600160401b03811115610e2757610e2761499c565b604051908082528060200260200182016040528015610e50578160200160208202803683370190505b50905060005b8451811015610ec857610e9b858281518110610e7457610e746151f9565b6020026020010151858381518110610e8e57610e8e6151f9565b6020026020010151610689565b828281518110610ead57610ead6151f9565b6020908102919091010152610ec181615225565b9050610e56565b509392505050565b610edb600833611bb1565b610ef75760405162461bcd60e51b81526004016106f090615265565b82518114610f175760405162461bcd60e51b81526004016106f09061523e565b60005b8351811015610acf57610f69848281518110610f3857610f386151f9565b6020026020010151848484818110610f5257610f526151f9565b9050602002810190610f64919061529c565b612ae2565b80610f7381615225565b915050610f1a565b610f86600833611bb1565b610fa25760405162461bcd60e51b81526004016106f090615265565b61097d8282612b38565b610fb46127f3565b33610fc76000546001600160a01b031690565b6001600160a01b03161480610fe25750610fe2600233611bb1565b610ffe5760405162461bcd60e51b81526004016106f090615138565b60005b838110156110ae5730600e6000878785818110611020576110206151f9565b60209081029290920135835250810191909152604001600020546001600160a01b03161461109c5760405162461bcd60e51b815260206004820152602360248201527f4120746f6b656e20776173206372656174656420627920616e20657874656e7360448201526234b7b760e91b60648201526084016106f0565b806110a681615225565b915050611001565b5061114e3087878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250612b5292505050565b61115760018055565b505050505050565b6111676122e7565b611172600282611bb1565b6107a05760405133906001600160a01b038316907f7e1a1a08d52e4ba0e21554733d66165fd5151f99460116223d9e3a608eec5cb190600090a361097d600282612e34565b6111bf6122e7565b6111c96000612e49565b565b6111d6600833611bb1565b6111f25760405162461bcd60e51b81526004016106f090615265565b610864838383612aa5565b60606112096008612655565b6001600160401b038111156112205761122061499c565b604051908082528060200260200182016040528015611249578160200160208202803683370190505b50905060005b6112596008612655565b811015610b7f5761126b60088261265f565b82828151811061127d5761127d6151f9565b6001600160a01b03909216602092830291909101909101528061129f81615225565b91505061124f565b60606112b16127f3565b6112bc600833611bb1565b6112d85760405162461bcd60e51b81526004016106f090615265565b6113523388888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a91829185019084908082843760009201919091525061134d92508891508990506152e2565b612e99565b905061135d60018055565b9695505050505050565b3361137a6000546001600160a01b031690565b6001600160a01b031614806113955750611395600233611bb1565b6113b15760405162461bcd60e51b81526004016106f090615138565b61097d828261324f565b61097d338383613269565b336113d96000546001600160a01b031690565b6001600160a01b031614806113f457506113f4600233611bb1565b6114105760405162461bcd60e51b81526004016106f090615138565b825181146114305760405162461bcd60e51b81526004016106f09061523e565b60005b8351811015610acf57611482848281518110611451576114516151f9565b602002602001015184848481811061146b5761146b6151f9565b905060200281019061147d919061529c565b611fd7565b8061148c81615225565b915050611433565b61149f600833611bb1565b6114bb5760405162461bcd60e51b81526004016106f090615265565b8015806114d457506114d4336324ea02c560e21b613349565b611548576040805162461bcd60e51b81526020600482015260248101919091527f457874656e73696f6e206d75737420696d706c656d656e74204945524331313560448201527f3543726561746f72457874656e73696f6e417070726f76655472616e7366657260648201526084016106f0565b336000908152600d602052604090205460ff161515811515146107a057336000818152600d6020908152604091829020805460ff191685151590811790915591519182527f072a7592283e2c2d1d56d21517ff6013325e0f55483f4828373ff4d98b0a1a36910160405180910390a250565b336115cd6000546001600160a01b031690565b6001600160a01b031614806115e857506115e8600233611bb1565b6116045760405162461bcd60e51b81526004016106f090615138565b6108c0858585858561266b565b606061161c82613365565b80548060200260200160405190810160405280929190818152602001828054801561080357602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116116525750505050509050919050565b606080611687836133f1565b8154604080516020808402820181019092528281529184918301828280156116d857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116116ba575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561172a57602002820191906000526020600020905b815481526020019060010190808311611716575b5050505050905091509150915091565b3361174d6000546001600160a01b031690565b6001600160a01b031614806117685750611768600233611bb1565b6117845760405162461bcd60e51b81526004016106f090615138565b6107a08161340f565b6117956127f3565b6117a0600833611bb1565b6117bc5760405162461bcd60e51b81526004016106f090615265565b60005b838110156118725733600e60008787858181106117de576117de6151f9565b60209081029290920135835250810191909152604001600020546001600160a01b0316146118605760405162461bcd60e51b815260206004820152602960248201527f4120746f6b656e20776173206e6f74206372656174656420627920746869732060448201526832bc3a32b739b4b7b760b91b60648201526084016106f0565b8061186a81615225565b9150506117bf565b5061114e3387878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a02828101820190935289825290935089925088918291850190849080828437600092019190915250612b5292505050565b61191d600833611bb1565b6119395760405162461bcd60e51b81526004016106f090615265565b610864838383612ae2565b336119576000546001600160a01b031690565b6001600160a01b031614806119725750611972600233611bb1565b61198e5760405162461bcd60e51b81526004016106f090615138565b61097d8282613460565b6001600160a01b0385163314806119b457506119b4853361060f565b6119d05760405162461bcd60e51b81526004016106f09061517c565b6108c08585858585613589565b6119e56122e7565b6001600160a01b038116611a4a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106f0565b6107a081612e49565b6060611a5d6127f3565b33611a706000546001600160a01b031690565b6001600160a01b03161480611a8b5750611a8b600233611bb1565b611aa75760405162461bcd60e51b81526004016106f090615138565b6113523088888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808c0282810182019093528b82529093508b92508a91829185019084908082843760009201919091525061134d92508891508990506152e2565b60006001600160e01b031982166301f4921160e61b148061071e575061071e826136c5565b60006001600160e01b03198216636cdb3d1360e11b148061073e57506001600160e01b031982166303a24d0760e21b148061071e575061071e825b60006001600160e01b03198216632a9f3abf60e11b148061071e57506301ffc9a760e01b6001600160e01b031983161461071e565b6001600160a01b038116600090815260018301602052604081205415155b9392505050565b306001600160a01b03821603611c2e5760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f7420626c61636b6c69737420796f757273656c660000000000000060448201526064016106f0565b611c39600882611bb1565b15611c815760405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a7890147990600090a3611c7f600882612341565b505b611c8c600a82611bb1565b6107a05760405133906001600160a01b038316907f05ac7bc5a606cd92a63365f9fda244499b9add0526b22d99937b6bd88181059c90600090a361097d600a82612e34565b6000818152600e60205260409020546060906001600160a01b0316611cf7600a82611bb1565b15611d145760405162461bcd60e51b81526004016106f0906151ca565b60008381526012602052604090208054611d2d90615373565b159050611e47576001600160a01b03811660009081526011602052604090208054611d5790615373565b159050611da8576001600160a01b038116600090815260116020908152604080832086845260128352928190209051611d91939201615440565b604051602081830303815290604052915050919050565b60008381526012602052604090208054611dc190615373565b80601f0160208091040260200160405190810160405280929190818152602001828054611ded90615373565b8015611e3a5780601f10611e0f57610100808354040283529160200191611e3a565b820191906000526020600020905b815481529060010190602001808311611e1d57829003601f168201915b5050505050915050919050565b611e588163e9dc637560e01b613349565b15611ed05760405163e9dc637560e01b8152306004820152602481018490526001600160a01b0382169063e9dc637590604401600060405180830381865afa158015611ea8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611bcf9190810190615455565b6001600160a01b03811660009081526010602052604090205460ff16611f22576001600160a01b0381166000908152600f60205260409020611f118461375b565b604051602001611d919291906154cc565b6001600160a01b0381166000908152600f602052604090208054611dc190615373565b50919050565b60008181526016602052604081205415611f715750600090815260166020526040902090565b6000828152600e60209081526040808320546001600160a01b03168352601490915290205415611fc357506000908152600e60209081526040808320546001600160a01b031683526014909152902090565b505030600090815260146020526040902090565b6000838152600e60205260409020546001600160a01b0316301461202d5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b60448201526064016106f0565b6000838152601260205260409020610acf908383614538565b8281146120655760405162461bcd60e51b81526004016106f09061523e565b6000805b828110156120a957838382818110612083576120836151f9565b905060200201358261209591906154f1565b9150806120a181615225565b915050612069565b5061271081106120f55760405162461bcd60e51b8152602060048201526017602482015276496e76616c696420746f74616c20726f79616c7469657360481b60448201526064016106f0565b600086815260156020526040902061210e9086866145b8565b50600086815260166020526040902061212890848461460b565b50857fabb46fe0761d77584bde75697647804ffd8113abd4d8d06bc664150395eccdee8686868660405161215f9493929190615509565b60405180910390a2505050505050565b6000818152600e60205260409020546001600160a01b03163081036121cf5760405162461bcd60e51b815260206004820152601660248201527527379032bc3a32b739b4b7b7103337b9103a37b5b2b760511b60448201526064016106f0565b6121da600a82611bb1565b156121f75760405162461bcd60e51b81526004016106f0906151ca565b919050565b600080600061220a85613365565b80549091506001101561225f5760405162461bcd60e51b815260206004820152601c60248201527f4d6f7265207468616e203120726f79616c74792072656365697665720000000060448201526064016106f0565b805460000361227557306000925092505061091d565b80600081548110612288576122886151f9565b6000918252602090912001546001600160a01b0316612710856122aa88611f4b565b6000815481106122bc576122bc6151f9565b90600052602060002001546122d1919061558d565b6122db91906155c2565b92509250509250929050565b6000546001600160a01b031633146111c95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106f0565b6000611bcf836001600160a01b038416613863565b81518351146123775760405162461bcd60e51b81526004016106f0906155d6565b6001600160a01b03841661239d5760405162461bcd60e51b81526004016106f09061561e565b336123ac818787878787613956565b60005b84518110156124955760008582815181106123cc576123cc6151f9565b6020026020010151905060008583815181106123ea576123ea6151f9565b60209081029190910181015160008481526004835260408082206001600160a01b038e16835290935291909120549091508181101561243b5760405162461bcd60e51b81526004016106f090615663565b60008381526004602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061247a9084906154f1565b925050819055505050508061248e90615225565b90506123af565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516124e59291906156ad565b60405180910390a4611157818787878787613962565b306000908152600f60209081526040909120825161097d92840190614645565b306001600160a01b038516036125665760405162461bcd60e51b815260206004820152601060248201526f10dc99585d1bdc8e88125b9d985b1a5960821b60448201526064016106f0565b6001600160a01b0384163b6125cb5760405162461bcd60e51b815260206004820152602560248201527f43726561746f723a20457874656e73696f6e206d757374206265206120636f6e6044820152641d1c9858dd60da1b60648201526084016106f0565b6125d6600885611bb1565b610acf576001600160a01b0384166000908152600f602052604090206125fd908484614538565b506001600160a01b038416600081815260106020526040808220805460ff1916851515179055513392917fd8cb8ba4086944eabf43c5535b7712015e4d4c714b24bf812c040ea5b7a3e42a91a36108c0600885612e34565b600061071e825490565b6000611bcf8383613ac6565b82811461268a5760405162461bcd60e51b81526004016106f09061523e565b6000805b828110156126ce578383828181106126a8576126a86151f9565b90506020020135826126ba91906154f1565b9150806126c681615225565b91505061268e565b50612710811061271a5760405162461bcd60e51b8152602060048201526017602482015276496e76616c696420746f74616c20726f79616c7469657360481b60448201526064016106f0565b6001600160a01b038616600090815260136020526040902061273d9086866145b8565b506001600160a01b038616600090815260146020526040902061276190848461460b565b50306001600160a01b038716036127b4577f2b6849d5976d799a5b0ca4dfd6b40a3d7afe9ea72c091fa01a958594f9a2659b858585856040516127a79493929190615509565b60405180910390a1611157565b856001600160a01b03167f535a93d2cb000582c0ebeaa9be4890ec6a287f98eb2df00c54c300612fd78d8f8686868660405161215f9493929190615509565b6002600154036128455760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016106f0565b6002600155565b612857838383613af0565b600082815260176020526040812080548392906128759084906156c0565b9091555050505050565b61288a838383613c0c565b60005b8251811015610acf578181815181106128a8576128a86151f9565b6020026020010151601760008584815181106128c6576128c66151f9565b6020026020010151815260200190815260200160002060008282546128eb91906156c0565b909155506128fa905081615225565b905061288d565b60008251116129225760405162461bcd60e51b81526004016106f09061523e565b6000600e60008460008151811061293b5761293b6151f9565b6020026020010151815260200190815260200160002060009054906101000a90046001600160a01b0316905060005b8351811015612a1657816001600160a01b0316600e6000868481518110612993576129936151f9565b6020908102919091018101518252810191909152604001600020546001600160a01b031614612a045760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f72730000000060448201526064016106f0565b80612a0e81615225565b91505061296a565b506001600160a01b0381163014610acf57612a38816303dc6f6560e51b613349565b15610acf576040516303dc6f6560e51b81526001600160a01b03821690637b8deca090612a6d908790879087906004016156d7565b600060405180830381600087803b158015612a8757600080fd5b505af1158015612a9b573d6000803e3d6000fd5b5050505050505050565b336000908152600f60205260409020612abf908484614538565b50336000908152601060205260409020805460ff19169115159190911790555050565b6000838152600e60205260409020546001600160a01b0316331461202d5760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b2103a37b5b2b760991b60448201526064016106f0565b336000908152601160205260409020610864908383614538565b6001600160a01b0384163014612b6d57612b6d838383613dab565b82516001148015612b7f575081516001145b8015612b8c575080516001145b15612c3357612c2e83600081518110612ba757612ba76151f9565b602002602001015183600081518110612bc257612bc26151f9565b602002602001015183600081518110612bdd57612bdd6151f9565b602002602001015160006001600160401b03811115612bfe57612bfe61499c565b6040519080825280601f01601f191660200182016040528015612c28576020820181803683370190505b50613e3a565b610acf565b82516001148015612c45575080518251145b15612cb357612c2e83600081518110612c6057612c606151f9565b6020026020010151838360006001600160401b03811115612c8357612c8361499c565b6040519080825280601f01601f191660200182016040528015612cad576020820181803683370190505b50613e6f565b81516001148015612cc5575080516001145b15612d395760005b8351811015612d3357612d21848281518110612ceb57612ceb6151f9565b602002602001015184600081518110612d0657612d066151f9565b602002602001015184600081518110612bdd57612bdd6151f9565b80612d2b81615225565b915050612ccd565b50610acf565b81516001148015612d4b575080518351145b15612db85760005b8351811015612d3357612da6848281518110612d7157612d716151f9565b602002602001015184600081518110612d8c57612d8c6151f9565b6020026020010151848481518110612bdd57612bdd6151f9565b80612db081615225565b915050612d53565b81518351148015612dca575080518351145b15612e1c5760005b8351811015612d3357612e0a848281518110612df057612df06151f9565b6020026020010151848381518110612d8c57612d8c6151f9565b80612e1481615225565b915050612dd2565b60405162461bcd60e51b81526004016106f09061523e565b6000611bcf836001600160a01b038416613ef2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060600184511115612f045760408051600180825281830190925290602080830190803683370190505090506001825111158015612ee35750825160011480612ee3575082518451145b612eff5760405162461bcd60e51b81526004016106f09061523e565b612f76565b82516001600160401b03811115612f1d57612f1d61499c565b604051908082528060200260200182016040528015612f46578160200160208202803683370190505b509050815160001480612f5a575081518351145b612f765760405162461bcd60e51b81526004016106f09061523e565b60005b8151811015612ff75760078054906000612f9283615225565b9190505550600754828281518110612fac57612fac6151f9565b6020908102919091018101919091526007546000908152600e9091526040902080546001600160a01b0319166001600160a01b03881617905580612fef81615225565b915050612f79565b506001600160a01b038516301461301357613013848285613dab565b83516001148015613025575080516001145b1561307b5761307684600081518110613040576130406151f9565b60200260200101518260008151811061305b5761305b6151f9565b602002602001015185600081518110612bdd57612bdd6151f9565b61319e565b6001845111156131655782516001036130fd5760005b84518110156130f7576130e58582815181106130af576130af6151f9565b6020026020010151836000815181106130ca576130ca6151f9565b602002602001015186600081518110612bdd57612bdd6151f9565b806130ef81615225565b915050613091565b5061319e565b60005b84518110156130f75761315385828151811061311e5761311e6151f9565b602002602001015183600081518110613139576131396151f9565b6020026020010151868481518110612bdd57612bdd6151f9565b8061315d81615225565b915050613100565b61319e8460008151811061317b5761317b6151f9565b6020026020010151828560006001600160401b03811115612c8357612c8361499c565b60005b8151811015613246578251811080156131d4575060008382815181106131c9576131c96151f9565b602002602001015151115b15613234578281815181106131eb576131eb6151f9565b602002602001015160126000848481518110613209576132096151f9565b602002602001015181526020019081526020016000209080519060200190613232929190614645565b505b8061323e81615225565b9150506131a1565b50949350505050565b306000908152601160205260409020610864908383614538565b816001600160a01b0316836001600160a01b0316036132dc5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016106f0565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b600061335483613f41565b8015611bcf5750611bcf8383613f74565b6000818152601560205260408120541561338b5750600090815260156020526040902090565b6000828152600e60209081526040808320546001600160a01b031683526013909152902054156133dd57506000908152600e60209081526040808320546001600160a01b031683526013909152902090565b505030600090815260136020526040902090565b6000806133fd83613365565b61340684611f4b565b91509150915091565b61341a600882611bb1565b156107a05760405133906001600160a01b038316907fd19cf84cf0fec6bec9ddfa29c63adf83a55707c712f32c8285d6180a7890147990600090a361097d600882612341565b61346b600883611bb1565b6134ab5760405162461bcd60e51b815260206004820152601160248201527024b73b30b634b21032bc3a32b739b4b7b760791b60448201526064016106f0565b6001600160a01b03811615806134cd57506134cd816378ea2a9760e11b613349565b61350b5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064016106f0565b6001600160a01b038281166000908152600c602052604090205481169082161461097d576001600160a01b038281166000818152600c602052604080822080546001600160a01b031916948616948517905551339392917f6a835c4fcf7e0d398db3762332fdaa1471814ad39f1e2d6d0b3fdabf8efee3e091a45050565b6001600160a01b0384166135af5760405162461bcd60e51b81526004016106f09061561e565b3360006135bb85613ffd565b905060006135c885613ffd565b90506135d8838989858589613956565b60008681526004602090815260408083206001600160a01b038c1684529091529020548581101561361b5760405162461bcd60e51b81526004016106f090615663565b60008781526004602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061365a9084906154f1565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46136ba848a8a8a8a8a614048565b505050505050505050565b60006001600160e01b031982166328f10a2160e01b14806136ea57506136ea82611b41565b8061370557506001600160e01b03198216635d9dd7eb60e11b145b8061372057506001600160e01b03198216632dde656160e21b145b8061373b57506001600160e01b031982166335681b5360e21b145b8061071e57506001600160e01b0319821663152a902d60e11b1492915050565b6060816000036137825750506040805180820190915260018152600360fc1b602082015290565b8160005b81156137ac578061379681615225565b91506137a59050600a836155c2565b9150613786565b6000816001600160401b038111156137c6576137c661499c565b6040519080825280601f01601f1916602001820160405280156137f0576020820181803683370190505b5090505b841561385b576138056001836156c0565b9150613812600a8661570d565b61381d9060306154f1565b60f81b818381518110613832576138326151f9565b60200101906001600160f81b031916908160001a905350613854600a866155c2565b94506137f4565b949350505050565b6000818152600183016020526040812054801561394c5760006138876001836156c0565b855490915060009061389b906001906156c0565b90508181146139005760008660000182815481106138bb576138bb6151f9565b90600052602060002001549050808760000184815481106138de576138de6151f9565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061391157613911615721565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061071e565b600091505061071e565b61115785858585614103565b6001600160a01b0384163b156111575760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906139a69089908990889088908890600401615737565b6020604051808303816000875af19250505080156139e1575060408051601f3d908101601f191682019092526139de91810190615795565b60015b613a8d576139ed6157b2565b806308c379a003613a265750613a016157ce565b80613a0c5750613a28565b8060405162461bcd60e51b81526004016106f091906147d0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016106f0565b6001600160e01b0319811663bc197c8160e01b14613abd5760405162461bcd60e51b81526004016106f090615857565b50505050505050565b6000826000018281548110613add57613add6151f9565b9060005260206000200154905092915050565b6001600160a01b038316613b165760405162461bcd60e51b81526004016106f09061589f565b336000613b2284613ffd565b90506000613b2f84613ffd565b9050613b4f83876000858560405180602001604052806000815250613956565b60008581526004602090815260408083206001600160a01b038a16845290915290205484811015613b925760405162461bcd60e51b81526004016106f0906158e2565b60008681526004602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052613abd565b6001600160a01b038316613c325760405162461bcd60e51b81526004016106f09061589f565b8051825114613c535760405162461bcd60e51b81526004016106f0906155d6565b6000339050613c7681856000868660405180602001604052806000815250613956565b60005b8351811015613d3e576000848281518110613c9657613c966151f9565b602002602001015190506000848381518110613cb457613cb46151f9565b60209081029190910181015160008481526004835260408082206001600160a01b038c168352909352919091205490915081811015613d055760405162461bcd60e51b81526004016106f0906158e2565b60009283526004602090815260408085206001600160a01b038b1686529091529092209103905580613d3681615225565b915050613c79565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051613d8f9291906156ad565b60405180910390a4604080516020810190915260009052610acf565b336000908152600c60205260409020546001600160a01b03161561086457336000818152600c6020526040908190205490516378ea2a9760e11b81526001600160a01b039091169163f1d4552e91613e0c9190879087908790600401615926565b600060405180830381600087803b158015613e2657600080fd5b505af1158015613abd573d6000803e3d6000fd5b613e46848484846142fb565b60008381526017602052604081208054849290613e649084906154f1565b909155505050505050565b613e7b848484846143dd565b60005b83518110156108c057828181518110613e9957613e996151f9565b602002602001015160176000868481518110613eb757613eb76151f9565b602002602001015181526020019081526020016000206000828254613edc91906154f1565b90915550613eeb905081615225565b9050613e7e565b6000818152600183016020526040812054613f395750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561071e565b50600061071e565b6000613f54826301ffc9a760e01b613f74565b801561071e5750613f6d826001600160e01b0319613f74565b1592915050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d91506000519050828015613fe6575060208210155b8015613ff25750600081115b979650505050505050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110614037576140376151f9565b602090810291909101015292915050565b6001600160a01b0384163b156111575760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061408c9089908990889088908890600401615970565b6020604051808303816000875af19250505080156140c7575060408051601f3d908101601f191682019092526140c491810190615795565b60015b6140d3576139ed6157b2565b6001600160e01b0319811663f23a6e6160e01b14613abd5760405162461bcd60e51b81526004016106f090615857565b60008251116141245760405162461bcd60e51b81526004016106f09061523e565b6000600e60008460008151811061413d5761413d6151f9565b6020026020010151815260200190815260200160002060009054906101000a90046001600160a01b0316905060005b835181101561421857816001600160a01b0316600e6000868481518110614195576141956151f9565b6020908102919091018101518252810191909152604001600020546001600160a01b0316146142065760405162461bcd60e51b815260206004820152601c60248201527f4d69736d61746368656420746f6b656e206f726967696e61746f72730000000060448201526064016106f0565b8061421081615225565b91505061416c565b506001600160a01b0381166000908152600d602052604090205460ff16156108c05760405163883da93360e01b81526001600160a01b0382169063883da9339061426c9088908890889088906004016159aa565b6020604051808303816000875af115801561428b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142af91906159e8565b6108c05760405162461bcd60e51b815260206004820152601a60248201527f457874656e73696f6e20617070726f76616c206661696c75726500000000000060448201526064016106f0565b6001600160a01b0384166143215760405162461bcd60e51b81526004016106f090615a05565b33600061432d85613ffd565b9050600061433a85613ffd565b905061434b83600089858589613956565b60008681526004602090815260408083206001600160a01b038b1684529091528120805487929061437d9084906154f1565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613abd83600089898989614048565b6001600160a01b0384166144035760405162461bcd60e51b81526004016106f090615a05565b81518351146144245760405162461bcd60e51b81526004016106f0906155d6565b3361443481600087878787613956565b60005b84518110156144d057838181518110614452576144526151f9565b602002602001015160046000878481518110614470576144706151f9565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546144b891906154f1565b909155508190506144c881615225565b915050614437565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516145219291906156ad565b60405180910390a46108c081600087878787613962565b82805461454490615373565b90600052602060002090601f01602090048101928261456657600085556145ac565b82601f1061457f5782800160ff198235161785556145ac565b828001600101855582156145ac579182015b828111156145ac578235825591602001919060010190614591565b50610b7f9291506146b9565b8280548282559060005260206000209081019282156145ac579160200282015b828111156145ac5781546001600160a01b0319166001600160a01b038435161782556020909201916001909101906145d8565b8280548282559060005260206000209081019282156145ac57916020028201828111156145ac578235825591602001919060010190614591565b82805461465190615373565b90600052602060002090601f01602090048101928261467357600085556145ac565b82601f1061468c57805160ff19168380011785556145ac565b828001600101855582156145ac579182015b828111156145ac57825182559160200191906001019061469e565b5b80821115610b7f57600081556001016146ba565b6001600160a01b03811681146107a057600080fd5b600080604083850312156146f657600080fd5b8235614701816146ce565b946020939093013593505050565b6001600160e01b0319811681146107a057600080fd5b60006020828403121561473757600080fd5b8135611bcf8161470f565b60006020828403121561475457600080fd5b8135611bcf816146ce565b60006020828403121561477157600080fd5b5035919050565b60005b8381101561479357818101518382015260200161477b565b83811115610acf5750506000910152565b600081518084526147bc816020860160208601614778565b601f01601f19169290920160200192915050565b602081526000611bcf60208301846147a4565b600081518084526020808501945080840160005b83811015614813578151875295820195908201906001016147f7565b509495945050505050565b602081526000611bcf60208301846147e3565b60008083601f84011261484357600080fd5b5081356001600160401b0381111561485a57600080fd5b60208301915083602082850101111561091d57600080fd5b60008060006040848603121561488757600080fd5b8335925060208401356001600160401b038111156148a457600080fd5b6148b086828701614831565b9497909650939450505050565b60008083601f8401126148cf57600080fd5b5081356001600160401b038111156148e657600080fd5b6020830191508360208260051b850101111561091d57600080fd5b60008060008060006060868803121561491957600080fd5b8535945060208601356001600160401b038082111561493757600080fd5b61494389838a016148bd565b9096509450604088013591508082111561495c57600080fd5b50614969888289016148bd565b969995985093965092949392505050565b6000806040838503121561498d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156149d7576149d761499c565b6040525050565b60006001600160401b038211156149f7576149f761499c565b5060051b60200190565b600082601f830112614a1257600080fd5b81356020614a1f826149de565b604051614a2c82826149b2565b83815260059390931b8501820192828101915086841115614a4c57600080fd5b8286015b84811015614a675780358352918301918301614a50565b509695505050505050565b60006001600160401b03821115614a8b57614a8b61499c565b50601f01601f191660200190565b6000614aa483614a72565b604051614ab182826149b2565b809250848152858585011115614ac657600080fd5b8484602083013760006020868301015250509392505050565b600082601f830112614af057600080fd5b611bcf83833560208501614a99565b600080600080600060a08688031215614b1757600080fd5b8535614b22816146ce565b94506020860135614b32816146ce565b935060408601356001600160401b0380821115614b4e57600080fd5b614b5a89838a01614a01565b94506060880135915080821115614b7057600080fd5b614b7c89838a01614a01565b93506080880135915080821115614b9257600080fd5b50614b9f88828901614adf565b9150509295509295909350565b60008060208385031215614bbf57600080fd5b82356001600160401b03811115614bd557600080fd5b614be185828601614831565b90969095509350505050565b600080600060408486031215614c0257600080fd5b8335614c0d816146ce565b925060208401356001600160401b038111156148a457600080fd5b600081518084526020808501945080840160005b838110156148135781516001600160a01b031687529582019590820190600101614c3c565b602081526000611bcf6020830184614c28565b60008060008060408587031215614c8a57600080fd5b84356001600160401b0380821115614ca157600080fd5b614cad888389016148bd565b90965094506020870135915080821115614cc657600080fd5b50614cd3878288016148bd565b95989497509550505050565b600080600060608486031215614cf457600080fd5b8335614cff816146ce565b925060208401356001600160401b0380821115614d1b57600080fd5b614d2787838801614a01565b93506040860135915080821115614d3d57600080fd5b50614d4a86828701614a01565b9150509250925092565b80151581146107a057600080fd5b60008060008060608587031215614d7857600080fd5b8435614d83816146ce565b935060208501356001600160401b03811115614d9e57600080fd5b614daa87828801614831565b9094509250506040850135614dbe81614d54565b939692955090935050565b60008060408385031215614ddc57600080fd5b82356001600160401b0380821115614df357600080fd5b818501915085601f830112614e0757600080fd5b81356020614e14826149de565b604051614e2182826149b2565b83815260059390931b8501820192828101915089841115614e4157600080fd5b948201945b83861015614e68578535614e59816146ce565b82529482019490820190614e46565b96505086013592505080821115614e7e57600080fd5b50614e8b85828601614a01565b9150509250929050565b600080600060408486031215614eaa57600080fd5b83356001600160401b0380821115614ec157600080fd5b614ecd87838801614a01565b94506020860135915080821115614ee357600080fd5b506148b0868287016148bd565b60008060008060008060608789031215614f0957600080fd5b86356001600160401b0380821115614f2057600080fd5b614f2c8a838b016148bd565b90985096506020890135915080821115614f4557600080fd5b614f518a838b016148bd565b90965094506040890135915080821115614f6a57600080fd5b50614f7789828a016148bd565b979a9699509497509295939492505050565b600080600060408486031215614f9e57600080fd5b83356001600160401b03811115614fb457600080fd5b614fc086828701614831565b9094509250506020840135614fd481614d54565b809150509250925092565b60008060408385031215614ff257600080fd5b8235614ffd816146ce565b9150602083013561500d81614d54565b809150509250929050565b60006020828403121561502a57600080fd5b8135611bcf81614d54565b60008060008060006060868803121561504d57600080fd5b8535615058816146ce565b945060208601356001600160401b038082111561493757600080fd5b6040815260006150876040830185614c28565b828103602084015261509981856147e3565b95945050505050565b600080604083850312156150b557600080fd5b82356150c0816146ce565b9150602083013561500d816146ce565b600080600080600060a086880312156150e857600080fd5b85356150f3816146ce565b94506020860135615103816146ce565b9350604086013592506060860135915060808601356001600160401b0381111561512c57600080fd5b614b9f88828901614adf565b60208082526024908201527f41646d696e436f6e74726f6c3a204d757374206265206f776e6572206f7220616040820152633236b4b760e11b606082015260800190565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b602080825260159082015274115e1d195b9cda5bdb88189b1858dadb1a5cdd1959605a1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016152375761523761520f565b5060010190565b6020808252600d908201526c125b9d985b1a59081a5b9c1d5d609a1b604082015260600190565b6020808252601c908201527f4d757374206265207265676973746572656420657874656e73696f6e00000000604082015260600190565b6000808335601e198436030181126152b357600080fd5b8301803591506001600160401b038211156152cd57600080fd5b60200191503681900382131561091d57600080fd5b60006152ed836149de565b6040516152fa82826149b2565b84815260208082019250600586901b85013681111561531857600080fd5b855b818110156153675780356001600160401b038111156153395760008081fd5b870136601f82011261534b5760008081fd5b615359368235868401614a99565b86525093820193820161531a565b50919695505050505050565b600181811c9082168061538757607f821691505b602082108103611f4557634e487b7160e01b600052602260045260246000fd5b8054600090600181811c90808316806153c157607f831692505b602080841082036153e257634e487b7160e01b600052602260045260246000fd5b8180156153f6576001811461540757615434565b60ff19861689528489019650615434565b60008881526020902060005b8681101561542c5781548b820152908501908301615413565b505084890196505b50505050505092915050565b600061385b61544f83866153a7565b846153a7565b60006020828403121561546757600080fd5b81516001600160401b0381111561547d57600080fd5b8201601f8101841361548e57600080fd5b805161549981614a72565b6040516154a682826149b2565b8281528660208486010111156154bb57600080fd5b61135d836020830160208701614778565b60006154d882856153a7565b83516154e8818360208801614778565b01949350505050565b600082198211156155045761550461520f565b500190565b6040808252810184905260008560608301825b8781101561554c57823561552f816146ce565b6001600160a01b031682526020928301929091019060010161551c565b5083810360208501528481526001600160fb1b0385111561556c57600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60008160001904831182151516156155a7576155a761520f565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826155d1576155d16155ac565b500490565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60408152600061508760408301856147e3565b6000828210156156d2576156d261520f565b500390565b6001600160a01b03841681526060602082018190526000906156fb908301856147e3565b828103604084015261135d81856147e3565b60008261571c5761571c6155ac565b500690565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0386811682528516602082015260a060408201819052600090615763908301866147e3565b828103606084015261577581866147e3565b9050828103608084015261578981856147a4565b98975050505050505050565b6000602082840312156157a757600080fd5b8151611bcf8161470f565b600060033d11156157cb5760046000803e5060005160e01c5b90565b600060443d10156157dc5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561580b57505050505090565b82850191508151818111156158235750505050505090565b843d870101602082850101111561583d5750505050505090565b61584c602082860101876149b2565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b038516815260806020820181905260009061594a90830186614c28565b828103604084015261595c81866147e3565b90508281036060840152613ff281856147e3565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613ff2908301846147a4565b6001600160a01b038581168252841660208201526080604082018190526000906159d6908301856147e3565b8281036060840152613ff281856147e3565b6000602082840312156159fa57600080fd5b8151611bcf81614d54565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b60608201526080019056fea2646970667358221220f7c825404635380e0ddaa9ab351c8fcd56bc59415e6e31424569353475668fcd64736f6c634300080d0033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.