Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ERC1155TL
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 2000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {
ERC1155Upgradeable,
IERC1155Upgradeable,
ERC165Upgradeable
} from "openzeppelin-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import {EIP2981TLUpgradeable} from "tl-sol-tools/upgradeable/royalties/EIP2981TLUpgradeable.sol";
import {OwnableAccessControlUpgradeable} from "tl-sol-tools/upgradeable/access/OwnableAccessControlUpgradeable.sol";
import {StoryContractUpgradeable} from "tl-story/upgradeable/StoryContractUpgradeable.sol";
import {BlockListUpgradeable} from "tl-blocklist/BlockListUpgradeable.sol";
/*//////////////////////////////////////////////////////////////////////////
Custom Errors
//////////////////////////////////////////////////////////////////////////*/
/// @dev token uri is an empty string
error EmptyTokenURI();
/// @dev batch size too small
error BatchSizeTooSmall();
/// @dev mint to zero addresses
error MintToZeroAddresses();
/// @dev array length mismatch
error ArrayLengthMismatch();
/// @dev token not owned by the owner of the contract
error TokenNotOwnedByOwner();
/// @dev caller is not approved or owner
error CallerNotApprovedOrOwner();
/// @dev token does not exist
error TokenDoesntExist();
/// @dev burning zero tokens
error BurnZeroTokens();
/*//////////////////////////////////////////////////////////////////////////
ERC1155TL
//////////////////////////////////////////////////////////////////////////*/
/// @title ERC1155TL.sol
/// @notice Transient Labs ERC-1155 Creator Contract
/// @dev features include
/// - batch minting
/// - airdrops
/// - ability to hook in external mint contracts
/// - ability to set multiple admins
/// - Story Contract
/// - BlockList
/// - individual token royalties
/// @author transientlabs.xyz
/// @custom:version 2.3.0
contract ERC1155TL is
ERC1155Upgradeable,
EIP2981TLUpgradeable,
OwnableAccessControlUpgradeable,
StoryContractUpgradeable,
BlockListUpgradeable
{
/*//////////////////////////////////////////////////////////////////////////
Custom Types
//////////////////////////////////////////////////////////////////////////*/
/// @dev struct defining a token
struct Token {
bool created;
string uri;
}
/*//////////////////////////////////////////////////////////////////////////
State Variables
//////////////////////////////////////////////////////////////////////////*/
string public constant VERSION = "2.3.0";
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
bytes32 public constant APPROVED_MINT_CONTRACT = keccak256("APPROVED_MINT_CONTRACT");
uint256 private _counter;
string public name;
string public symbol;
mapping(uint256 => Token) private _tokens;
/*//////////////////////////////////////////////////////////////////////////
Constructor
//////////////////////////////////////////////////////////////////////////*/
/// @param disable: boolean to disable initialization for the implementation contract
constructor(bool disable) {
if (disable) _disableInitializers();
}
/*//////////////////////////////////////////////////////////////////////////
Initializer
//////////////////////////////////////////////////////////////////////////*/
/// @param name_: the name of the 1155 contract
/// @param symbol_: the symbol for the 1155 contract
/// @param defaultRoyaltyRecipient: the default address for royalty payments
/// @param defaultRoyaltyPercentage: the default royalty percentage of basis points (out of 10,000)
/// @param initOwner: the owner of the contract
/// @param admins: array of admin addresses to add to the contract
/// @param enableStory: a bool deciding whether to add story fuctionality or not
/// @param blockListRegistry: address of the blocklist registry to use
function initialize(
string memory name_,
string memory symbol_,
address defaultRoyaltyRecipient,
uint256 defaultRoyaltyPercentage,
address initOwner,
address[] memory admins,
bool enableStory,
address blockListRegistry
) external initializer {
// initialize parent contracts
__ERC1155_init("");
__EIP2981TL_init(defaultRoyaltyRecipient, defaultRoyaltyPercentage);
__OwnableAccessControl_init(initOwner);
__StoryContractUpgradeable_init(enableStory);
__BlockList_init(blockListRegistry);
// add admins
_setRole(ADMIN_ROLE, admins, true);
// set name & symbol
name = name_;
symbol = symbol_;
}
/*//////////////////////////////////////////////////////////////////////////
General Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to get token creation details
/// @param tokenId: the token to lookup
function getTokenDetails(uint256 tokenId) external view returns (Token memory) {
return _tokens[tokenId];
}
/*//////////////////////////////////////////////////////////////////////////
Access Control Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to set approved mint contracts
/// @dev access to owner or admin
/// @param minters: array of minters to grant approval to
/// @param status: status for the minters
function setApprovedMintContracts(address[] calldata minters, bool status) external onlyRoleOrOwner(ADMIN_ROLE) {
_setRole(APPROVED_MINT_CONTRACT, minters, status);
}
/*//////////////////////////////////////////////////////////////////////////
Creation Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to create a token that can be minted to creator or airdropped
/// @dev requires owner or admin
/// @param newUri: the uri for the token to create
/// @param addresses: the addresses to mint the new token to
/// @param amounts: the amount of the new token to mint to each address
function createToken(string calldata newUri, address[] calldata addresses, uint256[] calldata amounts)
external
onlyRoleOrOwner(ADMIN_ROLE)
{
_createToken(newUri, addresses, amounts);
}
/// @notice function to create a token that can be minted to creator or airdropped
/// @dev overloaded function where you can set the token royalty config in this tx
/// @dev requires owner or admin
/// @param newUri: the uri for the token to create
/// @param addresses: the addresses to mint the new token to
/// @param amounts: the amount of the new token to mint to each address
/// @param royaltyAddress: royalty payout address for the created token
/// @param royaltyPercent: royalty percentage for this token
function createToken(
string calldata newUri,
address[] calldata addresses,
uint256[] calldata amounts,
address royaltyAddress,
uint256 royaltyPercent
) external onlyRoleOrOwner(ADMIN_ROLE) {
uint256 tokenId = _createToken(newUri, addresses, amounts);
_overrideTokenRoyaltyInfo(tokenId, royaltyAddress, royaltyPercent);
}
/// @notice function to batch create tokens that can be minted to creator or airdropped
/// @dev requires owner or admin
/// @param newUris: the uris for the tokens to create
/// @param addresses: 2d dynamic array holding the addresses to mint the new tokens to
/// @param amounts: 2d dynamic array holding the amounts of the new tokens to mint to each address
function batchCreateToken(string[] calldata newUris, address[][] calldata addresses, uint256[][] calldata amounts)
external
onlyRoleOrOwner(ADMIN_ROLE)
{
if (newUris.length == 0) revert EmptyTokenURI();
for (uint256 i = 0; i < newUris.length; i++) {
_createToken(newUris[i], addresses[i], amounts[i]);
}
}
/// @notice function to batch create tokens that can be minted to creator or airdropped
/// @dev overloaded function where you can set the token royalty config in this tx
/// @dev requires owner or admin
/// @param newUris: the uris for the tokens to create
/// @param addresses: 2d dynamic array holding the addresses to mint the new tokens to
/// @param amounts: 2d dynamic array holding the amounts of the new tokens to mint to each address
/// @param royaltyAddresses: royalty payout addresses for the tokens
/// @param royaltyPercents: royalty payout percents for the tokens
function batchCreateToken(
string[] calldata newUris,
address[][] calldata addresses,
uint256[][] calldata amounts,
address[] calldata royaltyAddresses,
uint256[] calldata royaltyPercents
) external onlyRoleOrOwner(ADMIN_ROLE) {
if (newUris.length == 0) revert EmptyTokenURI();
for (uint256 i = 0; i < newUris.length; i++) {
uint256 tokenId = _createToken(newUris[i], addresses[i], amounts[i]);
_overrideTokenRoyaltyInfo(tokenId, royaltyAddresses[i], royaltyPercents[i]);
}
}
/// @notice private helper function to create a new token
/// @param newUri: the uri for the token to create
/// @param addresses: the addresses to mint the new token to
/// @param amounts: the amount of the new token to mint to each address
/// @return _counter: token id created
function _createToken(string memory newUri, address[] memory addresses, uint256[] memory amounts)
private
returns (uint256)
{
if (bytes(newUri).length == 0) revert EmptyTokenURI();
if (addresses.length == 0) revert MintToZeroAddresses();
if (addresses.length != amounts.length) revert ArrayLengthMismatch();
_counter++;
_tokens[_counter] = Token(true, newUri);
for (uint256 i = 0; i < addresses.length; i++) {
_mint(addresses[i], _counter, amounts[i], "");
}
return _counter;
}
/// @notice private helper function to verify a token exists
/// @param tokenId: the token to check existence for
function _exists(uint256 tokenId) private view returns (bool) {
return _tokens[tokenId].created;
}
/*//////////////////////////////////////////////////////////////////////////
Mint Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to mint existing token to recipients
/// @dev requires owner or admin
/// @param tokenId: the token to mint
/// @param addresses: the addresses to mint to
/// @param amounts: amounts of the token to mint to each address
function mintToken(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts)
external
onlyRoleOrOwner(ADMIN_ROLE)
{
_mintToken(tokenId, addresses, amounts);
}
/// @notice external mint function
/// @dev requires caller to be an approved mint contract
/// @param tokenId: the token to mint
/// @param addresses: the addresses to mint to
/// @param amounts: amounts of the token to mint to each address
function externalMint(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts)
external
onlyRole(APPROVED_MINT_CONTRACT)
{
_mintToken(tokenId, addresses, amounts);
}
/// @notice private helper function
/// @param tokenId: the token to mint
/// @param addresses: the addresses to mint to
/// @param amounts: amounts of the token to mint to each address
function _mintToken(uint256 tokenId, address[] calldata addresses, uint256[] calldata amounts) private {
if (!_exists(tokenId)) revert TokenDoesntExist();
if (addresses.length == 0) revert MintToZeroAddresses();
if (addresses.length != amounts.length) revert ArrayLengthMismatch();
for (uint256 i = 0; i < addresses.length; i++) {
_mint(addresses[i], tokenId, amounts[i], "");
}
}
/*//////////////////////////////////////////////////////////////////////////
Burn Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to burn tokens from an account
/// @dev msg.sender must be owner or operator
/// @dev if this function is called from another contract as part of a burn/redeem,
/// the contract must ensure that no amount is '0' or if it is, that it isn't a vulnerability.
/// @param from: address to burn from
/// @param tokenIds: array of tokens to burn
/// @param amounts: amount of each token to burn
function burn(address from, uint256[] calldata tokenIds, uint256[] calldata amounts) external {
if (tokenIds.length == 0) revert BurnZeroTokens();
if (msg.sender != from && !isApprovedForAll(from, msg.sender)) revert CallerNotApprovedOrOwner();
_burnBatch(from, tokenIds, amounts);
}
/*//////////////////////////////////////////////////////////////////////////
Royalty Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to set the default royalty specification
/// @dev requires owner
/// @param newRecipient: the new royalty payout address
/// @param newPercentage: the new royalty percentage in basis (out of 10,000)
function setDefaultRoyalty(address newRecipient, uint256 newPercentage) external onlyOwner {
_setDefaultRoyaltyInfo(newRecipient, newPercentage);
}
/// @notice function to override a token's royalty info
/// @dev requires owner
/// @param tokenId: the token to override royalty for
/// @param newRecipient: the new royalty payout address for the token id
/// @param newPercentage: the new royalty percentage in basis (out of 10,000) for the token id
function setTokenRoyalty(uint256 tokenId, address newRecipient, uint256 newPercentage) external onlyOwner {
_overrideTokenRoyaltyInfo(tokenId, newRecipient, newPercentage);
}
/*//////////////////////////////////////////////////////////////////////////
Token Uri Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to set token Uri for a token
/// @dev requires owner or admin
/// @param tokenId: token to set a uri for
/// @param newUri: the new uri for the token
function setTokenUri(uint256 tokenId, string calldata newUri) external onlyRoleOrOwner(ADMIN_ROLE) {
if (!_exists(tokenId)) revert TokenDoesntExist();
if (bytes(newUri).length == 0) revert EmptyTokenURI();
_tokens[tokenId].uri = newUri;
emit IERC1155Upgradeable.URI(newUri, tokenId);
}
/// @notice function for token uris
/// @param tokenId: token for which to get the uri
function uri(uint256 tokenId) public view override(ERC1155Upgradeable) returns (string memory) {
if (!_exists(tokenId)) revert TokenDoesntExist();
return _tokens[tokenId].uri;
}
/*//////////////////////////////////////////////////////////////////////////
Story Contract Hooks
//////////////////////////////////////////////////////////////////////////*/
/// @inheritdoc StoryContractUpgradeable
/// @dev restricted to the owner of the contract
function _isStoryAdmin(address potentialAdmin) internal view override(StoryContractUpgradeable) returns (bool) {
return potentialAdmin == owner() || hasRole(ADMIN_ROLE, potentialAdmin);
}
/// @inheritdoc StoryContractUpgradeable
function _tokenExists(uint256 tokenId) internal view override(StoryContractUpgradeable) returns (bool) {
return _exists(tokenId);
}
/// @inheritdoc StoryContractUpgradeable
function _isTokenOwner(address potentialOwner, uint256 tokenId)
internal
view
override(StoryContractUpgradeable)
returns (bool)
{
return balanceOf(potentialOwner, tokenId) > 0;
}
/// @inheritdoc StoryContractUpgradeable
/// @dev restricted to the owner of the contract
function _isCreator(address potentialCreator, uint256 /* tokenId */ )
internal
view
override(StoryContractUpgradeable)
returns (bool)
{
return potentialCreator == owner() || hasRole(ADMIN_ROLE, potentialCreator);
}
/*//////////////////////////////////////////////////////////////////////////
BlockList Functions
//////////////////////////////////////////////////////////////////////////*/
/// @inheritdoc BlockListUpgradeable
/// @dev restricted to the owner of the contract
function isBlockListAdmin(address potentialAdmin) public view override(BlockListUpgradeable) returns (bool) {
return potentialAdmin == owner();
}
/// @inheritdoc ERC1155Upgradeable
/// @dev added the `notBlocked` modifier for blocklist
function setApprovalForAll(address operator, bool approved)
public
override(ERC1155Upgradeable)
notBlocked(operator)
{
ERC1155Upgradeable.setApprovalForAll(operator, approved);
}
/*//////////////////////////////////////////////////////////////////////////
ERC-165 Support
//////////////////////////////////////////////////////////////////////////*/
/// @inheritdoc ERC165Upgradeable
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC1155Upgradeable, EIP2981TLUpgradeable, StoryContractUpgradeable)
returns (bool)
{
return (
ERC1155Upgradeable.supportsInterface(interfaceId) || EIP2981TLUpgradeable.supportsInterface(interfaceId)
|| StoryContractUpgradeable.supportsInterface(interfaceId)
);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "./IERC1155Upgradeable.sol";
import "./IERC1155ReceiverUpgradeable.sol";
import "./extensions/IERC1155MetadataURIUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable {
using AddressUpgradeable 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}.
*/
function __ERC1155_init(string memory uri_) internal onlyInitializing {
__ERC1155_init_unchained(uri_);
}
function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
return
interfaceId == type(IERC1155Upgradeable).interfaceId ||
interfaceId == type(IERC1155MetadataURIUpgradeable).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 IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155ReceiverUpgradeable.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 IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155ReceiverUpgradeable.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;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[47] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {ERC165Upgradeable} from "openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import {IEIP2981} from "../../royalties/IEIP2981.sol";
/*//////////////////////////////////////////////////////////////////////////
Custom Errors
//////////////////////////////////////////////////////////////////////////*/
/// @dev error if the recipient is set to address(0)
error ZeroAddressError();
/// @dev error if the royalty percentage is greater than to 100%
error MaxRoyaltyError();
/*//////////////////////////////////////////////////////////////////////////
EIP2981TL
//////////////////////////////////////////////////////////////////////////*/
/// @title EIP2981TLUpgradeable.sol
/// @notice abstract contract to define a default royalty spec
/// while allowing for specific token overrides
/// @dev follows EIP-2981 (https://eips.ethereum.org/EIPS/eip-2981)
/// @author transientlabs.xyz
/// @custom:version 2.2.0
abstract contract EIP2981TLUpgradeable is IEIP2981, Initializable, ERC165Upgradeable {
/*//////////////////////////////////////////////////////////////////////////
Royalty Struct
//////////////////////////////////////////////////////////////////////////*/
struct RoyaltySpec {
address recipient;
uint256 percentage;
}
/*//////////////////////////////////////////////////////////////////////////
State Variables
//////////////////////////////////////////////////////////////////////////*/
address private _defaultRecipient;
uint256 private _defaultPercentage;
mapping(uint256 => RoyaltySpec) private _tokenOverrides;
/*//////////////////////////////////////////////////////////////////////////
Initializer
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to initialize the contract
/// @param defaultRecipient - the default royalty payout address
/// @param defaultPercentage - the deafult royalty percentage, out of 10,000
function __EIP2981TL_init(address defaultRecipient, uint256 defaultPercentage) internal onlyInitializing {
__EIP2981TL_init_unchained(defaultRecipient, defaultPercentage);
}
/// @notice unchained function to initialize the contract
/// @param defaultRecipient - the default royalty payout address
/// @param defaultPercentage - the deafult royalty percentage, out of 10,000
function __EIP2981TL_init_unchained(address defaultRecipient, uint256 defaultPercentage)
internal
onlyInitializing
{
_setDefaultRoyaltyInfo(defaultRecipient, defaultPercentage);
}
/*//////////////////////////////////////////////////////////////////////////
Royalty Changing Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to set default royalty info
/// @param newRecipient - the new default royalty payout address
/// @param newPercentage - the new default royalty percentage, out of 10,000
function _setDefaultRoyaltyInfo(address newRecipient, uint256 newPercentage) internal {
if (newRecipient == address(0)) revert ZeroAddressError();
if (newPercentage > 10_000) revert MaxRoyaltyError();
_defaultRecipient = newRecipient;
_defaultPercentage = newPercentage;
}
/// @notice function to override royalty spec on a specific token
/// @param tokenId - the token id to override royalty for
/// @param newRecipient - the new royalty payout address
/// @param newPercentage - the new royalty percentage, out of 10,000
function _overrideTokenRoyaltyInfo(uint256 tokenId, address newRecipient, uint256 newPercentage) internal {
if (newRecipient == address(0)) revert ZeroAddressError();
if (newPercentage > 10_000) revert MaxRoyaltyError();
_tokenOverrides[tokenId].recipient = newRecipient;
_tokenOverrides[tokenId].percentage = newPercentage;
}
/*//////////////////////////////////////////////////////////////////////////
Royalty Info
//////////////////////////////////////////////////////////////////////////*/
/// @inheritdoc IEIP2981
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount)
{
address recipient = _defaultRecipient;
uint256 percentage = _defaultPercentage;
if (_tokenOverrides[tokenId].recipient != address(0)) {
recipient = _tokenOverrides[tokenId].recipient;
percentage = _tokenOverrides[tokenId].percentage;
}
return (recipient, salePrice / 10_000 * percentage); // divide first to avoid overflow
}
/*//////////////////////////////////////////////////////////////////////////
ERC-165 Override
//////////////////////////////////////////////////////////////////////////*/
/// @inheritdoc ERC165Upgradeable
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable) returns (bool) {
return interfaceId == type(IEIP2981).interfaceId || ERC165Upgradeable.supportsInterface(interfaceId);
}
/*//////////////////////////////////////////////////////////////////////////
External View Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice Query the default royalty receiver and percentage.
/// @return Tuple containing the default royalty recipient and percentage out of 10_000
function getDefaultRoyaltyRecipientAndPercentage() external view returns (address, uint256) {
return (_defaultRecipient, _defaultPercentage);
}
/*//////////////////////////////////////////////////////////////////////////
Upgradeability Gap
//////////////////////////////////////////////////////////////////////////*/
/// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
uint256[50] private _gap;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {EnumerableSetUpgradeable} from "openzeppelin-upgradeable/utils/structs/EnumerableSetUpgradeable.sol";
import {OwnableUpgradeable} from "openzeppelin-upgradeable/access/OwnableUpgradeable.sol";
/*//////////////////////////////////////////////////////////////////////////
Custom Errors
//////////////////////////////////////////////////////////////////////////*/
/// @dev does not have specified role
error NotSpecifiedRole(bytes32 role);
/// @dev is not specified role or owner
error NotRoleOrOwner(bytes32 role);
/*//////////////////////////////////////////////////////////////////////////
OwnableAccessControlUpgradeable
//////////////////////////////////////////////////////////////////////////*/
/// @title OwnableAccessControl.sol
/// @notice single owner, flexible access control mechanics
/// @dev can easily be extended by inheriting and applying additional roles
/// @dev by default, only the owner can grant roles but by inheriting, but you
/// may allow other roles to grant roles by using the internal helper.
/// @author transientlabs.xyz
/// @custom:version 2.2.0
abstract contract OwnableAccessControlUpgradeable is Initializable, OwnableUpgradeable {
/*//////////////////////////////////////////////////////////////////////////
State Variables
//////////////////////////////////////////////////////////////////////////*/
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;
uint256 private _c; // counter to be able to revoke all priviledges
mapping(uint256 => mapping(bytes32 => mapping(address => bool))) private _roleStatus;
mapping(uint256 => mapping(bytes32 => EnumerableSetUpgradeable.AddressSet)) private _roleMembers;
/*//////////////////////////////////////////////////////////////////////////
Events
//////////////////////////////////////////////////////////////////////////*/
/// @param from - address that authorized the role change
/// @param user - the address who's role has been changed
/// @param approved - boolean indicating the user's status in role
/// @param role - the bytes32 role created in the inheriting contract
event RoleChange(address indexed from, address indexed user, bool indexed approved, bytes32 role);
/// @param from - address that authorized the revoke
event AllRolesRevoked(address indexed from);
/*//////////////////////////////////////////////////////////////////////////
Modifiers
//////////////////////////////////////////////////////////////////////////*/
modifier onlyRole(bytes32 role) {
if (!hasRole(role, msg.sender)) {
revert NotSpecifiedRole(role);
}
_;
}
modifier onlyRoleOrOwner(bytes32 role) {
if (!hasRole(role, msg.sender) && owner() != msg.sender) {
revert NotRoleOrOwner(role);
}
_;
}
/*//////////////////////////////////////////////////////////////////////////
Initializer
//////////////////////////////////////////////////////////////////////////*/
/// @param initOwner - the address of the initial owner
function __OwnableAccessControl_init(address initOwner) internal onlyInitializing {
__Ownable_init();
_transferOwnership(initOwner);
__OwnableAccessControl_init_unchained();
}
function __OwnableAccessControl_init_unchained() internal onlyInitializing {}
/*//////////////////////////////////////////////////////////////////////////
External Role Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to revoke all roles currently present
/// @dev increments the `_c` variables
/// @dev requires owner privileges
function revokeAllRoles() external onlyOwner {
_c++;
emit AllRolesRevoked(msg.sender);
}
/// @notice function to renounce role
/// @param role - bytes32 role created in inheriting contracts
function renounceRole(bytes32 role) external {
address[] memory members = new address[](1);
members[0] = msg.sender;
_setRole(role, members, false);
}
/// @notice function to grant/revoke a role to an address
/// @dev requires owner to call this function but this may be further
/// extended using the internal helper function in inheriting contracts
/// @param role - bytes32 role created in inheriting contracts
/// @param roleMembers - list of addresses that should have roles attached to them based on `status`
/// @param status - bool whether to remove or add `roleMembers` to the `role`
function setRole(bytes32 role, address[] memory roleMembers, bool status) external onlyOwner {
_setRole(role, roleMembers, status);
}
/*//////////////////////////////////////////////////////////////////////////
External View Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to see if an address is the owner
/// @param role - bytes32 role created in inheriting contracts
/// @param potentialRoleMember - address to check for role membership
function hasRole(bytes32 role, address potentialRoleMember) public view returns (bool) {
return _roleStatus[_c][role][potentialRoleMember];
}
/// @notice function to get role members
/// @param role - bytes32 role created in inheriting contracts
function getRoleMembers(bytes32 role) public view returns (address[] memory) {
return _roleMembers[_c][role].values();
}
/*//////////////////////////////////////////////////////////////////////////
Internal Helper Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice helper function to set addresses for a role
/// @param role - bytes32 role created in inheriting contracts
/// @param roleMembers - list of addresses that should have roles attached to them based on `status`
/// @param status - bool whether to remove or add `roleMembers` to the `role`
function _setRole(bytes32 role, address[] memory roleMembers, bool status) internal {
for (uint256 i = 0; i < roleMembers.length; i++) {
_roleStatus[_c][role][roleMembers[i]] = status;
if (status) {
_roleMembers[_c][role].add(roleMembers[i]);
} else {
_roleMembers[_c][role].remove(roleMembers[i]);
}
emit RoleChange(msg.sender, roleMembers[i], status, role);
}
}
/*//////////////////////////////////////////////////////////////////////////
Upgradeability Gap
//////////////////////////////////////////////////////////////////////////*/
/// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
uint256[50] private _gap;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {ERC165Upgradeable} from "openzeppelin-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import {
IStory, StoryNotEnabled, TokenDoesNotExist, NotTokenOwner, NotTokenCreator, NotStoryAdmin
} from "../IStory.sol";
/*//////////////////////////////////////////////////////////////////////////
Story Contract
//////////////////////////////////////////////////////////////////////////*/
/// @title Story Contract
/// @dev upgradeable, inheritable abstract contract implementing the Story Contract interface
/// @author transientlabs.xyz
/// @custom:version 3.0.0
abstract contract StoryContractUpgradeable is Initializable, IStory, ERC165Upgradeable {
/*//////////////////////////////////////////////////////////////////////////
State Variables
//////////////////////////////////////////////////////////////////////////*/
bool public storyEnabled;
/*//////////////////////////////////////////////////////////////////////////
Modifiers
//////////////////////////////////////////////////////////////////////////*/
modifier storyMustBeEnabled() {
if (!storyEnabled) revert StoryNotEnabled();
_;
}
/*//////////////////////////////////////////////////////////////////////////
Initializer
//////////////////////////////////////////////////////////////////////////*/
/// @param enabled - a bool to enable or disable Story addition
function __StoryContractUpgradeable_init(bool enabled) internal {
__StoryContractUpgradeable_init_unchained(enabled);
}
/// @param enabled - a bool to enable or disable Story addition
function __StoryContractUpgradeable_init_unchained(bool enabled) internal {
storyEnabled = enabled;
}
/*//////////////////////////////////////////////////////////////////////////
Story Functions
//////////////////////////////////////////////////////////////////////////*/
/// @dev function to set story enabled/disabled
/// @dev requires story admin
/// @param enabled - a boolean setting to enable or disable Story additions
function setStoryEnabled(bool enabled) external {
if (!_isStoryAdmin(msg.sender)) revert NotStoryAdmin();
storyEnabled = enabled;
}
/// @inheritdoc IStory
function addCreatorStory(uint256 tokenId, string calldata creatorName, string calldata story)
external
storyMustBeEnabled
{
if (!_tokenExists(tokenId)) revert TokenDoesNotExist();
if (!_isCreator(msg.sender, tokenId)) revert NotTokenCreator();
emit CreatorStory(tokenId, msg.sender, creatorName, story);
}
/// @inheritdoc IStory
function addStory(uint256 tokenId, string calldata collectorName, string calldata story)
external
storyMustBeEnabled
{
if (!_tokenExists(tokenId)) revert TokenDoesNotExist();
if (!_isTokenOwner(msg.sender, tokenId)) revert NotTokenOwner();
emit Story(tokenId, msg.sender, collectorName, story);
}
/*//////////////////////////////////////////////////////////////////////////
Hooks
//////////////////////////////////////////////////////////////////////////*/
/// @dev function to allow access to enabling/disabling story
/// @param potentialAdmin - the address to check for admin priviledges
function _isStoryAdmin(address potentialAdmin) internal view virtual returns (bool);
/// @dev function to check if a token exists on the token contract
/// @param tokenId - the token id to check for existence
function _tokenExists(uint256 tokenId) internal view virtual returns (bool);
/// @dev function to check ownership of a token
/// @param potentialOwner - the address to check for ownership of `tokenId`
/// @param tokenId - the token id to check ownership against
function _isTokenOwner(address potentialOwner, uint256 tokenId) internal view virtual returns (bool);
/// @dev function to check creatorship of a token
/// @param potentialCreator - the address to check creatorship of `tokenId`
/// @param tokenId - the token id to check creatorship against
function _isCreator(address potentialCreator, uint256 tokenId) internal view virtual returns (bool);
/*//////////////////////////////////////////////////////////////////////////
Overrides
//////////////////////////////////////////////////////////////////////////*/
/// @inheritdoc ERC165Upgradeable
function supportsInterface(bytes4 interfaceId) public view virtual override (ERC165Upgradeable) returns (bool) {
return interfaceId == type(IStory).interfaceId || ERC165Upgradeable.supportsInterface(interfaceId);
}
/*//////////////////////////////////////////////////////////////////////////
Upgradeability Gap
//////////////////////////////////////////////////////////////////////////*/
/// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
uint256[50] private _gap;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import {Initializable} from "openzeppelin-upgradeable/proxy/utils/Initializable.sol";
import {BlockedOperator, Unauthorized, IBlockList} from "./IBlockList.sol";
import {IBlockListRegistry} from "./IBlockListRegistry.sol";
/// @title BlockList
/// @author transientlabs.xyz
/// @notice abstract contract that can be inherited to block
/// approvals from non-royalty paying marketplaces
/// @custom:version 4.0.0
abstract contract BlockListUpgradeable is Initializable, IBlockList {
/*//////////////////////////////////////////////////////////////////////////
Public State Variables
//////////////////////////////////////////////////////////////////////////*/
IBlockListRegistry public blockListRegistry;
/*//////////////////////////////////////////////////////////////////////////
Events
//////////////////////////////////////////////////////////////////////////*/
event BlockListRegistryUpdated(address indexed caller, address indexed oldRegistry, address indexed newRegistry);
/*//////////////////////////////////////////////////////////////////////////
Modifiers
//////////////////////////////////////////////////////////////////////////*/
/// @dev modifier that can be applied to approval functions in order to block listings on marketplaces
modifier notBlocked(address operator) {
if (getBlockListStatus(operator)) {
revert BlockedOperator();
}
_;
}
/*//////////////////////////////////////////////////////////////////////////
Initializer
//////////////////////////////////////////////////////////////////////////*/
/// @param blockListRegistryAddr - the initial BlockList Registry Address
function __BlockList_init(address blockListRegistryAddr) internal onlyInitializing {
__BlockList_init_unchained(blockListRegistryAddr);
}
/// @param blockListRegistryAddr - the initial BlockList Registry Address
function __BlockList_init_unchained(address blockListRegistryAddr) internal onlyInitializing {
blockListRegistry = IBlockListRegistry(blockListRegistryAddr);
emit BlockListRegistryUpdated(msg.sender, address(0), blockListRegistryAddr);
}
/*//////////////////////////////////////////////////////////////////////////
Admin Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to transfer ownership of the blockList
/// @dev requires blockList owner
/// @dev can be transferred to the ZERO_ADDRESS if desired
/// @dev BE VERY CAREFUL USING THIS
/// @param newBlockListRegistry - the address of the new BlockList registry
function updateBlockListRegistry(address newBlockListRegistry) public {
if (!isBlockListAdmin(msg.sender)) revert Unauthorized();
address oldRegistry = address(blockListRegistry);
blockListRegistry = IBlockListRegistry(newBlockListRegistry);
emit BlockListRegistryUpdated(msg.sender, oldRegistry, newBlockListRegistry);
}
/*//////////////////////////////////////////////////////////////////////////
Public Read Functions
//////////////////////////////////////////////////////////////////////////*/
/// @inheritdoc IBlockList
function getBlockListStatus(address operator) public view override returns (bool) {
if (address(blockListRegistry).code.length == 0) return false;
try blockListRegistry.getBlockListStatus(operator) returns (bool isBlocked) {
return isBlocked;
} catch {
return false;
}
}
/// @notice Abstract function to determine if the operator is a blocklist admin.
/// @param potentialAdmin - the potential admin address to check
function isBlockListAdmin(address potentialAdmin) public view virtual returns (bool);
/*//////////////////////////////////////////////////////////////////////////
Upgradeability Gap
//////////////////////////////////////////////////////////////////////////*/
/// @dev gap variable - see https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
uint256[50] private _gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165Upgradeable.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 IERC1155Upgradeable is IERC165Upgradeable {
/**
* @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/IERC165Upgradeable.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155ReceiverUpgradeable is IERC165Upgradeable {
/**
* @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 "../IERC1155Upgradeable.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 IERC1155MetadataURIUpgradeable is IERC1155Upgradeable {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
///
/// @dev Interface for the NFT Royalty Standard
///
interface IEIP2981 {
/// ERC165 bytes to add to interface array - set in parent contract
/// implementing this standard
///
/// bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a
/// @notice Called with the sale price to determine how much royalty
// is owed and to whom.
/// @param tokenId - the NFT asset queried for royalty information
/// @param salePrice - the sale price of the NFT asset specified by tokenId
/// @return receiver - address of who should be sent the royalty payment
/// @return royaltyAmount - the royalty payment amount for salePrice
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
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 EnumerableSetUpgradeable {
// 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/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_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);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
/*//////////////////////////////////////////////////////////////////////////
Custom Errors
//////////////////////////////////////////////////////////////////////////*/
/// @dev story additions are not enabled
error StoryNotEnabled();
/// @dev token does not exist
error TokenDoesNotExist();
/// @dev caller is not the token owner
error NotTokenOwner();
/// @dev caller is not the token creator
error NotTokenCreator();
/// @dev caller is not a story admin
error NotStoryAdmin();
/*//////////////////////////////////////////////////////////////////////////
IStory
//////////////////////////////////////////////////////////////////////////*/
/// @title Story Contract Interface
/// @author transientlabs.xyz
/// @custom:version 3.0.0
interface IStory {
/*//////////////////////////////////////////////////////////////////////////
Events
//////////////////////////////////////////////////////////////////////////*/
/// @notice event describing a creator story getting added to a token
/// @dev this events stores creator stories on chain in the event log
/// @param tokenId - the token id to which the story is attached
/// @param creatorAddress - the address of the creator of the token
/// @param creatorName - string representation of the creator's name
/// @param story - the story written and attached to the token id
event CreatorStory(uint256 indexed tokenId, address indexed creatorAddress, string creatorName, string story);
/// @notice event describing a collector story getting added to a token
/// @dev this events stores collector stories on chain in the event log
/// @param tokenId - the token id to which the story is attached
/// @param collectorAddress - the address of the collector of the token
/// @param collectorName - string representation of the collectors's name
/// @param story - the story written and attached to the token id
event Story(uint256 indexed tokenId, address indexed collectorAddress, string collectorName, string story);
/*//////////////////////////////////////////////////////////////////////////
Story Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to let the creator add a story to any token they have created
/// @dev depending on the implementation, this function may be restricted in various ways, such as
/// limiting the number of times the creator may write a story.
/// @dev this function MUST emit the CreatorStory event each time it is called
/// @dev this function MUST implement logic to restrict access to only the creator
/// @dev this function MUST revert if a story is written to a non-existent token
/// @param tokenId - the token id to which the story is attached
/// @param creatorName - string representation of the creator's name
/// @param story - the story written and attached to the token id
function addCreatorStory(uint256 tokenId, string calldata creatorName, string calldata story) external;
/// @notice function to let collectors add a story to any token they own
/// @dev depending on the implementation, this function may be restricted in various ways, such as
/// limiting the number of times a collector may write a story.
/// @dev this function MUST emit the Story event each time it is called
/// @dev this function MUST implement logic to restrict access to only the owner of the token
/// @dev this function MUST revert if a story is written to a non-existent token
/// @param tokenId - the token id to which the story is attached
/// @param collectorName - string representation of the collectors's name
/// @param story - the story written and attached to the token id
function addStory(uint256 tokenId, string calldata collectorName, string calldata story) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
/*//////////////////////////////////////////////////////////////////////////
Custom Errors
//////////////////////////////////////////////////////////////////////////*/
/// @dev blocked operator error
error BlockedOperator();
/// @dev unauthorized to call fn method
error Unauthorized();
/*//////////////////////////////////////////////////////////////////////////
IBlockList
//////////////////////////////////////////////////////////////////////////*/
/// @title IBlockList
/// @notice interface for the BlockList Contract
/// @author transientlabs.xyz
/// @custom:version 4.0.0
interface IBlockList {
/// @notice function to get blocklist status with True meaning that the operator is blocked
/// @dev must return false if the blocklist registry is an EOA or an incompatible contract, true/false if compatible
/// @param operator - operator to check against for blocking
function getBlockListStatus(address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
/// @title BlockList Registry
/// @notice interface for the BlockListRegistry Contract
/// @author transientlabs.xyz
/// @custom:version 4.0.0
interface IBlockListRegistry {
/*//////////////////////////////////////////////////////////////////////////
Events
//////////////////////////////////////////////////////////////////////////*/
event BlockListStatusChange(address indexed user, address indexed operator, bool indexed status);
event BlockListCleared(address indexed user);
/*//////////////////////////////////////////////////////////////////////////
Public Read Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to get blocklist status with True meaning that the operator is blocked
function getBlockListStatus(address operator) external view returns (bool);
/*//////////////////////////////////////////////////////////////////////////
Public Write Functions
//////////////////////////////////////////////////////////////////////////*/
/// @notice function to set the block list status for multiple operators
/// @dev must be called by the blockList owner
function setBlockListStatus(address[] calldata operators, bool status) external;
/// @notice function to clear the block list status
/// @dev must be called by the blockList owner
function clearBlockList() external;
}// 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 IERC165Upgradeable {
/**
* @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);
}{
"remappings": [
"blocklist/=lib/blocklist/src/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"openzeppelin/=lib/openzeppelin-contracts/contracts/",
"sstore2/=lib/sstore2/contracts/",
"story-contract/=lib/story-contract/src/",
"tl-blocklist/=lib/blocklist/src/",
"tl-creator/=src/",
"tl-sol-tools/=lib/tl-sol-tools/src/",
"tl-story/=lib/story-contract/src/"
],
"optimizer": {
"enabled": true,
"runs": 2000
},
"metadata": {
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"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":[{"internalType":"bool","name":"disable","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"BlockedOperator","type":"error"},{"inputs":[],"name":"BurnZeroTokens","type":"error"},{"inputs":[],"name":"CallerNotApprovedOrOwner","type":"error"},{"inputs":[],"name":"EmptyTokenURI","type":"error"},{"inputs":[],"name":"MaxRoyaltyError","type":"error"},{"inputs":[],"name":"MintToZeroAddresses","type":"error"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"NotRoleOrOwner","type":"error"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"NotSpecifiedRole","type":"error"},{"inputs":[],"name":"NotStoryAdmin","type":"error"},{"inputs":[],"name":"NotTokenCreator","type":"error"},{"inputs":[],"name":"NotTokenOwner","type":"error"},{"inputs":[],"name":"StoryNotEnabled","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TokenDoesntExist","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"ZeroAddressError","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"}],"name":"AllRolesRevoked","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":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"oldRegistry","type":"address"},{"indexed":true,"internalType":"address","name":"newRegistry","type":"address"}],"name":"BlockListRegistryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"creatorAddress","type":"address"},{"indexed":false,"internalType":"string","name":"creatorName","type":"string"},{"indexed":false,"internalType":"string","name":"story","type":"string"}],"name":"CreatorStory","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"bool","name":"approved","type":"bool"},{"indexed":false,"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"RoleChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"collectorAddress","type":"address"},{"indexed":false,"internalType":"string","name":"collectorName","type":"string"},{"indexed":false,"internalType":"string","name":"story","type":"string"}],"name":"Story","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":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"APPROVED_MINT_CONTRACT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"creatorName","type":"string"},{"internalType":"string","name":"story","type":"string"}],"name":"addCreatorStory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"collectorName","type":"string"},{"internalType":"string","name":"story","type":"string"}],"name":"addStory","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":"string[]","name":"newUris","type":"string[]"},{"internalType":"address[][]","name":"addresses","type":"address[][]"},{"internalType":"uint256[][]","name":"amounts","type":"uint256[][]"},{"internalType":"address[]","name":"royaltyAddresses","type":"address[]"},{"internalType":"uint256[]","name":"royaltyPercents","type":"uint256[]"}],"name":"batchCreateToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"newUris","type":"string[]"},{"internalType":"address[][]","name":"addresses","type":"address[][]"},{"internalType":"uint256[][]","name":"amounts","type":"uint256[][]"}],"name":"batchCreateToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"blockListRegistry","outputs":[{"internalType":"contract IBlockListRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newUri","type":"string"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"royaltyAddress","type":"address"},{"internalType":"uint256","name":"royaltyPercent","type":"uint256"}],"name":"createToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newUri","type":"string"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"createToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"externalMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"getBlockListStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDefaultRoyaltyRecipientAndPercentage","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMembers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenDetails","outputs":[{"components":[{"internalType":"bool","name":"created","type":"bool"},{"internalType":"string","name":"uri","type":"string"}],"internalType":"struct ERC1155TL.Token","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"potentialRoleMember","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"defaultRoyaltyRecipient","type":"address"},{"internalType":"uint256","name":"defaultRoyaltyPercentage","type":"uint256"},{"internalType":"address","name":"initOwner","type":"address"},{"internalType":"address[]","name":"admins","type":"address[]"},{"internalType":"bool","name":"enableStory","type":"bool"},{"internalType":"address","name":"blockListRegistry","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","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":"potentialAdmin","type":"address"}],"name":"isBlockListAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"mintToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revokeAllRoles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"minters","type":"address[]"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setApprovedMintContracts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRecipient","type":"address"},{"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address[]","name":"roleMembers","type":"address[]"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setStoryEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"newRecipient","type":"address"},{"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"newUri","type":"string"}],"name":"setTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"storyEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newBlockListRegistry","type":"address"}],"name":"updateBlockListRegistry","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
60806040523480156200001157600080fd5b5060405162004eaf38038062004eaf83398101604081905262000034916200010e565b80156200004557620000456200004c565b5062000139565b600054610100900460ff1615620000b95760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156200010c576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012157600080fd5b815180151581146200013257600080fd5b9392505050565b614d6680620001496000396000f3fe608060405234801561001057600080fd5b50600436106102f35760003560e01c806356000f7711610191578063a22cb465116100e3578063d8c3a27411610097578063f242432a11610071578063f242432a146106e3578063f2fde38b146106f6578063ffa1ad741461070957600080fd5b8063d8c3a27414610681578063d8d045b414610694578063e985e9c5146106a757600080fd5b8063a3246ad3116100c8578063a3246ad31461062e578063c1e037281461064e578063d4bf502a1461066e57600080fd5b8063a22cb46514610607578063a25a33931461061a57600080fd5b80637e6cc5421161014557806391d148541161011f57806391d14854146105a857806395d89b41146105ec5780639713c807146105f457600080fd5b80637e6cc542146105595780638bb9c5bf146105705780638da5cb5b1461058357600080fd5b80635b23e3ce116101765780635b23e3ce14610517578063715018a61461052a57806375b238fc1461053257600080fd5b806356000f77146104f157806357f7789e1461050457600080fd5b80632eb2c2d61161024a5780633f2bc966116101fe5780634a597065116101d85780634a597065146104b05780634e1273f4146104be57806351dc02f2146104de57600080fd5b80633f2bc9661461047757806346317db71461048a578063485d3c071461049d57600080fd5b8063334980a51161022f578063334980a51461044957806333aa4fb31461045c5780633db0f8ab1461046457600080fd5b80632eb2c2d614610423578063319210231461043657600080fd5b80631fbd2402116102ac57806324f029c31161028657806324f029c3146103cb5780632a55205a146103de5780632d28c08b1461041057600080fd5b80631fbd24021461037e5780631ff7f0bc14610391578063249fde3b146103b857600080fd5b806306fdde03116102dd57806306fdde03146103415780630e89341c146103565780631258e8871461036957600080fd5b8062fdd58e146102f857806301ffc9a71461031e575b600080fd5b61030b610306366004613bcb565b610745565b6040519081526020015b60405180910390f35b61033161032c366004613c0b565b6107f3565b6040519015158152602001610315565b61034961081c565b6040516103159190613c6e565b610349610364366004613c81565b6108ab565b61037c610377366004613c9a565b610980565b005b61037c61038c366004613e21565b610a21565b61030b7ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af581565b61037c6103c6366004613f3b565b610bd3565b61037c6103d9366004613fb5565b610c79565b6103f16103ec366004613fd2565b610ccc565b604080516001600160a01b039093168352602083019190915201610315565b61037c61041e366004614036565b610d44565b61037c610431366004614150565b610e91565b61037c6104443660046141fa565b610f33565b610331610457366004613c9a565b611170565b61037c611220565b61037c6104723660046142eb565b61126a565b610331610485366004613c9a565b611387565b61037c610498366004614329565b6113b6565b61037c6104ab3660046143c3565b611559565b610133546103319060ff1681565b6104d16104cc366004614400565b61168b565b604051610315919061449f565b61037c6104ec3660046144b2565b6117c9565b61037c6104ff366004614509565b6118bf565b61037c610512366004614572565b6119ca565b61037c610525366004614509565b611b0b565b61037c611c07565b61030b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b6103f16097546098546001600160a01b0390911691565b61037c61057e366004613c81565b611c1b565b60cc546001600160a01b03165b6040516001600160a01b039091168152602001610315565b6103316105b63660046145be565b60fe54600090815260ff6020818152604080842086855282528084206001600160a01b0386168552909152909120541692915050565b610349611c81565b61037c6106023660046145ea565b611c8f565b61037c61061536600461461f565b611ca7565b61016654610590906001600160a01b031681565b61064161063c366004613c81565b611cf2565b6040516103159190614656565b61066161065c366004613c81565b611d1b565b60405161031591906146a3565b61037c61067c3660046146d2565b611df1565b61037c61068f366004613f3b565b611e04565b61037c6106a2366004613bcb565b611e86565b6103316106b5366004614722565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b61037c6106f136600461474c565b611e98565b61037c610704366004613c9a565b611f33565b6103496040518060400160405280600581526020017f322e332e3000000000000000000000000000000000000000000000000000000081525081565b60006001600160a01b0383166107c85760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e65720000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006107fe82611fc3565b8061080d575061080d82612045565b806107ed57506107ed82612093565b61019a805461082a906147b1565b80601f0160208091040260200160405190810160405280929190818152602001828054610856906147b1565b80156108a35780601f10610878576101008083540402835291602001916108a3565b820191906000526020600020905b81548152906001019060200180831161088657829003601f168201915b505050505081565b600081815261019c602052604090205460609060ff166108de57604051631d6fa32560e31b815260040160405180910390fd5b600082815261019c6020526040902060010180546108fb906147b1565b80601f0160208091040260200160405190810160405280929190818152602001828054610927906147b1565b80156109745780601f1061094957610100808354040283529160200191610974565b820191906000526020600020905b81548152906001019060200180831161095757829003601f168201915b50505050509050919050565b61098933611387565b6109bf576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61016680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff198316811790935560405191169190829033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f90600090a45050565b600054610100900460ff1615808015610a415750600054600160ff909116105b80610a5b5750303b158015610a5b575060005460ff166001145b610acd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016107bf565b6000805460ff191660011790558015610af0576000805461ff0019166101001790555b610b08604051806020016040528060008152506120e1565b610b128787612155565b610b1b856121ca565b610b3183610133805460ff191682151517905550565b610b3a8261224e565b610b667fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758560016122c2565b61019a610b738a82614831565b5061019b610b818982614831565b508015610bc8576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610c43575033610c3760cc546001600160a01b031690565b6001600160a01b031614155b15610c64576040516376c1743160e01b8152600481018290526024016107bf565b610c71868686868661244f565b505050505050565b610c8233612569565b610cb8576040517f4701b18c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610133805460ff1916911515919091179055565b609754609854600084815260996020526040812054909283926001600160a01b039182169290911615610d1e575050600084815260996020526040902080546001909101546001600160a01b03909116905b8181610d2c61271088614907565b610d369190614929565b9350935050505b9250929050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610db4575033610da860cc546001600160a01b031690565b6001600160a01b031614155b15610dd5576040516376c1743160e01b8152600481018290526024016107bf565b6000610e788a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b9182918501908490808284376000920191909152506125ec92505050565b9050610e85818585612764565b50505050505050505050565b6001600160a01b038516331480610ead5750610ead85336106b5565b610f1f5760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f76656400000000000000000000000000000000000060648201526084016107bf565b610f2c8585858585612820565b5050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610fa3575033610f9760cc546001600160a01b031690565b6001600160a01b031614155b15610fc4576040516376c1743160e01b8152600481018290526024016107bf565b60008a9003610fe6576040516317314b6160e01b815260040160405180910390fd5b60005b8a8110156111625760006111048d8d8481811061100857611008614940565b905060200281019061101a9190614956565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92508e915086905081811061106357611063614940565b9050602002810190611075919061499d565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508e92508d91508790508181106110bb576110bb614940565b90506020028101906110cd919061499d565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506125ec92505050565b905061114f8188888581811061111c5761111c614940565b90506020020160208101906111319190613c9a565b87878681811061114357611143614940565b90506020020135612764565b508061115a816149e7565b915050610fe9565b505050505050505050505050565b610166546000906001600160a01b03163b810361118f57506000919050565b610166546040517f334980a50000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529091169063334980a590602401602060405180830381865afa92505050801561120f575060408051601f3d908101601f1916820190925261120c91810190614a01565b60015b6107ed57506000919050565b919050565b611228612ab9565b60fe8054906000611238836149e7565b909155505060405133907fdf1eaea754aea6dc7d083377ed7366dd7405e3fb0f16ddfb9448770520e4427990600090a2565b60008390036112a5576040517f3fb001d600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b038616148015906112e257506001600160a01b038516600090815260666020908152604080832033845290915290205460ff16155b15611319576040517fc9c1cf1b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f2c8585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250612b1392505050565b600061139b60cc546001600160a01b031690565b6001600160a01b0316826001600160a01b0316149050919050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775808652908352818520338652909252909220541615801561142657503361141a60cc546001600160a01b031690565b6001600160a01b031614155b15611447576040516376c1743160e01b8152600481018290526024016107bf565b6000869003611469576040516317314b6160e01b815260040160405180910390fd5b60005b8681101561154f5761153c88888381811061148957611489614940565b905060200281019061149b9190614956565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a92508991508590508181106114e4576114e4614940565b90506020028101906114f6919061499d565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508992508891508690508181106110bb576110bb614940565b5080611547816149e7565b91505061146c565b5050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156115c95750336115bd60cc546001600160a01b031690565b6001600160a01b031614155b156115ea576040516376c1743160e01b8152600481018290526024016107bf565b61154f87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a028281018201909352898252909350899250889182918501908490808284376000920191909152506125ec92505050565b606081518351146117045760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d61746368000000000000000000000000000000000000000000000060648201526084016107bf565b6000835167ffffffffffffffff81111561172057611720613cb5565b604051908082528060200260200182016040528015611749578160200160208202803683370190505b50905060005b84518110156117c15761179485828151811061176d5761176d614940565b602002602001015185838151811061178757611787614940565b6020026020010151610745565b8282815181106117a6576117a6614940565b60209081029190910101526117ba816149e7565b905061174f565b509392505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775808652908352818520338652909252909220541615801561183957503361182d60cc546001600160a01b031690565b6001600160a01b031614155b1561185a576040516376c1743160e01b8152600481018290526024016107bf565b6118b97ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af58585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508792506122c2915050565b50505050565b6101335460ff166118fc576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61190585612da1565b61193b576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6119453386612db9565b61197b576040517f57deb26a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f5c0564b4237730adb947143019acb5addfdbf1be3ad1edf72e24a8f9d02fd2c1868686866040516119bb9493929190614a49565b60405180910390a35050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015611a3a575033611a2e60cc546001600160a01b031690565b6001600160a01b031614155b15611a5b576040516376c1743160e01b8152600481018290526024016107bf565b600084815261019c602052604090205460ff16611a8b57604051631d6fa32560e31b815260040160405180910390fd5b6000829003611aad576040516317314b6160e01b815260040160405180910390fd5b600084815261019c60205260409020600101611aca838583614a7b565b50837f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8484604051611afd929190614b3b565b60405180910390a250505050565b6101335460ff16611b48576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b5185612da1565b611b87576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b913386612e3f565b611bc7576040517f59dc379f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f40ebea9c3c7603a5d233a0bec01e483338737b6bed01bed2ac09ccbaa3d4b7ac868686866040516119bb9493929190614a49565b611c0f612ab9565b611c196000612e54565b565b604080516001808252818301909252600091602080830190803683370190505090503381600081518110611c5157611c51614940565b60200260200101906001600160a01b031690816001600160a01b031681525050611c7d828260006122c2565b5050565b61019b805461082a906147b1565b611c97612ab9565b611ca2838383612764565b505050565b81611cb181611170565b15611ce8576040517fe0574fb800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611ca28383612eb3565b60fe5460009081526101006020908152604080832084845290915290206060906107ed90612ebe565b604080518082019091526000815260606020820152600082815261019c60209081526040918290208251808401909352805460ff16151583526001810180549192840191611d68906147b1565b80601f0160208091040260200160405190810160405280929190818152602001828054611d94906147b1565b8015611de15780601f10611db657610100808354040283529160200191611de1565b820191906000526020600020905b815481529060010190602001808311611dc457829003601f168201915b5050505050815250509050919050565b611df9612ab9565b611ca28383836122c2565b60fe54600090815260ff602081815260408084207ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af58086529083528185203386529092529092205416610c64576040517fee074e74000000000000000000000000000000000000000000000000000000008152600481018290526024016107bf565b611e8e612ab9565b611c7d8282612ecb565b6001600160a01b038516331480611eb45750611eb485336106b5565b611f265760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f76656400000000000000000000000000000000000060648201526084016107bf565b610f2c8585858585612f7a565b611f3b612ab9565b6001600160a01b038116611fb75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016107bf565b611fc081612e54565b50565b60006001600160e01b031982167fd9b67a2600000000000000000000000000000000000000000000000000000000148061202657506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b806107ed57506301ffc9a760e01b6001600160e01b03198316146107ed565b60006001600160e01b031982167f2a55205a0000000000000000000000000000000000000000000000000000000014806107ed57506301ffc9a760e01b6001600160e01b03198316146107ed565b60006001600160e01b031982167f0d23ecb90000000000000000000000000000000000000000000000000000000014806107ed57506301ffc9a760e01b6001600160e01b03198316146107ed565b600054610100900460ff1661214c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611fc081613149565b600054610100900460ff166121c05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611c7d82826131bd565b600054610100900460ff166122355760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b61223d613228565b61224681612e54565b611fc061329b565b600054610100900460ff166122b95760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611fc081613306565b60005b82518110156118b95760fe54600090815260ff602090815260408083208784529091528120845184929086908590811061230157612301614940565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550811561238f5761238983828151811061235b5761235b614940565b60209081029190910181015160fe5460009081526101008352604080822089835290935291909120906133cd565b506123d4565b6123d28382815181106123a4576123a4614940565b60209081029190910181015160fe5460009081526101008352604080822089835290935291909120906133e2565b505b8115158382815181106123e9576123e9614940565b60200260200101516001600160a01b0316336001600160a01b03167fc9f6f69b3c19bd2b7eb8273129bbca5e3db0e3be63ca9903e140122a5bbb556e8760405161243591815260200190565b60405180910390a480612447816149e7565b9150506122c5565b600085815261019c602052604090205460ff1661247f57604051631d6fa32560e31b815260040160405180910390fd5b60008390036124ba576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8281146124f3576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015610c715761255785858381811061251357612513614940565b90506020020160208101906125289190613c9a565b8785858581811061253b5761253b614940565b90506020020135604051806020016040528060008152506133f7565b80612561816149e7565b9150506124f6565b600061257d60cc546001600160a01b031690565b6001600160a01b0316826001600160a01b031614806107ed575060fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775855282528084206001600160a01b038716855290915290912054166107ed565b60008351600003612610576040516317314b6160e01b815260040160405180910390fd5b825160000361264b576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8151835114612686576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101998054906000612697836149e7565b90915550506040805180820182526001808252602080830188815261019954600090815261019c9092529390208251815460ff19169015151781559251919291908201906126e59082614831565b5090505060005b83518110156127575761274584828151811061270a5761270a614940565b60200260200101516101995485848151811061272857612728614940565b6020026020010151604051806020016040528060008152506133f7565b8061274f816149e7565b9150506126ec565b5050610199549392505050565b6001600160a01b0382166127a4576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108111156127e0576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600092835260996020526040909220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117815560010155565b81518351146128975760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d6174636800000000000000000000000000000000000000000000000060648201526084016107bf565b6001600160a01b0384166129135760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016107bf565b3360005b8451811015612a5357600085828151811061293457612934614940565b60200260200101519050600085838151811061295257612952614940565b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156129f95760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016107bf565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612a38908490614b4f565b9250508190555050505080612a4c906149e7565b9050612917565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612aa3929190614b62565b60405180910390a4610c71818787878787613529565b60cc546001600160a01b03163314611c195760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107bf565b6001600160a01b038316612b8f5760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016107bf565b8051825114612c065760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d6174636800000000000000000000000000000000000000000000000060648201526084016107bf565b604080516020810190915260009081905233905b8351811015612d34576000848281518110612c3757612c37614940565b602002602001015190506000848381518110612c5557612c55614940565b60209081029190910181015160008481526065835260408082206001600160a01b038c168352909352919091205490915081811015612cfb5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e63650000000000000000000000000000000000000000000000000000000060648201526084016107bf565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580612d2c816149e7565b915050612c1a565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612d85929190614b62565b60405180910390a46040805160208101909152600090526118b9565b600081815261019c602052604081205460ff166107ed565b6000612dcd60cc546001600160a01b031690565b6001600160a01b0316836001600160a01b03161480612e38575060fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775855282528084206001600160a01b038816855290915290912054165b9392505050565b600080612e4c8484610745565b119392505050565b60cc80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611c7d338383613715565b60606000612e3883613809565b6001600160a01b038216612f0b576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710811115612f47576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6097805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155609855565b6001600160a01b038416612ff65760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016107bf565b33600061300285613864565b9050600061300f85613864565b905060008681526065602090815260408083206001600160a01b038c168452909152902054858110156130aa5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016107bf565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906130e9908490614b4f565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610bc8848a8a8a8a8a6138af565b600054610100900460ff166131b45760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611fc0816139f2565b600054610100900460ff16611e8e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b600054610100900460ff166132935760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611c196139fe565b600054610100900460ff16611c195760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b600054610100900460ff166133715760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b610166805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405160009033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f908390a450565b6000612e38836001600160a01b038416613a72565b6000612e38836001600160a01b038416613ac1565b6001600160a01b0384166134735760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016107bf565b33600061347f85613864565b9050600061348c85613864565b905060008681526065602090815260408083206001600160a01b038b168452909152812080548792906134c0908490614b4f565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613520836000898989896138af565b50505050505050565b6001600160a01b0384163b15610c71576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c81906135869089908990889088908890600401614b90565b6020604051808303816000875af19250505080156135c1575060408051601f3d908101601f191682019092526135be91810190614bee565b60015b613676576135cd614c0b565b806308c379a00361360657506135e1614c27565b806135ec5750613608565b8060405162461bcd60e51b81526004016107bf9190613c6e565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016107bf565b6001600160e01b031981167fbc197c8100000000000000000000000000000000000000000000000000000000146135205760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016107bf565b816001600160a01b0316836001600160a01b03160361379c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084016107bf565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561097457602002820191906000526020600020905b8154815260200190600101908083116138455750505050509050919050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061389e5761389e614940565b602090810291909101015292915050565b6001600160a01b0384163b15610c71576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e619061390c9089908990889088908890600401614ccf565b6020604051808303816000875af1925050508015613947575060408051601f3d908101601f1916820190925261394491810190614bee565b60015b613953576135cd614c0b565b6001600160e01b031981167ff23a6e6100000000000000000000000000000000000000000000000000000000146135205760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016107bf565b6067611c7d8282614831565b600054610100900460ff16613a695760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611c1933612e54565b6000818152600183016020526040812054613ab9575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556107ed565b5060006107ed565b60008181526001830160205260408120548015613baa576000613ae5600183614d07565b8554909150600090613af990600190614d07565b9050818114613b5e576000866000018281548110613b1957613b19614940565b9060005260206000200154905080876000018481548110613b3c57613b3c614940565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613b6f57613b6f614d1a565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506107ed565b60009150506107ed565b80356001600160a01b038116811461121b57600080fd5b60008060408385031215613bde57600080fd5b613be783613bb4565b946020939093013593505050565b6001600160e01b031981168114611fc057600080fd5b600060208284031215613c1d57600080fd5b8135612e3881613bf5565b6000815180845260005b81811015613c4e57602081850181015186830182015201613c32565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000612e386020830184613c28565b600060208284031215613c9357600080fd5b5035919050565b600060208284031215613cac57600080fd5b612e3882613bb4565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715613cf157613cf1613cb5565b6040525050565b600082601f830112613d0957600080fd5b813567ffffffffffffffff811115613d2357613d23613cb5565b604051613d3a6020601f19601f8501160182613ccb565b818152846020838601011115613d4f57600080fd5b816020850160208301376000918101602001919091529392505050565b600067ffffffffffffffff821115613d8657613d86613cb5565b5060051b60200190565b600082601f830112613da157600080fd5b81356020613dae82613d6c565b604051613dbb8282613ccb565b83815260059390931b8501820192828101915086841115613ddb57600080fd5b8286015b84811015613dfd57613df081613bb4565b8352918301918301613ddf565b509695505050505050565b8015158114611fc057600080fd5b803561121b81613e08565b600080600080600080600080610100898b031215613e3e57600080fd5b883567ffffffffffffffff80821115613e5657600080fd5b613e628c838d01613cf8565b995060208b0135915080821115613e7857600080fd5b613e848c838d01613cf8565b9850613e9260408c01613bb4565b975060608b01359650613ea760808c01613bb4565b955060a08b0135915080821115613ebd57600080fd5b50613eca8b828c01613d90565b935050613ed960c08a01613e16565b9150613ee760e08a01613bb4565b90509295985092959890939650565b60008083601f840112613f0857600080fd5b50813567ffffffffffffffff811115613f2057600080fd5b6020830191508360208260051b8501011115610d3d57600080fd5b600080600080600060608688031215613f5357600080fd5b85359450602086013567ffffffffffffffff80821115613f7257600080fd5b613f7e89838a01613ef6565b90965094506040880135915080821115613f9757600080fd5b50613fa488828901613ef6565b969995985093965092949392505050565b600060208284031215613fc757600080fd5b8135612e3881613e08565b60008060408385031215613fe557600080fd5b50508035926020909101359150565b60008083601f84011261400657600080fd5b50813567ffffffffffffffff81111561401e57600080fd5b602083019150836020828501011115610d3d57600080fd5b60008060008060008060008060a0898b03121561405257600080fd5b883567ffffffffffffffff8082111561406a57600080fd5b6140768c838d01613ff4565b909a50985060208b013591508082111561408f57600080fd5b61409b8c838d01613ef6565b909850965060408b01359150808211156140b457600080fd5b506140c18b828c01613ef6565b90955093506140d4905060608a01613bb4565b9150608089013590509295985092959890939650565b600082601f8301126140fb57600080fd5b8135602061410882613d6c565b6040516141158282613ccb565b83815260059390931b850182019282810191508684111561413557600080fd5b8286015b84811015613dfd5780358352918301918301614139565b600080600080600060a0868803121561416857600080fd5b61417186613bb4565b945061417f60208701613bb4565b9350604086013567ffffffffffffffff8082111561419c57600080fd5b6141a889838a016140ea565b945060608801359150808211156141be57600080fd5b6141ca89838a016140ea565b935060808801359150808211156141e057600080fd5b506141ed88828901613cf8565b9150509295509295909350565b60008060008060008060008060008060a08b8d03121561421957600080fd5b8a3567ffffffffffffffff8082111561423157600080fd5b61423d8e838f01613ef6565b909c509a5060208d013591508082111561425657600080fd5b6142628e838f01613ef6565b909a50985060408d013591508082111561427b57600080fd5b6142878e838f01613ef6565b909850965060608d01359150808211156142a057600080fd5b6142ac8e838f01613ef6565b909650945060808d01359150808211156142c557600080fd5b506142d28d828e01613ef6565b915080935050809150509295989b9194979a5092959850565b60008060008060006060868803121561430357600080fd5b61430c86613bb4565b9450602086013567ffffffffffffffff80821115613f7257600080fd5b6000806000806000806060878903121561434257600080fd5b863567ffffffffffffffff8082111561435a57600080fd5b6143668a838b01613ef6565b9098509650602089013591508082111561437f57600080fd5b61438b8a838b01613ef6565b909650945060408901359150808211156143a457600080fd5b506143b189828a01613ef6565b979a9699509497509295939492505050565b600080600080600080606087890312156143dc57600080fd5b863567ffffffffffffffff808211156143f457600080fd5b6143668a838b01613ff4565b6000806040838503121561441357600080fd5b823567ffffffffffffffff8082111561442b57600080fd5b61443786838701613d90565b9350602085013591508082111561444d57600080fd5b5061445a858286016140ea565b9150509250929050565b600081518084526020808501945080840160005b8381101561449457815187529582019590820190600101614478565b509495945050505050565b602081526000612e386020830184614464565b6000806000604084860312156144c757600080fd5b833567ffffffffffffffff8111156144de57600080fd5b6144ea86828701613ef6565b90945092505060208401356144fe81613e08565b809150509250925092565b60008060008060006060868803121561452157600080fd5b85359450602086013567ffffffffffffffff8082111561454057600080fd5b61454c89838a01613ff4565b9096509450604088013591508082111561456557600080fd5b50613fa488828901613ff4565b60008060006040848603121561458757600080fd5b83359250602084013567ffffffffffffffff8111156145a557600080fd5b6145b186828701613ff4565b9497909650939450505050565b600080604083850312156145d157600080fd5b823591506145e160208401613bb4565b90509250929050565b6000806000606084860312156145ff57600080fd5b8335925061460f60208501613bb4565b9150604084013590509250925092565b6000806040838503121561463257600080fd5b61463b83613bb4565b9150602083013561464b81613e08565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156146975783516001600160a01b031683529284019291840191600101614672565b50909695505050505050565b60208152815115156020820152600060208301516040808401526146ca6060840182613c28565b949350505050565b6000806000606084860312156146e757600080fd5b83359250602084013567ffffffffffffffff81111561470557600080fd5b61471186828701613d90565b92505060408401356144fe81613e08565b6000806040838503121561473557600080fd5b61473e83613bb4565b91506145e160208401613bb4565b600080600080600060a0868803121561476457600080fd5b61476d86613bb4565b945061477b60208701613bb4565b93506040860135925060608601359150608086013567ffffffffffffffff8111156147a557600080fd5b6141ed88828901613cf8565b600181811c908216806147c557607f821691505b6020821081036147e557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611ca257600081815260208120601f850160051c810160208610156148125750805b601f850160051c820191505b81811015610c715782815560010161481e565b815167ffffffffffffffff81111561484b5761484b613cb5565b61485f8161485984546147b1565b846147eb565b602080601f831160018114614894576000841561487c5750858301515b600019600386901b1c1916600185901b178555610c71565b600085815260208120601f198616915b828110156148c3578886015182559484019460019091019084016148a4565b50858210156148e15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b60008261492457634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176107ed576107ed6148f1565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261496d57600080fd5b83018035915067ffffffffffffffff82111561498857600080fd5b602001915036819003821315610d3d57600080fd5b6000808335601e198436030181126149b457600080fd5b83018035915067ffffffffffffffff8211156149cf57600080fd5b6020019150600581901b3603821315610d3d57600080fd5b600060001982036149fa576149fa6148f1565b5060010190565b600060208284031215614a1357600080fd5b8151612e3881613e08565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b604081526000614a5d604083018688614a1e565b8281036020840152614a70818587614a1e565b979650505050505050565b67ffffffffffffffff831115614a9357614a93613cb5565b614aa783614aa183546147b1565b836147eb565b6000601f841160018114614adb5760008515614ac35750838201355b600019600387901b1c1916600186901b178355610f2c565b600083815260209020601f19861690835b82811015614b0c5786850135825560209485019460019092019101614aec565b5086821015614b295760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6020815260006146ca602083018486614a1e565b808201808211156107ed576107ed6148f1565b604081526000614b756040830185614464565b8281036020840152614b878185614464565b95945050505050565b60006001600160a01b03808816835280871660208401525060a06040830152614bbc60a0830186614464565b8281036060840152614bce8186614464565b90508281036080840152614be28185613c28565b98975050505050505050565b600060208284031215614c0057600080fd5b8151612e3881613bf5565b600060033d1115614c245760046000803e5060005160e01c5b90565b600060443d1015614c355790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715614c8357505050505090565b8285019150815181811115614c9b5750505050505090565b843d8701016020828501011115614cb55750505050505090565b614cc460208286010187613ccb565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152614a7060a0830184613c28565b818103818111156107ed576107ed6148f1565b634e487b7160e01b600052603160045260246000fdfea264697066735822122067f5d42f0fbfdcc3a666cbd5bf4c8ab7e2d9a871746527385bbc78480828e48d64736f6c634300081300330000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102f35760003560e01c806356000f7711610191578063a22cb465116100e3578063d8c3a27411610097578063f242432a11610071578063f242432a146106e3578063f2fde38b146106f6578063ffa1ad741461070957600080fd5b8063d8c3a27414610681578063d8d045b414610694578063e985e9c5146106a757600080fd5b8063a3246ad3116100c8578063a3246ad31461062e578063c1e037281461064e578063d4bf502a1461066e57600080fd5b8063a22cb46514610607578063a25a33931461061a57600080fd5b80637e6cc5421161014557806391d148541161011f57806391d14854146105a857806395d89b41146105ec5780639713c807146105f457600080fd5b80637e6cc542146105595780638bb9c5bf146105705780638da5cb5b1461058357600080fd5b80635b23e3ce116101765780635b23e3ce14610517578063715018a61461052a57806375b238fc1461053257600080fd5b806356000f77146104f157806357f7789e1461050457600080fd5b80632eb2c2d61161024a5780633f2bc966116101fe5780634a597065116101d85780634a597065146104b05780634e1273f4146104be57806351dc02f2146104de57600080fd5b80633f2bc9661461047757806346317db71461048a578063485d3c071461049d57600080fd5b8063334980a51161022f578063334980a51461044957806333aa4fb31461045c5780633db0f8ab1461046457600080fd5b80632eb2c2d614610423578063319210231461043657600080fd5b80631fbd2402116102ac57806324f029c31161028657806324f029c3146103cb5780632a55205a146103de5780632d28c08b1461041057600080fd5b80631fbd24021461037e5780631ff7f0bc14610391578063249fde3b146103b857600080fd5b806306fdde03116102dd57806306fdde03146103415780630e89341c146103565780631258e8871461036957600080fd5b8062fdd58e146102f857806301ffc9a71461031e575b600080fd5b61030b610306366004613bcb565b610745565b6040519081526020015b60405180910390f35b61033161032c366004613c0b565b6107f3565b6040519015158152602001610315565b61034961081c565b6040516103159190613c6e565b610349610364366004613c81565b6108ab565b61037c610377366004613c9a565b610980565b005b61037c61038c366004613e21565b610a21565b61030b7ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af581565b61037c6103c6366004613f3b565b610bd3565b61037c6103d9366004613fb5565b610c79565b6103f16103ec366004613fd2565b610ccc565b604080516001600160a01b039093168352602083019190915201610315565b61037c61041e366004614036565b610d44565b61037c610431366004614150565b610e91565b61037c6104443660046141fa565b610f33565b610331610457366004613c9a565b611170565b61037c611220565b61037c6104723660046142eb565b61126a565b610331610485366004613c9a565b611387565b61037c610498366004614329565b6113b6565b61037c6104ab3660046143c3565b611559565b610133546103319060ff1681565b6104d16104cc366004614400565b61168b565b604051610315919061449f565b61037c6104ec3660046144b2565b6117c9565b61037c6104ff366004614509565b6118bf565b61037c610512366004614572565b6119ca565b61037c610525366004614509565b611b0b565b61037c611c07565b61030b7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b6103f16097546098546001600160a01b0390911691565b61037c61057e366004613c81565b611c1b565b60cc546001600160a01b03165b6040516001600160a01b039091168152602001610315565b6103316105b63660046145be565b60fe54600090815260ff6020818152604080842086855282528084206001600160a01b0386168552909152909120541692915050565b610349611c81565b61037c6106023660046145ea565b611c8f565b61037c61061536600461461f565b611ca7565b61016654610590906001600160a01b031681565b61064161063c366004613c81565b611cf2565b6040516103159190614656565b61066161065c366004613c81565b611d1b565b60405161031591906146a3565b61037c61067c3660046146d2565b611df1565b61037c61068f366004613f3b565b611e04565b61037c6106a2366004613bcb565b611e86565b6103316106b5366004614722565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b61037c6106f136600461474c565b611e98565b61037c610704366004613c9a565b611f33565b6103496040518060400160405280600581526020017f322e332e3000000000000000000000000000000000000000000000000000000081525081565b60006001600160a01b0383166107c85760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e65720000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006107fe82611fc3565b8061080d575061080d82612045565b806107ed57506107ed82612093565b61019a805461082a906147b1565b80601f0160208091040260200160405190810160405280929190818152602001828054610856906147b1565b80156108a35780601f10610878576101008083540402835291602001916108a3565b820191906000526020600020905b81548152906001019060200180831161088657829003601f168201915b505050505081565b600081815261019c602052604090205460609060ff166108de57604051631d6fa32560e31b815260040160405180910390fd5b600082815261019c6020526040902060010180546108fb906147b1565b80601f0160208091040260200160405190810160405280929190818152602001828054610927906147b1565b80156109745780601f1061094957610100808354040283529160200191610974565b820191906000526020600020905b81548152906001019060200180831161095757829003601f168201915b50505050509050919050565b61098933611387565b6109bf576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61016680546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff198316811790935560405191169190829033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f90600090a45050565b600054610100900460ff1615808015610a415750600054600160ff909116105b80610a5b5750303b158015610a5b575060005460ff166001145b610acd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016107bf565b6000805460ff191660011790558015610af0576000805461ff0019166101001790555b610b08604051806020016040528060008152506120e1565b610b128787612155565b610b1b856121ca565b610b3183610133805460ff191682151517905550565b610b3a8261224e565b610b667fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758560016122c2565b61019a610b738a82614831565b5061019b610b818982614831565b508015610bc8576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610c43575033610c3760cc546001600160a01b031690565b6001600160a01b031614155b15610c64576040516376c1743160e01b8152600481018290526024016107bf565b610c71868686868661244f565b505050505050565b610c8233612569565b610cb8576040517f4701b18c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610133805460ff1916911515919091179055565b609754609854600084815260996020526040812054909283926001600160a01b039182169290911615610d1e575050600084815260996020526040902080546001909101546001600160a01b03909116905b8181610d2c61271088614907565b610d369190614929565b9350935050505b9250929050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610db4575033610da860cc546001600160a01b031690565b6001600160a01b031614155b15610dd5576040516376c1743160e01b8152600481018290526024016107bf565b6000610e788a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b9182918501908490808284376000920191909152506125ec92505050565b9050610e85818585612764565b50505050505050505050565b6001600160a01b038516331480610ead5750610ead85336106b5565b610f1f5760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f76656400000000000000000000000000000000000060648201526084016107bf565b610f2c8585858585612820565b5050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015610fa3575033610f9760cc546001600160a01b031690565b6001600160a01b031614155b15610fc4576040516376c1743160e01b8152600481018290526024016107bf565b60008a9003610fe6576040516317314b6160e01b815260040160405180910390fd5b60005b8a8110156111625760006111048d8d8481811061100857611008614940565b905060200281019061101a9190614956565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92508e915086905081811061106357611063614940565b9050602002810190611075919061499d565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508e92508d91508790508181106110bb576110bb614940565b90506020028101906110cd919061499d565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506125ec92505050565b905061114f8188888581811061111c5761111c614940565b90506020020160208101906111319190613c9a565b87878681811061114357611143614940565b90506020020135612764565b508061115a816149e7565b915050610fe9565b505050505050505050505050565b610166546000906001600160a01b03163b810361118f57506000919050565b610166546040517f334980a50000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529091169063334980a590602401602060405180830381865afa92505050801561120f575060408051601f3d908101601f1916820190925261120c91810190614a01565b60015b6107ed57506000919050565b919050565b611228612ab9565b60fe8054906000611238836149e7565b909155505060405133907fdf1eaea754aea6dc7d083377ed7366dd7405e3fb0f16ddfb9448770520e4427990600090a2565b60008390036112a5576040517f3fb001d600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b038616148015906112e257506001600160a01b038516600090815260666020908152604080832033845290915290205460ff16155b15611319576040517fc9c1cf1b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f2c8585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250612b1392505050565b600061139b60cc546001600160a01b031690565b6001600160a01b0316826001600160a01b0316149050919050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775808652908352818520338652909252909220541615801561142657503361141a60cc546001600160a01b031690565b6001600160a01b031614155b15611447576040516376c1743160e01b8152600481018290526024016107bf565b6000869003611469576040516317314b6160e01b815260040160405180910390fd5b60005b8681101561154f5761153c88888381811061148957611489614940565b905060200281019061149b9190614956565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a92508991508590508181106114e4576114e4614940565b90506020028101906114f6919061499d565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508992508891508690508181106110bb576110bb614940565b5080611547816149e7565b91505061146c565b5050505050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177580865290835281852033865290925290922054161580156115c95750336115bd60cc546001600160a01b031690565b6001600160a01b031614155b156115ea576040516376c1743160e01b8152600481018290526024016107bf565b61154f87878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020808b0282810182019093528a82529093508a92508991829185019084908082843760009201919091525050604080516020808a028281018201909352898252909350899250889182918501908490808284376000920191909152506125ec92505050565b606081518351146117045760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d61746368000000000000000000000000000000000000000000000060648201526084016107bf565b6000835167ffffffffffffffff81111561172057611720613cb5565b604051908082528060200260200182016040528015611749578160200160208202803683370190505b50905060005b84518110156117c15761179485828151811061176d5761176d614940565b602002602001015185838151811061178757611787614940565b6020026020010151610745565b8282815181106117a6576117a6614940565b60209081029190910101526117ba816149e7565b905061174f565b509392505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775808652908352818520338652909252909220541615801561183957503361182d60cc546001600160a01b031690565b6001600160a01b031614155b1561185a576040516376c1743160e01b8152600481018290526024016107bf565b6118b97ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af58585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508792506122c2915050565b50505050565b6101335460ff166118fc576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61190585612da1565b61193b576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6119453386612db9565b61197b576040517f57deb26a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f5c0564b4237730adb947143019acb5addfdbf1be3ad1edf72e24a8f9d02fd2c1868686866040516119bb9493929190614a49565b60405180910390a35050505050565b60fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758086529083528185203386529092529092205416158015611a3a575033611a2e60cc546001600160a01b031690565b6001600160a01b031614155b15611a5b576040516376c1743160e01b8152600481018290526024016107bf565b600084815261019c602052604090205460ff16611a8b57604051631d6fa32560e31b815260040160405180910390fd5b6000829003611aad576040516317314b6160e01b815260040160405180910390fd5b600084815261019c60205260409020600101611aca838583614a7b565b50837f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8484604051611afd929190614b3b565b60405180910390a250505050565b6101335460ff16611b48576040517fc3d4cd7900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b5185612da1565b611b87576040517fceea21b600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611b913386612e3f565b611bc7576040517f59dc379f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b0316857f40ebea9c3c7603a5d233a0bec01e483338737b6bed01bed2ac09ccbaa3d4b7ac868686866040516119bb9493929190614a49565b611c0f612ab9565b611c196000612e54565b565b604080516001808252818301909252600091602080830190803683370190505090503381600081518110611c5157611c51614940565b60200260200101906001600160a01b031690816001600160a01b031681525050611c7d828260006122c2565b5050565b61019b805461082a906147b1565b611c97612ab9565b611ca2838383612764565b505050565b81611cb181611170565b15611ce8576040517fe0574fb800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611ca28383612eb3565b60fe5460009081526101006020908152604080832084845290915290206060906107ed90612ebe565b604080518082019091526000815260606020820152600082815261019c60209081526040918290208251808401909352805460ff16151583526001810180549192840191611d68906147b1565b80601f0160208091040260200160405190810160405280929190818152602001828054611d94906147b1565b8015611de15780601f10611db657610100808354040283529160200191611de1565b820191906000526020600020905b815481529060010190602001808311611dc457829003601f168201915b5050505050815250509050919050565b611df9612ab9565b611ca28383836122c2565b60fe54600090815260ff602081815260408084207ff0178e81e3689af48153edf0e1b2d669fe2786ab9e21fdecf3e3771c70330af58086529083528185203386529092529092205416610c64576040517fee074e74000000000000000000000000000000000000000000000000000000008152600481018290526024016107bf565b611e8e612ab9565b611c7d8282612ecb565b6001600160a01b038516331480611eb45750611eb485336106b5565b611f265760405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f76656400000000000000000000000000000000000060648201526084016107bf565b610f2c8585858585612f7a565b611f3b612ab9565b6001600160a01b038116611fb75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016107bf565b611fc081612e54565b50565b60006001600160e01b031982167fd9b67a2600000000000000000000000000000000000000000000000000000000148061202657506001600160e01b031982167f0e89341c00000000000000000000000000000000000000000000000000000000145b806107ed57506301ffc9a760e01b6001600160e01b03198316146107ed565b60006001600160e01b031982167f2a55205a0000000000000000000000000000000000000000000000000000000014806107ed57506301ffc9a760e01b6001600160e01b03198316146107ed565b60006001600160e01b031982167f0d23ecb90000000000000000000000000000000000000000000000000000000014806107ed57506301ffc9a760e01b6001600160e01b03198316146107ed565b600054610100900460ff1661214c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611fc081613149565b600054610100900460ff166121c05760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611c7d82826131bd565b600054610100900460ff166122355760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b61223d613228565b61224681612e54565b611fc061329b565b600054610100900460ff166122b95760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611fc081613306565b60005b82518110156118b95760fe54600090815260ff602090815260408083208784529091528120845184929086908590811061230157612301614940565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550811561238f5761238983828151811061235b5761235b614940565b60209081029190910181015160fe5460009081526101008352604080822089835290935291909120906133cd565b506123d4565b6123d28382815181106123a4576123a4614940565b60209081029190910181015160fe5460009081526101008352604080822089835290935291909120906133e2565b505b8115158382815181106123e9576123e9614940565b60200260200101516001600160a01b0316336001600160a01b03167fc9f6f69b3c19bd2b7eb8273129bbca5e3db0e3be63ca9903e140122a5bbb556e8760405161243591815260200190565b60405180910390a480612447816149e7565b9150506122c5565b600085815261019c602052604090205460ff1661247f57604051631d6fa32560e31b815260040160405180910390fd5b60008390036124ba576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8281146124f3576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b83811015610c715761255785858381811061251357612513614940565b90506020020160208101906125289190613c9a565b8785858581811061253b5761253b614940565b90506020020135604051806020016040528060008152506133f7565b80612561816149e7565b9150506124f6565b600061257d60cc546001600160a01b031690565b6001600160a01b0316826001600160a01b031614806107ed575060fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775855282528084206001600160a01b038716855290915290912054166107ed565b60008351600003612610576040516317314b6160e01b815260040160405180910390fd5b825160000361264b576040517fd8b8bfb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8151835114612686576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6101998054906000612697836149e7565b90915550506040805180820182526001808252602080830188815261019954600090815261019c9092529390208251815460ff19169015151781559251919291908201906126e59082614831565b5090505060005b83518110156127575761274584828151811061270a5761270a614940565b60200260200101516101995485848151811061272857612728614940565b6020026020010151604051806020016040528060008152506133f7565b8061274f816149e7565b9150506126ec565b5050610199549392505050565b6001600160a01b0382166127a4576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6127108111156127e0576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600092835260996020526040909220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039290921691909117815560010155565b81518351146128975760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d6174636800000000000000000000000000000000000000000000000060648201526084016107bf565b6001600160a01b0384166129135760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016107bf565b3360005b8451811015612a5357600085828151811061293457612934614940565b60200260200101519050600085838151811061295257612952614940565b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156129f95760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016107bf565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612a38908490614b4f565b9250508190555050505080612a4c906149e7565b9050612917565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612aa3929190614b62565b60405180910390a4610c71818787878787613529565b60cc546001600160a01b03163314611c195760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107bf565b6001600160a01b038316612b8f5760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016107bf565b8051825114612c065760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d6174636800000000000000000000000000000000000000000000000060648201526084016107bf565b604080516020810190915260009081905233905b8351811015612d34576000848281518110612c3757612c37614940565b602002602001015190506000848381518110612c5557612c55614940565b60209081029190910181015160008481526065835260408082206001600160a01b038c168352909352919091205490915081811015612cfb5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c60448201527f616e63650000000000000000000000000000000000000000000000000000000060648201526084016107bf565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580612d2c816149e7565b915050612c1a565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612d85929190614b62565b60405180910390a46040805160208101909152600090526118b9565b600081815261019c602052604081205460ff166107ed565b6000612dcd60cc546001600160a01b031690565b6001600160a01b0316836001600160a01b03161480612e38575060fe54600090815260ff602081815260408084207fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775855282528084206001600160a01b038816855290915290912054165b9392505050565b600080612e4c8484610745565b119392505050565b60cc80546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611c7d338383613715565b60606000612e3883613809565b6001600160a01b038216612f0b576040517f3efa09af00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612710811115612f47576040517fdc65bdeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6097805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039390931692909217909155609855565b6001600160a01b038416612ff65760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016107bf565b33600061300285613864565b9050600061300f85613864565b905060008681526065602090815260408083206001600160a01b038c168452909152902054858110156130aa5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e736665720000000000000000000000000000000000000000000060648201526084016107bf565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906130e9908490614b4f565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610bc8848a8a8a8a8a6138af565b600054610100900460ff166131b45760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611fc0816139f2565b600054610100900460ff16611e8e5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b600054610100900460ff166132935760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611c196139fe565b600054610100900460ff16611c195760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b600054610100900460ff166133715760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b610166805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03831690811790915560405160009033907ff6026fd4b2ac82ff1a70c6ad48ae392a9ebb9864f0df50089a32683980dd5f3f908390a450565b6000612e38836001600160a01b038416613a72565b6000612e38836001600160a01b038416613ac1565b6001600160a01b0384166134735760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016107bf565b33600061347f85613864565b9050600061348c85613864565b905060008681526065602090815260408083206001600160a01b038b168452909152812080548792906134c0908490614b4f565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613520836000898989896138af565b50505050505050565b6001600160a01b0384163b15610c71576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c81906135869089908990889088908890600401614b90565b6020604051808303816000875af19250505080156135c1575060408051601f3d908101601f191682019092526135be91810190614bee565b60015b613676576135cd614c0b565b806308c379a00361360657506135e1614c27565b806135ec5750613608565b8060405162461bcd60e51b81526004016107bf9190613c6e565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016107bf565b6001600160e01b031981167fbc197c8100000000000000000000000000000000000000000000000000000000146135205760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016107bf565b816001600160a01b0316836001600160a01b03160361379c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084016107bf565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561097457602002820191906000526020600020905b8154815260200190600101908083116138455750505050509050919050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061389e5761389e614940565b602090810291909101015292915050565b6001600160a01b0384163b15610c71576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e619061390c9089908990889088908890600401614ccf565b6020604051808303816000875af1925050508015613947575060408051601f3d908101601f1916820190925261394491810190614bee565b60015b613953576135cd614c0b565b6001600160e01b031981167ff23a6e6100000000000000000000000000000000000000000000000000000000146135205760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e7300000000000000000000000000000000000000000000000060648201526084016107bf565b6067611c7d8282614831565b600054610100900460ff16613a695760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b60648201526084016107bf565b611c1933612e54565b6000818152600183016020526040812054613ab9575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556107ed565b5060006107ed565b60008181526001830160205260408120548015613baa576000613ae5600183614d07565b8554909150600090613af990600190614d07565b9050818114613b5e576000866000018281548110613b1957613b19614940565b9060005260206000200154905080876000018481548110613b3c57613b3c614940565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080613b6f57613b6f614d1a565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506107ed565b60009150506107ed565b80356001600160a01b038116811461121b57600080fd5b60008060408385031215613bde57600080fd5b613be783613bb4565b946020939093013593505050565b6001600160e01b031981168114611fc057600080fd5b600060208284031215613c1d57600080fd5b8135612e3881613bf5565b6000815180845260005b81811015613c4e57602081850181015186830182015201613c32565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000612e386020830184613c28565b600060208284031215613c9357600080fd5b5035919050565b600060208284031215613cac57600080fd5b612e3882613bb4565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715613cf157613cf1613cb5565b6040525050565b600082601f830112613d0957600080fd5b813567ffffffffffffffff811115613d2357613d23613cb5565b604051613d3a6020601f19601f8501160182613ccb565b818152846020838601011115613d4f57600080fd5b816020850160208301376000918101602001919091529392505050565b600067ffffffffffffffff821115613d8657613d86613cb5565b5060051b60200190565b600082601f830112613da157600080fd5b81356020613dae82613d6c565b604051613dbb8282613ccb565b83815260059390931b8501820192828101915086841115613ddb57600080fd5b8286015b84811015613dfd57613df081613bb4565b8352918301918301613ddf565b509695505050505050565b8015158114611fc057600080fd5b803561121b81613e08565b600080600080600080600080610100898b031215613e3e57600080fd5b883567ffffffffffffffff80821115613e5657600080fd5b613e628c838d01613cf8565b995060208b0135915080821115613e7857600080fd5b613e848c838d01613cf8565b9850613e9260408c01613bb4565b975060608b01359650613ea760808c01613bb4565b955060a08b0135915080821115613ebd57600080fd5b50613eca8b828c01613d90565b935050613ed960c08a01613e16565b9150613ee760e08a01613bb4565b90509295985092959890939650565b60008083601f840112613f0857600080fd5b50813567ffffffffffffffff811115613f2057600080fd5b6020830191508360208260051b8501011115610d3d57600080fd5b600080600080600060608688031215613f5357600080fd5b85359450602086013567ffffffffffffffff80821115613f7257600080fd5b613f7e89838a01613ef6565b90965094506040880135915080821115613f9757600080fd5b50613fa488828901613ef6565b969995985093965092949392505050565b600060208284031215613fc757600080fd5b8135612e3881613e08565b60008060408385031215613fe557600080fd5b50508035926020909101359150565b60008083601f84011261400657600080fd5b50813567ffffffffffffffff81111561401e57600080fd5b602083019150836020828501011115610d3d57600080fd5b60008060008060008060008060a0898b03121561405257600080fd5b883567ffffffffffffffff8082111561406a57600080fd5b6140768c838d01613ff4565b909a50985060208b013591508082111561408f57600080fd5b61409b8c838d01613ef6565b909850965060408b01359150808211156140b457600080fd5b506140c18b828c01613ef6565b90955093506140d4905060608a01613bb4565b9150608089013590509295985092959890939650565b600082601f8301126140fb57600080fd5b8135602061410882613d6c565b6040516141158282613ccb565b83815260059390931b850182019282810191508684111561413557600080fd5b8286015b84811015613dfd5780358352918301918301614139565b600080600080600060a0868803121561416857600080fd5b61417186613bb4565b945061417f60208701613bb4565b9350604086013567ffffffffffffffff8082111561419c57600080fd5b6141a889838a016140ea565b945060608801359150808211156141be57600080fd5b6141ca89838a016140ea565b935060808801359150808211156141e057600080fd5b506141ed88828901613cf8565b9150509295509295909350565b60008060008060008060008060008060a08b8d03121561421957600080fd5b8a3567ffffffffffffffff8082111561423157600080fd5b61423d8e838f01613ef6565b909c509a5060208d013591508082111561425657600080fd5b6142628e838f01613ef6565b909a50985060408d013591508082111561427b57600080fd5b6142878e838f01613ef6565b909850965060608d01359150808211156142a057600080fd5b6142ac8e838f01613ef6565b909650945060808d01359150808211156142c557600080fd5b506142d28d828e01613ef6565b915080935050809150509295989b9194979a5092959850565b60008060008060006060868803121561430357600080fd5b61430c86613bb4565b9450602086013567ffffffffffffffff80821115613f7257600080fd5b6000806000806000806060878903121561434257600080fd5b863567ffffffffffffffff8082111561435a57600080fd5b6143668a838b01613ef6565b9098509650602089013591508082111561437f57600080fd5b61438b8a838b01613ef6565b909650945060408901359150808211156143a457600080fd5b506143b189828a01613ef6565b979a9699509497509295939492505050565b600080600080600080606087890312156143dc57600080fd5b863567ffffffffffffffff808211156143f457600080fd5b6143668a838b01613ff4565b6000806040838503121561441357600080fd5b823567ffffffffffffffff8082111561442b57600080fd5b61443786838701613d90565b9350602085013591508082111561444d57600080fd5b5061445a858286016140ea565b9150509250929050565b600081518084526020808501945080840160005b8381101561449457815187529582019590820190600101614478565b509495945050505050565b602081526000612e386020830184614464565b6000806000604084860312156144c757600080fd5b833567ffffffffffffffff8111156144de57600080fd5b6144ea86828701613ef6565b90945092505060208401356144fe81613e08565b809150509250925092565b60008060008060006060868803121561452157600080fd5b85359450602086013567ffffffffffffffff8082111561454057600080fd5b61454c89838a01613ff4565b9096509450604088013591508082111561456557600080fd5b50613fa488828901613ff4565b60008060006040848603121561458757600080fd5b83359250602084013567ffffffffffffffff8111156145a557600080fd5b6145b186828701613ff4565b9497909650939450505050565b600080604083850312156145d157600080fd5b823591506145e160208401613bb4565b90509250929050565b6000806000606084860312156145ff57600080fd5b8335925061460f60208501613bb4565b9150604084013590509250925092565b6000806040838503121561463257600080fd5b61463b83613bb4565b9150602083013561464b81613e08565b809150509250929050565b6020808252825182820181905260009190848201906040850190845b818110156146975783516001600160a01b031683529284019291840191600101614672565b50909695505050505050565b60208152815115156020820152600060208301516040808401526146ca6060840182613c28565b949350505050565b6000806000606084860312156146e757600080fd5b83359250602084013567ffffffffffffffff81111561470557600080fd5b61471186828701613d90565b92505060408401356144fe81613e08565b6000806040838503121561473557600080fd5b61473e83613bb4565b91506145e160208401613bb4565b600080600080600060a0868803121561476457600080fd5b61476d86613bb4565b945061477b60208701613bb4565b93506040860135925060608601359150608086013567ffffffffffffffff8111156147a557600080fd5b6141ed88828901613cf8565b600181811c908216806147c557607f821691505b6020821081036147e557634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115611ca257600081815260208120601f850160051c810160208610156148125750805b601f850160051c820191505b81811015610c715782815560010161481e565b815167ffffffffffffffff81111561484b5761484b613cb5565b61485f8161485984546147b1565b846147eb565b602080601f831160018114614894576000841561487c5750858301515b600019600386901b1c1916600185901b178555610c71565b600085815260208120601f198616915b828110156148c3578886015182559484019460019091019084016148a4565b50858210156148e15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b60008261492457634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176107ed576107ed6148f1565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261496d57600080fd5b83018035915067ffffffffffffffff82111561498857600080fd5b602001915036819003821315610d3d57600080fd5b6000808335601e198436030181126149b457600080fd5b83018035915067ffffffffffffffff8211156149cf57600080fd5b6020019150600581901b3603821315610d3d57600080fd5b600060001982036149fa576149fa6148f1565b5060010190565b600060208284031215614a1357600080fd5b8151612e3881613e08565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b604081526000614a5d604083018688614a1e565b8281036020840152614a70818587614a1e565b979650505050505050565b67ffffffffffffffff831115614a9357614a93613cb5565b614aa783614aa183546147b1565b836147eb565b6000601f841160018114614adb5760008515614ac35750838201355b600019600387901b1c1916600186901b178355610f2c565b600083815260209020601f19861690835b82811015614b0c5786850135825560209485019460019092019101614aec565b5086821015614b295760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6020815260006146ca602083018486614a1e565b808201808211156107ed576107ed6148f1565b604081526000614b756040830185614464565b8281036020840152614b878185614464565b95945050505050565b60006001600160a01b03808816835280871660208401525060a06040830152614bbc60a0830186614464565b8281036060840152614bce8186614464565b90508281036080840152614be28185613c28565b98975050505050505050565b600060208284031215614c0057600080fd5b8151612e3881613bf5565b600060033d1115614c245760046000803e5060005160e01c5b90565b600060443d1015614c355790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff8160248401118184111715614c8357505050505090565b8285019150815181811115614c9b5750505050505090565b843d8701016020828501011115614cb55750505050505090565b614cc460208286010187613ccb565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152614a7060a0830184613c28565b818103818111156107ed576107ed6148f1565b634e487b7160e01b600052603160045260246000fdfea264697066735822122067f5d42f0fbfdcc3a666cbd5bf4c8ab7e2d9a871746527385bbc78480828e48d64736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : disable (bool): True
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000001
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.