Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ZeeItemCollection
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../../acl/access-controlled/AccessControlledUpgradeable.sol";
import "../../common/BlockAware.sol";
import "./IZeeItemCollection.sol";
import "operator-filter-registry/src/upgradeable/DefaultOperatorFiltererUpgradeable.sol";
contract ZeeItemCollection is
IZeeItemCollection,
ERC1155Upgradeable,
ERC1155BurnableUpgradeable,
OwnableUpgradeable,
BlockAware,
AccessControlledUpgradeable,
DefaultOperatorFiltererUpgradeable
{
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant ZEE_ITEMS_MAINTAINER_ROLE = keccak256("ZEE_ITEMS_MAINTAINER_ROLE");
mapping(uint256 => bool) internal _soulBoundTokens;
uint256 public actionId;
mapping(uint256 => uint256) public supplyLimits;
mapping(uint256 => uint256) public supply;
mapping(uint256 => bool) public processedRequests;
constructor() initializer {}
function initialize (
address acl,
string calldata baseUri
) external initializer {
__BlockAware_init();
__AccessControlled_init(acl);
__UUPSUpgradeable_init();
__ERC1155_init(baseUri);
__Ownable_init();
// Set the base URI
_setBaseURI(baseUri);
}
function uri(uint256 tokenId) public view override returns (string memory) {
return string(abi.encodePacked(super.uri(tokenId), Strings.toString(tokenId)));
}
function setBaseURI(string calldata baseUri) external onlyOwner {
_setBaseURI(baseUri);
}
function _setBaseURI(string calldata baseUri) internal {
_setURI(baseUri);
emit UriSet(baseUri);
}
function airdropTokens(address[] calldata recipients, uint256 tokenId) public onlyRole(MINTER_ROLE) {
uint count = recipients.length;
for(uint i = 0; i < count; i++)
{
_safeMint(recipients[i], tokenId, 1);
}
}
function sendBatch(address _recipient, uint256[] calldata tokenIds) public onlyRole(MINTER_ROLE) {
uint count = tokenIds.length;
for(uint i = 0; i < count; i++) {
_safeMint(_recipient, tokenIds[i], 1);
}
}
function mintMultiple(address recipient, uint256 tokenId, uint256 amount) external onlyRole(MINTER_ROLE) {
_safeMint(recipient, tokenId, amount);
}
function airdropBatch(AirdropConfig[] calldata recipients) external onlyRole(MINTER_ROLE) {
_airdropBatchWithReason(recipients, "");
}
function airdropBatchSafe(AirdropConfig[] calldata recipients, uint256 requestId) external onlyRole(MINTER_ROLE) {
require(processedRequests[requestId] == false, "Already processed");
_airdropBatchWithReason(recipients, "");
processedRequests[requestId] = true;
}
function airdropBatchWithReason(AirdropConfig[] calldata recipients, string calldata reason) external onlyRole(MINTER_ROLE) {
_airdropBatchWithReason(recipients, reason);
}
function _airdropBatchWithReason(AirdropConfig[] calldata recipients, string memory reason) internal {
uint count = recipients.length;
for(uint i = 0; i < count; i++) {
require(recipients[i].tokenIds.length == recipients[i].amounts.length, "Invalid data length provided");
uint tokenCount = recipients[i].tokenIds.length;
for(uint j = 0; j < tokenCount; j++) {
_safeMint(recipients[i].wallet, recipients[i].tokenIds[j], recipients[i].amounts[j]);
}
}
emit BatchAirdropped(recipients, reason);
}
function airdropBatchFromMinted(AirdropConfig[] calldata recipients) external {
uint count = recipients.length;
for(uint i = 0; i < count; i++) {
_safeBatchTransferFrom(msg.sender, recipients[i].wallet, recipients[i].tokenIds, recipients[i].amounts, "");
}
}
function setSoulBoundTokens(uint256[] calldata tokenIds, bool soulbound) external onlyRole(ZEE_ITEMS_MAINTAINER_ROLE) {
require(tokenIds.length > 0, "No token ids provided");
uint256 count = tokenIds.length;
for (uint256 i = 0; i < count; i++) {
_soulBoundTokens[tokenIds[i]] = soulbound;
emit SoulBoundSet(tokenIds[i], soulbound);
}
}
function setTokenLimits(uint256[] calldata tokenIds, uint256[] calldata limits) external onlyRole(ZEE_ITEMS_MAINTAINER_ROLE) {
require(tokenIds.length > 0, "No data passed");
require(tokenIds.length == limits.length, "Invalid data lengths");
uint256 count = tokenIds.length;
for (uint256 i = 0; i < count; i++) {
supplyLimits[tokenIds[i]] = limits[i];
emit SupplyLimitSet(tokenIds[i], supplyLimits[tokenIds[i]]);
}
}
function setTokenCounts(uint256[] calldata tokenIds, uint256[] calldata counts) external onlyRole(ZEE_ITEMS_MAINTAINER_ROLE) {
require(tokenIds.length > 0, "No data passed");
require(tokenIds.length == counts.length, "Invalid data lengths");
uint256 count = tokenIds.length;
for (uint256 i = 0; i < count; i++) {
supply[tokenIds[i]] = counts[i];
emit SupplySet(tokenIds[i], supply[tokenIds[i]]);
}
}
function burnWithReason(uint256[] calldata tokenIds, uint256[] calldata amounts, uint256 requiredAmount, string calldata reason) external {
require(tokenIds.length == amounts.length, "Invalid data lengths");
uint256 count = tokenIds.length;
uint256 totalAmount = 0;
for (uint256 i = 0; i < count; i++) {
totalAmount += amounts[i];
}
actionId++;
require(totalAmount == requiredAmount, "Amount mismatch");
safeBatchTransferFrom(msg.sender, address(0x000000000000000000000000000000000000dEaD), tokenIds, amounts, bytes(""));
emit BatchBurnCompleted(tokenIds, amounts, requiredAmount, reason, msg.sender, actionId, "");
}
function burnWithReasonAndId(uint256[] calldata tokenIds, uint256[] calldata amounts, uint256 requiredAmount, string calldata reason, string calldata externalId) external {
require(tokenIds.length == amounts.length, "Invalid data lengths");
uint256 count = tokenIds.length;
uint256 totalAmount = 0;
for (uint256 i = 0; i < count; i++) {
totalAmount += amounts[i];
}
actionId++;
require(totalAmount == requiredAmount, "Amount mismatch");
safeBatchTransferFrom(msg.sender, address(0x000000000000000000000000000000000000dEaD), tokenIds, amounts, bytes(""));
emit BatchBurnCompleted(tokenIds, amounts, requiredAmount, reason, msg.sender, actionId, externalId);
}
function multipleBalanceOf(address owner, uint256[] calldata tokenIds) external view returns(ItemBalance[] memory) {
uint256 count = tokenIds.length;
ItemBalance[] memory balances = new ItemBalance[](count);
for (uint256 i = 0; i < count; i++) {
balances[i].tokenId = tokenIds[i];
balances[i].amount = balanceOf(owner, tokenIds[i]);
}
return balances;
}
/// @inheritdoc ERC165Upgradeable
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(AccessControlledUpgradeable, ERC1155Upgradeable)
returns (bool)
{
return interfaceId == type(IZeeItemCollection).interfaceId || ERC1155Upgradeable.supportsInterface(interfaceId) || AccessControlledUpgradeable.supportsInterface(interfaceId);
}
/// @inheritdoc UUPSUpgradeable
function _authorizeUpgrade(address) internal override onlyAdmin {
// solhint-disable-previous-line no-empty-blocks
}
// Opensea restrictions
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
super.setApprovalForAll(operator, approved);
}
function safeTransferFrom(address from, address to, uint256 tokenId, uint256 amount, bytes memory data)
public
override
onlyAllowedOperator(from)
{
super.safeTransferFrom(from, to, tokenId, amount, data);
}
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override onlyAllowedOperator(from) {
super.safeBatchTransferFrom(from, to, ids, amounts, data);
}
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
if (_getAcl().hasRole(ZEE_ITEMS_MAINTAINER_ROLE, operator)) {
return true;
}
return ERC1155Upgradeable.isApprovedForAll(account, operator);
}
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override {
uint256 count = ids.length;
if (from == address(0x0)) {
// Check mint limits for specific tokens
for (uint256 i = 0; i < count; i++) {
supply[ids[i]] += amounts[i];
if (supplyLimits[ids[i]] > 0 && supplyLimits[ids[i]] < supply[ids[i]]) {
revert("Token mint limits reached");
}
}
return;
}
for (uint256 i = 0; i < count; i++) {
require(_soulBoundTokens[ids[i]] == false, "Cannot transfer soul bound tokens");
}
}
function _safeMint(address recipient, uint256 tokenId, uint256 amount) internal {
require(tokenId >= 100000000, "id too small");
require(tokenId <= 999999999, "id too large");
_mint(recipient, tokenId, amount, "");
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri_) {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: address zero is not a valid owner");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `ids` and `amounts` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "./IERC1155Upgradeable.sol";
import "./IERC1155ReceiverUpgradeable.sol";
import "./extensions/IERC1155MetadataURIUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable {
using AddressUpgradeable for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
function __ERC1155_init(string memory uri_) internal onlyInitializing {
__ERC1155_init_unchained(uri_);
}
function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
return
interfaceId == type(IERC1155Upgradeable).interfaceId ||
interfaceId == type(IERC1155MetadataURIUpgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: address zero is not a valid owner");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `ids` and `amounts` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155ReceiverUpgradeable.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155ReceiverUpgradeable.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[47] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/extensions/ERC1155Burnable.sol)
pragma solidity ^0.8.0;
import "../ERC1155Upgradeable.sol";
import "../../../proxy/utils/Initializable.sol";
/**
* @dev Extension of {ERC1155} that allows token holders to destroy both their
* own tokens and those that they have been approved to use.
*
* _Available since v3.1._
*/
abstract contract ERC1155BurnableUpgradeable is Initializable, ERC1155Upgradeable {
function __ERC1155Burnable_init() internal onlyInitializing {
}
function __ERC1155Burnable_init_unchained() internal onlyInitializing {
}
function burn(
address account,
uint256 id,
uint256 value
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_burn(account, id, value);
}
function burnBatch(
address account,
uint256[] memory ids,
uint256[] memory values
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_burnBatch(account, ids, values);
}
/**
* @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.5.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*
* _Available since v4.1._
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address private immutable __self = address(this);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
require(address(this) != __self, "Function must be called through delegatecall");
require(_getImplementation() == __self, "Function must be called through active proxy");
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
_;
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate that the this implementation remains valid after an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeTo(address newImplementation) external virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data, true);
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal override onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) 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[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "./IAccessControlled.sol";
import "../Roles.sol";
import "../IACL.sol";
/// @notice Modifier provider for contracts that want to interact with the ACL contract.
abstract contract AccessControlledUpgradeable is
IAccessControlled,
UUPSUpgradeable,
ContextUpgradeable,
ERC165Upgradeable
{
bytes32 private constant _ACL_SLOT = bytes32(uint256(keccak256("zee-game.acl.slot")) - 1);
modifier onlyRole(bytes32 role) {
_getAcl().checkRole(role, _msgSender());
_;
}
/// @dev Modifier to make a function callable by the admin account.
modifier onlyAdmin() {
_getAcl().checkRole(Roles.ADMIN, _msgSender());
_;
}
/// @dev Modifier to make a function callable by a supervisor account.
modifier onlyMaintainer() {
_getAcl().checkRole(Roles.MAINTAINER, _msgSender());
_;
}
function __AccessControlled_init(address acl) internal onlyInitializing {
// solhint-disable-previous-line func-name-mixedcase
_setACL(acl);
}
/// @inheritdoc IAccessControlled
function getACL() external view returns (address) {
// solhint-disable-previous-line ordering
return address(_getAcl());
}
/// @inheritdoc IAccessControlled
function setACL(address acl) external onlyAdmin {
_setACL(acl);
}
/// @inheritdoc ERC165Upgradeable
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlled).interfaceId || super.supportsInterface(interfaceId);
}
function _setACL(address acl) internal {
if (!IERC165Upgradeable(acl).supportsInterface(type(IACL).interfaceId)) revert InvalidACLAddress(acl);
StorageSlotUpgradeable.getAddressSlot(_ACL_SLOT).value = acl;
emit ACLSet(acl);
}
/// @dev return the IACL address
function _getAcl() internal view returns (IACL) {
return IACL(StorageSlotUpgradeable.getAddressSlot(_ACL_SLOT).value);
}
/// @inheritdoc UUPSUpgradeable
function _authorizeUpgrade(address) internal virtual override onlyAdmin {
// solhint-disable-previous-line no-empty-blocks
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./IBlockAware.sol";
import "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
/// @notice The implementer contract will always know at which block it was created.
abstract contract BlockAware is IBlockAware, Initializable {
bytes32 private constant _DEPLOYMENT_BLOCK_NUMBER_SLOT =
bytes32(uint256(keccak256("zee-game.block-aware.deployment-block")) - 1);
// solhint-disable-next-line func-name-mixedcase
function __BlockAware_init() internal onlyInitializing {
StorageSlotUpgradeable.getUint256Slot(_DEPLOYMENT_BLOCK_NUMBER_SLOT).value = block.number;
}
/// @inheritdoc IBlockAware
function getDeploymentBlockNumber() external view returns (uint256) {
// solhint-disable-previous-line ordering
return StorageSlotUpgradeable.getUint256Slot(_DEPLOYMENT_BLOCK_NUMBER_SLOT).value;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
struct AirdropConfig {
address wallet;
uint256[] tokenIds;
uint256[] amounts;
}
struct ItemBalance {
uint256 tokenId;
uint256 amount;
}
interface IZeeItemCollection {
event UriSet(string newUri);
event BatchAirdropped(AirdropConfig[] recipients, string reason);
event SoulBoundSet(uint256 tokenId, bool soulbound);
event BatchBurnCompleted(uint256[] tokenIds, uint256[] amounts, uint256 requiredAmount, string reason, address operator, uint256 actionId, string externalId);
event SupplyLimitSet(uint256 tokenId, uint256 limit);
event SupplySet(uint256 tokenId, uint256 amount);
function setBaseURI(string calldata baseUri) external;
function airdropTokens(address[] calldata recipients, uint256 tokenId) external;
function sendBatch(address recipient, uint256[] calldata tokenIds) external;
function mintMultiple(address recipient, uint256 tokenId, uint256 amount) external;
function airdropBatch(AirdropConfig[] calldata recipients) external;
function airdropBatchSafe(AirdropConfig[] calldata recipients, uint256 requestId) external;
function airdropBatchWithReason(AirdropConfig[] calldata recipients, string calldata reason) external;
function airdropBatchFromMinted(AirdropConfig[] calldata recipients) external;
function setSoulBoundTokens(uint256[] calldata tokenIds, bool soulbound) external;
function setTokenLimits(uint256[] calldata tokenIds, uint256[] calldata limits) external;
function setTokenCounts(uint256[] calldata tokenIds, uint256[] calldata counts) external;
function burnWithReason(uint256[] calldata tokenIds, uint256[] calldata amounts, uint256 requiredAmount, string calldata reason) external;
function burnWithReasonAndId(uint256[] calldata tokenIds, uint256[] calldata amounts, uint256 requiredAmount, string calldata reason, string calldata externalId) external;
function multipleBalanceOf(address owner, uint256[] calldata tokenIds) external view returns(ItemBalance[] memory);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import {OperatorFiltererUpgradeable} from "./OperatorFiltererUpgradeable.sol";
abstract contract DefaultOperatorFiltererUpgradeable is OperatorFiltererUpgradeable {
address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);
function __DefaultOperatorFilterer_init() internal onlyInitializing {
OperatorFiltererUpgradeable.__OperatorFilterer_init(DEFAULT_SUBSCRIPTION, true);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
import "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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) (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) (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 (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165Upgradeable.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155Upgradeable is IERC165Upgradeable {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165Upgradeable.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155ReceiverUpgradeable is IERC165Upgradeable {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
import "../IERC1155Upgradeable.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURIUpgradeable is IERC1155Upgradeable {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/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.5.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822ProxiableUpgradeable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.sol";
/**
* @dev This abstract contract provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
*
* _Available since v4.1._
*
* @custom:oz-upgrades-unsafe-allow delegatecall
*/
abstract contract ERC1967UpgradeUpgradeable is Initializable {
function __ERC1967Upgrade_init() internal onlyInitializing {
}
function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
}
// This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Returns the current implementation address.
*/
function _getImplementation() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Perform implementation upgrade
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Perform implementation upgrade with additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCall(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
_upgradeTo(newImplementation);
if (data.length > 0 || forceCall) {
_functionDelegateCall(newImplementation, data);
}
}
/**
* @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCallUUPS(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
// Upgrades from old implementations will perform a rollback test. This test requires the new
// implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
// this special case will break upgrade paths from old UUPS implementation to new ones.
if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
_setImplementation(newImplementation);
} else {
try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
} catch {
revert("ERC1967Upgrade: new implementation is not UUPS");
}
_upgradeToAndCall(newImplementation, data, forceCall);
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Returns the current admin.
*/
function _getAdmin() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
require(newAdmin != address(0), "ERC1967: new admin is the zero address");
StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function _changeAdmin(address newAdmin) internal {
emit AdminChanged(_getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
*/
bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Emitted when the beacon is upgraded.
*/
event BeaconUpgraded(address indexed beacon);
/**
* @dev Returns the current beacon.
*/
function _getBeacon() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
require(
AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
"ERC1967: beacon implementation is not a contract"
);
StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
}
/**
* @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
* not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
*
* Emits a {BeaconUpgraded} event.
*/
function _upgradeBeaconToAndCall(
address newBeacon,
bytes memory data,
bool forceCall
) internal {
_setBeacon(newBeacon);
emit BeaconUpgraded(newBeacon);
if (data.length > 0 || forceCall) {
_functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
}
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) {
require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
}
/**
* @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 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeaconUpgradeable {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {BeaconProxy} will check that this address is a contract.
*/
function implementation() external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
*/
library StorageSlotUpgradeable {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
/// @notice Access Control List contract interface.
interface IAccessControlled {
/// @notice Thrown when the acl address does not implement the IACL interface.
error InvalidACLAddress(address acl);
/// @notice Emitted when the ACL contract gets set.
event ACLSet(address indexed acl);
/// @notice set the ACL contract
/// @param acl The ACL contract address.
function setACL(address acl) external;
/// @notice Get the ACL contract address.
/// @return The ACL contract address.
function getACL() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
/// @notice Different role definitions used by the ACL contract.
library Roles {
/// @dev This maps directly to the OpenZeppelins AccessControl DEFAULT_ADMIN
bytes32 public constant ADMIN = 0x00;
/// @dev The Maintainer role. Can execute Maintainer-only tasks.
bytes32 public constant MAINTAINER = keccak256("MAINTAINER_ROLE");
/// @dev The NFT owner role. Can execute NFT-only tasks.
bytes32 public constant NFT_OWNER = keccak256("NFT_OWNER");
/// @dev The auxiliary contracts that can perform cross-calls with one another.
// TODO: segregate these into a smaller roles.
bytes32 public constant AUXILIARY_CONTRACTS = keccak256("AUXILIARY_CONTRACTS");
/// @dev The Fragment mini-game burn permission
bytes32 public constant FRAGMENT_MINI_GAME_BURN = keccak256("FRAGMENT_MINI_GAME_BURN");
/// @dev The Zee NFT mint permission
bytes32 public constant ZEE_NFT_MINT = keccak256("ZEE_NFT_MINT");
/// @dev The Zee NFT burn permission
bytes32 public constant ZEE_NFT_BURN = keccak256("ZEE_NFT_BURN");
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol";
/// @notice Access Control List contract interface.
interface IACL is IAccessControlEnumerableUpgradeable {
/// @notice Thrown when the ACL roles do not match AccessControlEnumerable
error RolesContractIncorrectlyConfigured();
error CannotHaveMoreThanOneAddressInRole();
error CannotRemoveLastAdmin();
/// @notice Tevert if the `account` does not have the specified role.
/// @param role The role identifier.
/// @param account The address to check the role for.
function checkRole(bytes32 role, address account) external view;
/// @notice Get the admin role describing bytes.
/// @return role bytes.
function getAdminRole() external pure returns (bytes32);
/// @notice Get the maintainer role describing bytes.
/// @return role bytes.
function getMaintainerRole() external pure returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
*/
interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) external view returns (address);
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
/// @notice The implementer contract will always know at which block it was created.
interface IBlockAware {
/// @notice Get deployment block number.
function getDeploymentBlockNumber() external view returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import {IOperatorFilterRegistry} from "../IOperatorFilterRegistry.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
abstract contract OperatorFiltererUpgradeable is Initializable {
error OperatorNotAllowed(address operator);
IOperatorFilterRegistry constant operatorFilterRegistry =
IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);
function __OperatorFilterer_init(address subscriptionOrRegistrantToCopy, bool subscribe)
internal
onlyInitializing
{
// If an inheriting token contract is deployed to a network without the registry deployed, the modifier
// will not revert, but the contract will need to be registered with the registry once it is deployed in
// order for the modifier to filter addresses.
if (address(operatorFilterRegistry).code.length > 0) {
if (!operatorFilterRegistry.isRegistered(address(this))) {
if (subscribe) {
operatorFilterRegistry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
} else {
if (subscriptionOrRegistrantToCopy != address(0)) {
operatorFilterRegistry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
} else {
operatorFilterRegistry.register(address(this));
}
}
}
}
}
modifier onlyAllowedOperator(address from) virtual {
// Check registry code length to facilitate testing in environments without a deployed registry.
if (address(operatorFilterRegistry).code.length > 0) {
// Allow spending tokens from addresses with balance
// Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
// from an EOA.
if (from == msg.sender) {
_;
return;
}
if (!operatorFilterRegistry.isOperatorAllowed(address(this), msg.sender)) {
revert OperatorNotAllowed(msg.sender);
}
}
_;
}
modifier onlyAllowedOperatorApproval(address operator) virtual {
// Check registry code length to facilitate testing in environments without a deployed registry.
if (address(operatorFilterRegistry).code.length > 0) {
if (!operatorFilterRegistry.isOperatorAllowed(address(this), operator)) {
revert OperatorNotAllowed(operator);
}
}
_;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface IOperatorFilterRegistry {
function isOperatorAllowed(address registrant, address operator) external view returns (bool);
function register(address registrant) external;
function registerAndSubscribe(address registrant, address subscription) external;
function registerAndCopyEntries(address registrant, address registrantToCopy) external;
function unregister(address addr) external;
function updateOperator(address registrant, address operator, bool filtered) external;
function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
function subscribe(address registrant, address registrantToSubscribe) external;
function unsubscribe(address registrant, bool copyExistingEntries) external;
function subscriptionOf(address addr) external returns (address registrant);
function subscribers(address registrant) external returns (address[] memory);
function subscriberAt(address registrant, uint256 index) external returns (address);
function copyEntriesOf(address registrant, address registrantToCopy) external;
function isOperatorFiltered(address registrant, address operator) external returns (bool);
function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
function filteredOperators(address addr) external returns (address[] memory);
function filteredCodeHashes(address addr) external returns (bytes32[] memory);
function filteredOperatorAt(address registrant, uint256 index) external returns (address);
function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
function isRegistered(address addr) external returns (bool);
function codeHashOf(address addr) external returns (bytes32);
}{
"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":[{"internalType":"address","name":"acl","type":"address"}],"name":"InvalidACLAddress","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"acl","type":"address"}],"name":"ACLSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"indexed":false,"internalType":"struct AirdropConfig[]","name":"recipients","type":"tuple[]"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"BatchAirdropped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"requiredAmount","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"},{"indexed":false,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"uint256","name":"actionId","type":"uint256"},{"indexed":false,"internalType":"string","name":"externalId","type":"string"}],"name":"BatchBurnCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"soulbound","type":"bool"}],"name":"SoulBoundSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"limit","type":"uint256"}],"name":"SupplyLimitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SupplySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"newUri","type":"string"}],"name":"UriSet","type":"event"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ZEE_ITEMS_MAINTAINER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"actionId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct AirdropConfig[]","name":"recipients","type":"tuple[]"}],"name":"airdropBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct AirdropConfig[]","name":"recipients","type":"tuple[]"}],"name":"airdropBatchFromMinted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct AirdropConfig[]","name":"recipients","type":"tuple[]"},{"internalType":"uint256","name":"requestId","type":"uint256"}],"name":"airdropBatchSafe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct AirdropConfig[]","name":"recipients","type":"tuple[]"},{"internalType":"string","name":"reason","type":"string"}],"name":"airdropBatchWithReason","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"airdropTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"requiredAmount","type":"uint256"},{"internalType":"string","name":"reason","type":"string"}],"name":"burnWithReason","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256","name":"requiredAmount","type":"uint256"},{"internalType":"string","name":"reason","type":"string"},{"internalType":"string","name":"externalId","type":"string"}],"name":"burnWithReasonAndId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getACL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDeploymentBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"acl","type":"address"},{"internalType":"string","name":"baseUri","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"multipleBalanceOf","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ItemBalance[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"processedRequests","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"sendBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"acl","type":"address"}],"name":"setACL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseUri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bool","name":"soulbound","type":"bool"}],"name":"setSoulBoundTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"counts","type":"uint256[]"}],"name":"setTokenCounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"limits","type":"uint256[]"}],"name":"setTokenLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"supplyLimits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60a0604052306080523480156200001557600080fd5b50600054610100900460ff1615808015620000375750600054600160ff909116105b8062000067575062000054306200014160201b620021e71760201c565b15801562000067575060005460ff166001145b620000cf5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015620000f3576000805461ff0019166101001790555b80156200013a576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5062000150565b6001600160a01b03163b151590565b6080516150d96200018860003960008181610d3e01528181610d7e01528181611162015281816111a2015261121e01526150d96000f3fe60806040526004361061023a5760003560e01c806376aad6051161012e578063d5391393116100ab578063f242432a1161006f578063f242432a146106f1578063f2fde38b14610711578063f399e22e14610731578063f5298aca14610751578063fabc72251461077157600080fd5b8063d53913931461063e578063e058ea9714610660578063e10f8aad14610680578063e6f0af6e146106a0578063e985e9c5146106d157600080fd5b80639354f175116100f25780639354f1751461058e578063a11223da146105bc578063a22cb465146105dc578063b3a1acd8146105fc578063b47ac8c61461061157600080fd5b806376aad605146104ef5780638b394ad41461050f5780638b73138a1461052f5780638da5cb5b1461054f5780638f870e151461056e57600080fd5b806336b6e82b116101bc57806352d1902d1161018057806352d1902d1461046557806355f804b31461047a5780636b20c4541461049a578063715018a6146104ba57806371c489bb146104cf57600080fd5b806336b6e82b146103ce5780633bc9ef81146103e557806342dada87146104055780634e1273f4146104255780634f1ef2861461045257600080fd5b80632eb2c2d6116102035780632eb2c2d61461031e5780632f336fc2146103405780632f39a4ea1461036057806335403023146103805780633659cfe6146103ae57600080fd5b8062fdd58e1461023f57806301ffc9a71461027257806308737695146102a25780630e1466b4146102cf5780630e89341c146102f1575b600080fd5b34801561024b57600080fd5b5061025f61025a366004613bb9565b610791565b6040519081526020015b60405180910390f35b34801561027e57600080fd5b5061029261028d366004613bf9565b61082c565b6040519015158152602001610269565b3480156102ae57600080fd5b506102b7610860565b6040516001600160a01b039091168152602001610269565b3480156102db57600080fd5b5061025f60008051602061506483398151915281565b3480156102fd57600080fd5b5061031161030c366004613c16565b61086f565b6040516102699190613c7f565b34801561032a57600080fd5b5061033e610339366004613ddb565b6108aa565b005b34801561034c57600080fd5b5061033e61035b366004613ecf565b610989565b34801561036c57600080fd5b5061033e61037b366004613ecf565b610b63565b34801561038c57600080fd5b5061025f61039b366004613c16565b6101626020526000908152604090205481565b3480156103ba57600080fd5b5061033e6103c9366004613f3a565b610d34565b3480156103da57600080fd5b5061025f6101605481565b3480156103f157600080fd5b5061033e610400366004613f55565b610dfc565b34801561041157600080fd5b5061033e610420366004613fd7565b610e9f565b34801561043157600080fd5b5061044561044036600461407a565b61102f565b604051610269919061417f565b61033e610460366004614192565b611158565b34801561047157600080fd5b5061025f611211565b34801561048657600080fd5b5061033e6104953660046141d5565b6112c5565b3480156104a657600080fd5b5061033e6104b536600461420a565b6112d7565b3480156104c657600080fd5b5061033e61131a565b3480156104db57600080fd5b5061033e6104ea36600461427d565b61132e565b3480156104fb57600080fd5b5061033e61050a366004613f3a565b611440565b34801561051b57600080fd5b5061033e61052a3660046142c8565b6114bf565b34801561053b57600080fd5b5061033e61054a366004613f55565b611554565b34801561055b57600080fd5b5061012d546001600160a01b03166102b7565b34801561057a57600080fd5b5061033e6105893660046142fb565b611685565b34801561059a57600080fd5b5061025f6105a9366004613c16565b6101616020526000908152604090205481565b3480156105c857600080fd5b5061033e6105d736600461427d565b61174d565b3480156105e857600080fd5b5061033e6105f736600461435b565b611823565b34801561060857600080fd5b5061025f6118e7565b34801561061d57600080fd5b5061063161062c3660046142fb565b61191d565b6040516102699190614392565b34801561064a57600080fd5b5061025f60008051602061508483398151915281565b34801561066c57600080fd5b5061033e61067b3660046143e1565b611a24565b34801561068c57600080fd5b5061033e61069b366004614440565b611af0565b3480156106ac57600080fd5b506102926106bb366004613c16565b6101636020526000908152604090205460ff1681565b3480156106dd57600080fd5b506102926106ec366004614496565b611c7a565b3480156106fd57600080fd5b5061033e61070c3660046144c9565b611d3f565b34801561071d57600080fd5b5061033e61072c366004613f3a565b611e11565b34801561073d57600080fd5b5061033e61074c36600461452d565b611e87565b34801561075d57600080fd5b5061033e61076c3660046142c8565b611ffd565b34801561077d57600080fd5b5061033e61078c366004614572565b612040565b60006001600160a01b0383166108015760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b50600081815260c9602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216631e35eeb760e11b14806108515750610851826121f6565b80610826575061082682612246565b600061086a61226b565b905090565b606061087a826122aa565b6108838361233e565b604051602001610894929190614641565b6040516020818303038152906040529050919050565b846daaeb6d7670e522a718067333cd4e3b1561097457336001600160a01b038216036108e2576108dd8686868686612446565b610981565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015610931573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109559190614670565b61097457604051633b79c77360e21b81523360048201526024016107f8565b6109818686868686612446565b505050505050565b6000805160206150648339815191526109a061226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b1580156109f557600080fd5b505afa158015610a09573d6000803e3d6000fd5b5050508415159050610a4e5760405162461bcd60e51b815260206004820152600e60248201526d139bc819185d18481c185cdcd95960921b60448201526064016107f8565b838214610a6d5760405162461bcd60e51b81526004016107f89061468d565b8360005b81811015610b5a57848482818110610a8b57610a8b6146bb565b905060200201356101616000898985818110610aa957610aa96146bb565b905060200201358152602001908152602001600020819055507ffdd0c951a77e35ec9a9dff805fe73c8b356be2dffc15c0d971acfdebe440d93a878783818110610af557610af56146bb565b9050602002013561016160008a8a86818110610b1357610b136146bb565b90506020020135815260200190815260200160002054604051610b40929190918252602082015260400190565b60405180910390a180610b52816146e7565b915050610a71565b50505050505050565b600080516020615064833981519152610b7a61226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b158015610bcf57600080fd5b505afa158015610be3573d6000803e3d6000fd5b5050508415159050610c285760405162461bcd60e51b815260206004820152600e60248201526d139bc819185d18481c185cdcd95960921b60448201526064016107f8565b838214610c475760405162461bcd60e51b81526004016107f89061468d565b8360005b81811015610b5a57848482818110610c6557610c656146bb565b905060200201356101626000898985818110610c8357610c836146bb565b905060200201358152602001908152602001600020819055507f1ee2da4e75679087a6229817b7c20e223ebbe6c0540cdaa148264b52e6368676878783818110610ccf57610ccf6146bb565b9050602002013561016260008a8a86818110610ced57610ced6146bb565b90506020020135815260200190815260200160002054604051610d1a929190918252602082015260400190565b60405180910390a180610d2c816146e7565b915050610c4b565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610d7c5760405162461bcd60e51b81526004016107f890614700565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610dae61248b565b6001600160a01b031614610dd45760405162461bcd60e51b81526004016107f89061474c565b610ddd816124a1565b60408051600080825260208201909252610df991839190612513565b50565b600080516020615084833981519152610e1361226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b158015610e6857600080fd5b505afa158015610e7c573d6000803e3d6000fd5b50505050610e9a83836040518060200160405280600081525061267e565b505050565b858414610ebe5760405162461bcd60e51b81526004016107f89061468d565b856000805b82811015610f0357878782818110610edd57610edd6146bb565b9050602002013582610eef9190614798565b915080610efb816146e7565b915050610ec3565b506101608054906000610f15836146e7565b9190505550848114610f5b5760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840dad2e6dac2e8c6d608b1b60448201526064016107f8565b610fda3361dead8b8b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808f0282810182019093528e82529093508e92508d9182918501908490808284376000920182905250604080516020810190915290815292506108aa915050565b7f890d6ccc7da5679bcf424459c6ca26e63672f15bdc2e081fbdca551333dbeeb489898989898989336101605460405161101c99989796959493929190614806565b60405180910390a1505050505050505050565b606081518351146110945760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016107f8565b600083516001600160401b038111156110af576110af613c92565b6040519080825280602002602001820160405280156110d8578160200160208202803683370190505b50905060005b8451811015611150576111238582815181106110fc576110fc6146bb565b6020026020010151858381518110611116576111166146bb565b6020026020010151610791565b828281518110611135576111356146bb565b6020908102919091010152611149816146e7565b90506110de565b509392505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036111a05760405162461bcd60e51b81526004016107f890614700565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166111d261248b565b6001600160a01b0316146111f85760405162461bcd60e51b81526004016107f89061474c565b611201826124a1565b61120d82826001612513565b5050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112b15760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016107f8565b5060008051602061501d8339815191525b90565b6112cd6128a9565b61120d8282612904565b6001600160a01b0383163314806112f357506112f38333611c7a565b61130f5760405162461bcd60e51b81526004016107f89061487e565b610e9a838383612980565b6113226128a9565b61132c6000612b1f565b565b60008051602061508483398151915261134561226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b15801561139a57600080fd5b505afa1580156113ae573d6000803e3d6000fd5b5050506000838152610163602052604090205460ff161590506114075760405162461bcd60e51b8152602060048201526011602482015270105b1c9958591e481c1c9bd8d95cdcd959607a1b60448201526064016107f8565b61142184846040518060200160405280600081525061267e565b50600090815261016360205260409020805460ff191660011790555050565b61144861226b565b6001600160a01b03166312d9a6ad6000336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b15801561149e57600080fd5b505afa1580156114b2573d6000803e3d6000fd5b50505050610df981612b72565b6000805160206150848339815191526114d661226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b15801561152b57600080fd5b505afa15801561153f573d6000803e3d6000fd5b5050505061154e848484612c82565b50505050565b8060005b8181101561154e5761167333858584818110611576576115766146bb565b905060200281019061158891906148cd565b611596906020810190613f3a565b8686858181106115a8576115a86146bb565b90506020028101906115ba91906148cd565b6115c89060208101906148ed565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a925089915087905081811061160e5761160e6146bb565b905060200281019061162091906148cd565b61162e9060408101906148ed565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525060408051602081019091529081529250612d23915050565b8061167d816146e7565b915050611558565b60008051602061508483398151915261169c61226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b1580156116f157600080fd5b505afa158015611705573d6000803e3d6000fd5b5084925060009150505b818110156109815761173b8686868481811061172d5761172d6146bb565b905060200201356001612c82565b80611745816146e7565b91505061170f565b60008051602061508483398151915261176461226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b1580156117b957600080fd5b505afa1580156117cd573d6000803e3d6000fd5b5085925060009150505b81811015610981576118118686838181106117f4576117f46146bb565b90506020020160208101906118099190613f3a565b856001612c82565b8061181b816146e7565b9150506117d7565b816daaeb6d7670e522a718067333cd4e3b156118dd57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b59190614670565b6118dd57604051633b79c77360e21b81526001600160a01b03821660048201526024016107f8565b610e9a8383612ec8565b60006119176112c260017ff543659935858f1984e182916c71d5eaee151a124fbdd01f466a364186483b91614936565b54919050565b6060816000816001600160401b0381111561193a5761193a613c92565b60405190808252806020026020018201604052801561197f57816020015b60408051808201909152600080825260208201528152602001906001900390816119585790505b50905060005b82811015611a185785858281811061199f5761199f6146bb565b905060200201358282815181106119b8576119b86146bb565b6020908102919091010151526119e6878787848181106119da576119da6146bb565b90506020020135610791565b8282815181106119f8576119f86146bb565b602090810291909101810151015280611a10816146e7565b915050611985565b509150505b9392505050565b600080516020615084833981519152611a3b61226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b158015611a9057600080fd5b505afa158015611aa4573d6000803e3d6000fd5b50505050611ae9858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061267e92505050565b5050505050565b600080516020615064833981519152611b0761226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b158015611b5c57600080fd5b505afa158015611b70573d6000803e3d6000fd5b5050508315159050611bbc5760405162461bcd60e51b8152602060048201526015602482015274139bc81d1bdad95b881a591cc81c1c9bdd9a591959605a1b60448201526064016107f8565b8260005b81811015610981578361015f6000888885818110611be057611be06146bb565b90506020020135815260200190815260200160002060006101000a81548160ff0219169083151502179055507f9a86e784ed5083812dadbc12e73d308f4aceb81f1e446fbe53f50faff140b375868683818110611c3f57611c3f6146bb565b9050602002013585604051611c609291909182521515602082015260400190565b60405180910390a180611c72816146e7565b915050611bc0565b6000611c8461226b565b604051632474521560e21b815260008051602061506483398151915260048201526001600160a01b03848116602483015291909116906391d1485490604401602060405180830381865afa158015611ce0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d049190614670565b15611d1157506001610826565b6001600160a01b03808416600090815260ca602090815260408083209386168352929052205460ff16611a1d565b846daaeb6d7670e522a718067333cd4e3b15611e0457336001600160a01b03821603611d72576108dd8686868686612ed3565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611dc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de59190614670565b611e0457604051633b79c77360e21b81523360048201526024016107f8565b6109818686868686612ed3565b611e196128a9565b6001600160a01b038116611e7e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107f8565b610df981612b1f565b600054610100900460ff1615808015611ea75750600054600160ff909116105b80611ec15750303b158015611ec1575060005460ff166001145b611f245760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016107f8565b6000805460ff191660011790558015611f47576000805461ff0019166101001790555b611f4f612f18565b611f5884612f71565b611f60612fa1565b611f9f83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612fc892505050565b611fa7612ff8565b611fb18383612904565b801561154e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150505050565b6001600160a01b03831633148061201957506120198333611c7a565b6120355760405162461bcd60e51b81526004016107f89061487e565b610e9a838383613027565b87861461205f5760405162461bcd60e51b81526004016107f89061468d565b876000805b828110156120a45789898281811061207e5761207e6146bb565b90506020020135826120909190614798565b91508061209c816146e7565b915050612064565b5061016080549060006120b6836146e7565b91905055508681146120fc5760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840dad2e6dac2e8c6d608b1b60448201526064016107f8565b61218c3361dead8d8d80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508c8c808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250604080516020810190915290815292506108aa915050565b7f890d6ccc7da5679bcf424459c6ca26e63672f15bdc2e081fbdca551333dbeeb48b8b8b8b8b8b8b33610160548d8d6040516121d29b9a99989796959493929190614949565b60405180910390a15050505050505050505050565b6001600160a01b03163b151590565b60006001600160e01b03198216636cdb3d1360e11b148061222757506001600160e01b031982166303a24d0760e21b145b8061082657506301ffc9a760e01b6001600160e01b0319831614610826565b60006001600160e01b031982166307ed9a0960e41b14806108265750610826826121f6565b600061229b6112c260017f2f94117d2c26dd889e3bde9cad610be6ea59faa34cc016c7267596f75c87e376614936565b546001600160a01b0316919050565b606060cb80546122b9906149c8565b80601f01602080910402602001604051908101604052809291908181526020018280546122e5906149c8565b80156123325780601f1061230757610100808354040283529160200191612332565b820191906000526020600020905b81548152906001019060200180831161231557829003601f168201915b50505050509050919050565b6060816000036123655750506040805180820190915260018152600360fc1b602082015290565b8160005b811561238f5780612379816146e7565b91506123889050600a83614a18565b9150612369565b6000816001600160401b038111156123a9576123a9613c92565b6040519080825280601f01601f1916602001820160405280156123d3576020820181803683370190505b5090505b841561243e576123e8600183614936565b91506123f5600a86614a2c565b612400906030614798565b60f81b818381518110612415576124156146bb565b60200101906001600160f81b031916908160001a905350612437600a86614a18565b94506123d7565b949350505050565b6001600160a01b03851633148061246257506124628533611c7a565b61247e5760405162461bcd60e51b81526004016107f89061487e565b611ae98585858585612d23565b600060008051602061501d83398151915261229b565b6124a961226b565b6001600160a01b03166312d9a6ad6000336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b1580156124ff57600080fd5b505afa158015611ae9573d6000803e3d6000fd5b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561254657610e9a83613143565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156125a0575060408051601f3d908101601f1916820190925261259d91810190614a40565b60015b6126035760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016107f8565b60008051602061501d83398151915281146126725760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016107f8565b50610e9a8383836131df565b8160005b818110156128755784848281811061269c5761269c6146bb565b90506020028101906126ae91906148cd565b6126bc9060408101906148ed565b90508585838181106126d0576126d06146bb565b90506020028101906126e291906148cd565b6126f09060208101906148ed565b90501461273f5760405162461bcd60e51b815260206004820152601c60248201527f496e76616c69642064617461206c656e6774682070726f76696465640000000060448201526064016107f8565b6000858583818110612753576127536146bb565b905060200281019061276591906148cd565b6127739060208101906148ed565b9050905060005b818110156128605761284e878785818110612797576127976146bb565b90506020028101906127a991906148cd565b6127b7906020810190613f3a565b8888868181106127c9576127c96146bb565b90506020028101906127db91906148cd565b6127e99060208101906148ed565b848181106127f9576127f96146bb565b90506020020135898987818110612812576128126146bb565b905060200281019061282491906148cd565b6128329060408101906148ed565b85818110612842576128426146bb565b90506020020135612c82565b80612858816146e7565b91505061277a565b5050808061286d906146e7565b915050612682565b507f03d7af7902d67e4247b81c6d4d1d36949d992e898b6518117670331bd50c1e5b848484604051611fef93929190614aa1565b61012d546001600160a01b0316331461132c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107f8565b61294382828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061320492505050565b7fd09d05534067f74dbc9e6af794edbd29e904d7698e428d0bc1378e45889acdd78282604051612974929190614b77565b60405180910390a15050565b6001600160a01b0383166129a65760405162461bcd60e51b81526004016107f890614b8b565b80518251146129c75760405162461bcd60e51b81526004016107f890614bce565b60003390506129ea81856000868660405180602001604052806000815250613210565b60005b8351811015612ab2576000848281518110612a0a57612a0a6146bb565b602002602001015190506000848381518110612a2857612a286146bb565b602090810291909101810151600084815260c9835260408082206001600160a01b038c168352909352919091205490915081811015612a795760405162461bcd60e51b81526004016107f890614c16565b600092835260c9602090815260408085206001600160a01b038b1686529091529092209103905580612aaa816146e7565b9150506129ed565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612b03929190614c5a565b60405180910390a460408051602081019091526000905261154e565b61012d80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516301ffc9a760e01b815263d432a77560e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015612bbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be19190614670565b612c09576040516320d2869360e11b81526001600160a01b03821660048201526024016107f8565b80612c386112c260017f2f94117d2c26dd889e3bde9cad610be6ea59faa34cc016c7267596f75c87e376614936565b80546001600160a01b0319166001600160a01b03928316179055604051908216907fb682c047807b0e34dd5e7ec89aa8d43386ff4e25dbd12c98e2fbfd44b99936f990600090a250565b6305f5e100821015612cc55760405162461bcd60e51b815260206004820152600c60248201526b1a59081d1bdbc81cdb585b1b60a21b60448201526064016107f8565b633b9ac9ff821115612d085760405162461bcd60e51b815260206004820152600c60248201526b696420746f6f206c6172676560a01b60448201526064016107f8565b610e9a83838360405180602001604052806000815250613437565b8151835114612d445760405162461bcd60e51b81526004016107f890614bce565b6001600160a01b038416612d6a5760405162461bcd60e51b81526004016107f890614c7f565b33612d79818787878787613210565b60005b8451811015612e62576000858281518110612d9957612d996146bb565b602002602001015190506000858381518110612db757612db76146bb565b602090810291909101810151600084815260c9835260408082206001600160a01b038e168352909352919091205490915081811015612e085760405162461bcd60e51b81526004016107f890614cc4565b600083815260c9602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612e47908490614798565b9250508190555050505080612e5b906146e7565b9050612d7c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612eb2929190614c5a565b60405180910390a4610981818787878787613553565b61120d3383836136ae565b6001600160a01b038516331480612eef5750612eef8533611c7a565b612f0b5760405162461bcd60e51b81526004016107f89061487e565b611ae9858585858561378e565b600054610100900460ff16612f3f5760405162461bcd60e51b81526004016107f890614d0e565b43612f6e6112c260017ff543659935858f1984e182916c71d5eaee151a124fbdd01f466a364186483b91614936565b55565b600054610100900460ff16612f985760405162461bcd60e51b81526004016107f890614d0e565b610df981612b72565b600054610100900460ff1661132c5760405162461bcd60e51b81526004016107f890614d0e565b600054610100900460ff16612fef5760405162461bcd60e51b81526004016107f890614d0e565b610df9816138ca565b600054610100900460ff1661301f5760405162461bcd60e51b81526004016107f890614d0e565b61132c6138fa565b6001600160a01b03831661304d5760405162461bcd60e51b81526004016107f890614b8b565b3360006130598461392a565b905060006130668461392a565b905061308683876000858560405180602001604052806000815250613210565b600085815260c9602090815260408083206001600160a01b038a168452909152902054848110156130c95760405162461bcd60e51b81526004016107f890614c16565b600086815260c9602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052610b5a565b6001600160a01b0381163b6131b05760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016107f8565b60008051602061501d83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6131e883613975565b6000825111806131f55750805b15610e9a5761154e83836139b5565b60cb61120d8282614d9f565b82516001600160a01b0386166133845760005b8181101561337d5783818151811061323d5761323d6146bb565b6020026020010151610162600087848151811061325c5761325c6146bb565b6020026020010151815260200190815260200160002060008282546132819190614798565b92505081905550600061016160008784815181106132a1576132a16146bb565b602002602001015181526020019081526020016000205411801561331e575061016260008683815181106132d7576132d76146bb565b60200260200101518152602001908152602001600020546101616000878481518110613305576133056146bb565b6020026020010151815260200190815260200160002054105b1561336b5760405162461bcd60e51b815260206004820152601960248201527f546f6b656e206d696e74206c696d69747320726561636865640000000000000060448201526064016107f8565b80613375816146e7565b915050613223565b5050610981565b60005b8181101561342d5761015f60008683815181106133a6576133a66146bb565b60209081029190910181015182528101919091526040016000205460ff161561341b5760405162461bcd60e51b815260206004820152602160248201527f43616e6e6f74207472616e7366657220736f756c20626f756e6420746f6b656e6044820152607360f81b60648201526084016107f8565b80613425816146e7565b915050613387565b5050505050505050565b6001600160a01b0384166134975760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016107f8565b3360006134a38561392a565b905060006134b08561392a565b90506134c183600089858589613210565b600086815260c9602090815260408083206001600160a01b038b168452909152812080548792906134f3908490614798565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610b5a83600089898989613aa9565b6001600160a01b0384163b156109815760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906135979089908990889088908890600401614e5e565b6020604051808303816000875af19250505080156135d2575060408051601f3d908101601f191682019092526135cf91810190614ebc565b60015b61367e576135de614ed9565b806308c379a00361361757506135f2614ef4565b806135fd5750613619565b8060405162461bcd60e51b81526004016107f89190613c7f565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016107f8565b6001600160e01b0319811663bc197c8160e01b14610b5a5760405162461bcd60e51b81526004016107f890614f7d565b816001600160a01b0316836001600160a01b0316036137215760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016107f8565b6001600160a01b03838116600081815260ca6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166137b45760405162461bcd60e51b81526004016107f890614c7f565b3360006137c08561392a565b905060006137cd8561392a565b90506137dd838989858589613210565b600086815260c9602090815260408083206001600160a01b038c168452909152902054858110156138205760405162461bcd60e51b81526004016107f890614cc4565b600087815260c9602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061385f908490614798565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46138bf848a8a8a8a8a613aa9565b505050505050505050565b600054610100900460ff166138f15760405162461bcd60e51b81526004016107f890614d0e565b610df981613204565b600054610100900460ff166139215760405162461bcd60e51b81526004016107f890614d0e565b61132c33612b1f565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613964576139646146bb565b602090810291909101015292915050565b61397e81613143565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b613a1d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016107f8565b600080846001600160a01b031684604051613a389190614fc5565b600060405180830381855af49150503d8060008114613a73576040519150601f19603f3d011682016040523d82523d6000602084013e613a78565b606091505b5091509150613aa0828260405180606001604052806027815260200161503d60279139613b64565b95945050505050565b6001600160a01b0384163b156109815760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190613aed9089908990889088908890600401614fd7565b6020604051808303816000875af1925050508015613b28575060408051601f3d908101601f19168201909252613b2591810190614ebc565b60015b613b34576135de614ed9565b6001600160e01b0319811663f23a6e6160e01b14610b5a5760405162461bcd60e51b81526004016107f890614f7d565b60608315613b73575081611a1d565b825115613b835782518084602001fd5b8160405162461bcd60e51b81526004016107f89190613c7f565b80356001600160a01b0381168114613bb457600080fd5b919050565b60008060408385031215613bcc57600080fd5b613bd583613b9d565b946020939093013593505050565b6001600160e01b031981168114610df957600080fd5b600060208284031215613c0b57600080fd5b8135611a1d81613be3565b600060208284031215613c2857600080fd5b5035919050565b60005b83811015613c4a578181015183820152602001613c32565b50506000910152565b60008151808452613c6b816020860160208601613c2f565b601f01601f19169290920160200192915050565b602081526000611a1d6020830184613c53565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715613ccd57613ccd613c92565b6040525050565b60006001600160401b03821115613ced57613ced613c92565b5060051b60200190565b600082601f830112613d0857600080fd5b81356020613d1582613cd4565b604051613d228282613ca8565b83815260059390931b8501820192828101915086841115613d4257600080fd5b8286015b84811015613d5d5780358352918301918301613d46565b509695505050505050565b600082601f830112613d7957600080fd5b81356001600160401b03811115613d9257613d92613c92565b604051613da9601f8301601f191660200182613ca8565b818152846020838601011115613dbe57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215613df357600080fd5b613dfc86613b9d565b9450613e0a60208701613b9d565b935060408601356001600160401b0380821115613e2657600080fd5b613e3289838a01613cf7565b94506060880135915080821115613e4857600080fd5b613e5489838a01613cf7565b93506080880135915080821115613e6a57600080fd5b50613e7788828901613d68565b9150509295509295909350565b60008083601f840112613e9657600080fd5b5081356001600160401b03811115613ead57600080fd5b6020830191508360208260051b8501011115613ec857600080fd5b9250929050565b60008060008060408587031215613ee557600080fd5b84356001600160401b0380821115613efc57600080fd5b613f0888838901613e84565b90965094506020870135915080821115613f2157600080fd5b50613f2e87828801613e84565b95989497509550505050565b600060208284031215613f4c57600080fd5b611a1d82613b9d565b60008060208385031215613f6857600080fd5b82356001600160401b03811115613f7e57600080fd5b613f8a85828601613e84565b90969095509350505050565b60008083601f840112613fa857600080fd5b5081356001600160401b03811115613fbf57600080fd5b602083019150836020828501011115613ec857600080fd5b60008060008060008060006080888a031215613ff257600080fd5b87356001600160401b038082111561400957600080fd5b6140158b838c01613e84565b909950975060208a013591508082111561402e57600080fd5b61403a8b838c01613e84565b909750955060408a0135945060608a013591508082111561405a57600080fd5b506140678a828b01613f96565b989b979a50959850939692959293505050565b6000806040838503121561408d57600080fd5b82356001600160401b03808211156140a457600080fd5b818501915085601f8301126140b857600080fd5b813560206140c582613cd4565b6040516140d28282613ca8565b83815260059390931b85018201928281019150898411156140f257600080fd5b948201945b838610156141175761410886613b9d565b825294820194908201906140f7565b9650508601359250508082111561412d57600080fd5b5061413a85828601613cf7565b9150509250929050565b600081518084526020808501945080840160005b8381101561417457815187529582019590820190600101614158565b509495945050505050565b602081526000611a1d6020830184614144565b600080604083850312156141a557600080fd5b6141ae83613b9d565b915060208301356001600160401b038111156141c957600080fd5b61413a85828601613d68565b600080602083850312156141e857600080fd5b82356001600160401b038111156141fe57600080fd5b613f8a85828601613f96565b60008060006060848603121561421f57600080fd5b61422884613b9d565b925060208401356001600160401b038082111561424457600080fd5b61425087838801613cf7565b9350604086013591508082111561426657600080fd5b5061427386828701613cf7565b9150509250925092565b60008060006040848603121561429257600080fd5b83356001600160401b038111156142a857600080fd5b6142b486828701613e84565b909790965060209590950135949350505050565b6000806000606084860312156142dd57600080fd5b6142e684613b9d565b95602085013595506040909401359392505050565b60008060006040848603121561431057600080fd5b61431984613b9d565b925060208401356001600160401b0381111561433457600080fd5b61434086828701613e84565b9497909650939450505050565b8015158114610df957600080fd5b6000806040838503121561436e57600080fd5b61437783613b9d565b915060208301356143878161434d565b809150509250929050565b602080825282518282018190526000919060409081850190868401855b828110156143d4578151805185528601518685015292840192908501906001016143af565b5091979650505050505050565b600080600080604085870312156143f757600080fd5b84356001600160401b038082111561440e57600080fd5b61441a88838901613e84565b9096509450602087013591508082111561443357600080fd5b50613f2e87828801613f96565b60008060006040848603121561445557600080fd5b83356001600160401b0381111561446b57600080fd5b61447786828701613e84565b909450925050602084013561448b8161434d565b809150509250925092565b600080604083850312156144a957600080fd5b6144b283613b9d565b91506144c060208401613b9d565b90509250929050565b600080600080600060a086880312156144e157600080fd5b6144ea86613b9d565b94506144f860208701613b9d565b9350604086013592506060860135915060808601356001600160401b0381111561452157600080fd5b613e7788828901613d68565b60008060006040848603121561454257600080fd5b61454b84613b9d565b925060208401356001600160401b0381111561456657600080fd5b61434086828701613f96565b600080600080600080600080600060a08a8c03121561459057600080fd5b89356001600160401b03808211156145a757600080fd5b6145b38d838e01613e84565b909b50995060208c01359150808211156145cc57600080fd5b6145d88d838e01613e84565b909950975060408c0135965060608c01359150808211156145f857600080fd5b6146048d838e01613f96565b909650945060808c013591508082111561461d57600080fd5b5061462a8c828d01613f96565b915080935050809150509295985092959850929598565b60008351614653818460208801613c2f565b835190830190614667818360208801613c2f565b01949350505050565b60006020828403121561468257600080fd5b8151611a1d8161434d565b602080825260149082015273496e76616c69642064617461206c656e6774687360601b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016146f9576146f96146d1565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b80820180821115610826576108266146d1565b81835260006001600160fb1b038311156147c457600080fd5b8260051b80836020870137939093016020019392505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60e08152600061481a60e083018b8d6147ab565b828103602084015261482d818a8c6147ab565b905087604084015282810360608401526148488187896147dd565b6001600160a01b03959095166080840152505060a081019190915280820360c09091015260008152602001979650505050505050565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b60008235605e198336030181126148e357600080fd5b9190910192915050565b6000808335601e1984360301811261490457600080fd5b8301803591506001600160401b0382111561491e57600080fd5b6020019150600581901b3603821315613ec857600080fd5b81810381811115610826576108266146d1565b60e08152600061495d60e083018d8f6147ab565b8281036020840152614970818c8e6147ab565b9050896040840152828103606084015261498b81898b6147dd565b6001600160a01b038816608085015260a0840187905283810360c085015290506149b68185876147dd565b9e9d5050505050505050505050505050565b600181811c908216806149dc57607f821691505b6020821081036149fc57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601260045260246000fd5b600082614a2757614a27614a02565b500490565b600082614a3b57614a3b614a02565b500690565b600060208284031215614a5257600080fd5b5051919050565b6000808335601e19843603018112614a7057600080fd5b83016020810192503590506001600160401b03811115614a8f57600080fd5b8060051b3603821315613ec857600080fd5b60408082528181018490526000906060808401600587901b850182018885805b8a811015614b5557888403605f190185528235368d9003605e19018112614ae6578283fd5b8c016001600160a01b03614af982613b9d565b1685526020614b0a81830183614a59565b8983890152614b1c8a890182846147ab565b915050614b2b8a840184614a59565b93508782038b890152614b3f8285836147ab565b9883019897505050939093019250600101614ac1565b5050508581036020870152614b6a8188613c53565b9998505050505050505050565b60208152600061243e6020830184866147dd565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b604081526000614c6d6040830185614144565b8281036020840152613aa08185614144565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b601f821115610e9a57600081815260208120601f850160051c81016020861015614d805750805b601f850160051c820191505b8181101561098157828155600101614d8c565b81516001600160401b03811115614db857614db8613c92565b614dcc81614dc684546149c8565b84614d59565b602080601f831160018114614e015760008415614de95750858301515b600019600386901b1c1916600185901b178555610981565b600085815260208120601f198616915b82811015614e3057888601518255948401946001909101908401614e11565b5085821015614e4e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0386811682528516602082015260a060408201819052600090614e8a90830186614144565b8281036060840152614e9c8186614144565b90508281036080840152614eb08185613c53565b98975050505050505050565b600060208284031215614ece57600080fd5b8151611a1d81613be3565b600060033d11156112c25760046000803e5060005160e01c90565b600060443d1015614f025790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715614f3157505050505090565b8285019150815181811115614f495750505050505090565b843d8701016020828501011115614f635750505050505090565b614f7260208286010187613ca8565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b600082516148e3818460208701613c2f565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061501190830184613c53565b97965050505050505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564511e90c87488672c3e16326cb4b40ae04fe239269ab5483a2c1452ef17c2a5089f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a264697066735822122073fdbafa4446629163428b415598b3d8e332e0d10bbf317e3ec2bbc22dda460c64736f6c63430008110033
Deployed Bytecode
0x60806040526004361061023a5760003560e01c806376aad6051161012e578063d5391393116100ab578063f242432a1161006f578063f242432a146106f1578063f2fde38b14610711578063f399e22e14610731578063f5298aca14610751578063fabc72251461077157600080fd5b8063d53913931461063e578063e058ea9714610660578063e10f8aad14610680578063e6f0af6e146106a0578063e985e9c5146106d157600080fd5b80639354f175116100f25780639354f1751461058e578063a11223da146105bc578063a22cb465146105dc578063b3a1acd8146105fc578063b47ac8c61461061157600080fd5b806376aad605146104ef5780638b394ad41461050f5780638b73138a1461052f5780638da5cb5b1461054f5780638f870e151461056e57600080fd5b806336b6e82b116101bc57806352d1902d1161018057806352d1902d1461046557806355f804b31461047a5780636b20c4541461049a578063715018a6146104ba57806371c489bb146104cf57600080fd5b806336b6e82b146103ce5780633bc9ef81146103e557806342dada87146104055780634e1273f4146104255780634f1ef2861461045257600080fd5b80632eb2c2d6116102035780632eb2c2d61461031e5780632f336fc2146103405780632f39a4ea1461036057806335403023146103805780633659cfe6146103ae57600080fd5b8062fdd58e1461023f57806301ffc9a71461027257806308737695146102a25780630e1466b4146102cf5780630e89341c146102f1575b600080fd5b34801561024b57600080fd5b5061025f61025a366004613bb9565b610791565b6040519081526020015b60405180910390f35b34801561027e57600080fd5b5061029261028d366004613bf9565b61082c565b6040519015158152602001610269565b3480156102ae57600080fd5b506102b7610860565b6040516001600160a01b039091168152602001610269565b3480156102db57600080fd5b5061025f60008051602061506483398151915281565b3480156102fd57600080fd5b5061031161030c366004613c16565b61086f565b6040516102699190613c7f565b34801561032a57600080fd5b5061033e610339366004613ddb565b6108aa565b005b34801561034c57600080fd5b5061033e61035b366004613ecf565b610989565b34801561036c57600080fd5b5061033e61037b366004613ecf565b610b63565b34801561038c57600080fd5b5061025f61039b366004613c16565b6101626020526000908152604090205481565b3480156103ba57600080fd5b5061033e6103c9366004613f3a565b610d34565b3480156103da57600080fd5b5061025f6101605481565b3480156103f157600080fd5b5061033e610400366004613f55565b610dfc565b34801561041157600080fd5b5061033e610420366004613fd7565b610e9f565b34801561043157600080fd5b5061044561044036600461407a565b61102f565b604051610269919061417f565b61033e610460366004614192565b611158565b34801561047157600080fd5b5061025f611211565b34801561048657600080fd5b5061033e6104953660046141d5565b6112c5565b3480156104a657600080fd5b5061033e6104b536600461420a565b6112d7565b3480156104c657600080fd5b5061033e61131a565b3480156104db57600080fd5b5061033e6104ea36600461427d565b61132e565b3480156104fb57600080fd5b5061033e61050a366004613f3a565b611440565b34801561051b57600080fd5b5061033e61052a3660046142c8565b6114bf565b34801561053b57600080fd5b5061033e61054a366004613f55565b611554565b34801561055b57600080fd5b5061012d546001600160a01b03166102b7565b34801561057a57600080fd5b5061033e6105893660046142fb565b611685565b34801561059a57600080fd5b5061025f6105a9366004613c16565b6101616020526000908152604090205481565b3480156105c857600080fd5b5061033e6105d736600461427d565b61174d565b3480156105e857600080fd5b5061033e6105f736600461435b565b611823565b34801561060857600080fd5b5061025f6118e7565b34801561061d57600080fd5b5061063161062c3660046142fb565b61191d565b6040516102699190614392565b34801561064a57600080fd5b5061025f60008051602061508483398151915281565b34801561066c57600080fd5b5061033e61067b3660046143e1565b611a24565b34801561068c57600080fd5b5061033e61069b366004614440565b611af0565b3480156106ac57600080fd5b506102926106bb366004613c16565b6101636020526000908152604090205460ff1681565b3480156106dd57600080fd5b506102926106ec366004614496565b611c7a565b3480156106fd57600080fd5b5061033e61070c3660046144c9565b611d3f565b34801561071d57600080fd5b5061033e61072c366004613f3a565b611e11565b34801561073d57600080fd5b5061033e61074c36600461452d565b611e87565b34801561075d57600080fd5b5061033e61076c3660046142c8565b611ffd565b34801561077d57600080fd5b5061033e61078c366004614572565b612040565b60006001600160a01b0383166108015760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b50600081815260c9602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216631e35eeb760e11b14806108515750610851826121f6565b80610826575061082682612246565b600061086a61226b565b905090565b606061087a826122aa565b6108838361233e565b604051602001610894929190614641565b6040516020818303038152906040529050919050565b846daaeb6d7670e522a718067333cd4e3b1561097457336001600160a01b038216036108e2576108dd8686868686612446565b610981565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015610931573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109559190614670565b61097457604051633b79c77360e21b81523360048201526024016107f8565b6109818686868686612446565b505050505050565b6000805160206150648339815191526109a061226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b1580156109f557600080fd5b505afa158015610a09573d6000803e3d6000fd5b5050508415159050610a4e5760405162461bcd60e51b815260206004820152600e60248201526d139bc819185d18481c185cdcd95960921b60448201526064016107f8565b838214610a6d5760405162461bcd60e51b81526004016107f89061468d565b8360005b81811015610b5a57848482818110610a8b57610a8b6146bb565b905060200201356101616000898985818110610aa957610aa96146bb565b905060200201358152602001908152602001600020819055507ffdd0c951a77e35ec9a9dff805fe73c8b356be2dffc15c0d971acfdebe440d93a878783818110610af557610af56146bb565b9050602002013561016160008a8a86818110610b1357610b136146bb565b90506020020135815260200190815260200160002054604051610b40929190918252602082015260400190565b60405180910390a180610b52816146e7565b915050610a71565b50505050505050565b600080516020615064833981519152610b7a61226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b158015610bcf57600080fd5b505afa158015610be3573d6000803e3d6000fd5b5050508415159050610c285760405162461bcd60e51b815260206004820152600e60248201526d139bc819185d18481c185cdcd95960921b60448201526064016107f8565b838214610c475760405162461bcd60e51b81526004016107f89061468d565b8360005b81811015610b5a57848482818110610c6557610c656146bb565b905060200201356101626000898985818110610c8357610c836146bb565b905060200201358152602001908152602001600020819055507f1ee2da4e75679087a6229817b7c20e223ebbe6c0540cdaa148264b52e6368676878783818110610ccf57610ccf6146bb565b9050602002013561016260008a8a86818110610ced57610ced6146bb565b90506020020135815260200190815260200160002054604051610d1a929190918252602082015260400190565b60405180910390a180610d2c816146e7565b915050610c4b565b6001600160a01b037f000000000000000000000000a02755f2ef4515375945f299a5510846861f2cc9163003610d7c5760405162461bcd60e51b81526004016107f890614700565b7f000000000000000000000000a02755f2ef4515375945f299a5510846861f2cc96001600160a01b0316610dae61248b565b6001600160a01b031614610dd45760405162461bcd60e51b81526004016107f89061474c565b610ddd816124a1565b60408051600080825260208201909252610df991839190612513565b50565b600080516020615084833981519152610e1361226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b158015610e6857600080fd5b505afa158015610e7c573d6000803e3d6000fd5b50505050610e9a83836040518060200160405280600081525061267e565b505050565b858414610ebe5760405162461bcd60e51b81526004016107f89061468d565b856000805b82811015610f0357878782818110610edd57610edd6146bb565b9050602002013582610eef9190614798565b915080610efb816146e7565b915050610ec3565b506101608054906000610f15836146e7565b9190505550848114610f5b5760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840dad2e6dac2e8c6d608b1b60448201526064016107f8565b610fda3361dead8b8b8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808f0282810182019093528e82529093508e92508d9182918501908490808284376000920182905250604080516020810190915290815292506108aa915050565b7f890d6ccc7da5679bcf424459c6ca26e63672f15bdc2e081fbdca551333dbeeb489898989898989336101605460405161101c99989796959493929190614806565b60405180910390a1505050505050505050565b606081518351146110945760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016107f8565b600083516001600160401b038111156110af576110af613c92565b6040519080825280602002602001820160405280156110d8578160200160208202803683370190505b50905060005b8451811015611150576111238582815181106110fc576110fc6146bb565b6020026020010151858381518110611116576111166146bb565b6020026020010151610791565b828281518110611135576111356146bb565b6020908102919091010152611149816146e7565b90506110de565b509392505050565b6001600160a01b037f000000000000000000000000a02755f2ef4515375945f299a5510846861f2cc91630036111a05760405162461bcd60e51b81526004016107f890614700565b7f000000000000000000000000a02755f2ef4515375945f299a5510846861f2cc96001600160a01b03166111d261248b565b6001600160a01b0316146111f85760405162461bcd60e51b81526004016107f89061474c565b611201826124a1565b61120d82826001612513565b5050565b6000306001600160a01b037f000000000000000000000000a02755f2ef4515375945f299a5510846861f2cc916146112b15760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016107f8565b5060008051602061501d8339815191525b90565b6112cd6128a9565b61120d8282612904565b6001600160a01b0383163314806112f357506112f38333611c7a565b61130f5760405162461bcd60e51b81526004016107f89061487e565b610e9a838383612980565b6113226128a9565b61132c6000612b1f565b565b60008051602061508483398151915261134561226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b15801561139a57600080fd5b505afa1580156113ae573d6000803e3d6000fd5b5050506000838152610163602052604090205460ff161590506114075760405162461bcd60e51b8152602060048201526011602482015270105b1c9958591e481c1c9bd8d95cdcd959607a1b60448201526064016107f8565b61142184846040518060200160405280600081525061267e565b50600090815261016360205260409020805460ff191660011790555050565b61144861226b565b6001600160a01b03166312d9a6ad6000336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b15801561149e57600080fd5b505afa1580156114b2573d6000803e3d6000fd5b50505050610df981612b72565b6000805160206150848339815191526114d661226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b15801561152b57600080fd5b505afa15801561153f573d6000803e3d6000fd5b5050505061154e848484612c82565b50505050565b8060005b8181101561154e5761167333858584818110611576576115766146bb565b905060200281019061158891906148cd565b611596906020810190613f3a565b8686858181106115a8576115a86146bb565b90506020028101906115ba91906148cd565b6115c89060208101906148ed565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508a925089915087905081811061160e5761160e6146bb565b905060200281019061162091906148cd565b61162e9060408101906148ed565b80806020026020016040519081016040528093929190818152602001838360200280828437600092018290525060408051602081019091529081529250612d23915050565b8061167d816146e7565b915050611558565b60008051602061508483398151915261169c61226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b1580156116f157600080fd5b505afa158015611705573d6000803e3d6000fd5b5084925060009150505b818110156109815761173b8686868481811061172d5761172d6146bb565b905060200201356001612c82565b80611745816146e7565b91505061170f565b60008051602061508483398151915261176461226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b1580156117b957600080fd5b505afa1580156117cd573d6000803e3d6000fd5b5085925060009150505b81811015610981576118118686838181106117f4576117f46146bb565b90506020020160208101906118099190613f3a565b856001612c82565b8061181b816146e7565b9150506117d7565b816daaeb6d7670e522a718067333cd4e3b156118dd57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611891573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b59190614670565b6118dd57604051633b79c77360e21b81526001600160a01b03821660048201526024016107f8565b610e9a8383612ec8565b60006119176112c260017ff543659935858f1984e182916c71d5eaee151a124fbdd01f466a364186483b91614936565b54919050565b6060816000816001600160401b0381111561193a5761193a613c92565b60405190808252806020026020018201604052801561197f57816020015b60408051808201909152600080825260208201528152602001906001900390816119585790505b50905060005b82811015611a185785858281811061199f5761199f6146bb565b905060200201358282815181106119b8576119b86146bb565b6020908102919091010151526119e6878787848181106119da576119da6146bb565b90506020020135610791565b8282815181106119f8576119f86146bb565b602090810291909101810151015280611a10816146e7565b915050611985565b509150505b9392505050565b600080516020615084833981519152611a3b61226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b158015611a9057600080fd5b505afa158015611aa4573d6000803e3d6000fd5b50505050611ae9858585858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061267e92505050565b5050505050565b600080516020615064833981519152611b0761226b565b6001600160a01b03166312d9a6ad82336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b158015611b5c57600080fd5b505afa158015611b70573d6000803e3d6000fd5b5050508315159050611bbc5760405162461bcd60e51b8152602060048201526015602482015274139bc81d1bdad95b881a591cc81c1c9bdd9a591959605a1b60448201526064016107f8565b8260005b81811015610981578361015f6000888885818110611be057611be06146bb565b90506020020135815260200190815260200160002060006101000a81548160ff0219169083151502179055507f9a86e784ed5083812dadbc12e73d308f4aceb81f1e446fbe53f50faff140b375868683818110611c3f57611c3f6146bb565b9050602002013585604051611c609291909182521515602082015260400190565b60405180910390a180611c72816146e7565b915050611bc0565b6000611c8461226b565b604051632474521560e21b815260008051602061506483398151915260048201526001600160a01b03848116602483015291909116906391d1485490604401602060405180830381865afa158015611ce0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d049190614670565b15611d1157506001610826565b6001600160a01b03808416600090815260ca602090815260408083209386168352929052205460ff16611a1d565b846daaeb6d7670e522a718067333cd4e3b15611e0457336001600160a01b03821603611d72576108dd8686868686612ed3565b604051633185c44d60e21b81523060048201523360248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015611dc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de59190614670565b611e0457604051633b79c77360e21b81523360048201526024016107f8565b6109818686868686612ed3565b611e196128a9565b6001600160a01b038116611e7e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107f8565b610df981612b1f565b600054610100900460ff1615808015611ea75750600054600160ff909116105b80611ec15750303b158015611ec1575060005460ff166001145b611f245760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016107f8565b6000805460ff191660011790558015611f47576000805461ff0019166101001790555b611f4f612f18565b611f5884612f71565b611f60612fa1565b611f9f83838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612fc892505050565b611fa7612ff8565b611fb18383612904565b801561154e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a150505050565b6001600160a01b03831633148061201957506120198333611c7a565b6120355760405162461bcd60e51b81526004016107f89061487e565b610e9a838383613027565b87861461205f5760405162461bcd60e51b81526004016107f89061468d565b876000805b828110156120a45789898281811061207e5761207e6146bb565b90506020020135826120909190614798565b91508061209c816146e7565b915050612064565b5061016080549060006120b6836146e7565b91905055508681146120fc5760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840dad2e6dac2e8c6d608b1b60448201526064016107f8565b61218c3361dead8d8d80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508c8c808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250604080516020810190915290815292506108aa915050565b7f890d6ccc7da5679bcf424459c6ca26e63672f15bdc2e081fbdca551333dbeeb48b8b8b8b8b8b8b33610160548d8d6040516121d29b9a99989796959493929190614949565b60405180910390a15050505050505050505050565b6001600160a01b03163b151590565b60006001600160e01b03198216636cdb3d1360e11b148061222757506001600160e01b031982166303a24d0760e21b145b8061082657506301ffc9a760e01b6001600160e01b0319831614610826565b60006001600160e01b031982166307ed9a0960e41b14806108265750610826826121f6565b600061229b6112c260017f2f94117d2c26dd889e3bde9cad610be6ea59faa34cc016c7267596f75c87e376614936565b546001600160a01b0316919050565b606060cb80546122b9906149c8565b80601f01602080910402602001604051908101604052809291908181526020018280546122e5906149c8565b80156123325780601f1061230757610100808354040283529160200191612332565b820191906000526020600020905b81548152906001019060200180831161231557829003601f168201915b50505050509050919050565b6060816000036123655750506040805180820190915260018152600360fc1b602082015290565b8160005b811561238f5780612379816146e7565b91506123889050600a83614a18565b9150612369565b6000816001600160401b038111156123a9576123a9613c92565b6040519080825280601f01601f1916602001820160405280156123d3576020820181803683370190505b5090505b841561243e576123e8600183614936565b91506123f5600a86614a2c565b612400906030614798565b60f81b818381518110612415576124156146bb565b60200101906001600160f81b031916908160001a905350612437600a86614a18565b94506123d7565b949350505050565b6001600160a01b03851633148061246257506124628533611c7a565b61247e5760405162461bcd60e51b81526004016107f89061487e565b611ae98585858585612d23565b600060008051602061501d83398151915261229b565b6124a961226b565b6001600160a01b03166312d9a6ad6000336040516001600160e01b031960e085901b16815260048101929092526001600160a01b0316602482015260440160006040518083038186803b1580156124ff57600080fd5b505afa158015611ae9573d6000803e3d6000fd5b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561254657610e9a83613143565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156125a0575060408051601f3d908101601f1916820190925261259d91810190614a40565b60015b6126035760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016107f8565b60008051602061501d83398151915281146126725760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016107f8565b50610e9a8383836131df565b8160005b818110156128755784848281811061269c5761269c6146bb565b90506020028101906126ae91906148cd565b6126bc9060408101906148ed565b90508585838181106126d0576126d06146bb565b90506020028101906126e291906148cd565b6126f09060208101906148ed565b90501461273f5760405162461bcd60e51b815260206004820152601c60248201527f496e76616c69642064617461206c656e6774682070726f76696465640000000060448201526064016107f8565b6000858583818110612753576127536146bb565b905060200281019061276591906148cd565b6127739060208101906148ed565b9050905060005b818110156128605761284e878785818110612797576127976146bb565b90506020028101906127a991906148cd565b6127b7906020810190613f3a565b8888868181106127c9576127c96146bb565b90506020028101906127db91906148cd565b6127e99060208101906148ed565b848181106127f9576127f96146bb565b90506020020135898987818110612812576128126146bb565b905060200281019061282491906148cd565b6128329060408101906148ed565b85818110612842576128426146bb565b90506020020135612c82565b80612858816146e7565b91505061277a565b5050808061286d906146e7565b915050612682565b507f03d7af7902d67e4247b81c6d4d1d36949d992e898b6518117670331bd50c1e5b848484604051611fef93929190614aa1565b61012d546001600160a01b0316331461132c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107f8565b61294382828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061320492505050565b7fd09d05534067f74dbc9e6af794edbd29e904d7698e428d0bc1378e45889acdd78282604051612974929190614b77565b60405180910390a15050565b6001600160a01b0383166129a65760405162461bcd60e51b81526004016107f890614b8b565b80518251146129c75760405162461bcd60e51b81526004016107f890614bce565b60003390506129ea81856000868660405180602001604052806000815250613210565b60005b8351811015612ab2576000848281518110612a0a57612a0a6146bb565b602002602001015190506000848381518110612a2857612a286146bb565b602090810291909101810151600084815260c9835260408082206001600160a01b038c168352909352919091205490915081811015612a795760405162461bcd60e51b81526004016107f890614c16565b600092835260c9602090815260408085206001600160a01b038b1686529091529092209103905580612aaa816146e7565b9150506129ed565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612b03929190614c5a565b60405180910390a460408051602081019091526000905261154e565b61012d80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516301ffc9a760e01b815263d432a77560e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015612bbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612be19190614670565b612c09576040516320d2869360e11b81526001600160a01b03821660048201526024016107f8565b80612c386112c260017f2f94117d2c26dd889e3bde9cad610be6ea59faa34cc016c7267596f75c87e376614936565b80546001600160a01b0319166001600160a01b03928316179055604051908216907fb682c047807b0e34dd5e7ec89aa8d43386ff4e25dbd12c98e2fbfd44b99936f990600090a250565b6305f5e100821015612cc55760405162461bcd60e51b815260206004820152600c60248201526b1a59081d1bdbc81cdb585b1b60a21b60448201526064016107f8565b633b9ac9ff821115612d085760405162461bcd60e51b815260206004820152600c60248201526b696420746f6f206c6172676560a01b60448201526064016107f8565b610e9a83838360405180602001604052806000815250613437565b8151835114612d445760405162461bcd60e51b81526004016107f890614bce565b6001600160a01b038416612d6a5760405162461bcd60e51b81526004016107f890614c7f565b33612d79818787878787613210565b60005b8451811015612e62576000858281518110612d9957612d996146bb565b602002602001015190506000858381518110612db757612db76146bb565b602090810291909101810151600084815260c9835260408082206001600160a01b038e168352909352919091205490915081811015612e085760405162461bcd60e51b81526004016107f890614cc4565b600083815260c9602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612e47908490614798565b9250508190555050505080612e5b906146e7565b9050612d7c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612eb2929190614c5a565b60405180910390a4610981818787878787613553565b61120d3383836136ae565b6001600160a01b038516331480612eef5750612eef8533611c7a565b612f0b5760405162461bcd60e51b81526004016107f89061487e565b611ae9858585858561378e565b600054610100900460ff16612f3f5760405162461bcd60e51b81526004016107f890614d0e565b43612f6e6112c260017ff543659935858f1984e182916c71d5eaee151a124fbdd01f466a364186483b91614936565b55565b600054610100900460ff16612f985760405162461bcd60e51b81526004016107f890614d0e565b610df981612b72565b600054610100900460ff1661132c5760405162461bcd60e51b81526004016107f890614d0e565b600054610100900460ff16612fef5760405162461bcd60e51b81526004016107f890614d0e565b610df9816138ca565b600054610100900460ff1661301f5760405162461bcd60e51b81526004016107f890614d0e565b61132c6138fa565b6001600160a01b03831661304d5760405162461bcd60e51b81526004016107f890614b8b565b3360006130598461392a565b905060006130668461392a565b905061308683876000858560405180602001604052806000815250613210565b600085815260c9602090815260408083206001600160a01b038a168452909152902054848110156130c95760405162461bcd60e51b81526004016107f890614c16565b600086815260c9602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052610b5a565b6001600160a01b0381163b6131b05760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016107f8565b60008051602061501d83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6131e883613975565b6000825111806131f55750805b15610e9a5761154e83836139b5565b60cb61120d8282614d9f565b82516001600160a01b0386166133845760005b8181101561337d5783818151811061323d5761323d6146bb565b6020026020010151610162600087848151811061325c5761325c6146bb565b6020026020010151815260200190815260200160002060008282546132819190614798565b92505081905550600061016160008784815181106132a1576132a16146bb565b602002602001015181526020019081526020016000205411801561331e575061016260008683815181106132d7576132d76146bb565b60200260200101518152602001908152602001600020546101616000878481518110613305576133056146bb565b6020026020010151815260200190815260200160002054105b1561336b5760405162461bcd60e51b815260206004820152601960248201527f546f6b656e206d696e74206c696d69747320726561636865640000000000000060448201526064016107f8565b80613375816146e7565b915050613223565b5050610981565b60005b8181101561342d5761015f60008683815181106133a6576133a66146bb565b60209081029190910181015182528101919091526040016000205460ff161561341b5760405162461bcd60e51b815260206004820152602160248201527f43616e6e6f74207472616e7366657220736f756c20626f756e6420746f6b656e6044820152607360f81b60648201526084016107f8565b80613425816146e7565b915050613387565b5050505050505050565b6001600160a01b0384166134975760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016107f8565b3360006134a38561392a565b905060006134b08561392a565b90506134c183600089858589613210565b600086815260c9602090815260408083206001600160a01b038b168452909152812080548792906134f3908490614798565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610b5a83600089898989613aa9565b6001600160a01b0384163b156109815760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906135979089908990889088908890600401614e5e565b6020604051808303816000875af19250505080156135d2575060408051601f3d908101601f191682019092526135cf91810190614ebc565b60015b61367e576135de614ed9565b806308c379a00361361757506135f2614ef4565b806135fd5750613619565b8060405162461bcd60e51b81526004016107f89190613c7f565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016107f8565b6001600160e01b0319811663bc197c8160e01b14610b5a5760405162461bcd60e51b81526004016107f890614f7d565b816001600160a01b0316836001600160a01b0316036137215760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016107f8565b6001600160a01b03838116600081815260ca6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166137b45760405162461bcd60e51b81526004016107f890614c7f565b3360006137c08561392a565b905060006137cd8561392a565b90506137dd838989858589613210565b600086815260c9602090815260408083206001600160a01b038c168452909152902054858110156138205760405162461bcd60e51b81526004016107f890614cc4565b600087815260c9602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061385f908490614798565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46138bf848a8a8a8a8a613aa9565b505050505050505050565b600054610100900460ff166138f15760405162461bcd60e51b81526004016107f890614d0e565b610df981613204565b600054610100900460ff166139215760405162461bcd60e51b81526004016107f890614d0e565b61132c33612b1f565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613964576139646146bb565b602090810291909101015292915050565b61397e81613143565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b613a1d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016107f8565b600080846001600160a01b031684604051613a389190614fc5565b600060405180830381855af49150503d8060008114613a73576040519150601f19603f3d011682016040523d82523d6000602084013e613a78565b606091505b5091509150613aa0828260405180606001604052806027815260200161503d60279139613b64565b95945050505050565b6001600160a01b0384163b156109815760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190613aed9089908990889088908890600401614fd7565b6020604051808303816000875af1925050508015613b28575060408051601f3d908101601f19168201909252613b2591810190614ebc565b60015b613b34576135de614ed9565b6001600160e01b0319811663f23a6e6160e01b14610b5a5760405162461bcd60e51b81526004016107f890614f7d565b60608315613b73575081611a1d565b825115613b835782518084602001fd5b8160405162461bcd60e51b81526004016107f89190613c7f565b80356001600160a01b0381168114613bb457600080fd5b919050565b60008060408385031215613bcc57600080fd5b613bd583613b9d565b946020939093013593505050565b6001600160e01b031981168114610df957600080fd5b600060208284031215613c0b57600080fd5b8135611a1d81613be3565b600060208284031215613c2857600080fd5b5035919050565b60005b83811015613c4a578181015183820152602001613c32565b50506000910152565b60008151808452613c6b816020860160208601613c2f565b601f01601f19169290920160200192915050565b602081526000611a1d6020830184613c53565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715613ccd57613ccd613c92565b6040525050565b60006001600160401b03821115613ced57613ced613c92565b5060051b60200190565b600082601f830112613d0857600080fd5b81356020613d1582613cd4565b604051613d228282613ca8565b83815260059390931b8501820192828101915086841115613d4257600080fd5b8286015b84811015613d5d5780358352918301918301613d46565b509695505050505050565b600082601f830112613d7957600080fd5b81356001600160401b03811115613d9257613d92613c92565b604051613da9601f8301601f191660200182613ca8565b818152846020838601011115613dbe57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215613df357600080fd5b613dfc86613b9d565b9450613e0a60208701613b9d565b935060408601356001600160401b0380821115613e2657600080fd5b613e3289838a01613cf7565b94506060880135915080821115613e4857600080fd5b613e5489838a01613cf7565b93506080880135915080821115613e6a57600080fd5b50613e7788828901613d68565b9150509295509295909350565b60008083601f840112613e9657600080fd5b5081356001600160401b03811115613ead57600080fd5b6020830191508360208260051b8501011115613ec857600080fd5b9250929050565b60008060008060408587031215613ee557600080fd5b84356001600160401b0380821115613efc57600080fd5b613f0888838901613e84565b90965094506020870135915080821115613f2157600080fd5b50613f2e87828801613e84565b95989497509550505050565b600060208284031215613f4c57600080fd5b611a1d82613b9d565b60008060208385031215613f6857600080fd5b82356001600160401b03811115613f7e57600080fd5b613f8a85828601613e84565b90969095509350505050565b60008083601f840112613fa857600080fd5b5081356001600160401b03811115613fbf57600080fd5b602083019150836020828501011115613ec857600080fd5b60008060008060008060006080888a031215613ff257600080fd5b87356001600160401b038082111561400957600080fd5b6140158b838c01613e84565b909950975060208a013591508082111561402e57600080fd5b61403a8b838c01613e84565b909750955060408a0135945060608a013591508082111561405a57600080fd5b506140678a828b01613f96565b989b979a50959850939692959293505050565b6000806040838503121561408d57600080fd5b82356001600160401b03808211156140a457600080fd5b818501915085601f8301126140b857600080fd5b813560206140c582613cd4565b6040516140d28282613ca8565b83815260059390931b85018201928281019150898411156140f257600080fd5b948201945b838610156141175761410886613b9d565b825294820194908201906140f7565b9650508601359250508082111561412d57600080fd5b5061413a85828601613cf7565b9150509250929050565b600081518084526020808501945080840160005b8381101561417457815187529582019590820190600101614158565b509495945050505050565b602081526000611a1d6020830184614144565b600080604083850312156141a557600080fd5b6141ae83613b9d565b915060208301356001600160401b038111156141c957600080fd5b61413a85828601613d68565b600080602083850312156141e857600080fd5b82356001600160401b038111156141fe57600080fd5b613f8a85828601613f96565b60008060006060848603121561421f57600080fd5b61422884613b9d565b925060208401356001600160401b038082111561424457600080fd5b61425087838801613cf7565b9350604086013591508082111561426657600080fd5b5061427386828701613cf7565b9150509250925092565b60008060006040848603121561429257600080fd5b83356001600160401b038111156142a857600080fd5b6142b486828701613e84565b909790965060209590950135949350505050565b6000806000606084860312156142dd57600080fd5b6142e684613b9d565b95602085013595506040909401359392505050565b60008060006040848603121561431057600080fd5b61431984613b9d565b925060208401356001600160401b0381111561433457600080fd5b61434086828701613e84565b9497909650939450505050565b8015158114610df957600080fd5b6000806040838503121561436e57600080fd5b61437783613b9d565b915060208301356143878161434d565b809150509250929050565b602080825282518282018190526000919060409081850190868401855b828110156143d4578151805185528601518685015292840192908501906001016143af565b5091979650505050505050565b600080600080604085870312156143f757600080fd5b84356001600160401b038082111561440e57600080fd5b61441a88838901613e84565b9096509450602087013591508082111561443357600080fd5b50613f2e87828801613f96565b60008060006040848603121561445557600080fd5b83356001600160401b0381111561446b57600080fd5b61447786828701613e84565b909450925050602084013561448b8161434d565b809150509250925092565b600080604083850312156144a957600080fd5b6144b283613b9d565b91506144c060208401613b9d565b90509250929050565b600080600080600060a086880312156144e157600080fd5b6144ea86613b9d565b94506144f860208701613b9d565b9350604086013592506060860135915060808601356001600160401b0381111561452157600080fd5b613e7788828901613d68565b60008060006040848603121561454257600080fd5b61454b84613b9d565b925060208401356001600160401b0381111561456657600080fd5b61434086828701613f96565b600080600080600080600080600060a08a8c03121561459057600080fd5b89356001600160401b03808211156145a757600080fd5b6145b38d838e01613e84565b909b50995060208c01359150808211156145cc57600080fd5b6145d88d838e01613e84565b909950975060408c0135965060608c01359150808211156145f857600080fd5b6146048d838e01613f96565b909650945060808c013591508082111561461d57600080fd5b5061462a8c828d01613f96565b915080935050809150509295985092959850929598565b60008351614653818460208801613c2f565b835190830190614667818360208801613c2f565b01949350505050565b60006020828403121561468257600080fd5b8151611a1d8161434d565b602080825260149082015273496e76616c69642064617461206c656e6774687360601b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016146f9576146f96146d1565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b80820180821115610826576108266146d1565b81835260006001600160fb1b038311156147c457600080fd5b8260051b80836020870137939093016020019392505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60e08152600061481a60e083018b8d6147ab565b828103602084015261482d818a8c6147ab565b905087604084015282810360608401526148488187896147dd565b6001600160a01b03959095166080840152505060a081019190915280820360c09091015260008152602001979650505050505050565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b60008235605e198336030181126148e357600080fd5b9190910192915050565b6000808335601e1984360301811261490457600080fd5b8301803591506001600160401b0382111561491e57600080fd5b6020019150600581901b3603821315613ec857600080fd5b81810381811115610826576108266146d1565b60e08152600061495d60e083018d8f6147ab565b8281036020840152614970818c8e6147ab565b9050896040840152828103606084015261498b81898b6147dd565b6001600160a01b038816608085015260a0840187905283810360c085015290506149b68185876147dd565b9e9d5050505050505050505050505050565b600181811c908216806149dc57607f821691505b6020821081036149fc57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601260045260246000fd5b600082614a2757614a27614a02565b500490565b600082614a3b57614a3b614a02565b500690565b600060208284031215614a5257600080fd5b5051919050565b6000808335601e19843603018112614a7057600080fd5b83016020810192503590506001600160401b03811115614a8f57600080fd5b8060051b3603821315613ec857600080fd5b60408082528181018490526000906060808401600587901b850182018885805b8a811015614b5557888403605f190185528235368d9003605e19018112614ae6578283fd5b8c016001600160a01b03614af982613b9d565b1685526020614b0a81830183614a59565b8983890152614b1c8a890182846147ab565b915050614b2b8a840184614a59565b93508782038b890152614b3f8285836147ab565b9883019897505050939093019250600101614ac1565b5050508581036020870152614b6a8188613c53565b9998505050505050505050565b60208152600061243e6020830184866147dd565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b604081526000614c6d6040830185614144565b8281036020840152613aa08185614144565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b601f821115610e9a57600081815260208120601f850160051c81016020861015614d805750805b601f850160051c820191505b8181101561098157828155600101614d8c565b81516001600160401b03811115614db857614db8613c92565b614dcc81614dc684546149c8565b84614d59565b602080601f831160018114614e015760008415614de95750858301515b600019600386901b1c1916600185901b178555610981565b600085815260208120601f198616915b82811015614e3057888601518255948401946001909101908401614e11565b5085821015614e4e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0386811682528516602082015260a060408201819052600090614e8a90830186614144565b8281036060840152614e9c8186614144565b90508281036080840152614eb08185613c53565b98975050505050505050565b600060208284031215614ece57600080fd5b8151611a1d81613be3565b600060033d11156112c25760046000803e5060005160e01c90565b600060443d1015614f025790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715614f3157505050505090565b8285019150815181811115614f495750505050505090565b843d8701016020828501011115614f635750505050505090565b614f7260208286010187613ca8565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b600082516148e3818460208701613c2f565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061501190830184613c53565b97965050505050505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564511e90c87488672c3e16326cb4b40ae04fe239269ab5483a2c1452ef17c2a5089f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a264697066735822122073fdbafa4446629163428b415598b3d8e332e0d10bbf317e3ec2bbc22dda460c64736f6c63430008110033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 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.