Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
SeizonZenith
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol';
import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol';
import '@chocolate-factory/contracts/admin-manager/AdminManagerUpgradable.sol';
import '@chocolate-factory/contracts/admin-mint/AdminMintUpgradable.sol';
import '@chocolate-factory/contracts/uri-manager/UriManagerUpgradable.sol';
import '@chocolate-factory/contracts/royalties/RoyaltiesUpgradable.sol';
import 'operator-filter-registry/src/upgradeable/DefaultOperatorFiltererUpgradeable.sol';
import './interfaces/ISeizon.sol';
import './interfaces/ISeizonU .sol';
import './interfaces/IERC6551Registry.sol';
import './interfaces/IAccountProxy.sol';
contract SeizonZenith is
Initializable,
OwnableUpgradeable,
ERC1155Upgradeable,
AdminMintUpgradable,
RoyaltiesUpgradable,
DefaultOperatorFiltererUpgradeable
{
string public constant name = 'SEIZON - ZENITH';
uint256 public constant TOKEN_ID = 1;
IERC6551Registry public constant ERC_6551_REGISTRY =
IERC6551Registry(0x000000006551c19487814612e58FE06813775758);
address public constant TOKEN_BOUND_ACCOUNT_PROXY =
0x55266d75D1a14E4572138116aF39863Ed6596E7F;
address public constant TOKEN_BOUND_ACCOUNT_IMPLEMENTATION =
0x41C8f39463A868d3A88af00cd0fe7102F30E44eC;
ISeizon public seizon;
ISeizonU public seizonU;
mapping(uint256 => bool) public mintedTokenIds;
mapping(uint256 => bool) public blockedTokenIds;
event MintSeizonL2(uint256 indexed tokenId);
function initialize(
address royaltiesRecipient_,
uint256 royaltiesValue_,
string calldata uri_
) public initializer {
__Ownable_init_unchained();
__ERC1155_init_unchained(uri_);
__AdminManager_init_unchained();
__AdminMint_init_unchained();
__Royalties_init_unchained(royaltiesRecipient_, royaltiesValue_);
__DefaultOperatorFilterer_init();
}
function initializeV2(
address seizonAddress_,
address seizonUAddress_
) public reinitializer(2) {
seizon = ISeizon(seizonAddress_);
seizonU = ISeizonU(seizonUAddress_);
blockedTokenIds[225] = true;
blockedTokenIds[1557] = true;
blockedTokenIds[1998] = true;
blockedTokenIds[2364] = true;
blockedTokenIds[3240] = true;
blockedTokenIds[3449] = true;
blockedTokenIds[3549] = true;
blockedTokenIds[3824] = true;
blockedTokenIds[4745] = true;
blockedTokenIds[4762] = true;
blockedTokenIds[5385] = true;
blockedTokenIds[5631] = true;
blockedTokenIds[5924] = true;
blockedTokenIds[6763] = true;
blockedTokenIds[6815] = true;
blockedTokenIds[6865] = true;
blockedTokenIds[6902] = true;
blockedTokenIds[7224] = true;
blockedTokenIds[7252] = true;
}
function _adminMint(address account_, uint256 amount_) internal override {
uint256[] memory ids = new uint256[](1);
uint256[] memory amounts = new uint256[](1);
ids[0] = TOKEN_ID;
amounts[0] = amount_;
_mintBatch(account_, ids, amounts, '');
}
function queryMinted(
uint256[] calldata tokenIds_
) external view returns (bool[] memory) {
uint256 tokenIdsLength = tokenIds_.length;
bool[] memory minted = new bool[](tokenIdsLength);
for (uint256 i = 0; i < tokenIdsLength; i++) {
minted[i] = mintedTokenIds[tokenIds_[i]];
}
return minted;
}
function mintSeizonL2(uint256 tokenId_) external onlyEOA {
require(
seizon.ownerOf(tokenId_) == msg.sender,
"You don't own the requested token"
);
require(!blockedTokenIds[tokenId_], "The requested token can't be minted");
require(
!mintedTokenIds[tokenId_],
'The requested token was already minted'
);
mintedTokenIds[tokenId_] = true;
_burn(msg.sender, TOKEN_ID, 1);
address tokenBoundAccountAddress = ERC_6551_REGISTRY.createAccount(
TOKEN_BOUND_ACCOUNT_PROXY,
bytes32(0),
block.chainid,
address(seizon),
tokenId_
);
IAccountProxy tokenBoundAccount = IAccountProxy(tokenBoundAccountAddress);
tokenBoundAccount.initialize(TOKEN_BOUND_ACCOUNT_IMPLEMENTATION);
seizonU.mint(tokenBoundAccountAddress, tokenId_);
emit MintSeizonL2(tokenId_);
}
function setURI(string calldata uri_) external onlyAdmin {
_setURI(uri_);
}
function setSeizon(address seizonAddress_) public onlyAdmin {
seizon = ISeizon(seizonAddress_);
}
function supportsInterface(
bytes4 interfaceId
)
public
view
virtual
override(RoyaltiesUpgradable, ERC1155Upgradeable)
returns (bool)
{
return
RoyaltiesUpgradable.supportsInterface(interfaceId) ||
ERC1155Upgradeable.supportsInterface(interfaceId);
}
function setApprovalForAll(
address operator,
bool approved
) public override onlyAllowedOperatorApproval(operator) {
super.setApprovalForAll(operator, approved);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
uint256 amount,
bytes memory data
) public override onlyAllowedOperator(from) {
super.safeTransferFrom(from, to, tokenId, amount, data);
}
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override onlyAllowedOperator(from) {
super.safeBatchTransferFrom(from, to, ids, amounts, data);
}
modifier onlyEOA() {
require(tx.origin == msg.sender, 'Only EOA allowed');
_;
}
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
contract AdminManagerUpgradable is Initializable {
mapping(address => bool) private _admins;
function __AdminManager_init() internal onlyInitializing {
__AdminManager_init_unchained();
}
function __AdminManager_init_unchained() internal onlyInitializing {
_admins[msg.sender] = true;
}
function setAdminPermissions(address account_, bool enable_)
external
onlyAdmin
{
_admins[account_] = enable_;
}
function isAdmin(address account_) public view returns (bool) {
return _admins[account_];
}
modifier onlyAdmin() {
require(isAdmin(msg.sender), "Not an admin");
_;
}
uint256[49] private __gap;
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "../admin-manager/AdminManagerUpgradable.sol";
abstract contract AdminMintUpgradable is Initializable, AdminManagerUpgradable {
function __AdminMint_init() internal onlyInitializing {
__AdminManager_init_unchained();
__AdminMint_init_unchained();
}
function __AdminMint_init_unchained() internal onlyInitializing {}
function adminMint(
address[] calldata accounts_,
uint256[] calldata amounts_
) external onlyAdmin {
uint256 accountsLength = accounts_.length;
require(accountsLength == amounts_.length, "Admin mint: bad request");
for (uint256 i; i < accountsLength; i++) {
_adminMint(accounts_[i], amounts_[i]);
}
}
function _adminMint(address account_, uint256 amount_) internal virtual;
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
interface IERC2981Royalties {
function royaltyInfo(uint256 tokenId_, uint256 value_)
external
view
returns (address receiver, uint256 royaltyAmount);
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import "../admin-manager/AdminManagerUpgradable.sol";
import "./IERC2981Royalties.sol";
contract RoyaltiesUpgradable is
Initializable,
ERC165Upgradeable,
IERC2981Royalties,
AdminManagerUpgradable
{
struct RoyaltyInfo {
address recipient;
uint24 amount;
}
RoyaltyInfo private _royalties;
uint256 constant maxValue = 10000;
event RoyaltiesSet(address recipient, uint256 amount);
function __Royalties_init(address recipient_, uint256 amount_)
internal
onlyInitializing
{
__AdminManager_init_unchained();
__Royalties_init_unchained(recipient_, amount_);
}
function __Royalties_init_unchained(address recipient_, uint256 amount_)
internal
onlyInitializing
{
_setRoyalties(recipient_, amount_);
}
function _setRoyalties(address recipient_, uint256 amount_) internal {
require(amount_ <= maxValue, "Royalties: value is too high");
_royalties = RoyaltyInfo(recipient_, uint24(amount_));
emit RoyaltiesSet(recipient_, amount_);
}
function setRoyalties(address recipient_, uint256 amount_)
external
onlyAdmin
{
_setRoyalties(recipient_, amount_);
}
function royaltyInfo(uint256, uint256 value_)
external
view
override
returns (address receiver, uint256 royaltyAmount)
{
RoyaltyInfo memory royalties = _royalties;
receiver = royalties.recipient;
royaltyAmount = (value_ * royalties.amount) / maxValue;
}
function supportsInterface(bytes4 interfaceId_)
public
view
virtual
override
returns (bool)
{
return
interfaceId_ == type(IERC2981Royalties).interfaceId ||
super.supportsInterface(interfaceId_);
}
uint256[49] private __gap;
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "../admin-manager/AdminManagerUpgradable.sol";
contract UriManagerUpgradable is Initializable, AdminManagerUpgradable {
using StringsUpgradeable for uint256;
string internal _prefix;
string internal _suffix;
function prefix() public view returns (string memory) {
return _prefix;
}
function suffix() public view returns (string memory) {
return _suffix;
}
function __UriManager_init(string memory prefix_, string memory suffix_)
internal
onlyInitializing
{
__AdminManager_init_unchained();
__UriManager_init_unchained(prefix_, suffix_);
}
function __UriManager_init_unchained(
string memory prefix_,
string memory suffix_
) internal onlyInitializing {
_prefix = prefix_;
_suffix = suffix_;
}
function _buildUri(uint256 tokenId) internal view returns (string memory) {
return string(abi.encodePacked(_prefix, tokenId.toString(), _suffix));
}
function setPrefix(string calldata prefix_) external onlyAdmin {
_prefix = prefix_;
}
function setSuffix(string calldata suffix_) external onlyAdmin {
_suffix = suffix_;
}
uint256[48] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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
// OpenZeppelin Contracts (last updated v4.9.0) (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]
* ```solidity
* 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.9.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
// 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 (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 (last updated v4.9.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.9.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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [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://consensys.net/diligence/blog/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.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
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
// 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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library MathUpgradeable {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMathUpgradeable {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/MathUpgradeable.sol";
import "./math/SignedMathUpgradeable.sol";
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = MathUpgradeable.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, MathUpgradeable.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface IAccountProxy {
function initialize(address implementation) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface IERC6551Registry {
function createAccount(
address implementation,
bytes32 salt,
uint256 chainId,
address tokenContract,
uint256 tokenId
) external returns (address account);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface ISeizon {
function ownerOf(uint256 tokenId) external view returns (address owner);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface ISeizonU {
function mint(address to_, uint256 tokenId_) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface IOperatorFilterRegistry {
/**
* @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns
* true if supplied registrant address is not registered.
*/
function isOperatorAllowed(address registrant, address operator) external view returns (bool);
/**
* @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner.
*/
function register(address registrant) external;
/**
* @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes.
*/
function registerAndSubscribe(address registrant, address subscription) external;
/**
* @notice Registers an address with the registry and copies the filtered operators and codeHashes from another
* address without subscribing.
*/
function registerAndCopyEntries(address registrant, address registrantToCopy) external;
/**
* @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner.
* Note that this does not remove any filtered addresses or codeHashes.
* Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes.
*/
function unregister(address addr) external;
/**
* @notice Update an operator address for a registered address - when filtered is true, the operator is filtered.
*/
function updateOperator(address registrant, address operator, bool filtered) external;
/**
* @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates.
*/
function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
/**
* @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered.
*/
function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
/**
* @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates.
*/
function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
/**
* @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous
* subscription if present.
* Note that accounts with subscriptions may go on to subscribe to other accounts - in this case,
* subscriptions will not be forwarded. Instead the former subscription's existing entries will still be
* used.
*/
function subscribe(address registrant, address registrantToSubscribe) external;
/**
* @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes.
*/
function unsubscribe(address registrant, bool copyExistingEntries) external;
/**
* @notice Get the subscription address of a given registrant, if any.
*/
function subscriptionOf(address addr) external returns (address registrant);
/**
* @notice Get the set of addresses subscribed to a given registrant.
* Note that order is not guaranteed as updates are made.
*/
function subscribers(address registrant) external returns (address[] memory);
/**
* @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant.
* Note that order is not guaranteed as updates are made.
*/
function subscriberAt(address registrant, uint256 index) external returns (address);
/**
* @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr.
*/
function copyEntriesOf(address registrant, address registrantToCopy) external;
/**
* @notice Returns true if operator is filtered by a given address or its subscription.
*/
function isOperatorFiltered(address registrant, address operator) external returns (bool);
/**
* @notice Returns true if the hash of an address's code is filtered by a given address or its subscription.
*/
function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
/**
* @notice Returns true if a codeHash is filtered by a given address or its subscription.
*/
function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
/**
* @notice Returns a list of filtered operators for a given address or its subscription.
*/
function filteredOperators(address addr) external returns (address[] memory);
/**
* @notice Returns the set of filtered codeHashes for a given address or its subscription.
* Note that order is not guaranteed as updates are made.
*/
function filteredCodeHashes(address addr) external returns (bytes32[] memory);
/**
* @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or
* its subscription.
* Note that order is not guaranteed as updates are made.
*/
function filteredOperatorAt(address registrant, uint256 index) external returns (address);
/**
* @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or
* its subscription.
* Note that order is not guaranteed as updates are made.
*/
function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
/**
* @notice Returns true if an address has registered
*/
function isRegistered(address addr) external returns (bool);
/**
* @dev Convenience method to compute the code hash of an arbitrary contract
*/
function codeHashOf(address addr) external returns (bytes32);
}// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E; address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import {OperatorFiltererUpgradeable} from "./OperatorFiltererUpgradeable.sol";
import {CANONICAL_CORI_SUBSCRIPTION} from "../lib/Constants.sol";
/**
* @title DefaultOperatorFiltererUpgradeable
* @notice Inherits from OperatorFiltererUpgradeable and automatically subscribes to the default OpenSea subscription
* when the init function is called.
*/
abstract contract DefaultOperatorFiltererUpgradeable is OperatorFiltererUpgradeable {
/// @dev The upgradeable initialize function that should be called when the contract is being deployed.
function __DefaultOperatorFilterer_init() internal onlyInitializing {
OperatorFiltererUpgradeable.__OperatorFilterer_init(CANONICAL_CORI_SUBSCRIPTION, true);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import {IOperatorFilterRegistry} from "../IOperatorFilterRegistry.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
/**
* @title OperatorFiltererUpgradeable
* @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
* registrant's entries in the OperatorFilterRegistry when the init function is called.
* @dev This smart contract is meant to be inherited by token contracts so they can use the following:
* - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
* - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
*/
abstract contract OperatorFiltererUpgradeable is Initializable {
/// @notice Emitted when an operator is not allowed.
error OperatorNotAllowed(address operator);
IOperatorFilterRegistry constant OPERATOR_FILTER_REGISTRY =
IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);
/// @dev The upgradeable initialize function that should be called when the contract is being upgraded.
function __OperatorFilterer_init(address subscriptionOrRegistrantToCopy, bool subscribe)
internal
onlyInitializing
{
// If an inheriting token contract is deployed to a network without the registry deployed, the modifier
// will not revert, but the contract will need to be registered with the registry once it is deployed in
// order for the modifier to filter addresses.
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
if (!OPERATOR_FILTER_REGISTRY.isRegistered(address(this))) {
if (subscribe) {
OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
} else {
if (subscriptionOrRegistrantToCopy != address(0)) {
OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
} else {
OPERATOR_FILTER_REGISTRY.register(address(this));
}
}
}
}
}
/**
* @dev A helper modifier to check if the operator is allowed.
*/
modifier onlyAllowedOperator(address from) virtual {
// Allow spending tokens from addresses with balance
// Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
// from an EOA.
if (from != msg.sender) {
_checkFilterOperator(msg.sender);
}
_;
}
/**
* @dev A helper modifier to check if the operator approval is allowed.
*/
modifier onlyAllowedOperatorApproval(address operator) virtual {
_checkFilterOperator(operator);
_;
}
/**
* @dev A helper function to check if the operator is allowed.
*/
function _checkFilterOperator(address operator) internal view virtual {
// Check registry code length to facilitate testing in environments without a deployed registry.
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
// under normal circumstances, this function will revert rather than return false, but inheriting or
// upgraded contracts may specify their own OperatorFilterRegistry implementations, which may behave
// differently
if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
revert OperatorNotAllowed(operator);
}
}
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"MintSeizonL2","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":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RoyaltiesSet","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":"ERC_6551_REGISTRY","outputs":[{"internalType":"contract IERC6551Registry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_BOUND_ACCOUNT_IMPLEMENTATION","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_BOUND_ACCOUNT_PROXY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts_","type":"address[]"},{"internalType":"uint256[]","name":"amounts_","type":"uint256[]"}],"name":"adminMint","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":"uint256","name":"","type":"uint256"}],"name":"blockedTokenIds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"royaltiesRecipient_","type":"address"},{"internalType":"uint256","name":"royaltiesValue_","type":"uint256"},{"internalType":"string","name":"uri_","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seizonAddress_","type":"address"},{"internalType":"address","name":"seizonUAddress_","type":"address"}],"name":"initializeV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"mintSeizonL2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintedTokenIds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":[{"internalType":"uint256[]","name":"tokenIds_","type":"uint256[]"}],"name":"queryMinted","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"value_","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":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"seizon","outputs":[{"internalType":"contract ISeizon","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"seizonU","outputs":[{"internalType":"contract ISeizonU","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account_","type":"address"},{"internalType":"bool","name":"enable_","type":"bool"}],"name":"setAdminPermissions","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":"recipient_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"setRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"seizonAddress_","type":"address"}],"name":"setSeizon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"setURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50613197806100206000396000f3fe608060405234801561001057600080fd5b50600436106101e45760003560e01c8063891214481161010f578063a49340cc116100a2578063e985e9c511610071578063e985e9c5146104a8578063ece527ae146104e4578063f242432a146104f7578063f2fde38b1461050a57600080fd5b8063a49340cc14610443578063b45a79f214610456578063b725120114610469578063b95b63f81461048457600080fd5b806395b82c13116100de57806395b82c13146103d857806396cf1d4d146103fc57806399d1e1a814610410578063a22cb4651461043057600080fd5b8063891214481461039157806389a89002146103ac5780638c7ea24b146103b45780638da5cb5b146103c757600080fd5b8063240ff27f116101875780634e1273f4116101565780634e1273f41461033f5780636caefed11461035f578063715018a61461037657806381d609561461037e57600080fd5b8063240ff27f146102d457806324d7806c146102e75780632a55205a146102fa5780632eb2c2d61461032c57600080fd5b806306fdde03116101c357806306fdde03146102475780630840ba72146102825780630e89341c146102955780631993f811146102a857600080fd5b8062fdd58e146101e957806301ffc9a71461020f57806302fe530514610232575b600080fd5b6101fc6101f736600461249c565b61051d565b6040519081526020015b60405180910390f35b61022261021d3660046124de565b6105b8565b6040519015158152602001610206565b61024561024036600461254a565b6105d2565b005b6102756040518060400160405280600f81526020016e0a68a92b49e9c405a40b48a9c92a89608b1b81525081565b60405161020691906125d1565b6102456102903660046125e4565b61063a565b6102756102a336600461261d565b610a20565b61015f546102bc906001600160a01b031681565b6040516001600160a01b039091168152602001610206565b6102456102e2366004612644565b610ab4565b6102226102f5366004612672565b610b04565b61030d61030836600461268f565b610b22565b604080516001600160a01b039093168352602083019190915201610206565b61024561033a3660046127fa565b610b78565b61035261034d3660046128a7565b610ba7565b60405161020691906129a4565b6102bc6f6551c19487814612e58fe0681377575881565b610245610cd0565b61024561038c3660046129b7565b610ce4565b6102bc7341c8f39463a868d3a88af00cd0fe7102f30e44ec81565b6101fc600181565b6102456103c236600461249c565b610e13565b6033546001600160a01b03166102bc565b6102226103e636600461261d565b6101626020526000908152604090205460ff1681565b610160546102bc906001600160a01b031681565b61042361041e366004612a56565b610e42565b6040516102069190612a8b565b61024561043e366004612644565b610f0d565b610245610451366004612ad1565b610f26565b61024561046436600461261d565b611000565b6102bc7355266d75d1a14e4572138116af39863ed6596e7f81565b61022261049236600461261d565b6101616020526000908152604090205460ff1681565b6102226104b63660046125e4565b6001600160a01b03918216600090815260986020908152604080832093909416825291909152205460ff1690565b6102456104f2366004612672565b6113cc565b610245610505366004612b30565b611414565b610245610518366004612672565b61143b565b60006001600160a01b03831661058d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526097602090815260408083206001600160a01b03861684529091529020545b92915050565b60006105c3826114b4565b806105b257506105b2826114d5565b6105db33610b04565b6105f75760405162461bcd60e51b815260040161058490612b98565b61063682828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061152592505050565b5050565b600054600290610100900460ff1615801561065c575060005460ff8083169116105b6106785760405162461bcd60e51b815260040161058490612bbe565b6000805461015f80546001600160a01b038781166001600160a01b03199283161790925561016080549287169290911691909117905561016260209081527f737b7b094f71a48bf37aefb211463eba903e09dcd784e8c7a7a44cf7ed34434d805460ff1990811660019081179092557f765145cc59b6093bd87e27b2350236b5ea3484d01884859f975a2ddb699a602b80548216831790557f60c5e47dc6aa4fd5f7c36374a422359c22fb283b44b995177ae0624f2cd5559f80548216831790557f61a300934f54e6a16db4bcf13c13dbe30feacacc0b59a3e093d38959fca978fc80548216831790557ff38c0219cbadc268aad3a383f06bb926e20d9b377d70d1ea6e61af179bbbb72d80548216831790557f025a90ce8d8ccbb436cd42674c5cc7f1a783986ca2874f4a86817d09a01b2b0280548216831790557ffc22627fa7dd28c549de44d423fd589ea1c6022b71a8ecaf86fe227930a125a080548216831790557f92e58627c8e195366e422d6b5de05e148acd74f8245897edf4c3887ae209650380548216831790557ff70938bb8c74b5e1beb0991456611162005164e708506efaf9ccf59c38d1640480548216831790557ff6888b4905a46830db7173223655b72535893bc31005ae4d66e019e1f9ef325980548216831790557fcf848f53c65641584569aa4c83e8d79db7bf0a07136470d8b9091dc8bb80fdf180548216831790557f481e7ec82f75148c6991e730c59c2b04dcb149c3207802dbc10ebd2de7b1f17580548216831790557f384ea740e1a06f0082b8fa75161a01d2da624b65e5fcf15fefa5738558f7cf6380548216831790557f884681cf1617bd96a113ef4f2321def609e681bb1495049135c082ed9f05a3fa80548216831790557f1efb5774349450f75d0a02fbb42bdeff3842266a78726fde65e9e5454d43390780548216831790557f50d80290b47b6f3a6095f727a27f874a25918e84152f0d5ef9a78a1c2a4563fe80548216831790557f9c971867ba9f5c61c54a11f92d614f71d4efc898fe08473f928b4841225efbe080548216831790557fe16faf3a011a341d3a15c6422b963f2db6a26787cf9a3d439c2e76cf90cd0e118054821683179055611c5485527f36591685258600f4fdf731c38cf9075a580e587a6a784a13f707314edde390f38054909116909117905561ffff1990911660ff84169081176101001761ff0019169092556040519182527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498910160405180910390a1505050565b606060998054610a2f90612c0c565b80601f0160208091040260200160405190810160405280929190818152602001828054610a5b90612c0c565b8015610aa85780601f10610a7d57610100808354040283529160200191610aa8565b820191906000526020600020905b815481529060010190602001808311610a8b57829003601f168201915b50505050509050919050565b610abd33610b04565b610ad95760405162461bcd60e51b815260040161058490612b98565b6001600160a01b0391909116600090815260c960205260409020805460ff1916911515919091179055565b6001600160a01b0316600090815260c9602052604090205460ff1690565b6040805180820190915261012d546001600160a01b038116808352600160a01b90910462ffffff1660208301819052909160009161271090610b649086612c5c565b610b6e9190612c73565b9150509250929050565b846001600160a01b0381163314610b9257610b9233611531565b610b9f86868686866115ea565b505050505050565b60608151835114610c0c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610584565b600083516001600160401b03811115610c2757610c276126b1565b604051908082528060200260200182016040528015610c50578160200160208202803683370190505b50905060005b8451811015610cc857610c9b858281518110610c7457610c74612c95565b6020026020010151858381518110610c8e57610c8e612c95565b602002602001015161051d565b828281518110610cad57610cad612c95565b6020908102919091010152610cc181612cab565b9050610c56565b509392505050565b610cd861162f565b610ce26000611689565b565b600054610100900460ff1615808015610d045750600054600160ff909116105b80610d1e5750303b158015610d1e575060005460ff166001145b610d3a5760405162461bcd60e51b815260040161058490612bbe565b6000805460ff191660011790558015610d5d576000805461ff0019166101001790555b610d656116db565b610da483838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061170b92505050565b610dac61173b565b610db461177e565b610dbe85856117a5565b610dc66117cc565b8015610e0c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b610e1c33610b04565b610e385760405162461bcd60e51b815260040161058490612b98565b6106368282611812565b6060816000816001600160401b03811115610e5f57610e5f6126b1565b604051908082528060200260200182016040528015610e88578160200160208202803683370190505b50905060005b82811015610f04576101616000878784818110610ead57610ead612c95565b90506020020135815260200190815260200160002060009054906101000a900460ff16828281518110610ee257610ee2612c95565b9115156020928302919091019091015280610efc81612cab565b915050610e8e565b50949350505050565b81610f1781611531565b610f2183836118e1565b505050565b610f2f33610b04565b610f4b5760405162461bcd60e51b815260040161058490612b98565b82818114610f9b5760405162461bcd60e51b815260206004820152601760248201527f41646d696e206d696e743a2062616420726571756573740000000000000000006044820152606401610584565b60005b81811015610b9f57610fee868683818110610fbb57610fbb612c95565b9050602002016020810190610fd09190612672565b858584818110610fe257610fe2612c95565b905060200201356118ec565b80610ff881612cab565b915050610f9e565b3233146110425760405162461bcd60e51b815260206004820152601060248201526f13db9b1e481153d048185b1b1bddd95960821b6044820152606401610584565b61015f546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa15801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612cc4565b6001600160a01b0316146111105760405162461bcd60e51b815260206004820152602160248201527f596f7520646f6e2774206f776e207468652072657175657374656420746f6b656044820152603760f91b6064820152608401610584565b6000818152610162602052604090205460ff161561117c5760405162461bcd60e51b815260206004820152602360248201527f5468652072657175657374656420746f6b656e2063616e2774206265206d696e6044820152621d195960ea1b6064820152608401610584565b6000818152610161602052604090205460ff16156111eb5760405162461bcd60e51b815260206004820152602660248201527f5468652072657175657374656420746f6b656e2077617320616c7265616479206044820152651b5a5b9d195960d21b6064820152608401610584565b600081815261016160205260409020805460ff1916600190811790915561121490339080611993565b61015f54604051638a54c52f60e01b81527355266d75d1a14e4572138116af39863ed6596e7f60048201526000602482018190524660448301526001600160a01b039092166064820152608481018390526f6551c19487814612e58fe0681377575890638a54c52f9060a4016020604051808303816000875af115801561129f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c39190612cc4565b60405163189acdbd60e31b81527341c8f39463a868d3a88af00cd0fe7102f30e44ec600482015290915081906001600160a01b0382169063c4d66de890602401600060405180830381600087803b15801561131d57600080fd5b505af1158015611331573d6000803e3d6000fd5b5050610160546040516340c10f1960e01b81526001600160a01b0386811660048301526024820188905290911692506340c10f199150604401600060405180830381600087803b15801561138457600080fd5b505af1158015611398573d6000803e3d6000fd5b50506040518592507f9c2099e1a27fdca8683455c754c645b6d98286e26fa3660c13a26e24c68793159150600090a2505050565b6113d533610b04565b6113f15760405162461bcd60e51b815260040161058490612b98565b61015f80546001600160a01b0319166001600160a01b0392909216919091179055565b846001600160a01b038116331461142e5761142e33611531565b610b9f8686868686611b17565b61144361162f565b6001600160a01b0381166114a85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610584565b6114b181611689565b50565b60006001600160e01b0319821663152a902d60e11b14806105b257506105b2825b60006001600160e01b03198216636cdb3d1360e11b148061150657506001600160e01b031982166303a24d0760e21b145b806105b257506301ffc9a760e01b6001600160e01b03198316146105b2565b60996106368282612d27565b6daaeb6d7670e522a718067333cd4e3b156114b157604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa15801561159e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c29190612de6565b6114b157604051633b79c77360e21b81526001600160a01b0382166004820152602401610584565b6001600160a01b038516331480611606575061160685336104b6565b6116225760405162461bcd60e51b815260040161058490612e03565b610e0c8585858585611b5c565b6033546001600160a01b03163314610ce25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610584565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166117025760405162461bcd60e51b815260040161058490612e51565b610ce233611689565b600054610100900460ff166117325760405162461bcd60e51b815260040161058490612e51565b6114b181611525565b600054610100900460ff166117625760405162461bcd60e51b815260040161058490612e51565b33600090815260c960205260409020805460ff19166001179055565b600054610100900460ff16610ce25760405162461bcd60e51b815260040161058490612e51565b600054610100900460ff16610e385760405162461bcd60e51b815260040161058490612e51565b600054610100900460ff166117f35760405162461bcd60e51b815260040161058490612e51565b610ce2733cc6cdda760b79bafa08df41ecfa224f810dceb66001611cf3565b6127108111156118645760405162461bcd60e51b815260206004820152601c60248201527f526f79616c746965733a2076616c756520697320746f6f2068696768000000006044820152606401610584565b6040805180820182526001600160a01b03841680825262ffffff8416602092830181905261012d80546001600160b81b0319168317600160a01b90920291909117905582519081529081018390527f908669f35f6fb3977a956ba70597841fe541d1e8491ca3c025161e258d3bfdb6910160405180910390a15050565b610636338383611e92565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905060018260008151811061194657611946612c95565b602002602001018181525050828160008151811061196657611966612c95565b60200260200101818152505061198d84838360405180602001604052806000815250611f72565b50505050565b6001600160a01b0383166119f55760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610584565b336000611a01846120f8565b90506000611a0e846120f8565b6040805160208082018352600091829052888252609781528282206001600160a01b038b1683529052205490915084811015611a985760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610584565b60008681526097602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46040805160208101909152600090525b50505050505050565b6001600160a01b038516331480611b335750611b3385336104b6565b611b4f5760405162461bcd60e51b815260040161058490612e03565b610e0c8585858585612143565b8151835114611b7d5760405162461bcd60e51b815260040161058490612e9c565b6001600160a01b038416611ba35760405162461bcd60e51b815260040161058490612ee4565b3360005b8451811015611c8d576000858281518110611bc457611bc4612c95565b602002602001015190506000858381518110611be257611be2612c95565b60209081029190910181015160008481526097835260408082206001600160a01b038e168352909352919091205490915081811015611c335760405162461bcd60e51b815260040161058490612f29565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611c72908490612f73565b9250508190555050505080611c8690612cab565b9050611ba7565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611cdd929190612f86565b60405180910390a4610b9f818787878787612271565b600054610100900460ff16611d1a5760405162461bcd60e51b815260040161058490612e51565b6daaeb6d7670e522a718067333cd4e3b156106365760405163c3c5a54760e01b81523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af1158015611d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d9e9190612de6565b610636578015611e1257604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b158015611dfe57600080fd5b505af1158015610b9f573d6000803e3d6000fd5b6001600160a01b03821615611e615760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401611de4565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401611de4565b816001600160a01b0316836001600160a01b031603611f055760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610584565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038416611fd25760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610584565b8151835114611ff35760405162461bcd60e51b815260040161058490612e9c565b3360005b84518110156120905783818151811061201257612012612c95565b60200260200101516097600087848151811061203057612030612c95565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546120789190612f73565b9091555081905061208881612cab565b915050611ff7565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516120e1929190612f86565b60405180910390a4610e0c81600087878787612271565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061213257612132612c95565b602090810291909101015292915050565b6001600160a01b0384166121695760405162461bcd60e51b815260040161058490612ee4565b336000612175856120f8565b90506000612182856120f8565b905060008681526097602090815260408083206001600160a01b038c168452909152902054858110156121c75760405162461bcd60e51b815260040161058490612f29565b60008781526097602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612206908490612f73565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612266848a8a8a8a8a6123cc565b505050505050505050565b6001600160a01b0384163b15610b9f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906122b59089908990889088908890600401612fb4565b6020604051808303816000875af19250505080156122f0575060408051601f3d908101601f191682019092526122ed91810190613012565b60015b61239c576122fc61302f565b806308c379a003612335575061231061304b565b8061231b5750612337565b8060405162461bcd60e51b815260040161058491906125d1565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610584565b6001600160e01b0319811663bc197c8160e01b14611b0e5760405162461bcd60e51b8152600401610584906130d4565b6001600160a01b0384163b15610b9f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612410908990899088908890889060040161311c565b6020604051808303816000875af192505050801561244b575060408051601f3d908101601f1916820190925261244891810190613012565b60015b612457576122fc61302f565b6001600160e01b0319811663f23a6e6160e01b14611b0e5760405162461bcd60e51b8152600401610584906130d4565b6001600160a01b03811681146114b157600080fd5b600080604083850312156124af57600080fd5b82356124ba81612487565b946020939093013593505050565b6001600160e01b0319811681146114b157600080fd5b6000602082840312156124f057600080fd5b81356124fb816124c8565b9392505050565b60008083601f84011261251457600080fd5b5081356001600160401b0381111561252b57600080fd5b60208301915083602082850101111561254357600080fd5b9250929050565b6000806020838503121561255d57600080fd5b82356001600160401b0381111561257357600080fd5b61257f85828601612502565b90969095509350505050565b6000815180845260005b818110156125b157602081850181015186830182015201612595565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006124fb602083018461258b565b600080604083850312156125f757600080fd5b823561260281612487565b9150602083013561261281612487565b809150509250929050565b60006020828403121561262f57600080fd5b5035919050565b80151581146114b157600080fd5b6000806040838503121561265757600080fd5b823561266281612487565b9150602083013561261281612636565b60006020828403121561268457600080fd5b81356124fb81612487565b600080604083850312156126a257600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156126ec576126ec6126b1565b6040525050565b60006001600160401b0382111561270c5761270c6126b1565b5060051b60200190565b600082601f83011261272757600080fd5b81356020612734826126f3565b60405161274182826126c7565b83815260059390931b850182019282810191508684111561276157600080fd5b8286015b8481101561277c5780358352918301918301612765565b509695505050505050565b600082601f83011261279857600080fd5b81356001600160401b038111156127b1576127b16126b1565b6040516127c8601f8301601f1916602001826126c7565b8181528460208386010111156127dd57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561281257600080fd5b853561281d81612487565b9450602086013561282d81612487565b935060408601356001600160401b038082111561284957600080fd5b61285589838a01612716565b9450606088013591508082111561286b57600080fd5b61287789838a01612716565b9350608088013591508082111561288d57600080fd5b5061289a88828901612787565b9150509295509295909350565b600080604083850312156128ba57600080fd5b82356001600160401b03808211156128d157600080fd5b818501915085601f8301126128e557600080fd5b813560206128f2826126f3565b6040516128ff82826126c7565b83815260059390931b850182019282810191508984111561291f57600080fd5b948201945b8386101561294657853561293781612487565b82529482019490820190612924565b9650508601359250508082111561295c57600080fd5b50610b6e85828601612716565b600081518084526020808501945080840160005b838110156129995781518752958201959082019060010161297d565b509495945050505050565b6020815260006124fb6020830184612969565b600080600080606085870312156129cd57600080fd5b84356129d881612487565b93506020850135925060408501356001600160401b038111156129fa57600080fd5b612a0687828801612502565b95989497509550505050565b60008083601f840112612a2457600080fd5b5081356001600160401b03811115612a3b57600080fd5b6020830191508360208260051b850101111561254357600080fd5b60008060208385031215612a6957600080fd5b82356001600160401b03811115612a7f57600080fd5b61257f85828601612a12565b6020808252825182820181905260009190848201906040850190845b81811015612ac5578351151583529284019291840191600101612aa7565b50909695505050505050565b60008060008060408587031215612ae757600080fd5b84356001600160401b0380821115612afe57600080fd5b612b0a88838901612a12565b90965094506020870135915080821115612b2357600080fd5b50612a0687828801612a12565b600080600080600060a08688031215612b4857600080fd5b8535612b5381612487565b94506020860135612b6381612487565b9350604086013592506060860135915060808601356001600160401b03811115612b8c57600080fd5b61289a88828901612787565b6020808252600c908201526b2737ba1030b71030b236b4b760a11b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600181811c90821680612c2057607f821691505b602082108103612c4057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176105b2576105b2612c46565b600082612c9057634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060018201612cbd57612cbd612c46565b5060010190565b600060208284031215612cd657600080fd5b81516124fb81612487565b601f821115610f2157600081815260208120601f850160051c81016020861015612d085750805b601f850160051c820191505b81811015610b9f57828155600101612d14565b81516001600160401b03811115612d4057612d406126b1565b612d5481612d4e8454612c0c565b84612ce1565b602080601f831160018114612d895760008415612d715750858301515b600019600386901b1c1916600185901b178555610b9f565b600085815260208120601f198616915b82811015612db857888601518255948401946001909101908401612d99565b5085821015612dd65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215612df857600080fd5b81516124fb81612636565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b808201808211156105b2576105b2612c46565b604081526000612f996040830185612969565b8281036020840152612fab8185612969565b95945050505050565b6001600160a01b0386811682528516602082015260a060408201819052600090612fe090830186612969565b8281036060840152612ff28186612969565b90508281036080840152613006818561258b565b98975050505050505050565b60006020828403121561302457600080fd5b81516124fb816124c8565b600060033d11156130485760046000803e5060005160e01c5b90565b600060443d10156130595790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561308857505050505090565b82850191508151818111156130a05750505050505090565b843d87010160208285010111156130ba5750505050505090565b6130c9602082860101876126c7565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906131569083018461258b565b97965050505050505056fea264697066735822122031ac8af7964efcb348f3d8f4636fb676e7f8aba460c7e86b3ede280c845c091264736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101e45760003560e01c8063891214481161010f578063a49340cc116100a2578063e985e9c511610071578063e985e9c5146104a8578063ece527ae146104e4578063f242432a146104f7578063f2fde38b1461050a57600080fd5b8063a49340cc14610443578063b45a79f214610456578063b725120114610469578063b95b63f81461048457600080fd5b806395b82c13116100de57806395b82c13146103d857806396cf1d4d146103fc57806399d1e1a814610410578063a22cb4651461043057600080fd5b8063891214481461039157806389a89002146103ac5780638c7ea24b146103b45780638da5cb5b146103c757600080fd5b8063240ff27f116101875780634e1273f4116101565780634e1273f41461033f5780636caefed11461035f578063715018a61461037657806381d609561461037e57600080fd5b8063240ff27f146102d457806324d7806c146102e75780632a55205a146102fa5780632eb2c2d61461032c57600080fd5b806306fdde03116101c357806306fdde03146102475780630840ba72146102825780630e89341c146102955780631993f811146102a857600080fd5b8062fdd58e146101e957806301ffc9a71461020f57806302fe530514610232575b600080fd5b6101fc6101f736600461249c565b61051d565b6040519081526020015b60405180910390f35b61022261021d3660046124de565b6105b8565b6040519015158152602001610206565b61024561024036600461254a565b6105d2565b005b6102756040518060400160405280600f81526020016e0a68a92b49e9c405a40b48a9c92a89608b1b81525081565b60405161020691906125d1565b6102456102903660046125e4565b61063a565b6102756102a336600461261d565b610a20565b61015f546102bc906001600160a01b031681565b6040516001600160a01b039091168152602001610206565b6102456102e2366004612644565b610ab4565b6102226102f5366004612672565b610b04565b61030d61030836600461268f565b610b22565b604080516001600160a01b039093168352602083019190915201610206565b61024561033a3660046127fa565b610b78565b61035261034d3660046128a7565b610ba7565b60405161020691906129a4565b6102bc6f6551c19487814612e58fe0681377575881565b610245610cd0565b61024561038c3660046129b7565b610ce4565b6102bc7341c8f39463a868d3a88af00cd0fe7102f30e44ec81565b6101fc600181565b6102456103c236600461249c565b610e13565b6033546001600160a01b03166102bc565b6102226103e636600461261d565b6101626020526000908152604090205460ff1681565b610160546102bc906001600160a01b031681565b61042361041e366004612a56565b610e42565b6040516102069190612a8b565b61024561043e366004612644565b610f0d565b610245610451366004612ad1565b610f26565b61024561046436600461261d565b611000565b6102bc7355266d75d1a14e4572138116af39863ed6596e7f81565b61022261049236600461261d565b6101616020526000908152604090205460ff1681565b6102226104b63660046125e4565b6001600160a01b03918216600090815260986020908152604080832093909416825291909152205460ff1690565b6102456104f2366004612672565b6113cc565b610245610505366004612b30565b611414565b610245610518366004612672565b61143b565b60006001600160a01b03831661058d5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526097602090815260408083206001600160a01b03861684529091529020545b92915050565b60006105c3826114b4565b806105b257506105b2826114d5565b6105db33610b04565b6105f75760405162461bcd60e51b815260040161058490612b98565b61063682828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061152592505050565b5050565b600054600290610100900460ff1615801561065c575060005460ff8083169116105b6106785760405162461bcd60e51b815260040161058490612bbe565b6000805461015f80546001600160a01b038781166001600160a01b03199283161790925561016080549287169290911691909117905561016260209081527f737b7b094f71a48bf37aefb211463eba903e09dcd784e8c7a7a44cf7ed34434d805460ff1990811660019081179092557f765145cc59b6093bd87e27b2350236b5ea3484d01884859f975a2ddb699a602b80548216831790557f60c5e47dc6aa4fd5f7c36374a422359c22fb283b44b995177ae0624f2cd5559f80548216831790557f61a300934f54e6a16db4bcf13c13dbe30feacacc0b59a3e093d38959fca978fc80548216831790557ff38c0219cbadc268aad3a383f06bb926e20d9b377d70d1ea6e61af179bbbb72d80548216831790557f025a90ce8d8ccbb436cd42674c5cc7f1a783986ca2874f4a86817d09a01b2b0280548216831790557ffc22627fa7dd28c549de44d423fd589ea1c6022b71a8ecaf86fe227930a125a080548216831790557f92e58627c8e195366e422d6b5de05e148acd74f8245897edf4c3887ae209650380548216831790557ff70938bb8c74b5e1beb0991456611162005164e708506efaf9ccf59c38d1640480548216831790557ff6888b4905a46830db7173223655b72535893bc31005ae4d66e019e1f9ef325980548216831790557fcf848f53c65641584569aa4c83e8d79db7bf0a07136470d8b9091dc8bb80fdf180548216831790557f481e7ec82f75148c6991e730c59c2b04dcb149c3207802dbc10ebd2de7b1f17580548216831790557f384ea740e1a06f0082b8fa75161a01d2da624b65e5fcf15fefa5738558f7cf6380548216831790557f884681cf1617bd96a113ef4f2321def609e681bb1495049135c082ed9f05a3fa80548216831790557f1efb5774349450f75d0a02fbb42bdeff3842266a78726fde65e9e5454d43390780548216831790557f50d80290b47b6f3a6095f727a27f874a25918e84152f0d5ef9a78a1c2a4563fe80548216831790557f9c971867ba9f5c61c54a11f92d614f71d4efc898fe08473f928b4841225efbe080548216831790557fe16faf3a011a341d3a15c6422b963f2db6a26787cf9a3d439c2e76cf90cd0e118054821683179055611c5485527f36591685258600f4fdf731c38cf9075a580e587a6a784a13f707314edde390f38054909116909117905561ffff1990911660ff84169081176101001761ff0019169092556040519182527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498910160405180910390a1505050565b606060998054610a2f90612c0c565b80601f0160208091040260200160405190810160405280929190818152602001828054610a5b90612c0c565b8015610aa85780601f10610a7d57610100808354040283529160200191610aa8565b820191906000526020600020905b815481529060010190602001808311610a8b57829003601f168201915b50505050509050919050565b610abd33610b04565b610ad95760405162461bcd60e51b815260040161058490612b98565b6001600160a01b0391909116600090815260c960205260409020805460ff1916911515919091179055565b6001600160a01b0316600090815260c9602052604090205460ff1690565b6040805180820190915261012d546001600160a01b038116808352600160a01b90910462ffffff1660208301819052909160009161271090610b649086612c5c565b610b6e9190612c73565b9150509250929050565b846001600160a01b0381163314610b9257610b9233611531565b610b9f86868686866115ea565b505050505050565b60608151835114610c0c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610584565b600083516001600160401b03811115610c2757610c276126b1565b604051908082528060200260200182016040528015610c50578160200160208202803683370190505b50905060005b8451811015610cc857610c9b858281518110610c7457610c74612c95565b6020026020010151858381518110610c8e57610c8e612c95565b602002602001015161051d565b828281518110610cad57610cad612c95565b6020908102919091010152610cc181612cab565b9050610c56565b509392505050565b610cd861162f565b610ce26000611689565b565b600054610100900460ff1615808015610d045750600054600160ff909116105b80610d1e5750303b158015610d1e575060005460ff166001145b610d3a5760405162461bcd60e51b815260040161058490612bbe565b6000805460ff191660011790558015610d5d576000805461ff0019166101001790555b610d656116db565b610da483838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061170b92505050565b610dac61173b565b610db461177e565b610dbe85856117a5565b610dc66117cc565b8015610e0c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b610e1c33610b04565b610e385760405162461bcd60e51b815260040161058490612b98565b6106368282611812565b6060816000816001600160401b03811115610e5f57610e5f6126b1565b604051908082528060200260200182016040528015610e88578160200160208202803683370190505b50905060005b82811015610f04576101616000878784818110610ead57610ead612c95565b90506020020135815260200190815260200160002060009054906101000a900460ff16828281518110610ee257610ee2612c95565b9115156020928302919091019091015280610efc81612cab565b915050610e8e565b50949350505050565b81610f1781611531565b610f2183836118e1565b505050565b610f2f33610b04565b610f4b5760405162461bcd60e51b815260040161058490612b98565b82818114610f9b5760405162461bcd60e51b815260206004820152601760248201527f41646d696e206d696e743a2062616420726571756573740000000000000000006044820152606401610584565b60005b81811015610b9f57610fee868683818110610fbb57610fbb612c95565b9050602002016020810190610fd09190612672565b858584818110610fe257610fe2612c95565b905060200201356118ec565b80610ff881612cab565b915050610f9e565b3233146110425760405162461bcd60e51b815260206004820152601060248201526f13db9b1e481153d048185b1b1bddd95960821b6044820152606401610584565b61015f546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa15801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612cc4565b6001600160a01b0316146111105760405162461bcd60e51b815260206004820152602160248201527f596f7520646f6e2774206f776e207468652072657175657374656420746f6b656044820152603760f91b6064820152608401610584565b6000818152610162602052604090205460ff161561117c5760405162461bcd60e51b815260206004820152602360248201527f5468652072657175657374656420746f6b656e2063616e2774206265206d696e6044820152621d195960ea1b6064820152608401610584565b6000818152610161602052604090205460ff16156111eb5760405162461bcd60e51b815260206004820152602660248201527f5468652072657175657374656420746f6b656e2077617320616c7265616479206044820152651b5a5b9d195960d21b6064820152608401610584565b600081815261016160205260409020805460ff1916600190811790915561121490339080611993565b61015f54604051638a54c52f60e01b81527355266d75d1a14e4572138116af39863ed6596e7f60048201526000602482018190524660448301526001600160a01b039092166064820152608481018390526f6551c19487814612e58fe0681377575890638a54c52f9060a4016020604051808303816000875af115801561129f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c39190612cc4565b60405163189acdbd60e31b81527341c8f39463a868d3a88af00cd0fe7102f30e44ec600482015290915081906001600160a01b0382169063c4d66de890602401600060405180830381600087803b15801561131d57600080fd5b505af1158015611331573d6000803e3d6000fd5b5050610160546040516340c10f1960e01b81526001600160a01b0386811660048301526024820188905290911692506340c10f199150604401600060405180830381600087803b15801561138457600080fd5b505af1158015611398573d6000803e3d6000fd5b50506040518592507f9c2099e1a27fdca8683455c754c645b6d98286e26fa3660c13a26e24c68793159150600090a2505050565b6113d533610b04565b6113f15760405162461bcd60e51b815260040161058490612b98565b61015f80546001600160a01b0319166001600160a01b0392909216919091179055565b846001600160a01b038116331461142e5761142e33611531565b610b9f8686868686611b17565b61144361162f565b6001600160a01b0381166114a85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610584565b6114b181611689565b50565b60006001600160e01b0319821663152a902d60e11b14806105b257506105b2825b60006001600160e01b03198216636cdb3d1360e11b148061150657506001600160e01b031982166303a24d0760e21b145b806105b257506301ffc9a760e01b6001600160e01b03198316146105b2565b60996106368282612d27565b6daaeb6d7670e522a718067333cd4e3b156114b157604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa15801561159e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c29190612de6565b6114b157604051633b79c77360e21b81526001600160a01b0382166004820152602401610584565b6001600160a01b038516331480611606575061160685336104b6565b6116225760405162461bcd60e51b815260040161058490612e03565b610e0c8585858585611b5c565b6033546001600160a01b03163314610ce25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610584565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166117025760405162461bcd60e51b815260040161058490612e51565b610ce233611689565b600054610100900460ff166117325760405162461bcd60e51b815260040161058490612e51565b6114b181611525565b600054610100900460ff166117625760405162461bcd60e51b815260040161058490612e51565b33600090815260c960205260409020805460ff19166001179055565b600054610100900460ff16610ce25760405162461bcd60e51b815260040161058490612e51565b600054610100900460ff16610e385760405162461bcd60e51b815260040161058490612e51565b600054610100900460ff166117f35760405162461bcd60e51b815260040161058490612e51565b610ce2733cc6cdda760b79bafa08df41ecfa224f810dceb66001611cf3565b6127108111156118645760405162461bcd60e51b815260206004820152601c60248201527f526f79616c746965733a2076616c756520697320746f6f2068696768000000006044820152606401610584565b6040805180820182526001600160a01b03841680825262ffffff8416602092830181905261012d80546001600160b81b0319168317600160a01b90920291909117905582519081529081018390527f908669f35f6fb3977a956ba70597841fe541d1e8491ca3c025161e258d3bfdb6910160405180910390a15050565b610636338383611e92565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905060018260008151811061194657611946612c95565b602002602001018181525050828160008151811061196657611966612c95565b60200260200101818152505061198d84838360405180602001604052806000815250611f72565b50505050565b6001600160a01b0383166119f55760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608401610584565b336000611a01846120f8565b90506000611a0e846120f8565b6040805160208082018352600091829052888252609781528282206001600160a01b038b1683529052205490915084811015611a985760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608401610584565b60008681526097602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46040805160208101909152600090525b50505050505050565b6001600160a01b038516331480611b335750611b3385336104b6565b611b4f5760405162461bcd60e51b815260040161058490612e03565b610e0c8585858585612143565b8151835114611b7d5760405162461bcd60e51b815260040161058490612e9c565b6001600160a01b038416611ba35760405162461bcd60e51b815260040161058490612ee4565b3360005b8451811015611c8d576000858281518110611bc457611bc4612c95565b602002602001015190506000858381518110611be257611be2612c95565b60209081029190910181015160008481526097835260408082206001600160a01b038e168352909352919091205490915081811015611c335760405162461bcd60e51b815260040161058490612f29565b60008381526097602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611c72908490612f73565b9250508190555050505080611c8690612cab565b9050611ba7565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611cdd929190612f86565b60405180910390a4610b9f818787878787612271565b600054610100900460ff16611d1a5760405162461bcd60e51b815260040161058490612e51565b6daaeb6d7670e522a718067333cd4e3b156106365760405163c3c5a54760e01b81523060048201526daaeb6d7670e522a718067333cd4e9063c3c5a547906024016020604051808303816000875af1158015611d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d9e9190612de6565b610636578015611e1257604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b158015611dfe57600080fd5b505af1158015610b9f573d6000803e3d6000fd5b6001600160a01b03821615611e615760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401611de4565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401611de4565b816001600160a01b0316836001600160a01b031603611f055760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610584565b6001600160a01b03838116600081815260986020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038416611fd25760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610584565b8151835114611ff35760405162461bcd60e51b815260040161058490612e9c565b3360005b84518110156120905783818151811061201257612012612c95565b60200260200101516097600087848151811061203057612030612c95565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b0316815260200190815260200160002060008282546120789190612f73565b9091555081905061208881612cab565b915050611ff7565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516120e1929190612f86565b60405180910390a4610e0c81600087878787612271565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061213257612132612c95565b602090810291909101015292915050565b6001600160a01b0384166121695760405162461bcd60e51b815260040161058490612ee4565b336000612175856120f8565b90506000612182856120f8565b905060008681526097602090815260408083206001600160a01b038c168452909152902054858110156121c75760405162461bcd60e51b815260040161058490612f29565b60008781526097602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290612206908490612f73565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612266848a8a8a8a8a6123cc565b505050505050505050565b6001600160a01b0384163b15610b9f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906122b59089908990889088908890600401612fb4565b6020604051808303816000875af19250505080156122f0575060408051601f3d908101601f191682019092526122ed91810190613012565b60015b61239c576122fc61302f565b806308c379a003612335575061231061304b565b8061231b5750612337565b8060405162461bcd60e51b815260040161058491906125d1565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610584565b6001600160e01b0319811663bc197c8160e01b14611b0e5760405162461bcd60e51b8152600401610584906130d4565b6001600160a01b0384163b15610b9f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612410908990899088908890889060040161311c565b6020604051808303816000875af192505050801561244b575060408051601f3d908101601f1916820190925261244891810190613012565b60015b612457576122fc61302f565b6001600160e01b0319811663f23a6e6160e01b14611b0e5760405162461bcd60e51b8152600401610584906130d4565b6001600160a01b03811681146114b157600080fd5b600080604083850312156124af57600080fd5b82356124ba81612487565b946020939093013593505050565b6001600160e01b0319811681146114b157600080fd5b6000602082840312156124f057600080fd5b81356124fb816124c8565b9392505050565b60008083601f84011261251457600080fd5b5081356001600160401b0381111561252b57600080fd5b60208301915083602082850101111561254357600080fd5b9250929050565b6000806020838503121561255d57600080fd5b82356001600160401b0381111561257357600080fd5b61257f85828601612502565b90969095509350505050565b6000815180845260005b818110156125b157602081850181015186830182015201612595565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006124fb602083018461258b565b600080604083850312156125f757600080fd5b823561260281612487565b9150602083013561261281612487565b809150509250929050565b60006020828403121561262f57600080fd5b5035919050565b80151581146114b157600080fd5b6000806040838503121561265757600080fd5b823561266281612487565b9150602083013561261281612636565b60006020828403121561268457600080fd5b81356124fb81612487565b600080604083850312156126a257600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156126ec576126ec6126b1565b6040525050565b60006001600160401b0382111561270c5761270c6126b1565b5060051b60200190565b600082601f83011261272757600080fd5b81356020612734826126f3565b60405161274182826126c7565b83815260059390931b850182019282810191508684111561276157600080fd5b8286015b8481101561277c5780358352918301918301612765565b509695505050505050565b600082601f83011261279857600080fd5b81356001600160401b038111156127b1576127b16126b1565b6040516127c8601f8301601f1916602001826126c7565b8181528460208386010111156127dd57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561281257600080fd5b853561281d81612487565b9450602086013561282d81612487565b935060408601356001600160401b038082111561284957600080fd5b61285589838a01612716565b9450606088013591508082111561286b57600080fd5b61287789838a01612716565b9350608088013591508082111561288d57600080fd5b5061289a88828901612787565b9150509295509295909350565b600080604083850312156128ba57600080fd5b82356001600160401b03808211156128d157600080fd5b818501915085601f8301126128e557600080fd5b813560206128f2826126f3565b6040516128ff82826126c7565b83815260059390931b850182019282810191508984111561291f57600080fd5b948201945b8386101561294657853561293781612487565b82529482019490820190612924565b9650508601359250508082111561295c57600080fd5b50610b6e85828601612716565b600081518084526020808501945080840160005b838110156129995781518752958201959082019060010161297d565b509495945050505050565b6020815260006124fb6020830184612969565b600080600080606085870312156129cd57600080fd5b84356129d881612487565b93506020850135925060408501356001600160401b038111156129fa57600080fd5b612a0687828801612502565b95989497509550505050565b60008083601f840112612a2457600080fd5b5081356001600160401b03811115612a3b57600080fd5b6020830191508360208260051b850101111561254357600080fd5b60008060208385031215612a6957600080fd5b82356001600160401b03811115612a7f57600080fd5b61257f85828601612a12565b6020808252825182820181905260009190848201906040850190845b81811015612ac5578351151583529284019291840191600101612aa7565b50909695505050505050565b60008060008060408587031215612ae757600080fd5b84356001600160401b0380821115612afe57600080fd5b612b0a88838901612a12565b90965094506020870135915080821115612b2357600080fd5b50612a0687828801612a12565b600080600080600060a08688031215612b4857600080fd5b8535612b5381612487565b94506020860135612b6381612487565b9350604086013592506060860135915060808601356001600160401b03811115612b8c57600080fd5b61289a88828901612787565b6020808252600c908201526b2737ba1030b71030b236b4b760a11b604082015260600190565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b600181811c90821680612c2057607f821691505b602082108103612c4057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176105b2576105b2612c46565b600082612c9057634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060018201612cbd57612cbd612c46565b5060010190565b600060208284031215612cd657600080fd5b81516124fb81612487565b601f821115610f2157600081815260208120601f850160051c81016020861015612d085750805b601f850160051c820191505b81811015610b9f57828155600101612d14565b81516001600160401b03811115612d4057612d406126b1565b612d5481612d4e8454612c0c565b84612ce1565b602080601f831160018114612d895760008415612d715750858301515b600019600386901b1c1916600185901b178555610b9f565b600085815260208120601f198616915b82811015612db857888601518255948401946001909101908401612d99565b5085821015612dd65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215612df857600080fd5b81516124fb81612636565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b808201808211156105b2576105b2612c46565b604081526000612f996040830185612969565b8281036020840152612fab8185612969565b95945050505050565b6001600160a01b0386811682528516602082015260a060408201819052600090612fe090830186612969565b8281036060840152612ff28186612969565b90508281036080840152613006818561258b565b98975050505050505050565b60006020828403121561302457600080fd5b81516124fb816124c8565b600060033d11156130485760046000803e5060005160e01c5b90565b600060443d10156130595790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561308857505050505090565b82850191508151818111156130a05750505050505090565b843d87010160208285010111156130ba5750505050505090565b6130c9602082860101876126c7565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906131569083018461258b565b97965050505050505056fea264697066735822122031ac8af7964efcb348f3d8f4636fb676e7f8aba460c7e86b3ede280c845c091264736f6c63430008110033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 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.