Source Code
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
OFDropCollection
Compiler Version
v0.8.15+commit.e14f2714
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.9;
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/ERC721EnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "../interfaces/IOperatorRegistry.sol";
import "../OFBaseCollection.sol";
contract OFDropCollection is
OFBaseCollection,
ERC721Upgradeable,
ERC721EnumerableUpgradeable
{
using SafeMathUpgradeable for uint256;
mapping(address => uint256) private _mintCount;
bytes32 private _merkleRoot;
string private _tokenBaseURI;
// Sales Parameters
uint256 private _maxAmount;
uint256 private _maxPerMint;
uint256 private _maxPerWallet;
uint256 private _price;
// States
bool private _presaleActive = false;
bool private _saleActive = false;
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
modifier onlyMintable(uint64 quantity) {
require(quantity > 0, "Quantity is 0");
require(
_maxAmount > 0 ? totalSupply().add(quantity) <= _maxAmount : true,
"Exceeded max supply"
);
require(quantity <= _maxPerMint, "Exceeded max per mint");
_;
}
function initialize(
address owner_,
string memory name_,
string memory symbol_,
address treasury_,
address royalty_,
uint96 royaltyFee_
) public initializer {
__ERC721_init(name_, symbol_);
__ERC721Enumerable_init();
__BaseCollection_init(owner_, treasury_, royalty_, royaltyFee_);
}
function mint(uint64 quantity) external payable onlyMintable(quantity) {
require(!_presaleActive, "Presale active");
require(_saleActive, "Sale not active");
require(
_mintCount[_msgSender()].add(quantity) <= _maxPerWallet,
"Exceeded max per wallet"
);
_purchaseMint(quantity, _msgSender());
}
function mintTo(address recipient, uint64 quantity)
external
payable
onlyMintable(quantity)
{
require(!_presaleActive, "Presale active");
require(_saleActive, "Sale not active");
require(
_mintCount[recipient].add(quantity) <= _maxPerWallet,
"Exceeded max per wallet"
);
_purchaseMint(quantity, recipient);
}
function presaleMint(
uint64 quantity,
uint256 allowed,
bytes32[] calldata proof
) external payable onlyMintable(quantity) {
uint256 mintQuantity = _mintCount[_msgSender()].add(quantity);
require(_presaleActive, "Presale not active");
require(_merkleRoot != "", "Presale not set");
require(mintQuantity <= _maxPerWallet, "Exceeded max per wallet");
require(mintQuantity <= allowed, "Exceeded max per wallet");
require(
MerkleProofUpgradeable.verify(
proof,
_merkleRoot,
keccak256(abi.encodePacked(_msgSender(), allowed))
),
"Presale invalid"
);
_purchaseMint(quantity, _msgSender());
}
function presaleMintTo(
address recipient,
uint64 quantity,
uint256 allowed,
bytes32[] calldata proof
) external payable onlyMintable(quantity) {
uint256 mintQuantity = _mintCount[recipient].add(quantity);
require(_presaleActive, "Presale not active");
require(_merkleRoot != "", "Presale not set");
require(mintQuantity <= _maxPerWallet, "Exceeded max per wallet");
require(mintQuantity <= allowed, "Exceeded max per wallet");
require(
MerkleProofUpgradeable.verify(
proof,
_merkleRoot,
keccak256(abi.encodePacked(recipient, allowed))
),
"Presale invalid"
);
_purchaseMint(quantity, recipient);
}
function batchAirdrop(
uint64[] calldata quantities,
address[] calldata recipients
) external onlyRolesOrOwner(MANAGER_ROLE) {
uint256 length = recipients.length;
require(quantities.length == length, "Invalid Arguments");
for (uint256 i = 0; i < length; ) {
_mint(quantities[i], recipients[i]);
unchecked {
i++;
}
}
}
function setMerkleRoot(bytes32 newRoot)
external
onlyRolesOrOwner(MANAGER_ROLE)
{
_merkleRoot = newRoot;
}
function startSale(
uint256 newMaxAmount,
uint256 newMaxPerMint,
uint256 newMaxPerWallet,
uint256 newPrice,
bool presale
) external onlyRolesOrOwner(MANAGER_ROLE) {
_saleActive = true;
_presaleActive = presale;
_maxAmount = newMaxAmount;
_maxPerMint = newMaxPerMint;
_maxPerWallet = newMaxPerWallet;
_price = newPrice;
}
function stopSale() external onlyRolesOrOwner(MANAGER_ROLE) {
_saleActive = false;
_presaleActive = false;
}
function setBaseURI(string memory newBaseURI)
external
onlyRolesOrOwner(MANAGER_ROLE)
{
_tokenBaseURI = newBaseURI;
}
function burn(uint256 tokenId) external onlyRoles(BURNER_ROLE) {
require(AddressUpgradeable.isContract(_msgSender()), "Not Allowed");
_burn(tokenId);
}
function maxAmount() external view returns (uint256) {
return _maxAmount;
}
function maxPerMint() external view returns (uint256) {
return _maxPerMint;
}
function maxPerWallet() external view returns (uint256) {
return _maxPerWallet;
}
function price() external view returns (uint256) {
return _price;
}
function presaleActive() external view returns (bool) {
return _presaleActive;
}
function saleActive() external view returns (bool) {
return _saleActive;
}
function _baseURI() internal view virtual override returns (string memory) {
return _tokenBaseURI;
}
function _purchaseMint(uint64 quantity, address to) internal {
require(_price.mul(quantity) <= msg.value, "Value incorrect");
unchecked {
_totalRevenue = _totalRevenue.add(msg.value);
_mintCount[to] = _mintCount[to].add(quantity);
}
_niftyKit.addFees(msg.value);
_mint(quantity, to);
}
function _mint(uint64 quantity, address to) internal {
for (uint64 i = 0; i < quantity; ) {
_safeMint(to, totalSupply().add(1));
unchecked {
i++;
}
}
}
function approve(address to, uint256 tokenId)
public
virtual
override(ERC721Upgradeable, IERC721Upgradeable)
onlyAllowedOperatorApproval(to)
{
ERC721Upgradeable.approve(to, tokenId);
}
function setApprovalForAll(address operator, bool approved)
public
virtual
override(ERC721Upgradeable, IERC721Upgradeable)
onlyAllowedOperatorApproval(operator)
{
ERC721Upgradeable.setApprovalForAll(operator, approved);
}
function transferFrom(
address from,
address to,
uint256 tokenId
)
public
override(ERC721Upgradeable, IERC721Upgradeable)
onlyAllowedOperator(from)
{
super.transferFrom(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
)
public
override(ERC721Upgradeable, IERC721Upgradeable)
onlyAllowedOperator(from)
{
super.safeTransferFrom(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
)
public
override(ERC721Upgradeable, IERC721Upgradeable)
onlyAllowedOperator(from)
{
super.safeTransferFrom(from, to, tokenId, data);
}
// The following functions are overrides required by Solidity.
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
)
internal
virtual
override(ERC721Upgradeable, ERC721EnumerableUpgradeable)
{
super._beforeTokenTransfer(from, to, tokenId);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(
ERC721Upgradeable,
ERC721EnumerableUpgradeable,
OFBaseCollection
)
returns (bool)
{
return
ERC721Upgradeable.supportsInterface(interfaceId) ||
ERC721EnumerableUpgradeable.supportsInterface(interfaceId) ||
OFBaseCollection.supportsInterface(interfaceId) ||
super.supportsInterface(interfaceId);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165Upgradeable.sol";
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/
interface IERC2981Upgradeable is IERC165Upgradeable {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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]
* ```
* 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. Equivalent to `reinitializer(1)`.
*/
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.
*
* `initializer` is equivalent to `reinitializer(1)`, so 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.
*
* 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.
*/
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.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.0;
import "../../interfaces/IERC2981Upgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
*
* Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
* fee is specified in basis points by default.
*
* IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
* https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
* voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
*
* _Available since v4.5._
*/
abstract contract ERC2981Upgradeable is Initializable, IERC2981Upgradeable, ERC165Upgradeable {
function __ERC2981_init() internal onlyInitializing {
}
function __ERC2981_init_unchained() internal onlyInitializing {
}
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) {
return interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981Upgradeable
*/
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();
return (royalty.receiver, royaltyAmount);
}
/**
* @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
* fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
* override.
*/
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
/**
* @dev Sets the royalty information that all ids in this contract will default to.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Removes default royalty information.
*/
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
/**
* @dev Sets the royalty information for a specific token id, overriding the global default.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Resets royalty information for the token id back to the global default.
*/
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
/**
* @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[48] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
using AddressUpgradeable for address;
using StringsUpgradeable for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC721_init_unchained(name_, symbol_);
}
function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
return
interfaceId == type(IERC721Upgradeable).interfaceId ||
interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: address zero is not a valid owner");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: invalid token ID");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
_requireMinted(tokenId);
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721Upgradeable.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not token owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
_requireMinted(tokenId);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
_safeTransfer(from, to, tokenId, data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
address owner = ERC721Upgradeable.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721Upgradeable.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Reverts if the `tokenId` has not been minted yet.
*/
function _requireMinted(uint256 tokenId) internal view virtual {
require(_exists(tokenId), "ERC721: invalid token ID");
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @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[44] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../ERC721Upgradeable.sol";
import "./IERC721EnumerableUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721EnumerableUpgradeable is Initializable, ERC721Upgradeable, IERC721EnumerableUpgradeable {
function __ERC721Enumerable_init() internal onlyInitializing {
}
function __ERC721Enumerable_init_unchained() internal onlyInitializing {
}
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC721Upgradeable) returns (bool) {
return interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Upgradeable.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721EnumerableUpgradeable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721Upgradeable.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721Upgradeable.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
/**
* @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[46] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721Upgradeable.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721EnumerableUpgradeable is IERC721Upgradeable {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721Upgradeable.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721ReceiverUpgradeable {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165Upgradeable.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721Upgradeable is IERC165Upgradeable {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts 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 (last updated v4.7.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
*/
library MerkleProofUpgradeable {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Calldata version of {verify}
*
* _Available since v4.7._
*/
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Calldata version of {processProof}
*
* _Available since v4.7._
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be proved to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* _Available since v4.7._
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Calldata version of {multiProofVerify}
*
* _Available since v4.7._
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and the sibling nodes in `proof`,
* consuming from one or the other at each step according to the instructions given by
* `proofFlags`.
*
* _Available since v4.7._
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Calldata version of {processMultiProof}
*
* _Available since v4.7._
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the merkle tree.
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
// Check proof validity.
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.2) (utils/introspection/ERC165Checker.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
/**
* @dev Library used to query support of an interface declared via {IERC165}.
*
* Note that these functions return the actual result of the query: they do not
* `revert` if an interface is not supported. It is up to the caller to decide
* what to do in these cases.
*/
library ERC165CheckerUpgradeable {
// As per the EIP-165 spec, no interface should ever match 0xffffffff
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
/**
* @dev Returns true if `account` supports the {IERC165} interface,
*/
function supportsERC165(address account) internal view returns (bool) {
// Any contract that implements ERC165 must explicitly indicate support of
// InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
return
_supportsERC165Interface(account, type(IERC165Upgradeable).interfaceId) &&
!_supportsERC165Interface(account, _INTERFACE_ID_INVALID);
}
/**
* @dev Returns true if `account` supports the interface defined by
* `interfaceId`. Support for {IERC165} itself is queried automatically.
*
* See {IERC165-supportsInterface}.
*/
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
// query support of both ERC165 as per the spec and support of _interfaceId
return supportsERC165(account) && _supportsERC165Interface(account, interfaceId);
}
/**
* @dev Returns a boolean array where each value corresponds to the
* interfaces passed in and whether they're supported or not. This allows
* you to batch check interfaces for a contract where your expectation
* is that some interfaces may not be supported.
*
* See {IERC165-supportsInterface}.
*
* _Available since v3.4._
*/
function getSupportedInterfaces(address account, bytes4[] memory interfaceIds)
internal
view
returns (bool[] memory)
{
// an array of booleans corresponding to interfaceIds and whether they're supported or not
bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);
// query support of ERC165 itself
if (supportsERC165(account)) {
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);
}
}
return interfaceIdsSupported;
}
/**
* @dev Returns true if `account` supports all the interfaces defined in
* `interfaceIds`. Support for {IERC165} itself is queried automatically.
*
* Batch-querying can lead to gas savings by skipping repeated checks for
* {IERC165} support.
*
* See {IERC165-supportsInterface}.
*/
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
// query support of ERC165 itself
if (!supportsERC165(account)) {
return false;
}
// query support of each interface in _interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!_supportsERC165Interface(account, interfaceIds[i])) {
return false;
}
}
// all interfaces supported
return true;
}
/**
* @notice Query if a contract implements an interface, does not check ERC165 support
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return true if the contract at account indicates support of the interface with
* identifier interfaceId, false otherwise
* @dev Assumes that account contains a contract that supports ERC165, otherwise
* the behavior of this method is undefined. This precondition can be checked
* with {supportsERC165}.
* Interface identification is specified in ERC-165.
*/
function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
// prepare call
bytes memory encodedParams = abi.encodeWithSelector(IERC165Upgradeable.supportsInterface.selector, interfaceId);
// perform static call
bool success;
uint256 returnSize;
uint256 returnValue;
assembly {
success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
returnSize := returndatasize()
returnValue := mload(0x00)
}
return success && returnSize >= 0x20 && returnValue > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts 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.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMathUpgradeable {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Optimized and flexible operator filterer to abide to OpenSea's
/// mandatory on-chain royalty enforcement in order for new collections to
/// receive royalties.
/// For more information, see:
/// See: https://github.com/ProjectOpenSea/operator-filter-registry
abstract contract OperatorFilterer {
/// @dev The default OpenSea operator blocklist subscription.
address internal constant _DEFAULT_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
/// @dev The OpenSea operator filter registry.
address internal constant _OPERATOR_FILTER_REGISTRY = 0x000000000000AAeB6D7670E522A718067333cd4E;
/// @dev Registers the current contract to OpenSea's operator filter,
/// and subscribe to the default OpenSea operator blocklist.
/// Note: Will not revert nor update existing settings for repeated registration.
function _registerForOperatorFiltering() internal virtual {
_registerForOperatorFiltering(_DEFAULT_SUBSCRIPTION, true);
}
/// @dev Registers the current contract to OpenSea's operator filter.
/// Note: Will not revert nor update existing settings for repeated registration.
function _registerForOperatorFiltering(address subscriptionOrRegistrantToCopy, bool subscribe) internal virtual {
/// @solidity memory-safe-assembly
assembly {
let functionSelector := 0x7d3e3dbe // `registerAndSubscribe(address,address)`.
// Clean the upper 96 bits of `subscriptionOrRegistrantToCopy` in case they are dirty.
subscriptionOrRegistrantToCopy := shr(96, shl(96, subscriptionOrRegistrantToCopy))
// prettier-ignore
for {} iszero(subscribe) {} {
if iszero(subscriptionOrRegistrantToCopy) {
functionSelector := 0x4420e486 // `register(address)`.
break
}
functionSelector := 0xa0af2903 // `registerAndCopyEntries(address,address)`.
break
}
// Store the function selector.
mstore(0x00, shl(224, functionSelector))
// Store the `address(this)`.
mstore(0x04, address())
// Store the `subscriptionOrRegistrantToCopy`.
mstore(0x24, subscriptionOrRegistrantToCopy)
// Register into the registry.
pop(call(gas(), _OPERATOR_FILTER_REGISTRY, 0, 0x00, 0x44, 0x00, 0x00))
// Restore the part of the free memory pointer that was overwritten,
// which is guaranteed to be zero, because of Solidity's memory size limits.
mstore(0x24, 0)
}
}
/// @dev Modifier to guard a function and revert if the caller is a blocked operator.
modifier onlyAllowedOperator(address from) virtual {
if (from != msg.sender)
if (!_isPriorityOperator(msg.sender))
if (_operatorFilteringEnabled()) _revertIfBlocked(msg.sender);
_;
}
/// @dev Modifier to guard a function from approving a blocked operator..
modifier onlyAllowedOperatorApproval(address operator) virtual {
if (!_isPriorityOperator(operator))
if (_operatorFilteringEnabled()) _revertIfBlocked(operator);
_;
}
/// @dev Helper function that reverts if the `operator` is blocked by the registry.
function _revertIfBlocked(address operator) private view {
/// @solidity memory-safe-assembly
assembly {
// Store the function selector of `isOperatorAllowed(address,address)`,
// shifted left by 6 bytes, which is enough for 8tb of memory.
// We waste 6-3 = 3 bytes to save on 6 runtime gas (PUSH1 0x224 SHL).
mstore(0x00, 0xc6171134001122334455)
// Store the `address(this)`.
mstore(0x1a, address())
// Store the `operator`.
mstore(0x3a, operator)
// `isOperatorAllowed` always returns true if it does not revert.
if iszero(staticcall(gas(), _OPERATOR_FILTER_REGISTRY, 0x16, 0x44, 0x00, 0x00)) {
// Bubble up the revert if the staticcall reverts.
returndatacopy(0x00, 0x00, returndatasize())
revert(0x00, returndatasize())
}
// We'll skip checking if `from` is inside the blacklist.
// Even though that can block transferring out of wrapper contracts,
// we don't want tokens to be stuck.
// Restore the part of the free memory pointer that was overwritten,
// which is guaranteed to be zero, if less than 8tb of memory is used.
mstore(0x3a, 0)
}
}
/// @dev For deriving contracts to override, so that operator filtering
/// can be turned on / off.
function _operatorFilteringEnabled() internal view virtual returns (bool) {
return true;
}
/// @dev For deriving contracts to override, such that preferred marketplaces can
/// skip the operator filtering, helping users save gas.
function _isPriorityOperator(address) internal view virtual returns (bool) {
return false;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
interface IBaseCollection {
event OperatorAllowed(bytes32 indexed operator, bool allowed);
event OperatorBlocked(bytes32 indexed operator, bool blocked);
/**
* @dev Contract upgradeable initializer
*/
function initialize(
address owner,
string memory name,
string memory symbol,
address treasury,
address royalty,
uint96 royaltyFee
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
interface INiftyKit {
struct Entry {
uint256 value;
bool isValue;
}
/**
* @dev Emitted when collection is created
*/
event CollectionCreated(
uint96 indexed typeId,
address indexed collectionAddress
);
/**
* @dev Emitted when user rate is updated
*/
event UserRateUpdated(address indexed user, uint256 indexed rate);
/**
* @dev Emitted when user rate is removed
*/
event UserRateRemoved(address indexed user, uint256 indexed rate);
/**
* @dev Returns the commission amount.
*/
function commission(address collection, uint256 amount)
external
view
returns (uint256);
/**
* @dev Add fees from Collection
*/
function addFees(uint256 amount) external;
/**
* @dev Add fees claimed by the Collection
*/
function addFeesClaimed(uint256 amount) external;
/**
* @dev Get fees accrued by the account
*/
function getFees(address account) external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
interface IOperatorRegistry {
event OperatorIdentified(
bytes32 indexed identifer,
address indexed operator
);
function getIdentifier(address operator) external view returns (bytes32);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "solady/src/auth/OwnableRoles.sol";
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165CheckerUpgradeable.sol";
import "closedsea/src/OperatorFilterer.sol";
import "./interfaces/IBaseCollection.sol";
import "./interfaces/INiftyKit.sol";
abstract contract OFBaseCollection is
OwnableRoles,
OperatorFilterer,
ContextUpgradeable,
ERC2981Upgradeable,
IBaseCollection
{
using AddressUpgradeable for address;
using SafeMathUpgradeable for uint256;
uint256 public constant ADMIN_ROLE = 1 << 0;
uint256 public constant MANAGER_ROLE = 1 << 1;
uint256 public constant BURNER_ROLE = 1 << 2;
INiftyKit internal _niftyKit;
address internal _treasury;
uint256 internal _totalRevenue;
// Operator Filtering
bool internal operatorFilteringEnabled;
function __BaseCollection_init(
address owner_,
address treasury_,
address royalty_,
uint96 royaltyFee_
) internal onlyInitializing {
_initializeOwner(owner_);
__ERC2981_init();
_registerForOperatorFiltering();
_niftyKit = INiftyKit(_msgSender());
_treasury = treasury_;
operatorFilteringEnabled = true;
_setDefaultRoyalty(royalty_, royaltyFee_);
}
function withdraw() external onlyRolesOrOwner(ADMIN_ROLE) {
require(address(this).balance > 0, "0 balance");
INiftyKit niftyKit = _niftyKit;
uint256 balance = address(this).balance;
uint256 fees = niftyKit.getFees(address(this));
niftyKit.addFeesClaimed(fees);
AddressUpgradeable.sendValue(payable(address(niftyKit)), fees);
AddressUpgradeable.sendValue(payable(_treasury), balance.sub(fees));
}
function setTreasury(address newTreasury)
external
onlyRolesOrOwner(ADMIN_ROLE)
{
_treasury = newTreasury;
}
function setDefaultRoyalty(address receiver, uint96 feeNumerator)
external
onlyRolesOrOwner(ADMIN_ROLE)
{
_setDefaultRoyalty(receiver, feeNumerator);
}
function setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) external onlyRolesOrOwner(ADMIN_ROLE) {
_setTokenRoyalty(tokenId, receiver, feeNumerator);
}
function setOperatorFilteringEnabled(bool value)
public
onlyRolesOrOwner(ADMIN_ROLE)
{
operatorFilteringEnabled = value;
}
function _operatorFilteringEnabled()
internal
view
virtual
override
returns (bool)
{
return operatorFilteringEnabled;
}
function treasury() external view returns (address) {
return _treasury;
}
function totalRevenue() external view returns (uint256) {
return _totalRevenue;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC2981Upgradeable)
returns (bool)
{
return
interfaceId == type(IBaseCollection).interfaceId ||
super.supportsInterface(interfaceId);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Simple single owner and multiroles authorization mixin.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/OwnableRoles.sol)
/// @dev While the ownable portion follows [EIP-173](https://eips.ethereum.org/EIPS/eip-173)
/// for compatibility, the nomenclature for the 2-step ownership handover and roles
/// may be unique to this codebase.
abstract contract OwnableRoles {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The caller is not authorized to call the function.
error Unauthorized();
/// @dev The `newOwner` cannot be the zero address.
error NewOwnerIsZeroAddress();
/// @dev The `pendingOwner` does not have a valid handover request.
error NoHandoverRequest();
/// @dev `bytes4(keccak256(bytes("Unauthorized()")))`.
uint256 private constant _UNAUTHORIZED_ERROR_SELECTOR = 0x82b42900;
/// @dev `bytes4(keccak256(bytes("NewOwnerIsZeroAddress()")))`.
uint256 private constant _NEW_OWNER_IS_ZERO_ADDRESS_ERROR_SELECTOR = 0x7448fbae;
/// @dev `bytes4(keccak256(bytes("NoHandoverRequest()")))`.
uint256 private constant _NO_HANDOVER_REQUEST_ERROR_SELECTOR = 0x6f5e8818;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* EVENTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The ownership is transferred from `oldOwner` to `newOwner`.
/// This event is intentionally kept the same as OpenZeppelin's Ownable to be
/// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),
/// despite it not being as lightweight as a single argument event.
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
/// @dev An ownership handover to `pendingOwner` has been requested.
event OwnershipHandoverRequested(address indexed pendingOwner);
/// @dev The ownership handover to `pendingOwner` has been cancelled.
event OwnershipHandoverCanceled(address indexed pendingOwner);
/// @dev The `user`'s roles is updated to `roles`.
/// Each bit of `roles` represents whether the role is set.
event RolesUpdated(address indexed user, uint256 indexed roles);
/// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`.
uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =
0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;
/// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`.
uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =
0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;
/// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`.
uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =
0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;
/// @dev `keccak256(bytes("RolesUpdated(address,uint256)"))`.
uint256 private constant _ROLES_UPDATED_EVENT_SIGNATURE =
0x715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* STORAGE */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The owner slot is given by: `not(_OWNER_SLOT_NOT)`.
/// It is intentionally choosen to be a high value
/// to avoid collision with lower slots.
/// The choice of manual storage layout is to enable compatibility
/// with both regular and upgradeable contracts.
///
/// The role slot of `user` is given by:
/// ```
/// mstore(0x00, or(shl(96, user), _OWNER_SLOT_NOT))
/// let roleSlot := keccak256(0x00, 0x20)
/// ```
/// This automatically ignores the upper bits of the `user` in case
/// they are not clean, as well as keep the `keccak256` under 32-bytes.
uint256 private constant _OWNER_SLOT_NOT = 0x8b78c6d8;
/// The ownership handover slot of `newOwner` is given by:
/// ```
/// mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))
/// let handoverSlot := keccak256(0x00, 0x20)
/// ```
/// It stores the expiry timestamp of the two-step ownership handover.
uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* INTERNAL FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Initializes the owner directly without authorization guard.
/// This function must be called upon initialization,
/// regardless of whether the contract is upgradeable or not.
/// This is to enable generalization to both regular and upgradeable contracts,
/// and to save gas in case the initial owner is not the caller.
/// For performance reasons, this function will not check if there
/// is an existing owner.
function _initializeOwner(address newOwner) internal virtual {
assembly {
// Clean the upper 96 bits.
newOwner := shr(96, shl(96, newOwner))
// Store the new value.
sstore(not(_OWNER_SLOT_NOT), newOwner)
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
}
}
/// @dev Sets the owner directly without authorization guard.
function _setOwner(address newOwner) internal virtual {
assembly {
let ownerSlot := not(_OWNER_SLOT_NOT)
// Clean the upper 96 bits.
newOwner := shr(96, shl(96, newOwner))
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
// Store the new value.
sstore(ownerSlot, newOwner)
}
}
/// @dev Grants the roles directly without authorization guard.
/// Each bit of `roles` represents the role to turn on.
function _grantRoles(address user, uint256 roles) internal virtual {
assembly {
// Compute the role slot.
mstore(0x00, or(shl(96, user), _OWNER_SLOT_NOT))
let roleSlot := keccak256(0x00, 0x20)
// Load the current value and `or` it with `roles`.
let newRoles := or(sload(roleSlot), roles)
// Store the new value.
sstore(roleSlot, newRoles)
// Emit the {RolesUpdated} event.
log3(0, 0, _ROLES_UPDATED_EVENT_SIGNATURE, shr(96, shl(96, user)), newRoles)
}
}
/// @dev Removes the roles directly without authorization guard.
/// Each bit of `roles` represents the role to turn off.
function _removeRoles(address user, uint256 roles) internal virtual {
assembly {
// Compute the role slot.
mstore(0x00, or(shl(96, user), _OWNER_SLOT_NOT))
let roleSlot := keccak256(0x00, 0x20)
// Load the current value.
let currentRoles := sload(roleSlot)
// Use `and` to compute the intersection of `currentRoles` and `roles`,
// `xor` it with `currentRoles` to flip the bits in the intersection.
let newRoles := xor(currentRoles, and(currentRoles, roles))
// Then, store the new value.
sstore(roleSlot, newRoles)
// Emit the {RolesUpdated} event.
log3(0, 0, _ROLES_UPDATED_EVENT_SIGNATURE, shr(96, shl(96, user)), newRoles)
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* PUBLIC UPDATE FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Allows the owner to transfer the ownership to `newOwner`.
function transferOwnership(address newOwner) public virtual onlyOwner {
assembly {
// Clean the upper 96 bits.
newOwner := shr(96, shl(96, newOwner))
// Reverts if the `newOwner` is the zero address.
if iszero(newOwner) {
mstore(0x00, _NEW_OWNER_IS_ZERO_ADDRESS_ERROR_SELECTOR)
revert(0x1c, 0x04)
}
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, caller(), newOwner)
// Store the new value.
sstore(not(_OWNER_SLOT_NOT), newOwner)
}
}
/// @dev Allows the owner to renounce their ownership.
function renounceOwnership() public virtual onlyOwner {
assembly {
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, caller(), 0)
// Store the new value.
sstore(not(_OWNER_SLOT_NOT), 0)
}
}
/// @dev Request a two-step ownership handover to the caller.
/// The request will be automatically expire in 48 hours (172800 seconds) by default.
function requestOwnershipHandover() public virtual {
unchecked {
uint256 expires = block.timestamp + ownershipHandoverValidFor();
assembly {
// Compute and set the handover slot to 1.
mstore(0x00, or(shl(96, caller()), _HANDOVER_SLOT_SEED))
sstore(keccak256(0x00, 0x20), expires)
// Emit the {OwnershipHandoverRequested} event.
log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())
}
}
}
/// @dev Cancels the two-step ownership handover to the caller, if any.
function cancelOwnershipHandover() public virtual {
assembly {
// Compute and set the handover slot to 0.
mstore(0x00, or(shl(96, caller()), _HANDOVER_SLOT_SEED))
sstore(keccak256(0x00, 0x20), 0)
// Emit the {OwnershipHandoverCanceled} event.
log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())
}
}
/// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.
/// Reverts if there is no existing ownership handover requested by `pendingOwner`.
function completeOwnershipHandover(address pendingOwner) public virtual onlyOwner {
assembly {
// Clean the upper 96 bits.
pendingOwner := shr(96, shl(96, pendingOwner))
// Compute and set the handover slot to 0.
mstore(0x00, or(shl(96, pendingOwner), _HANDOVER_SLOT_SEED))
let handoverSlot := keccak256(0x00, 0x20)
// If the handover does not exist, or has expired.
if gt(timestamp(), sload(handoverSlot)) {
mstore(0x00, _NO_HANDOVER_REQUEST_ERROR_SELECTOR)
revert(0x1c, 0x04)
}
// Set the handover slot to 0.
sstore(handoverSlot, 0)
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, caller(), pendingOwner)
// Store the new value.
sstore(not(_OWNER_SLOT_NOT), pendingOwner)
}
}
/// @dev Allows the owner to grant `user` `roles`.
/// If the `user` already has a role, then it will be an no-op for the role.
function grantRoles(address user, uint256 roles) public virtual onlyOwner {
_grantRoles(user, roles);
}
/// @dev Allows the owner to remove `user` `roles`.
/// If the `user` does not have a role, then it will be an no-op for the role.
function revokeRoles(address user, uint256 roles) public virtual onlyOwner {
_removeRoles(user, roles);
}
/// @dev Allow the caller to remove their own roles.
/// If the caller does not have a role, then it will be an no-op for the role.
function renounceRoles(uint256 roles) public virtual {
_removeRoles(msg.sender, roles);
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* PUBLIC READ FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Returns the owner of the contract.
function owner() public view virtual returns (address result) {
assembly {
result := sload(not(_OWNER_SLOT_NOT))
}
}
/// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.
function ownershipHandoverExpiresAt(address pendingOwner) public view virtual returns (uint256 result) {
assembly {
// Compute the handover slot.
mstore(0x00, or(shl(96, pendingOwner), _HANDOVER_SLOT_SEED))
// Load the handover slot.
result := sload(keccak256(0x00, 0x20))
}
}
/// @dev Returns how long a two-step ownership handover is valid for in seconds.
function ownershipHandoverValidFor() public view virtual returns (uint64) {
return 48 * 3600;
}
/// @dev Returns whether `user` has any of `roles`.
function hasAnyRole(address user, uint256 roles) public view virtual returns (bool result) {
assembly {
// Compute the role slot.
mstore(0x00, or(shl(96, user), _OWNER_SLOT_NOT))
// Load the stored value, and set the result to whether the
// `and` intersection of the value and `roles` is not zero.
result := iszero(iszero(and(sload(keccak256(0x00, 0x20)), roles)))
}
}
/// @dev Returns whether `user` has all of `roles`.
function hasAllRoles(address user, uint256 roles) public view virtual returns (bool result) {
assembly {
// Compute the role slot.
mstore(0x00, or(shl(96, user), _OWNER_SLOT_NOT))
// Whether the stored value is contains all the set bits in `roles`.
result := eq(and(sload(keccak256(0x00, 0x20)), roles), roles)
}
}
/// @dev Returns the roles of `user`.
function rolesOf(address user) public view virtual returns (uint256 roles) {
assembly {
// Compute the role slot.
mstore(0x00, or(shl(96, user), _OWNER_SLOT_NOT))
// Load the stored value.
roles := sload(keccak256(0x00, 0x20))
}
}
/// @dev Convenience function to return a `roles` bitmap from the `ordinals`.
/// This is meant for frontends like Etherscan, and is therefore not fully optimized.
/// Not recommended to be called on-chain.
function rolesFromOrdinals(uint8[] memory ordinals) public pure returns (uint256 roles) {
assembly {
// Skip the length slot.
let o := add(ordinals, 0x20)
// `shl` 5 is equivalent to multiplying by 0x20.
let end := add(o, shl(5, mload(ordinals)))
// prettier-ignore
for {} iszero(eq(o, end)) { o := add(o, 0x20) } {
roles := or(roles, shl(and(mload(o), 0xff), 1))
}
}
}
/// @dev Convenience function to return a `roles` bitmap from the `ordinals`.
/// This is meant for frontends like Etherscan, and is therefore not fully optimized.
/// Not recommended to be called on-chain.
function ordinalsFromRoles(uint256 roles) public pure returns (uint8[] memory ordinals) {
assembly {
// Grab the pointer to the free memory.
let ptr := add(mload(0x40), 0x20)
// The absence of lookup tables, De Bruijn, etc., here is intentional for
// smaller bytecode, as this function is not meant to be called on-chain.
// prettier-ignore
for { let i := 0 } 1 { i := add(i, 1) } {
mstore(ptr, i)
// `shr` 5 is equivalent to multiplying by 0x20.
// Push back into the ordinals array if the bit is set.
ptr := add(ptr, shl(5, and(roles, 1)))
roles := shr(1, roles)
// prettier-ignore
if iszero(roles) { break }
}
// Set `ordinals` to the start of the free memory.
ordinals := mload(0x40)
// Allocate the memory.
mstore(0x40, ptr)
// Store the length of `ordinals`.
mstore(ordinals, shr(5, sub(ptr, add(ordinals, 0x20))))
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* MODIFIERS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Marks a function as only callable by the owner.
modifier onlyOwner() virtual {
assembly {
// If the caller is not the stored owner, revert.
if iszero(eq(caller(), sload(not(_OWNER_SLOT_NOT)))) {
mstore(0x00, _UNAUTHORIZED_ERROR_SELECTOR)
revert(0x1c, 0x04)
}
}
_;
}
/// @dev Marks a function as only callable by an account with `roles`.
modifier onlyRoles(uint256 roles) virtual {
assembly {
// Compute the role slot.
mstore(0x00, or(shl(96, caller()), _OWNER_SLOT_NOT))
// Load the stored value, and if the `and` intersection
// of the value and `roles` is zero, revert.
if iszero(and(sload(keccak256(0x00, 0x20)), roles)) {
mstore(0x00, _UNAUTHORIZED_ERROR_SELECTOR)
revert(0x1c, 0x04)
}
}
_;
}
/// @dev Marks a function as only callable by the owner or by an account
/// with `roles`. Checks for ownership first, then lazily checks for roles.
modifier onlyOwnerOrRoles(uint256 roles) virtual {
assembly {
// If the caller is not the stored owner.
if iszero(eq(caller(), sload(not(_OWNER_SLOT_NOT)))) {
// Compute the role slot.
mstore(0x00, or(shl(96, caller()), _OWNER_SLOT_NOT))
// Load the stored value, and if the `and` intersection
// of the value and `roles` is zero, revert.
if iszero(and(sload(keccak256(0x00, 0x20)), roles)) {
mstore(0x00, _UNAUTHORIZED_ERROR_SELECTOR)
revert(0x1c, 0x04)
}
}
}
_;
}
/// @dev Marks a function as only callable by an account with `roles`
/// or the owner. Checks for roles first, then lazily checks for ownership.
modifier onlyRolesOrOwner(uint256 roles) virtual {
assembly {
// Compute the role slot.
mstore(0x00, or(shl(96, caller()), _OWNER_SLOT_NOT))
// Load the stored value, and if the `and` intersection
// of the value and `roles` is zero, revert.
if iszero(and(sload(keccak256(0x00, 0x20)), roles)) {
// If the caller is not the stored owner.
if iszero(eq(caller(), sload(not(_OWNER_SLOT_NOT)))) {
mstore(0x00, _UNAUTHORIZED_ERROR_SELECTOR)
revert(0x1c, 0x04)
}
}
}
_;
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* ROLE CONSTANTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
// IYKYK
uint256 internal constant _ROLE_0 = 1 << 0;
uint256 internal constant _ROLE_1 = 1 << 1;
uint256 internal constant _ROLE_2 = 1 << 2;
uint256 internal constant _ROLE_3 = 1 << 3;
uint256 internal constant _ROLE_4 = 1 << 4;
uint256 internal constant _ROLE_5 = 1 << 5;
uint256 internal constant _ROLE_6 = 1 << 6;
uint256 internal constant _ROLE_7 = 1 << 7;
uint256 internal constant _ROLE_8 = 1 << 8;
uint256 internal constant _ROLE_9 = 1 << 9;
uint256 internal constant _ROLE_10 = 1 << 10;
uint256 internal constant _ROLE_11 = 1 << 11;
uint256 internal constant _ROLE_12 = 1 << 12;
uint256 internal constant _ROLE_13 = 1 << 13;
uint256 internal constant _ROLE_14 = 1 << 14;
uint256 internal constant _ROLE_15 = 1 << 15;
uint256 internal constant _ROLE_16 = 1 << 16;
uint256 internal constant _ROLE_17 = 1 << 17;
uint256 internal constant _ROLE_18 = 1 << 18;
uint256 internal constant _ROLE_19 = 1 << 19;
uint256 internal constant _ROLE_20 = 1 << 20;
uint256 internal constant _ROLE_21 = 1 << 21;
uint256 internal constant _ROLE_22 = 1 << 22;
uint256 internal constant _ROLE_23 = 1 << 23;
uint256 internal constant _ROLE_24 = 1 << 24;
uint256 internal constant _ROLE_25 = 1 << 25;
uint256 internal constant _ROLE_26 = 1 << 26;
uint256 internal constant _ROLE_27 = 1 << 27;
uint256 internal constant _ROLE_28 = 1 << 28;
uint256 internal constant _ROLE_29 = 1 << 29;
uint256 internal constant _ROLE_30 = 1 << 30;
uint256 internal constant _ROLE_31 = 1 << 31;
uint256 internal constant _ROLE_32 = 1 << 32;
uint256 internal constant _ROLE_33 = 1 << 33;
uint256 internal constant _ROLE_34 = 1 << 34;
uint256 internal constant _ROLE_35 = 1 << 35;
uint256 internal constant _ROLE_36 = 1 << 36;
uint256 internal constant _ROLE_37 = 1 << 37;
uint256 internal constant _ROLE_38 = 1 << 38;
uint256 internal constant _ROLE_39 = 1 << 39;
uint256 internal constant _ROLE_40 = 1 << 40;
uint256 internal constant _ROLE_41 = 1 << 41;
uint256 internal constant _ROLE_42 = 1 << 42;
uint256 internal constant _ROLE_43 = 1 << 43;
uint256 internal constant _ROLE_44 = 1 << 44;
uint256 internal constant _ROLE_45 = 1 << 45;
uint256 internal constant _ROLE_46 = 1 << 46;
uint256 internal constant _ROLE_47 = 1 << 47;
uint256 internal constant _ROLE_48 = 1 << 48;
uint256 internal constant _ROLE_49 = 1 << 49;
uint256 internal constant _ROLE_50 = 1 << 50;
uint256 internal constant _ROLE_51 = 1 << 51;
uint256 internal constant _ROLE_52 = 1 << 52;
uint256 internal constant _ROLE_53 = 1 << 53;
uint256 internal constant _ROLE_54 = 1 << 54;
uint256 internal constant _ROLE_55 = 1 << 55;
uint256 internal constant _ROLE_56 = 1 << 56;
uint256 internal constant _ROLE_57 = 1 << 57;
uint256 internal constant _ROLE_58 = 1 << 58;
uint256 internal constant _ROLE_59 = 1 << 59;
uint256 internal constant _ROLE_60 = 1 << 60;
uint256 internal constant _ROLE_61 = 1 << 61;
uint256 internal constant _ROLE_62 = 1 << 62;
uint256 internal constant _ROLE_63 = 1 << 63;
uint256 internal constant _ROLE_64 = 1 << 64;
uint256 internal constant _ROLE_65 = 1 << 65;
uint256 internal constant _ROLE_66 = 1 << 66;
uint256 internal constant _ROLE_67 = 1 << 67;
uint256 internal constant _ROLE_68 = 1 << 68;
uint256 internal constant _ROLE_69 = 1 << 69;
uint256 internal constant _ROLE_70 = 1 << 70;
uint256 internal constant _ROLE_71 = 1 << 71;
uint256 internal constant _ROLE_72 = 1 << 72;
uint256 internal constant _ROLE_73 = 1 << 73;
uint256 internal constant _ROLE_74 = 1 << 74;
uint256 internal constant _ROLE_75 = 1 << 75;
uint256 internal constant _ROLE_76 = 1 << 76;
uint256 internal constant _ROLE_77 = 1 << 77;
uint256 internal constant _ROLE_78 = 1 << 78;
uint256 internal constant _ROLE_79 = 1 << 79;
uint256 internal constant _ROLE_80 = 1 << 80;
uint256 internal constant _ROLE_81 = 1 << 81;
uint256 internal constant _ROLE_82 = 1 << 82;
uint256 internal constant _ROLE_83 = 1 << 83;
uint256 internal constant _ROLE_84 = 1 << 84;
uint256 internal constant _ROLE_85 = 1 << 85;
uint256 internal constant _ROLE_86 = 1 << 86;
uint256 internal constant _ROLE_87 = 1 << 87;
uint256 internal constant _ROLE_88 = 1 << 88;
uint256 internal constant _ROLE_89 = 1 << 89;
uint256 internal constant _ROLE_90 = 1 << 90;
uint256 internal constant _ROLE_91 = 1 << 91;
uint256 internal constant _ROLE_92 = 1 << 92;
uint256 internal constant _ROLE_93 = 1 << 93;
uint256 internal constant _ROLE_94 = 1 << 94;
uint256 internal constant _ROLE_95 = 1 << 95;
uint256 internal constant _ROLE_96 = 1 << 96;
uint256 internal constant _ROLE_97 = 1 << 97;
uint256 internal constant _ROLE_98 = 1 << 98;
uint256 internal constant _ROLE_99 = 1 << 99;
uint256 internal constant _ROLE_100 = 1 << 100;
uint256 internal constant _ROLE_101 = 1 << 101;
uint256 internal constant _ROLE_102 = 1 << 102;
uint256 internal constant _ROLE_103 = 1 << 103;
uint256 internal constant _ROLE_104 = 1 << 104;
uint256 internal constant _ROLE_105 = 1 << 105;
uint256 internal constant _ROLE_106 = 1 << 106;
uint256 internal constant _ROLE_107 = 1 << 107;
uint256 internal constant _ROLE_108 = 1 << 108;
uint256 internal constant _ROLE_109 = 1 << 109;
uint256 internal constant _ROLE_110 = 1 << 110;
uint256 internal constant _ROLE_111 = 1 << 111;
uint256 internal constant _ROLE_112 = 1 << 112;
uint256 internal constant _ROLE_113 = 1 << 113;
uint256 internal constant _ROLE_114 = 1 << 114;
uint256 internal constant _ROLE_115 = 1 << 115;
uint256 internal constant _ROLE_116 = 1 << 116;
uint256 internal constant _ROLE_117 = 1 << 117;
uint256 internal constant _ROLE_118 = 1 << 118;
uint256 internal constant _ROLE_119 = 1 << 119;
uint256 internal constant _ROLE_120 = 1 << 120;
uint256 internal constant _ROLE_121 = 1 << 121;
uint256 internal constant _ROLE_122 = 1 << 122;
uint256 internal constant _ROLE_123 = 1 << 123;
uint256 internal constant _ROLE_124 = 1 << 124;
uint256 internal constant _ROLE_125 = 1 << 125;
uint256 internal constant _ROLE_126 = 1 << 126;
uint256 internal constant _ROLE_127 = 1 << 127;
uint256 internal constant _ROLE_128 = 1 << 128;
uint256 internal constant _ROLE_129 = 1 << 129;
uint256 internal constant _ROLE_130 = 1 << 130;
uint256 internal constant _ROLE_131 = 1 << 131;
uint256 internal constant _ROLE_132 = 1 << 132;
uint256 internal constant _ROLE_133 = 1 << 133;
uint256 internal constant _ROLE_134 = 1 << 134;
uint256 internal constant _ROLE_135 = 1 << 135;
uint256 internal constant _ROLE_136 = 1 << 136;
uint256 internal constant _ROLE_137 = 1 << 137;
uint256 internal constant _ROLE_138 = 1 << 138;
uint256 internal constant _ROLE_139 = 1 << 139;
uint256 internal constant _ROLE_140 = 1 << 140;
uint256 internal constant _ROLE_141 = 1 << 141;
uint256 internal constant _ROLE_142 = 1 << 142;
uint256 internal constant _ROLE_143 = 1 << 143;
uint256 internal constant _ROLE_144 = 1 << 144;
uint256 internal constant _ROLE_145 = 1 << 145;
uint256 internal constant _ROLE_146 = 1 << 146;
uint256 internal constant _ROLE_147 = 1 << 147;
uint256 internal constant _ROLE_148 = 1 << 148;
uint256 internal constant _ROLE_149 = 1 << 149;
uint256 internal constant _ROLE_150 = 1 << 150;
uint256 internal constant _ROLE_151 = 1 << 151;
uint256 internal constant _ROLE_152 = 1 << 152;
uint256 internal constant _ROLE_153 = 1 << 153;
uint256 internal constant _ROLE_154 = 1 << 154;
uint256 internal constant _ROLE_155 = 1 << 155;
uint256 internal constant _ROLE_156 = 1 << 156;
uint256 internal constant _ROLE_157 = 1 << 157;
uint256 internal constant _ROLE_158 = 1 << 158;
uint256 internal constant _ROLE_159 = 1 << 159;
uint256 internal constant _ROLE_160 = 1 << 160;
uint256 internal constant _ROLE_161 = 1 << 161;
uint256 internal constant _ROLE_162 = 1 << 162;
uint256 internal constant _ROLE_163 = 1 << 163;
uint256 internal constant _ROLE_164 = 1 << 164;
uint256 internal constant _ROLE_165 = 1 << 165;
uint256 internal constant _ROLE_166 = 1 << 166;
uint256 internal constant _ROLE_167 = 1 << 167;
uint256 internal constant _ROLE_168 = 1 << 168;
uint256 internal constant _ROLE_169 = 1 << 169;
uint256 internal constant _ROLE_170 = 1 << 170;
uint256 internal constant _ROLE_171 = 1 << 171;
uint256 internal constant _ROLE_172 = 1 << 172;
uint256 internal constant _ROLE_173 = 1 << 173;
uint256 internal constant _ROLE_174 = 1 << 174;
uint256 internal constant _ROLE_175 = 1 << 175;
uint256 internal constant _ROLE_176 = 1 << 176;
uint256 internal constant _ROLE_177 = 1 << 177;
uint256 internal constant _ROLE_178 = 1 << 178;
uint256 internal constant _ROLE_179 = 1 << 179;
uint256 internal constant _ROLE_180 = 1 << 180;
uint256 internal constant _ROLE_181 = 1 << 181;
uint256 internal constant _ROLE_182 = 1 << 182;
uint256 internal constant _ROLE_183 = 1 << 183;
uint256 internal constant _ROLE_184 = 1 << 184;
uint256 internal constant _ROLE_185 = 1 << 185;
uint256 internal constant _ROLE_186 = 1 << 186;
uint256 internal constant _ROLE_187 = 1 << 187;
uint256 internal constant _ROLE_188 = 1 << 188;
uint256 internal constant _ROLE_189 = 1 << 189;
uint256 internal constant _ROLE_190 = 1 << 190;
uint256 internal constant _ROLE_191 = 1 << 191;
uint256 internal constant _ROLE_192 = 1 << 192;
uint256 internal constant _ROLE_193 = 1 << 193;
uint256 internal constant _ROLE_194 = 1 << 194;
uint256 internal constant _ROLE_195 = 1 << 195;
uint256 internal constant _ROLE_196 = 1 << 196;
uint256 internal constant _ROLE_197 = 1 << 197;
uint256 internal constant _ROLE_198 = 1 << 198;
uint256 internal constant _ROLE_199 = 1 << 199;
uint256 internal constant _ROLE_200 = 1 << 200;
uint256 internal constant _ROLE_201 = 1 << 201;
uint256 internal constant _ROLE_202 = 1 << 202;
uint256 internal constant _ROLE_203 = 1 << 203;
uint256 internal constant _ROLE_204 = 1 << 204;
uint256 internal constant _ROLE_205 = 1 << 205;
uint256 internal constant _ROLE_206 = 1 << 206;
uint256 internal constant _ROLE_207 = 1 << 207;
uint256 internal constant _ROLE_208 = 1 << 208;
uint256 internal constant _ROLE_209 = 1 << 209;
uint256 internal constant _ROLE_210 = 1 << 210;
uint256 internal constant _ROLE_211 = 1 << 211;
uint256 internal constant _ROLE_212 = 1 << 212;
uint256 internal constant _ROLE_213 = 1 << 213;
uint256 internal constant _ROLE_214 = 1 << 214;
uint256 internal constant _ROLE_215 = 1 << 215;
uint256 internal constant _ROLE_216 = 1 << 216;
uint256 internal constant _ROLE_217 = 1 << 217;
uint256 internal constant _ROLE_218 = 1 << 218;
uint256 internal constant _ROLE_219 = 1 << 219;
uint256 internal constant _ROLE_220 = 1 << 220;
uint256 internal constant _ROLE_221 = 1 << 221;
uint256 internal constant _ROLE_222 = 1 << 222;
uint256 internal constant _ROLE_223 = 1 << 223;
uint256 internal constant _ROLE_224 = 1 << 224;
uint256 internal constant _ROLE_225 = 1 << 225;
uint256 internal constant _ROLE_226 = 1 << 226;
uint256 internal constant _ROLE_227 = 1 << 227;
uint256 internal constant _ROLE_228 = 1 << 228;
uint256 internal constant _ROLE_229 = 1 << 229;
uint256 internal constant _ROLE_230 = 1 << 230;
uint256 internal constant _ROLE_231 = 1 << 231;
uint256 internal constant _ROLE_232 = 1 << 232;
uint256 internal constant _ROLE_233 = 1 << 233;
uint256 internal constant _ROLE_234 = 1 << 234;
uint256 internal constant _ROLE_235 = 1 << 235;
uint256 internal constant _ROLE_236 = 1 << 236;
uint256 internal constant _ROLE_237 = 1 << 237;
uint256 internal constant _ROLE_238 = 1 << 238;
uint256 internal constant _ROLE_239 = 1 << 239;
uint256 internal constant _ROLE_240 = 1 << 240;
uint256 internal constant _ROLE_241 = 1 << 241;
uint256 internal constant _ROLE_242 = 1 << 242;
uint256 internal constant _ROLE_243 = 1 << 243;
uint256 internal constant _ROLE_244 = 1 << 244;
uint256 internal constant _ROLE_245 = 1 << 245;
uint256 internal constant _ROLE_246 = 1 << 246;
uint256 internal constant _ROLE_247 = 1 << 247;
uint256 internal constant _ROLE_248 = 1 << 248;
uint256 internal constant _ROLE_249 = 1 << 249;
uint256 internal constant _ROLE_250 = 1 << 250;
uint256 internal constant _ROLE_251 = 1 << 251;
uint256 internal constant _ROLE_252 = 1 << 252;
uint256 internal constant _ROLE_253 = 1 << 253;
uint256 internal constant _ROLE_254 = 1 << 254;
uint256 internal constant _ROLE_255 = 1 << 255;
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"operator","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"allowed","type":"bool"}],"name":"OperatorAllowed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"operator","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"blocked","type":"bool"}],"name":"OperatorBlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"roles","type":"uint256"}],"name":"RolesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BURNER_ROLE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64[]","name":"quantities","type":"uint64[]"},{"internalType":"address[]","name":"recipients","type":"address[]"}],"name":"batchAirdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelOwnershipHandover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"grantRoles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"hasAllRoles","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"hasAnyRole","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"treasury_","type":"address"},{"internalType":"address","name":"royalty_","type":"address"},{"internalType":"uint96","name":"royaltyFee_","type":"uint96"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPerWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"quantity","type":"uint64"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint64","name":"quantity","type":"uint64"}],"name":"mintTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"ordinalsFromRoles","outputs":[{"internalType":"uint8[]","name":"ordinals","type":"uint8[]"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownershipHandoverValidFor","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"quantity","type":"uint64"},{"internalType":"uint256","name":"allowed","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"presaleMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint64","name":"quantity","type":"uint64"},{"internalType":"uint256","name":"allowed","type":"uint256"},{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"}],"name":"presaleMintTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"renounceRoles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"revokeRoles","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8[]","name":"ordinals","type":"uint8[]"}],"name":"rolesFromOrdinals","outputs":[{"internalType":"uint256","name":"roles","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"rolesOf","outputs":[{"internalType":"uint256","name":"roles","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"newRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setOperatorFilteringEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTreasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxAmount","type":"uint256"},{"internalType":"uint256","name":"newMaxPerMint","type":"uint256"},{"internalType":"uint256","name":"newMaxPerWallet","type":"uint256"},{"internalType":"uint256","name":"newPrice","type":"uint256"},{"internalType":"bool","name":"presale","type":"bool"}],"name":"startSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stopSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRevenue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6080604052610106805461ffff191690553480156200001d57600080fd5b50620000286200002e565b620000f0565b600054610100900460ff16156200009b5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000ee576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61417080620001006000396000f3fe6080604052600436106103975760003560e01c806361d027b3116101dc578063b88d4fde11610102578063e985e9c5116100a0578063f2fde38b1161006f578063f2fde38b14610aa0578063fb9d09c814610ac0578063fd51fae814610ad3578063fee81cf414610ae657600080fd5b8063e985e9c514610a02578063ec87621c14610a4b578063f04e283e14610a60578063f0f4426014610a8057600080fd5b8063c87b56dd116100dc578063c87b56dd1461098f578063d53ab501146109af578063d7533f02146109cf578063e36b0b37146109ed57600080fd5b8063b88d4fde1461093a578063bf2d9e0b1461095a578063bfa9aadc1461096f57600080fd5b8063789e3a551161017a57806395d89b411161014957806395d89b41146108cf578063a035b1fe146108e4578063a22cb465146108fa578063b7c0b8e81461091a57600080fd5b8063789e3a55146108635780637cb64759146108835780638da5cb5b146108a357806393d756aa146108bc57600080fd5b806370a08231116101b657806370a08231146107ec578063715018a61461080c5780637359e41f1461082157806375b238fc1461084e57600080fd5b806361d027b3146107905780636352211e146107ae57806368428a1b146107ce57600080fd5b80632f745c59116102c15780634f6ccce71161025f57806354d1f13d1161022e57806354d1f13d1461072557806355f804b31461073a5780635944c7531461075a5780635f48f3931461077a57600080fd5b80634f6ccce71461069f578063507e094f146106bf578063514e62fc146106d557806353135ca01461070c57600080fd5b806342842e0e1161029b57806342842e0e1461062957806342966c6814610649578063453c2310146106695780634a4ee7b11461067f57600080fd5b80632f745c59146105e1578063386bacdc146106015780633ccfd60b1461061457600080fd5b8063183a4f6e1161033957806325692962116103085780632569296214610547578063282c51f31461055c5780632a55205a146105715780632de94807146105b057600080fd5b8063183a4f6e146104b05780631c10893f146104d05780631cd64df4146104f057806323b872dd1461052757600080fd5b8063081812fc11610375578063081812fc14610415578063095ea7b31461044d57806313a661ed1461046d57806318160ddd1461049b57600080fd5b806301ffc9a71461039c57806304634d8d146103d157806306fdde03146103f3575b600080fd5b3480156103a857600080fd5b506103bc6103b73660046134e0565b610b17565b60405190151581526020015b60405180910390f35b3480156103dd57600080fd5b506103f16103ec366004613530565b610b55565b005b3480156103ff57600080fd5b50610408610b9a565b6040516103c891906135bb565b34801561042157600080fd5b506104356104303660046135ce565b610c2c565b6040516001600160a01b0390911681526020016103c8565b34801561045957600080fd5b506103f16104683660046135e7565b610c53565b34801561047957600080fd5b5061048d610488366004613657565b610c72565b6040519081526020016103c8565b3480156104a757600080fd5b5060cf5461048d565b3480156104bc57600080fd5b506103f16104cb3660046135ce565b610ca5565b3480156104dc57600080fd5b506103f16104eb3660046135e7565b610cb2565b3480156104fc57600080fd5b506103bc61050b3660046135e7565b60609190911b638b78c6d8176000908152602090205481161490565b34801561053357600080fd5b506103f161054236600461370f565b610cdb565b34801561055357600080fd5b506103f1610d11565b34801561056857600080fd5b5061048d600481565b34801561057d57600080fd5b5061059161058c36600461374b565b610d61565b604080516001600160a01b0390931683526020830191909152016103c8565b3480156105bc57600080fd5b5061048d6105cb36600461376d565b60601b638b78c6d8176000908152602090205490565b3480156105ed57600080fd5b5061048d6105fc3660046135e7565b610e0f565b6103f161060f3660046137e3565b610eaa565b34801561062057600080fd5b506103f1611126565b34801561063557600080fd5b506103f161064436600461370f565b611291565b34801561065557600080fd5b506103f16106643660046135ce565b6112c1565b34801561067557600080fd5b506101045461048d565b34801561068b57600080fd5b506103f161069a3660046135e7565b61132f565b3480156106ab57600080fd5b5061048d6106ba3660046135ce565b611354565b3480156106cb57600080fd5b506101035461048d565b3480156106e157600080fd5b506103bc6106f03660046135e7565b60609190911b638b78c6d8176000908152602090205416151590565b34801561071857600080fd5b506101065460ff166103bc565b34801561073157600080fd5b506103f16113e7565b34801561074657600080fd5b506103f16107553660046138b3565b611424565b34801561076657600080fd5b506103f16107753660046138e7565b611467565b34801561078657600080fd5b506101025461048d565b34801561079c57600080fd5b506098546001600160a01b0316610435565b3480156107ba57600080fd5b506104356107c93660046135ce565b6114a8565b3480156107da57600080fd5b5061010654610100900460ff166103bc565b3480156107f857600080fd5b5061048d61080736600461376d565b611508565b34801561081857600080fd5b506103f161158e565b34801561082d57600080fd5b5061084161083c3660046135ce565b6115ca565b6040516103c89190613923565b34801561085a57600080fd5b5061048d600181565b34801561086f57600080fd5b506103f161087e36600461397a565b611612565b34801561088f57600080fd5b506103f161089e3660046135ce565b61167a565b3480156108af57600080fd5b50638b78c6d81954610435565b6103f16108ca3660046139c3565b6116b7565b3480156108db57600080fd5b5061040861183f565b3480156108f057600080fd5b506101055461048d565b34801561090657600080fd5b506103f16109153660046139ed565b61184e565b34801561092657600080fd5b506103f1610935366004613a17565b61186d565b34801561094657600080fd5b506103f1610955366004613a32565b6118b7565b34801561096657600080fd5b5060995461048d565b34801561097b57600080fd5b506103f161098a366004613aad565b6118ef565b34801561099b57600080fd5b506104086109aa3660046135ce565b611a1c565b3480156109bb57600080fd5b506103f16109ca366004613b51565b611a83565b3480156109db57600080fd5b506040516202a30081526020016103c8565b3480156109f957600080fd5b506103f1611b66565b348015610a0e57600080fd5b506103bc610a1d366004613bb0565b6001600160a01b03918216600090815260a06020908152604080832093909416825291909152205460ff1690565b348015610a5757600080fd5b5061048d600281565b348015610a6c57600080fd5b506103f1610a7b36600461376d565b611bab565b348015610a8c57600080fd5b506103f1610a9b36600461376d565b611c1b565b348015610aac57600080fd5b506103f1610abb36600461376d565b611c74565b6103f1610ace366004613bda565b611cc9565b6103f1610ae1366004613bf5565b611e3c565b348015610af257600080fd5b5061048d610b0136600461376d565b60601b63389a75e1176000908152602090205490565b6000610b228261208c565b80610b315750610b31826120cc565b80610b405750610b40826120f1565b80610b4f5750610b4f826120cc565b92915050565b6001638b78c6d83360601b176000528060206000205416610b8b57638b78c6d819543314610b8b576382b429006000526004601cfd5b610b958383612116565b505050565b6060609b8054610ba990613c63565b80601f0160208091040260200160405190810160405280929190818152602001828054610bd590613c63565b8015610c225780601f10610bf757610100808354040283529160200191610c22565b820191906000526020600020905b815481529060010190602001808311610c0557829003601f168201915b5050505050905090565b6000610c37826121d0565b506000908152609f60205260409020546001600160a01b031690565b81609a5460ff1615610c6857610c688161222f565b610b958383612273565b600060208201825160051b81015b808214610c9e57600160ff8351161b83179250602082019150610c80565b5050919050565b610caf3382612383565b50565b638b78c6d819543314610ccd576382b429006000526004601cfd5b610cd782826123d4565b5050565b826001600160a01b0381163314610d0057609a5460ff1615610d0057610d003361222f565b610d0b848484612420565b50505050565b60006202a3006001600160401b03164201905063389a75e13360601b1760005280602060002055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b60008281526066602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610dd65750604080518082019091526065546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610df5906001600160601b031687613cb3565b610dff9190613ce8565b91519350909150505b9250929050565b6000610e1a83611508565b8210610e815760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084015b60405180910390fd5b506001600160a01b0391909116600090815260cd60209081526040808320938352929052205490565b836000816001600160401b031611610ed45760405162461bcd60e51b8152600401610e7890613cfc565b60006101025411610ee6576001610f09565b61010254610f06826001600160401b0316610f0060cf5490565b90612451565b11155b610f255760405162461bcd60e51b8152600401610e7890613d23565b61010354816001600160401b03161115610f515760405162461bcd60e51b8152600401610e7890613d50565b6000610f856001600160401b03871660ff83335b6001600160a01b0316815260208101919091526040016000205490612451565b6101065490915060ff16610fd05760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b6044820152606401610e78565b610100546000036110155760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b6044820152606401610e78565b610104548111156110385760405162461bcd60e51b8152600401610e7890613d7f565b848111156110585760405162461bcd60e51b8152600401610e7890613d7f565b6110d684848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050610100546040516bffffffffffffffffffffffff193360601b166020820152603481018b905290925060540190505b6040516020818303038152906040528051906020012061245d565b6111145760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b6044820152606401610e78565b61111e8633612473565b505050505050565b6001638b78c6d83360601b17600052806020600020541661115c57638b78c6d81954331461115c576382b429006000526004601cfd5b600047116111985760405162461bcd60e51b8152602060048201526009602482015268302062616c616e636560b81b6044820152606401610e78565b609754604051639af608c960e01b81523060048201526001600160a01b039091169047906000908390639af608c990602401602060405180830381865afa1580156111e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120b9190613db6565b60405163b9bff4bb60e01b8152600481018290529091506001600160a01b0384169063b9bff4bb90602401600060405180830381600087803b15801561125057600080fd5b505af1158015611264573d6000803e3d6000fd5b505050506112728382612584565b609854610d0b906001600160a01b031661128c848461269d565b612584565b826001600160a01b03811633146112b657609a5460ff16156112b6576112b63361222f565b610d0b8484846126a9565b6004638b78c6d83360601b1760005280602060002054166112ea576382b429006000526004601cfd5b333b6113265760405162461bcd60e51b815260206004820152600b60248201526a139bdd08105b1b1bddd95960aa1b6044820152606401610e78565b610cd7826126c4565b638b78c6d81954331461134a576382b429006000526004601cfd5b610cd78282612383565b600061135f60cf5490565b82106113c25760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e78565b60cf82815481106113d5576113d5613dcf565b90600052602060002001549050919050565b63389a75e13360601b176000526000602060002055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b6002638b78c6d83360601b17600052806020600020541661145a57638b78c6d81954331461145a576382b429006000526004601cfd5b610101610b958382613e2b565b6001638b78c6d83360601b17600052806020600020541661149d57638b78c6d81954331461149d576382b429006000526004601cfd5b610d0b84848461276b565b6000818152609d60205260408120546001600160a01b031680610b4f5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e78565b60006001600160a01b0382166115725760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610e78565b506001600160a01b03166000908152609e602052604090205490565b638b78c6d8195433146115a9576382b429006000526004601cfd5b60003360008051602061411b833981519152600080a36000638b78c6d81955565b606060206040510160005b8082526001841660051b820191508360011c935083156115f7576001016115d5565b5060405191508060405260208201810360051c825250919050565b6002638b78c6d83360601b17600052806020600020541661164857638b78c6d819543314611648576382b429006000526004601cfd5b50610106805491151561ffff199092169190911761010017905561010293909355610103919091556101045561010555565b6002638b78c6d83360601b1760005280602060002054166116b057638b78c6d8195433146116b0576382b429006000526004601cfd5b5061010055565b806000816001600160401b0316116116e15760405162461bcd60e51b8152600401610e7890613cfc565b600061010254116116f3576001611710565b6101025461170d826001600160401b0316610f0060cf5490565b11155b61172c5760405162461bcd60e51b8152600401610e7890613d23565b61010354816001600160401b031611156117585760405162461bcd60e51b8152600401610e7890613d50565b6101065460ff161561179d5760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b6044820152606401610e78565b61010654610100900460ff166117e75760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b6044820152606401610e78565b610104546001600160a01b038416600090815260ff6020526040902054611817906001600160401b038516612451565b11156118355760405162461bcd60e51b8152600401610e7890613d7f565b610b958284612473565b6060609c8054610ba990613c63565b81609a5460ff1615611863576118638161222f565b610b958383612836565b6001638b78c6d83360601b1760005280602060002054166118a357638b78c6d8195433146118a3576382b429006000526004601cfd5b50609a805460ff1916911515919091179055565b836001600160a01b03811633146118dc57609a5460ff16156118dc576118dc3361222f565b6118e885858585612841565b5050505050565b600054610100900460ff161580801561190f5750600054600160ff909116105b806119295750303b158015611929575060005460ff166001145b61198c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610e78565b6000805460ff1916600117905580156119af576000805461ff0019166101001790555b6119b98686612873565b6119c16128a4565b6119cd878585856128cd565b8015611a13576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6060611a27826121d0565b6000611a3161294d565b90506000815111611a515760405180602001604052806000815250611a7c565b80611a5b8461295d565b604051602001611a6c929190613eea565b6040516020818303038152906040525b9392505050565b6002638b78c6d83360601b176000528060206000205416611ab957638b78c6d819543314611ab9576382b429006000526004601cfd5b81848114611afd5760405162461bcd60e51b8152602060048201526011602482015270496e76616c696420417267756d656e747360781b6044820152606401610e78565b60005b81811015611a1357611b5e878783818110611b1d57611b1d613dcf565b9050602002016020810190611b329190613bda565b868684818110611b4457611b44613dcf565b9050602002016020810190611b59919061376d565b612a65565b600101611b00565b6002638b78c6d83360601b176000528060206000205416611b9c57638b78c6d819543314611b9c576382b429006000526004601cfd5b50610106805461ffff19169055565b638b78c6d819543314611bc6576382b429006000526004601cfd5b8060601b60601c905063389a75e18160601b1760005260206000208054421115611bf857636f5e88186000526004601cfd5b6000815550803360008051602061411b833981519152600080a3638b78c6d81955565b6001638b78c6d83360601b176000528060206000205416611c5157638b78c6d819543314611c51576382b429006000526004601cfd5b50609880546001600160a01b0319166001600160a01b0392909216919091179055565b638b78c6d819543314611c8f576382b429006000526004601cfd5b6001600160a01b031680611cab57637448fbae6000526004601cfd5b803360008051602061411b833981519152600080a3638b78c6d81955565b806000816001600160401b031611611cf35760405162461bcd60e51b8152600401610e7890613cfc565b60006101025411611d05576001611d22565b61010254611d1f826001600160401b0316610f0060cf5490565b11155b611d3e5760405162461bcd60e51b8152600401610e7890613d23565b61010354816001600160401b03161115611d6a5760405162461bcd60e51b8152600401610e7890613d50565b6101065460ff1615611daf5760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b6044820152606401610e78565b61010654610100900460ff16611df95760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b6044820152606401610e78565b61010454611e146001600160401b03841660ff600033610f65565b1115611e325760405162461bcd60e51b8152600401610e7890613d7f565b610cd78233612473565b836000816001600160401b031611611e665760405162461bcd60e51b8152600401610e7890613cfc565b60006101025411611e78576001611e95565b61010254611e92826001600160401b0316610f0060cf5490565b11155b611eb15760405162461bcd60e51b8152600401610e7890613d23565b61010354816001600160401b03161115611edd5760405162461bcd60e51b8152600401610e7890613d50565b6001600160a01b038616600090815260ff6020526040812054611f09906001600160401b038816612451565b6101065490915060ff16611f545760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b6044820152606401610e78565b61010054600003611f995760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b6044820152606401610e78565b61010454811115611fbc5760405162461bcd60e51b8152600401610e7890613d7f565b84811115611fdc5760405162461bcd60e51b8152600401610e7890613d7f565b61204484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050610100546040516bffffffffffffffffffffffff1960608e901b166020820152603481018b905290925060540190506110bb565b6120825760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b6044820152606401610e78565b611a138688612473565b60006001600160e01b031982166380ac58cd60e01b14806120bd57506001600160e01b03198216635b5e139f60e01b145b80610b4f5750610b4f826120f1565b60006001600160e01b0319821663780e9d6360e01b1480610b4f5750610b4f8261208c565b60006001600160e01b03198216632fea6ab760e21b1480610b4f5750610b4f82612aa1565b6127106001600160601b03821611156121415760405162461bcd60e51b8152600401610e7890613f19565b6001600160a01b0382166121975760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610e78565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217606555565b6000818152609d60205260409020546001600160a01b0316610caf5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e78565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa61226b573d6000803e3d6000fd5b6000603a5250565b600061227e826114a8565b9050806001600160a01b0316836001600160a01b0316036122eb5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610e78565b336001600160a01b038216148061230757506123078133610a1d565b6123795760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610e78565b610b958383612ad6565b638b78c6d88260601b176000526020600020805482811681189050808255808460601b60601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a350505050565b638b78c6d88260601b17600052602060002081815417808255808460601b60601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a350505050565b61242a3382612b44565b6124465760405162461bcd60e51b8152600401610e7890613f63565b610b95838383612bc2565b6000611a7c8284613fb1565b60008261246a8584612d69565b14949350505050565b61010554349061248c906001600160401b038516612db6565b11156124cc5760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b6044820152606401610e78565b6099546124d99034612451565b6099556001600160a01b038116600090815260ff6020526040902054612508906001600160401b038416612451565b6001600160a01b03828116600090815260ff60205260409081902092909255609754915163107e9cf160e01b815234600482015291169063107e9cf190602401600060405180830381600087803b15801561256257600080fd5b505af1158015612576573d6000803e3d6000fd5b50505050610cd78282612a65565b804710156125d45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610e78565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612621576040519150601f19603f3d011682016040523d82523d6000602084013e612626565b606091505b5050905080610b955760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610e78565b6000611a7c8284613fc9565b610b95838383604051806020016040528060008152506118b7565b60006126cf826114a8565b90506126dd81600084612dc2565b6126e8600083612ad6565b6001600160a01b0381166000908152609e60205260408120805460019290612711908490613fc9565b90915550506000828152609d602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6127106001600160601b03821611156127965760405162461bcd60e51b8152600401610e7890613f19565b6001600160a01b0382166127ec5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610e78565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752606690529190942093519051909116600160a01b029116179055565b610cd7338383612dcd565b61284b3383612b44565b6128675760405162461bcd60e51b8152600401610e7890613f63565b610d0b84848484612e9b565b600054610100900460ff1661289a5760405162461bcd60e51b8152600401610e7890613fe0565b610cd78282612ece565b600054610100900460ff166128cb5760405162461bcd60e51b8152600401610e7890613fe0565b565b600054610100900460ff166128f45760405162461bcd60e51b8152600401610e7890613fe0565b6128fd84612f0e565b6129056128a4565b61290d612f38565b60978054336001600160a01b031991821617909155609880549091166001600160a01b038516179055609a805460ff19166001179055610d0b8282612116565b60606101018054610ba990613c63565b6060816000036129845750506040805180820190915260018152600360fc1b602082015290565b8160005b81156129ae57806129988161402b565b91506129a79050600a83613ce8565b9150612988565b6000816001600160401b038111156129c8576129c8613611565b6040519080825280601f01601f1916602001820160405280156129f2576020820181803683370190505b5090505b8415612a5d57612a07600183613fc9565b9150612a14600a86614044565b612a1f906030613fb1565b60f81b818381518110612a3457612a34613dcf565b60200101906001600160f81b031916908160001a905350612a56600a86613ce8565b94506129f6565b949350505050565b60005b826001600160401b0316816001600160401b03161015610b9557612a9982612a946001610f0060cf5490565b612f57565b600101612a68565b60006001600160e01b0319821663152a902d60e11b1480610b4f57506301ffc9a760e01b6001600160e01b0319831614610b4f565b6000818152609f6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612b0b826114a8565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080612b50836114a8565b9050806001600160a01b0316846001600160a01b03161480612b9757506001600160a01b03808216600090815260a0602090815260408083209388168352929052205460ff165b80612a5d5750836001600160a01b0316612bb084610c2c565b6001600160a01b031614949350505050565b826001600160a01b0316612bd5826114a8565b6001600160a01b031614612c395760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610e78565b6001600160a01b038216612c9b5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e78565b612ca6838383612dc2565b612cb1600082612ad6565b6001600160a01b0383166000908152609e60205260408120805460019290612cda908490613fc9565b90915550506001600160a01b0382166000908152609e60205260408120805460019290612d08908490613fb1565b90915550506000818152609d602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600081815b8451811015612dae57612d9a82868381518110612d8d57612d8d613dcf565b6020026020010151612f71565b915080612da68161402b565b915050612d6e565b509392505050565b6000611a7c8284613cb3565b610b95838383612fa0565b816001600160a01b0316836001600160a01b031603612e2e5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610e78565b6001600160a01b03838116600081815260a06020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612ea6848484612bc2565b612eb284848484613058565b610d0b5760405162461bcd60e51b8152600401610e7890614058565b600054610100900460ff16612ef55760405162461bcd60e51b8152600401610e7890613fe0565b609b612f018382613e2b565b50609c610b958282613e2b565b6001600160a01b0316638b78c6d81981905580600060008051602061411b8339815191528180a350565b6128cb733cc6cdda760b79bafa08df41ecfa224f810dceb66001613159565b610cd78282604051806020016040528060008152506131b9565b6000818310612f8d576000828152602084905260409020611a7c565b6000838152602083905260409020611a7c565b6001600160a01b038316612ffb57612ff68160cf8054600083815260d060205260408120829055600182018355919091527facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf290155565b61301e565b816001600160a01b0316836001600160a01b03161461301e5761301e83826131ec565b6001600160a01b03821661303557610b9581613289565b826001600160a01b0316826001600160a01b031614610b9557610b958282613338565b60006001600160a01b0384163b1561314e57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061309c9033908990889088906004016140aa565b6020604051808303816000875af19250505080156130d7575060408051601f3d908101601f191682019092526130d4918101906140e7565b60015b613134573d808015613105576040519150601f19603f3d011682016040523d82523d6000602084013e61310a565b606091505b50805160000361312c5760405162461bcd60e51b8152600401610e7890614058565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612a5d565b506001949350505050565b6001600160a01b0390911690637d3e3dbe81613186578261317f5750634420e486613186565b5063a0af29035b8060e01b60005250306004528160245260008060446000806daaeb6d7670e522a718067333cd4e5af15060006024525050565b6131c3838361337c565b6131d06000848484613058565b610b955760405162461bcd60e51b8152600401610e7890614058565b600060016131f984611508565b6132039190613fc9565b600083815260ce6020526040902054909150808214613256576001600160a01b038416600090815260cd60209081526040808320858452825280832054848452818420819055835260ce90915290208190555b50600091825260ce602090815260408084208490556001600160a01b03909416835260cd81528383209183525290812055565b60cf5460009061329b90600190613fc9565b600083815260d0602052604081205460cf80549394509092849081106132c3576132c3613dcf565b906000526020600020015490508060cf83815481106132e4576132e4613dcf565b600091825260208083209091019290925582815260d0909152604080822084905585825281205560cf80548061331c5761331c614104565b6001900381819060005260206000200160009055905550505050565b600061334383611508565b6001600160a01b03909316600090815260cd60209081526040808320868452825280832085905593825260ce9052919091209190915550565b6001600160a01b0382166133d25760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e78565b6000818152609d60205260409020546001600160a01b0316156134375760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e78565b61344360008383612dc2565b6001600160a01b0382166000908152609e6020526040812080546001929061346c908490613fb1565b90915550506000818152609d602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b031981168114610caf57600080fd5b6000602082840312156134f257600080fd5b8135611a7c816134ca565b80356001600160a01b038116811461351457600080fd5b919050565b80356001600160601b038116811461351457600080fd5b6000806040838503121561354357600080fd5b61354c836134fd565b915061355a60208401613519565b90509250929050565b60005b8381101561357e578181015183820152602001613566565b83811115610d0b5750506000910152565b600081518084526135a7816020860160208601613563565b601f01601f19169290920160200192915050565b602081526000611a7c602083018461358f565b6000602082840312156135e057600080fd5b5035919050565b600080604083850312156135fa57600080fd5b613603836134fd565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561364f5761364f613611565b604052919050565b6000602080838503121561366a57600080fd5b82356001600160401b038082111561368157600080fd5b818501915085601f83011261369557600080fd5b8135818111156136a7576136a7613611565b8060051b91506136b8848301613627565b81815291830184019184810190888411156136d257600080fd5b938501935b83851015613703578435925060ff831683146136f35760008081fd5b82825293850193908501906136d7565b98975050505050505050565b60008060006060848603121561372457600080fd5b61372d846134fd565b925061373b602085016134fd565b9150604084013590509250925092565b6000806040838503121561375e57600080fd5b50508035926020909101359150565b60006020828403121561377f57600080fd5b611a7c826134fd565b80356001600160401b038116811461351457600080fd5b60008083601f8401126137b157600080fd5b5081356001600160401b038111156137c857600080fd5b6020830191508360208260051b8501011115610e0857600080fd5b600080600080606085870312156137f957600080fd5b61380285613788565b93506020850135925060408501356001600160401b0381111561382457600080fd5b6138308782880161379f565b95989497509550505050565b60006001600160401b0383111561385557613855613611565b613868601f8401601f1916602001613627565b905082815283838301111561387c57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126138a457600080fd5b611a7c8383356020850161383c565b6000602082840312156138c557600080fd5b81356001600160401b038111156138db57600080fd5b612a5d84828501613893565b6000806000606084860312156138fc57600080fd5b8335925061390c602085016134fd565b915061391a60408501613519565b90509250925092565b6020808252825182820181905260009190848201906040850190845b8181101561395e57835160ff168352928401929184019160010161393f565b50909695505050505050565b8035801515811461351457600080fd5b600080600080600060a0868803121561399257600080fd5b853594506020860135935060408601359250606086013591506139b76080870161396a565b90509295509295909350565b600080604083850312156139d657600080fd5b6139df836134fd565b915061355a60208401613788565b60008060408385031215613a0057600080fd5b613a09836134fd565b915061355a6020840161396a565b600060208284031215613a2957600080fd5b611a7c8261396a565b60008060008060808587031215613a4857600080fd5b613a51856134fd565b9350613a5f602086016134fd565b92506040850135915060608501356001600160401b03811115613a8157600080fd5b8501601f81018713613a9257600080fd5b613aa18782356020840161383c565b91505092959194509250565b60008060008060008060c08789031215613ac657600080fd5b613acf876134fd565b955060208701356001600160401b0380821115613aeb57600080fd5b613af78a838b01613893565b96506040890135915080821115613b0d57600080fd5b50613b1a89828a01613893565b945050613b29606088016134fd565b9250613b37608088016134fd565b9150613b4560a08801613519565b90509295509295509295565b60008060008060408587031215613b6757600080fd5b84356001600160401b0380821115613b7e57600080fd5b613b8a8883890161379f565b90965094506020870135915080821115613ba357600080fd5b506138308782880161379f565b60008060408385031215613bc357600080fd5b613bcc836134fd565b915061355a602084016134fd565b600060208284031215613bec57600080fd5b611a7c82613788565b600080600080600060808688031215613c0d57600080fd5b613c16866134fd565b9450613c2460208701613788565b93506040860135925060608601356001600160401b03811115613c4657600080fd5b613c528882890161379f565b969995985093965092949392505050565b600181811c90821680613c7757607f821691505b602082108103613c9757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615613ccd57613ccd613c9d565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613cf757613cf7613cd2565b500490565b6020808252600d908201526c05175616e74697479206973203609c1b604082015260600190565b6020808252601390820152724578636565646564206d617820737570706c7960681b604082015260600190565b602080825260159082015274115e18d959591959081b585e081c195c881b5a5b9d605a1b604082015260600190565b60208082526017908201527f4578636565646564206d6178207065722077616c6c6574000000000000000000604082015260600190565b600060208284031215613dc857600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b601f821115610b9557600081815260208120601f850160051c81016020861015613e0c5750805b601f850160051c820191505b8181101561111e57828155600101613e18565b81516001600160401b03811115613e4457613e44613611565b613e5881613e528454613c63565b84613de5565b602080601f831160018114613e8d5760008415613e755750858301515b600019600386901b1c1916600185901b17855561111e565b600085815260208120601f198616915b82811015613ebc57888601518255948401946001909101908401613e9d565b5085821015613eda5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008351613efc818460208801613563565b835190830190613f10818360208801613563565b01949350505050565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b60008219821115613fc457613fc4613c9d565b500190565b600082821015613fdb57613fdb613c9d565b500390565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006001820161403d5761403d613c9d565b5060010190565b60008261405357614053613cd2565b500690565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906140dd9083018461358f565b9695505050505050565b6000602082840312156140f957600080fd5b8151611a7c816134ca565b634e487b7160e01b600052603160045260246000fdfe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212203ec2a2d18422d8958a006ed7726bdacd4ec5c44f5254140c5371f14366a1ad4264736f6c634300080f0033
Deployed Bytecode
0x6080604052600436106103975760003560e01c806361d027b3116101dc578063b88d4fde11610102578063e985e9c5116100a0578063f2fde38b1161006f578063f2fde38b14610aa0578063fb9d09c814610ac0578063fd51fae814610ad3578063fee81cf414610ae657600080fd5b8063e985e9c514610a02578063ec87621c14610a4b578063f04e283e14610a60578063f0f4426014610a8057600080fd5b8063c87b56dd116100dc578063c87b56dd1461098f578063d53ab501146109af578063d7533f02146109cf578063e36b0b37146109ed57600080fd5b8063b88d4fde1461093a578063bf2d9e0b1461095a578063bfa9aadc1461096f57600080fd5b8063789e3a551161017a57806395d89b411161014957806395d89b41146108cf578063a035b1fe146108e4578063a22cb465146108fa578063b7c0b8e81461091a57600080fd5b8063789e3a55146108635780637cb64759146108835780638da5cb5b146108a357806393d756aa146108bc57600080fd5b806370a08231116101b657806370a08231146107ec578063715018a61461080c5780637359e41f1461082157806375b238fc1461084e57600080fd5b806361d027b3146107905780636352211e146107ae57806368428a1b146107ce57600080fd5b80632f745c59116102c15780634f6ccce71161025f57806354d1f13d1161022e57806354d1f13d1461072557806355f804b31461073a5780635944c7531461075a5780635f48f3931461077a57600080fd5b80634f6ccce71461069f578063507e094f146106bf578063514e62fc146106d557806353135ca01461070c57600080fd5b806342842e0e1161029b57806342842e0e1461062957806342966c6814610649578063453c2310146106695780634a4ee7b11461067f57600080fd5b80632f745c59146105e1578063386bacdc146106015780633ccfd60b1461061457600080fd5b8063183a4f6e1161033957806325692962116103085780632569296214610547578063282c51f31461055c5780632a55205a146105715780632de94807146105b057600080fd5b8063183a4f6e146104b05780631c10893f146104d05780631cd64df4146104f057806323b872dd1461052757600080fd5b8063081812fc11610375578063081812fc14610415578063095ea7b31461044d57806313a661ed1461046d57806318160ddd1461049b57600080fd5b806301ffc9a71461039c57806304634d8d146103d157806306fdde03146103f3575b600080fd5b3480156103a857600080fd5b506103bc6103b73660046134e0565b610b17565b60405190151581526020015b60405180910390f35b3480156103dd57600080fd5b506103f16103ec366004613530565b610b55565b005b3480156103ff57600080fd5b50610408610b9a565b6040516103c891906135bb565b34801561042157600080fd5b506104356104303660046135ce565b610c2c565b6040516001600160a01b0390911681526020016103c8565b34801561045957600080fd5b506103f16104683660046135e7565b610c53565b34801561047957600080fd5b5061048d610488366004613657565b610c72565b6040519081526020016103c8565b3480156104a757600080fd5b5060cf5461048d565b3480156104bc57600080fd5b506103f16104cb3660046135ce565b610ca5565b3480156104dc57600080fd5b506103f16104eb3660046135e7565b610cb2565b3480156104fc57600080fd5b506103bc61050b3660046135e7565b60609190911b638b78c6d8176000908152602090205481161490565b34801561053357600080fd5b506103f161054236600461370f565b610cdb565b34801561055357600080fd5b506103f1610d11565b34801561056857600080fd5b5061048d600481565b34801561057d57600080fd5b5061059161058c36600461374b565b610d61565b604080516001600160a01b0390931683526020830191909152016103c8565b3480156105bc57600080fd5b5061048d6105cb36600461376d565b60601b638b78c6d8176000908152602090205490565b3480156105ed57600080fd5b5061048d6105fc3660046135e7565b610e0f565b6103f161060f3660046137e3565b610eaa565b34801561062057600080fd5b506103f1611126565b34801561063557600080fd5b506103f161064436600461370f565b611291565b34801561065557600080fd5b506103f16106643660046135ce565b6112c1565b34801561067557600080fd5b506101045461048d565b34801561068b57600080fd5b506103f161069a3660046135e7565b61132f565b3480156106ab57600080fd5b5061048d6106ba3660046135ce565b611354565b3480156106cb57600080fd5b506101035461048d565b3480156106e157600080fd5b506103bc6106f03660046135e7565b60609190911b638b78c6d8176000908152602090205416151590565b34801561071857600080fd5b506101065460ff166103bc565b34801561073157600080fd5b506103f16113e7565b34801561074657600080fd5b506103f16107553660046138b3565b611424565b34801561076657600080fd5b506103f16107753660046138e7565b611467565b34801561078657600080fd5b506101025461048d565b34801561079c57600080fd5b506098546001600160a01b0316610435565b3480156107ba57600080fd5b506104356107c93660046135ce565b6114a8565b3480156107da57600080fd5b5061010654610100900460ff166103bc565b3480156107f857600080fd5b5061048d61080736600461376d565b611508565b34801561081857600080fd5b506103f161158e565b34801561082d57600080fd5b5061084161083c3660046135ce565b6115ca565b6040516103c89190613923565b34801561085a57600080fd5b5061048d600181565b34801561086f57600080fd5b506103f161087e36600461397a565b611612565b34801561088f57600080fd5b506103f161089e3660046135ce565b61167a565b3480156108af57600080fd5b50638b78c6d81954610435565b6103f16108ca3660046139c3565b6116b7565b3480156108db57600080fd5b5061040861183f565b3480156108f057600080fd5b506101055461048d565b34801561090657600080fd5b506103f16109153660046139ed565b61184e565b34801561092657600080fd5b506103f1610935366004613a17565b61186d565b34801561094657600080fd5b506103f1610955366004613a32565b6118b7565b34801561096657600080fd5b5060995461048d565b34801561097b57600080fd5b506103f161098a366004613aad565b6118ef565b34801561099b57600080fd5b506104086109aa3660046135ce565b611a1c565b3480156109bb57600080fd5b506103f16109ca366004613b51565b611a83565b3480156109db57600080fd5b506040516202a30081526020016103c8565b3480156109f957600080fd5b506103f1611b66565b348015610a0e57600080fd5b506103bc610a1d366004613bb0565b6001600160a01b03918216600090815260a06020908152604080832093909416825291909152205460ff1690565b348015610a5757600080fd5b5061048d600281565b348015610a6c57600080fd5b506103f1610a7b36600461376d565b611bab565b348015610a8c57600080fd5b506103f1610a9b36600461376d565b611c1b565b348015610aac57600080fd5b506103f1610abb36600461376d565b611c74565b6103f1610ace366004613bda565b611cc9565b6103f1610ae1366004613bf5565b611e3c565b348015610af257600080fd5b5061048d610b0136600461376d565b60601b63389a75e1176000908152602090205490565b6000610b228261208c565b80610b315750610b31826120cc565b80610b405750610b40826120f1565b80610b4f5750610b4f826120cc565b92915050565b6001638b78c6d83360601b176000528060206000205416610b8b57638b78c6d819543314610b8b576382b429006000526004601cfd5b610b958383612116565b505050565b6060609b8054610ba990613c63565b80601f0160208091040260200160405190810160405280929190818152602001828054610bd590613c63565b8015610c225780601f10610bf757610100808354040283529160200191610c22565b820191906000526020600020905b815481529060010190602001808311610c0557829003601f168201915b5050505050905090565b6000610c37826121d0565b506000908152609f60205260409020546001600160a01b031690565b81609a5460ff1615610c6857610c688161222f565b610b958383612273565b600060208201825160051b81015b808214610c9e57600160ff8351161b83179250602082019150610c80565b5050919050565b610caf3382612383565b50565b638b78c6d819543314610ccd576382b429006000526004601cfd5b610cd782826123d4565b5050565b826001600160a01b0381163314610d0057609a5460ff1615610d0057610d003361222f565b610d0b848484612420565b50505050565b60006202a3006001600160401b03164201905063389a75e13360601b1760005280602060002055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b60008281526066602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610dd65750604080518082019091526065546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610df5906001600160601b031687613cb3565b610dff9190613ce8565b91519350909150505b9250929050565b6000610e1a83611508565b8210610e815760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084015b60405180910390fd5b506001600160a01b0391909116600090815260cd60209081526040808320938352929052205490565b836000816001600160401b031611610ed45760405162461bcd60e51b8152600401610e7890613cfc565b60006101025411610ee6576001610f09565b61010254610f06826001600160401b0316610f0060cf5490565b90612451565b11155b610f255760405162461bcd60e51b8152600401610e7890613d23565b61010354816001600160401b03161115610f515760405162461bcd60e51b8152600401610e7890613d50565b6000610f856001600160401b03871660ff83335b6001600160a01b0316815260208101919091526040016000205490612451565b6101065490915060ff16610fd05760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b6044820152606401610e78565b610100546000036110155760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b6044820152606401610e78565b610104548111156110385760405162461bcd60e51b8152600401610e7890613d7f565b848111156110585760405162461bcd60e51b8152600401610e7890613d7f565b6110d684848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050610100546040516bffffffffffffffffffffffff193360601b166020820152603481018b905290925060540190505b6040516020818303038152906040528051906020012061245d565b6111145760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b6044820152606401610e78565b61111e8633612473565b505050505050565b6001638b78c6d83360601b17600052806020600020541661115c57638b78c6d81954331461115c576382b429006000526004601cfd5b600047116111985760405162461bcd60e51b8152602060048201526009602482015268302062616c616e636560b81b6044820152606401610e78565b609754604051639af608c960e01b81523060048201526001600160a01b039091169047906000908390639af608c990602401602060405180830381865afa1580156111e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120b9190613db6565b60405163b9bff4bb60e01b8152600481018290529091506001600160a01b0384169063b9bff4bb90602401600060405180830381600087803b15801561125057600080fd5b505af1158015611264573d6000803e3d6000fd5b505050506112728382612584565b609854610d0b906001600160a01b031661128c848461269d565b612584565b826001600160a01b03811633146112b657609a5460ff16156112b6576112b63361222f565b610d0b8484846126a9565b6004638b78c6d83360601b1760005280602060002054166112ea576382b429006000526004601cfd5b333b6113265760405162461bcd60e51b815260206004820152600b60248201526a139bdd08105b1b1bddd95960aa1b6044820152606401610e78565b610cd7826126c4565b638b78c6d81954331461134a576382b429006000526004601cfd5b610cd78282612383565b600061135f60cf5490565b82106113c25760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610e78565b60cf82815481106113d5576113d5613dcf565b90600052602060002001549050919050565b63389a75e13360601b176000526000602060002055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b6002638b78c6d83360601b17600052806020600020541661145a57638b78c6d81954331461145a576382b429006000526004601cfd5b610101610b958382613e2b565b6001638b78c6d83360601b17600052806020600020541661149d57638b78c6d81954331461149d576382b429006000526004601cfd5b610d0b84848461276b565b6000818152609d60205260408120546001600160a01b031680610b4f5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e78565b60006001600160a01b0382166115725760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610e78565b506001600160a01b03166000908152609e602052604090205490565b638b78c6d8195433146115a9576382b429006000526004601cfd5b60003360008051602061411b833981519152600080a36000638b78c6d81955565b606060206040510160005b8082526001841660051b820191508360011c935083156115f7576001016115d5565b5060405191508060405260208201810360051c825250919050565b6002638b78c6d83360601b17600052806020600020541661164857638b78c6d819543314611648576382b429006000526004601cfd5b50610106805491151561ffff199092169190911761010017905561010293909355610103919091556101045561010555565b6002638b78c6d83360601b1760005280602060002054166116b057638b78c6d8195433146116b0576382b429006000526004601cfd5b5061010055565b806000816001600160401b0316116116e15760405162461bcd60e51b8152600401610e7890613cfc565b600061010254116116f3576001611710565b6101025461170d826001600160401b0316610f0060cf5490565b11155b61172c5760405162461bcd60e51b8152600401610e7890613d23565b61010354816001600160401b031611156117585760405162461bcd60e51b8152600401610e7890613d50565b6101065460ff161561179d5760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b6044820152606401610e78565b61010654610100900460ff166117e75760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b6044820152606401610e78565b610104546001600160a01b038416600090815260ff6020526040902054611817906001600160401b038516612451565b11156118355760405162461bcd60e51b8152600401610e7890613d7f565b610b958284612473565b6060609c8054610ba990613c63565b81609a5460ff1615611863576118638161222f565b610b958383612836565b6001638b78c6d83360601b1760005280602060002054166118a357638b78c6d8195433146118a3576382b429006000526004601cfd5b50609a805460ff1916911515919091179055565b836001600160a01b03811633146118dc57609a5460ff16156118dc576118dc3361222f565b6118e885858585612841565b5050505050565b600054610100900460ff161580801561190f5750600054600160ff909116105b806119295750303b158015611929575060005460ff166001145b61198c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610e78565b6000805460ff1916600117905580156119af576000805461ff0019166101001790555b6119b98686612873565b6119c16128a4565b6119cd878585856128cd565b8015611a13576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6060611a27826121d0565b6000611a3161294d565b90506000815111611a515760405180602001604052806000815250611a7c565b80611a5b8461295d565b604051602001611a6c929190613eea565b6040516020818303038152906040525b9392505050565b6002638b78c6d83360601b176000528060206000205416611ab957638b78c6d819543314611ab9576382b429006000526004601cfd5b81848114611afd5760405162461bcd60e51b8152602060048201526011602482015270496e76616c696420417267756d656e747360781b6044820152606401610e78565b60005b81811015611a1357611b5e878783818110611b1d57611b1d613dcf565b9050602002016020810190611b329190613bda565b868684818110611b4457611b44613dcf565b9050602002016020810190611b59919061376d565b612a65565b600101611b00565b6002638b78c6d83360601b176000528060206000205416611b9c57638b78c6d819543314611b9c576382b429006000526004601cfd5b50610106805461ffff19169055565b638b78c6d819543314611bc6576382b429006000526004601cfd5b8060601b60601c905063389a75e18160601b1760005260206000208054421115611bf857636f5e88186000526004601cfd5b6000815550803360008051602061411b833981519152600080a3638b78c6d81955565b6001638b78c6d83360601b176000528060206000205416611c5157638b78c6d819543314611c51576382b429006000526004601cfd5b50609880546001600160a01b0319166001600160a01b0392909216919091179055565b638b78c6d819543314611c8f576382b429006000526004601cfd5b6001600160a01b031680611cab57637448fbae6000526004601cfd5b803360008051602061411b833981519152600080a3638b78c6d81955565b806000816001600160401b031611611cf35760405162461bcd60e51b8152600401610e7890613cfc565b60006101025411611d05576001611d22565b61010254611d1f826001600160401b0316610f0060cf5490565b11155b611d3e5760405162461bcd60e51b8152600401610e7890613d23565b61010354816001600160401b03161115611d6a5760405162461bcd60e51b8152600401610e7890613d50565b6101065460ff1615611daf5760405162461bcd60e51b815260206004820152600e60248201526d50726573616c652061637469766560901b6044820152606401610e78565b61010654610100900460ff16611df95760405162461bcd60e51b815260206004820152600f60248201526e53616c65206e6f742061637469766560881b6044820152606401610e78565b61010454611e146001600160401b03841660ff600033610f65565b1115611e325760405162461bcd60e51b8152600401610e7890613d7f565b610cd78233612473565b836000816001600160401b031611611e665760405162461bcd60e51b8152600401610e7890613cfc565b60006101025411611e78576001611e95565b61010254611e92826001600160401b0316610f0060cf5490565b11155b611eb15760405162461bcd60e51b8152600401610e7890613d23565b61010354816001600160401b03161115611edd5760405162461bcd60e51b8152600401610e7890613d50565b6001600160a01b038616600090815260ff6020526040812054611f09906001600160401b038816612451565b6101065490915060ff16611f545760405162461bcd60e51b815260206004820152601260248201527150726573616c65206e6f742061637469766560701b6044820152606401610e78565b61010054600003611f995760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481b9bdd081cd95d608a1b6044820152606401610e78565b61010454811115611fbc5760405162461bcd60e51b8152600401610e7890613d7f565b84811115611fdc5760405162461bcd60e51b8152600401610e7890613d7f565b61204484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050610100546040516bffffffffffffffffffffffff1960608e901b166020820152603481018b905290925060540190506110bb565b6120825760405162461bcd60e51b815260206004820152600f60248201526e141c995cd85b19481a5b9d985b1a59608a1b6044820152606401610e78565b611a138688612473565b60006001600160e01b031982166380ac58cd60e01b14806120bd57506001600160e01b03198216635b5e139f60e01b145b80610b4f5750610b4f826120f1565b60006001600160e01b0319821663780e9d6360e01b1480610b4f5750610b4f8261208c565b60006001600160e01b03198216632fea6ab760e21b1480610b4f5750610b4f82612aa1565b6127106001600160601b03821611156121415760405162461bcd60e51b8152600401610e7890613f19565b6001600160a01b0382166121975760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610e78565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217606555565b6000818152609d60205260409020546001600160a01b0316610caf5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610e78565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa61226b573d6000803e3d6000fd5b6000603a5250565b600061227e826114a8565b9050806001600160a01b0316836001600160a01b0316036122eb5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610e78565b336001600160a01b038216148061230757506123078133610a1d565b6123795760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610e78565b610b958383612ad6565b638b78c6d88260601b176000526020600020805482811681189050808255808460601b60601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a350505050565b638b78c6d88260601b17600052602060002081815417808255808460601b60601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a350505050565b61242a3382612b44565b6124465760405162461bcd60e51b8152600401610e7890613f63565b610b95838383612bc2565b6000611a7c8284613fb1565b60008261246a8584612d69565b14949350505050565b61010554349061248c906001600160401b038516612db6565b11156124cc5760405162461bcd60e51b815260206004820152600f60248201526e15985b1d59481a5b98dbdc9c9958dd608a1b6044820152606401610e78565b6099546124d99034612451565b6099556001600160a01b038116600090815260ff6020526040902054612508906001600160401b038416612451565b6001600160a01b03828116600090815260ff60205260409081902092909255609754915163107e9cf160e01b815234600482015291169063107e9cf190602401600060405180830381600087803b15801561256257600080fd5b505af1158015612576573d6000803e3d6000fd5b50505050610cd78282612a65565b804710156125d45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610e78565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612621576040519150601f19603f3d011682016040523d82523d6000602084013e612626565b606091505b5050905080610b955760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610e78565b6000611a7c8284613fc9565b610b95838383604051806020016040528060008152506118b7565b60006126cf826114a8565b90506126dd81600084612dc2565b6126e8600083612ad6565b6001600160a01b0381166000908152609e60205260408120805460019290612711908490613fc9565b90915550506000828152609d602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6127106001600160601b03821611156127965760405162461bcd60e51b8152600401610e7890613f19565b6001600160a01b0382166127ec5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610e78565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752606690529190942093519051909116600160a01b029116179055565b610cd7338383612dcd565b61284b3383612b44565b6128675760405162461bcd60e51b8152600401610e7890613f63565b610d0b84848484612e9b565b600054610100900460ff1661289a5760405162461bcd60e51b8152600401610e7890613fe0565b610cd78282612ece565b600054610100900460ff166128cb5760405162461bcd60e51b8152600401610e7890613fe0565b565b600054610100900460ff166128f45760405162461bcd60e51b8152600401610e7890613fe0565b6128fd84612f0e565b6129056128a4565b61290d612f38565b60978054336001600160a01b031991821617909155609880549091166001600160a01b038516179055609a805460ff19166001179055610d0b8282612116565b60606101018054610ba990613c63565b6060816000036129845750506040805180820190915260018152600360fc1b602082015290565b8160005b81156129ae57806129988161402b565b91506129a79050600a83613ce8565b9150612988565b6000816001600160401b038111156129c8576129c8613611565b6040519080825280601f01601f1916602001820160405280156129f2576020820181803683370190505b5090505b8415612a5d57612a07600183613fc9565b9150612a14600a86614044565b612a1f906030613fb1565b60f81b818381518110612a3457612a34613dcf565b60200101906001600160f81b031916908160001a905350612a56600a86613ce8565b94506129f6565b949350505050565b60005b826001600160401b0316816001600160401b03161015610b9557612a9982612a946001610f0060cf5490565b612f57565b600101612a68565b60006001600160e01b0319821663152a902d60e11b1480610b4f57506301ffc9a760e01b6001600160e01b0319831614610b4f565b6000818152609f6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612b0b826114a8565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080612b50836114a8565b9050806001600160a01b0316846001600160a01b03161480612b9757506001600160a01b03808216600090815260a0602090815260408083209388168352929052205460ff165b80612a5d5750836001600160a01b0316612bb084610c2c565b6001600160a01b031614949350505050565b826001600160a01b0316612bd5826114a8565b6001600160a01b031614612c395760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610e78565b6001600160a01b038216612c9b5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610e78565b612ca6838383612dc2565b612cb1600082612ad6565b6001600160a01b0383166000908152609e60205260408120805460019290612cda908490613fc9565b90915550506001600160a01b0382166000908152609e60205260408120805460019290612d08908490613fb1565b90915550506000818152609d602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600081815b8451811015612dae57612d9a82868381518110612d8d57612d8d613dcf565b6020026020010151612f71565b915080612da68161402b565b915050612d6e565b509392505050565b6000611a7c8284613cb3565b610b95838383612fa0565b816001600160a01b0316836001600160a01b031603612e2e5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610e78565b6001600160a01b03838116600081815260a06020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612ea6848484612bc2565b612eb284848484613058565b610d0b5760405162461bcd60e51b8152600401610e7890614058565b600054610100900460ff16612ef55760405162461bcd60e51b8152600401610e7890613fe0565b609b612f018382613e2b565b50609c610b958282613e2b565b6001600160a01b0316638b78c6d81981905580600060008051602061411b8339815191528180a350565b6128cb733cc6cdda760b79bafa08df41ecfa224f810dceb66001613159565b610cd78282604051806020016040528060008152506131b9565b6000818310612f8d576000828152602084905260409020611a7c565b6000838152602083905260409020611a7c565b6001600160a01b038316612ffb57612ff68160cf8054600083815260d060205260408120829055600182018355919091527facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf290155565b61301e565b816001600160a01b0316836001600160a01b03161461301e5761301e83826131ec565b6001600160a01b03821661303557610b9581613289565b826001600160a01b0316826001600160a01b031614610b9557610b958282613338565b60006001600160a01b0384163b1561314e57604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061309c9033908990889088906004016140aa565b6020604051808303816000875af19250505080156130d7575060408051601f3d908101601f191682019092526130d4918101906140e7565b60015b613134573d808015613105576040519150601f19603f3d011682016040523d82523d6000602084013e61310a565b606091505b50805160000361312c5760405162461bcd60e51b8152600401610e7890614058565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612a5d565b506001949350505050565b6001600160a01b0390911690637d3e3dbe81613186578261317f5750634420e486613186565b5063a0af29035b8060e01b60005250306004528160245260008060446000806daaeb6d7670e522a718067333cd4e5af15060006024525050565b6131c3838361337c565b6131d06000848484613058565b610b955760405162461bcd60e51b8152600401610e7890614058565b600060016131f984611508565b6132039190613fc9565b600083815260ce6020526040902054909150808214613256576001600160a01b038416600090815260cd60209081526040808320858452825280832054848452818420819055835260ce90915290208190555b50600091825260ce602090815260408084208490556001600160a01b03909416835260cd81528383209183525290812055565b60cf5460009061329b90600190613fc9565b600083815260d0602052604081205460cf80549394509092849081106132c3576132c3613dcf565b906000526020600020015490508060cf83815481106132e4576132e4613dcf565b600091825260208083209091019290925582815260d0909152604080822084905585825281205560cf80548061331c5761331c614104565b6001900381819060005260206000200160009055905550505050565b600061334383611508565b6001600160a01b03909316600090815260cd60209081526040808320868452825280832085905593825260ce9052919091209190915550565b6001600160a01b0382166133d25760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e78565b6000818152609d60205260409020546001600160a01b0316156134375760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e78565b61344360008383612dc2565b6001600160a01b0382166000908152609e6020526040812080546001929061346c908490613fb1565b90915550506000818152609d602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b031981168114610caf57600080fd5b6000602082840312156134f257600080fd5b8135611a7c816134ca565b80356001600160a01b038116811461351457600080fd5b919050565b80356001600160601b038116811461351457600080fd5b6000806040838503121561354357600080fd5b61354c836134fd565b915061355a60208401613519565b90509250929050565b60005b8381101561357e578181015183820152602001613566565b83811115610d0b5750506000910152565b600081518084526135a7816020860160208601613563565b601f01601f19169290920160200192915050565b602081526000611a7c602083018461358f565b6000602082840312156135e057600080fd5b5035919050565b600080604083850312156135fa57600080fd5b613603836134fd565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561364f5761364f613611565b604052919050565b6000602080838503121561366a57600080fd5b82356001600160401b038082111561368157600080fd5b818501915085601f83011261369557600080fd5b8135818111156136a7576136a7613611565b8060051b91506136b8848301613627565b81815291830184019184810190888411156136d257600080fd5b938501935b83851015613703578435925060ff831683146136f35760008081fd5b82825293850193908501906136d7565b98975050505050505050565b60008060006060848603121561372457600080fd5b61372d846134fd565b925061373b602085016134fd565b9150604084013590509250925092565b6000806040838503121561375e57600080fd5b50508035926020909101359150565b60006020828403121561377f57600080fd5b611a7c826134fd565b80356001600160401b038116811461351457600080fd5b60008083601f8401126137b157600080fd5b5081356001600160401b038111156137c857600080fd5b6020830191508360208260051b8501011115610e0857600080fd5b600080600080606085870312156137f957600080fd5b61380285613788565b93506020850135925060408501356001600160401b0381111561382457600080fd5b6138308782880161379f565b95989497509550505050565b60006001600160401b0383111561385557613855613611565b613868601f8401601f1916602001613627565b905082815283838301111561387c57600080fd5b828260208301376000602084830101529392505050565b600082601f8301126138a457600080fd5b611a7c8383356020850161383c565b6000602082840312156138c557600080fd5b81356001600160401b038111156138db57600080fd5b612a5d84828501613893565b6000806000606084860312156138fc57600080fd5b8335925061390c602085016134fd565b915061391a60408501613519565b90509250925092565b6020808252825182820181905260009190848201906040850190845b8181101561395e57835160ff168352928401929184019160010161393f565b50909695505050505050565b8035801515811461351457600080fd5b600080600080600060a0868803121561399257600080fd5b853594506020860135935060408601359250606086013591506139b76080870161396a565b90509295509295909350565b600080604083850312156139d657600080fd5b6139df836134fd565b915061355a60208401613788565b60008060408385031215613a0057600080fd5b613a09836134fd565b915061355a6020840161396a565b600060208284031215613a2957600080fd5b611a7c8261396a565b60008060008060808587031215613a4857600080fd5b613a51856134fd565b9350613a5f602086016134fd565b92506040850135915060608501356001600160401b03811115613a8157600080fd5b8501601f81018713613a9257600080fd5b613aa18782356020840161383c565b91505092959194509250565b60008060008060008060c08789031215613ac657600080fd5b613acf876134fd565b955060208701356001600160401b0380821115613aeb57600080fd5b613af78a838b01613893565b96506040890135915080821115613b0d57600080fd5b50613b1a89828a01613893565b945050613b29606088016134fd565b9250613b37608088016134fd565b9150613b4560a08801613519565b90509295509295509295565b60008060008060408587031215613b6757600080fd5b84356001600160401b0380821115613b7e57600080fd5b613b8a8883890161379f565b90965094506020870135915080821115613ba357600080fd5b506138308782880161379f565b60008060408385031215613bc357600080fd5b613bcc836134fd565b915061355a602084016134fd565b600060208284031215613bec57600080fd5b611a7c82613788565b600080600080600060808688031215613c0d57600080fd5b613c16866134fd565b9450613c2460208701613788565b93506040860135925060608601356001600160401b03811115613c4657600080fd5b613c528882890161379f565b969995985093965092949392505050565b600181811c90821680613c7757607f821691505b602082108103613c9757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615613ccd57613ccd613c9d565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613cf757613cf7613cd2565b500490565b6020808252600d908201526c05175616e74697479206973203609c1b604082015260600190565b6020808252601390820152724578636565646564206d617820737570706c7960681b604082015260600190565b602080825260159082015274115e18d959591959081b585e081c195c881b5a5b9d605a1b604082015260600190565b60208082526017908201527f4578636565646564206d6178207065722077616c6c6574000000000000000000604082015260600190565b600060208284031215613dc857600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b601f821115610b9557600081815260208120601f850160051c81016020861015613e0c5750805b601f850160051c820191505b8181101561111e57828155600101613e18565b81516001600160401b03811115613e4457613e44613611565b613e5881613e528454613c63565b84613de5565b602080601f831160018114613e8d5760008415613e755750858301515b600019600386901b1c1916600185901b17855561111e565b600085815260208120601f198616915b82811015613ebc57888601518255948401946001909101908401613e9d565b5085821015613eda5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008351613efc818460208801613563565b835190830190613f10818360208801613563565b01949350505050565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b60008219821115613fc457613fc4613c9d565b500190565b600082821015613fdb57613fdb613c9d565b500390565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60006001820161403d5761403d613c9d565b5060010190565b60008261405357614053613cd2565b500690565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906140dd9083018461358f565b9695505050505050565b6000602082840312156140f957600080fd5b8151611a7c816134ca565b634e487b7160e01b600052603160045260246000fdfe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212203ec2a2d18422d8958a006ed7726bdacd4ec5c44f5254140c5371f14366a1ad4264736f6c634300080f0033
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.