Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 6,837 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 30008922 | 6 days ago | IN | 0 ETH | 0.00000009 | ||||
| Set Approval For... | 29434571 | 19 days ago | IN | 0 ETH | 0.0000001 | ||||
| Set Approval For... | 29072478 | 28 days ago | IN | 0 ETH | 0.00000004 | ||||
| Set Approval For... | 28878998 | 32 days ago | IN | 0 ETH | 0.00000014 | ||||
| Set Approval For... | 28625791 | 38 days ago | IN | 0 ETH | 0.00000014 | ||||
| Safe Transfer Fr... | 28330604 | 45 days ago | IN | 0 ETH | 0.00000082 | ||||
| Safe Transfer Fr... | 28176079 | 49 days ago | IN | 0 ETH | 0 | ||||
| Safe Transfer Fr... | 28158402 | 49 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 28070111 | 51 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 28004592 | 53 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 28003331 | 53 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 27909159 | 55 days ago | IN | 0 ETH | 0 | ||||
| Safe Transfer Fr... | 27666476 | 60 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 27472505 | 65 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 27300872 | 69 days ago | IN | 0 ETH | 0.00000005 | ||||
| Set Approval For... | 27045527 | 75 days ago | IN | 0 ETH | 0.00000004 | ||||
| Set Approval For... | 27043757 | 75 days ago | IN | 0 ETH | 0.00000001 | ||||
| Set Approval For... | 27014271 | 76 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 26771923 | 81 days ago | IN | 0 ETH | 0.00000003 | ||||
| Set Approval For... | 26551378 | 86 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 26513982 | 87 days ago | IN | 0 ETH | 0.00000004 | ||||
| Set Approval For... | 26365938 | 91 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 26365934 | 91 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 26365930 | 91 days ago | IN | 0 ETH | 0 | ||||
| Set Approval For... | 26209986 | 94 days ago | IN | 0 ETH | 0.00000004 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MonoSwapNFT
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 1 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol";
contract MonoSwapNFT is
ERC1155,
AccessControl,
ERC1155Pausable,
ERC1155Burnable,
ERC1155Supply
{
bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
string public name = "MonoSwap Non-Fungible Token";
string public symbol = "MS-NFT";
mapping(uint256 => string) public nftNames;
mapping(uint256 => string) public nftSymbols;
mapping(uint256 => string) public nftURIs;
mapping(uint256 => uint256) public hardCaps;
constructor() ERC1155("") {
_grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
_grantRole(PAUSER_ROLE, _msgSender());
_grantRole(MINTER_ROLE, _msgSender());
}
function setNFT(
uint256 id,
string memory _name,
string memory _symbol,
string memory _uri,
uint256 _hardCaps
) public onlyRole(DEFAULT_ADMIN_ROLE) {
nftNames[id] = _name;
nftSymbols[id] = _symbol;
nftURIs[id] = _uri;
hardCaps[id] = _hardCaps;
}
function pause() public onlyRole(PAUSER_ROLE) {
_pause();
}
function unpause() public onlyRole(PAUSER_ROLE) {
_unpause();
}
function mint(
address account,
uint256 id,
uint256 amount,
bytes memory data
) public onlyRole(MINTER_ROLE) {
_mint(account, id, amount, data);
}
function mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public onlyRole(MINTER_ROLE) {
_mintBatch(to, ids, amounts, data);
}
function mintBySystem(
address[] memory accounts,
uint256 id,
uint256[] memory amounts,
bytes memory data
) public onlyRole(MINTER_ROLE) {
for (uint256 i = 0; i < accounts.length; i++) {
mint(accounts[i], id, amounts[i], data);
}
}
// The following functions are overrides required by Solidity.
function _update(
address from,
address to,
uint256[] memory ids,
uint256[] memory values
) internal override(ERC1155, ERC1155Supply, ERC1155Pausable) {
super._update(from, to, ids, values);
for (uint256 i = 0; i < ids.length; i++) {
require(
hardCaps[ids[i]] >= totalSupply(ids[i]),
"Hard cap reached"
);
}
}
function uri(
uint256 id
) public view override(ERC1155) returns (string memory) {
return nftURIs[id];
}
function supportsInterface(
bytes4 interfaceId
) public view override(ERC1155, AccessControl) returns (bool) {
return super.supportsInterface(interfaceId);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)
pragma solidity ^0.8.20;
import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address account => bool) hasRole;
bytes32 adminRole;
}
mapping(bytes32 role => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with an {AccessControlUnauthorizedAccount} error including the required role.
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual returns (bool) {
return _roles[role].hasRole[account];
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
* is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
* is missing `role`.
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert AccessControlUnauthorizedAccount(account, role);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @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.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @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 revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address callerConfirmation) public virtual {
if (callerConfirmation != _msgSender()) {
revert AccessControlBadConfirmation();
}
_revokeRole(role, callerConfirmation);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
if (!hasRole(role, account)) {
_roles[role].hasRole[account] = true;
emit RoleGranted(role, account, _msgSender());
return true;
} else {
return false;
}
}
/**
* @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
if (hasRole(role, account)) {
_roles[role].hasRole[account] = false;
emit RoleRevoked(role, account, _msgSender());
return true;
} else {
return false;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev The `account` is missing a role.
*/
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
/**
* @dev The caller of a function is not the expected one.
*
* NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
*/
error AccessControlBadConfirmation();
/**
* @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.
*/
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 `callerConfirmation`.
*/
function renounceRole(bytes32 role, address callerConfirmation) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.20;
import {IERC1155} from "./IERC1155.sol";
import {IERC1155Receiver} from "./IERC1155Receiver.sol";
import {IERC1155MetadataURI} from "./extensions/IERC1155MetadataURI.sol";
import {Context} from "../../utils/Context.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
import {Arrays} from "../../utils/Arrays.sol";
import {IERC1155Errors} from "../../interfaces/draft-IERC6093.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
*/
abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IERC1155Errors {
using Arrays for uint256[];
using Arrays for address[];
mapping(uint256 id => mapping(address account => uint256)) private _balances;
mapping(address account => mapping(address operator => 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 /* id */) public view virtual returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*/
function balanceOf(address account, uint256 id) public view virtual returns (uint256) {
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 returns (uint256[] memory) {
if (accounts.length != ids.length) {
revert ERC1155InvalidArrayLength(ids.length, accounts.length);
}
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts.unsafeMemoryAccess(i), ids.unsafeMemoryAccess(i));
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual {
address sender = _msgSender();
if (from != sender && !isApprovedForAll(from, sender)) {
revert ERC1155MissingApprovalForAll(sender, from);
}
_safeTransferFrom(from, to, id, value, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) public virtual {
address sender = _msgSender();
if (from != sender && !isApprovedForAll(from, sender)) {
revert ERC1155MissingApprovalForAll(sender, from);
}
_safeBatchTransferFrom(from, to, ids, values, data);
}
/**
* @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. Will mint (or burn) if `from`
* (or `to`) is the zero address.
*
* Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received}
* or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value.
* - `ids` and `values` must have the same length.
*
* NOTE: The ERC-1155 acceptance check is not performed in this function. See {_updateWithAcceptanceCheck} instead.
*/
function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual {
if (ids.length != values.length) {
revert ERC1155InvalidArrayLength(ids.length, values.length);
}
address operator = _msgSender();
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids.unsafeMemoryAccess(i);
uint256 value = values.unsafeMemoryAccess(i);
if (from != address(0)) {
uint256 fromBalance = _balances[id][from];
if (fromBalance < value) {
revert ERC1155InsufficientBalance(from, fromBalance, value, id);
}
unchecked {
// Overflow not possible: value <= fromBalance
_balances[id][from] = fromBalance - value;
}
}
if (to != address(0)) {
_balances[id][to] += value;
}
}
if (ids.length == 1) {
uint256 id = ids.unsafeMemoryAccess(0);
uint256 value = values.unsafeMemoryAccess(0);
emit TransferSingle(operator, from, to, id, value);
} else {
emit TransferBatch(operator, from, to, ids, values);
}
}
/**
* @dev Version of {_update} that performs the token acceptance check by calling
* {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} on the receiver address if it
* contains code (eg. is a smart contract at the moment of execution).
*
* IMPORTANT: Overriding this function is discouraged because it poses a reentrancy risk from the receiver. So any
* update to the contract state after this function would break the check-effect-interaction pattern. Consider
* overriding {_update} instead.
*/
function _updateWithAcceptanceCheck(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) internal virtual {
_update(from, to, ids, values);
if (to != address(0)) {
address operator = _msgSender();
if (ids.length == 1) {
uint256 id = ids.unsafeMemoryAccess(0);
uint256 value = values.unsafeMemoryAccess(0);
_doSafeTransferAcceptanceCheck(operator, from, to, id, value, data);
} else {
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, values, data);
}
}
}
/**
* @dev Transfers a `value` 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 `value` 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 value, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(from, to, ids, values, 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.
* - `ids` and `values` must have the same length.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
_updateWithAcceptanceCheck(from, to, ids, values, 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 values 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 a `value` amount of tokens of 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 value, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(address(0), to, ids, values, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `values` must have the same length.
* - `to` cannot be the zero address.
* - 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 values, bytes memory data) internal {
if (to == address(0)) {
revert ERC1155InvalidReceiver(address(0));
}
_updateWithAcceptanceCheck(address(0), to, ids, values, data);
}
/**
* @dev Destroys a `value` amount of tokens of type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `value` amount of tokens of type `id`.
*/
function _burn(address from, uint256 id, uint256 value) internal {
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
(uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
_updateWithAcceptanceCheck(from, address(0), ids, values, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `value` amount of tokens of type `id`.
* - `ids` and `values` must have the same length.
*/
function _burnBatch(address from, uint256[] memory ids, uint256[] memory values) internal {
if (from == address(0)) {
revert ERC1155InvalidSender(address(0));
}
_updateWithAcceptanceCheck(from, address(0), ids, values, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the zero address.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
if (operator == address(0)) {
revert ERC1155InvalidOperator(address(0));
}
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Performs an acceptance check by calling {IERC1155-onERC1155Received} on the `to` address
* if it contains code at the moment of execution.
*/
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 value,
bytes memory data
) private {
if (to.code.length > 0) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, value, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
// Tokens rejected
revert ERC1155InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
// non-ERC1155Receiver implementer
revert ERC1155InvalidReceiver(to);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
}
/**
* @dev Performs a batch acceptance check by calling {IERC1155-onERC1155BatchReceived} on the `to` address
* if it contains code at the moment of execution.
*/
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory values,
bytes memory data
) private {
if (to.code.length > 0) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, values, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
// Tokens rejected
revert ERC1155InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
// non-ERC1155Receiver implementer
revert ERC1155InvalidReceiver(to);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
}
/**
* @dev Creates an array in memory with only one value for each of the elements provided.
*/
function _asSingletonArrays(
uint256 element1,
uint256 element2
) private pure returns (uint256[] memory array1, uint256[] memory array2) {
/// @solidity memory-safe-assembly
assembly {
// Load the free memory pointer
array1 := mload(0x40)
// Set array length to 1
mstore(array1, 1)
// Store the single element at the next word after the length (where content starts)
mstore(add(array1, 0x20), element1)
// Repeat for next array locating it right after the first array
array2 := add(array1, 0x40)
mstore(array2, 1)
mstore(add(array2, 0x20), element2)
// Update the free memory pointer by pointing after the second array
mstore(0x40, add(array2, 0x40))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/ERC1155Burnable.sol)
pragma solidity ^0.8.20;
import {ERC1155} from "../ERC1155.sol";
/**
* @dev Extension of {ERC1155} that allows token holders to destroy both their
* own tokens and those that they have been approved to use.
*/
abstract contract ERC1155Burnable is ERC1155 {
function burn(address account, uint256 id, uint256 value) public virtual {
if (account != _msgSender() && !isApprovedForAll(account, _msgSender())) {
revert ERC1155MissingApprovalForAll(_msgSender(), account);
}
_burn(account, id, value);
}
function burnBatch(address account, uint256[] memory ids, uint256[] memory values) public virtual {
if (account != _msgSender() && !isApprovedForAll(account, _msgSender())) {
revert ERC1155MissingApprovalForAll(_msgSender(), account);
}
_burnBatch(account, ids, values);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/ERC1155Pausable.sol)
pragma solidity ^0.8.20;
import {ERC1155} from "../ERC1155.sol";
import {Pausable} from "../../../utils/Pausable.sol";
/**
* @dev ERC1155 token with pausable token transfers, minting and burning.
*
* Useful for scenarios such as preventing trades until the end of an evaluation
* period, or having an emergency switch for freezing all token transfers in the
* event of a large bug.
*
* IMPORTANT: This contract does not include public pause and unpause functions. In
* addition to inheriting this contract, you must define both functions, invoking the
* {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate
* access control, e.g. using {AccessControl} or {Ownable}. Not doing so will
* make the contract pause mechanism of the contract unreachable, and thus unusable.
*/
abstract contract ERC1155Pausable is ERC1155, Pausable {
/**
* @dev See {ERC1155-_update}.
*
* Requirements:
*
* - the contract must not be paused.
*/
function _update(
address from,
address to,
uint256[] memory ids,
uint256[] memory values
) internal virtual override whenNotPaused {
super._update(from, to, ids, values);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/ERC1155Supply.sol)
pragma solidity ^0.8.20;
import {ERC1155} from "../ERC1155.sol";
/**
* @dev Extension of ERC1155 that adds tracking of total supply per id.
*
* Useful for scenarios where Fungible and Non-fungible tokens have to be
* clearly identified. Note: While a totalSupply of 1 might mean the
* corresponding is an NFT, there is no guarantees that no other token with the
* same id are not going to be minted.
*
* NOTE: This contract implies a global limit of 2**256 - 1 to the number of tokens
* that can be minted.
*
* CAUTION: This extension should not be added in an upgrade to an already deployed contract.
*/
abstract contract ERC1155Supply is ERC1155 {
mapping(uint256 id => uint256) private _totalSupply;
uint256 private _totalSupplyAll;
/**
* @dev Total value of tokens in with a given id.
*/
function totalSupply(uint256 id) public view virtual returns (uint256) {
return _totalSupply[id];
}
/**
* @dev Total value of tokens.
*/
function totalSupply() public view virtual returns (uint256) {
return _totalSupplyAll;
}
/**
* @dev Indicates whether any token exist with a given id, or not.
*/
function exists(uint256 id) public view virtual returns (bool) {
return totalSupply(id) > 0;
}
/**
* @dev See {ERC1155-_update}.
*/
function _update(
address from,
address to,
uint256[] memory ids,
uint256[] memory values
) internal virtual override {
super._update(from, to, ids, values);
if (from == address(0)) {
uint256 totalMintValue = 0;
for (uint256 i = 0; i < ids.length; ++i) {
uint256 value = values[i];
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply[ids[i]] += value;
totalMintValue += value;
}
// Overflow check required: The rest of the code assumes that totalSupplyAll never overflows
_totalSupplyAll += totalMintValue;
}
if (to == address(0)) {
uint256 totalBurnValue = 0;
for (uint256 i = 0; i < ids.length; ++i) {
uint256 value = values[i];
unchecked {
// Overflow not possible: values[i] <= balanceOf(from, ids[i]) <= totalSupply(ids[i])
_totalSupply[ids[i]] -= value;
// Overflow not possible: sum_i(values[i]) <= sum_i(totalSupply(ids[i])) <= totalSupplyAll
totalBurnValue += value;
}
}
unchecked {
// Overflow not possible: totalBurnValue = sum_i(values[i]) <= sum_i(totalSupply(ids[i])) <= totalSupplyAll
_totalSupplyAll -= totalBurnValue;
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.20;
import {IERC1155} from "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*/
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 v5.0.1) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` amount of tokens of 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 value 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 a `value` amount of tokens of type `id` from `from` to `to`.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155Received} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* 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 `value` 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 value, bytes calldata data) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* WARNING: This function can potentially allow a reentrancy attack when transferring tokens
* to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
* Ensure to follow the checks-effects-interactions pattern and consider employing
* reentrancy guards when interacting with untrusted contracts.
*
* Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
*
* Requirements:
*
* - `ids` and `values` 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 values,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Interface that must be implemented by smart contracts in order to receive
* ERC-1155 token transfers.
*/
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 (last updated v5.0.0) (utils/Arrays.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
import {Math} from "./math/Math.sol";
/**
* @dev Collection of functions related to array types.
*/
library Arrays {
using StorageSlot for bytes32;
/**
* @dev Searches a sorted `array` and returns the first index that contains
* a value greater or equal to `element`. If no such index exists (i.e. all
* values in the array are strictly less than `element`), the array length is
* returned. Time complexity O(log n).
*
* `array` is expected to be sorted in ascending order, and to contain no
* repeated elements.
*/
function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {
uint256 low = 0;
uint256 high = array.length;
if (high == 0) {
return 0;
}
while (low < high) {
uint256 mid = Math.average(low, high);
// Note that mid will always be strictly less than high (i.e. it will be a valid array index)
// because Math.average rounds towards zero (it does integer division with truncation).
if (unsafeAccess(array, mid).value > element) {
high = mid;
} else {
low = mid + 1;
}
}
// At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.
if (low > 0 && unsafeAccess(array, low - 1).value == element) {
return low - 1;
} else {
return low;
}
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getAddressSlot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getBytes32Slot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) {
bytes32 slot;
// We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
// following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.
/// @solidity memory-safe-assembly
assembly {
mstore(0, arr.slot)
slot := add(keccak256(0, 0x20), pos)
}
return slot.getUint256Slot();
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) {
assembly {
res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
}
}
/**
* @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
*
* WARNING: Only use if you are certain `pos` is lower than the array length.
*/
function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) {
assembly {
res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./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);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @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 (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @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:
* ```solidity
* 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(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes 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
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}{
"optimizer": {
"enabled": true,
"runs": 1
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC1155InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC1155InvalidApprover","type":"error"},{"inputs":[{"internalType":"uint256","name":"idsLength","type":"uint256"},{"internalType":"uint256","name":"valuesLength","type":"uint256"}],"name":"ERC1155InvalidArrayLength","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC1155InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC1155InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC1155InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC1155MissingApprovalForAll","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","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":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"hardCaps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"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":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintBySystem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftNames","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftSymbols","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftURIs","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","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":"values","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"uint256","name":"_hardCaps","type":"uint256"}],"name":"setNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c0604052601b60809081527f4d6f6e6f53776170204e6f6e2d46756e6769626c6520546f6b656e000000000060a0526007906200003e908262000277565b506040805180820190915260068152651354cb53919560d21b60208201526008906200006b908262000277565b503480156200007957600080fd5b5060408051602081019091526000815262000094816200010d565b506004805460ff19169055620000ac6000336200011f565b50620000d97f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a336200011f565b50620001067f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6336200011f565b5062000343565b60026200011b828262000277565b5050565b60008281526003602090815260408083206001600160a01b038516845290915281205460ff16620001c85760008381526003602090815260408083206001600160a01b03861684529091529020805460ff191660011790556200017f3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001620001cc565b5060005b92915050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001fd57607f821691505b6020821081036200021e57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200027257600081815260208120601f850160051c810160208610156200024d5750805b601f850160051c820191505b818110156200026e5782815560010162000259565b5050505b505050565b81516001600160401b03811115620002935762000293620001d2565b620002ab81620002a48454620001e8565b8462000224565b602080601f831160018114620002e35760008415620002ca5750858301515b600019600386901b1c1916600185901b1785556200026e565b600085815260208120601f198616915b828110156200031457888601518255948401946001909101908401620002f3565b5085821015620003335787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61210080620003536000396000f3fe608060405234801561001057600080fd5b50600436106101955760003560e01c8062fdd58e1461019a57806301ffc9a7146101c057806306fdde03146101e35780630e89341c146101f857806318160ddd1461020b5780631f7fdffa14610213578063248a9ca3146102285780632c4e920c1461023b5780632eb2c2d61461024e5780632f2ff15d1461026157806336568abe146102745780633a59a7af146102875780633f4ba83a1461029a5780634132ec8d146102a25780634e1273f4146102b55780634f558e79146102d55780635c975abb146102e8578063621277cb146102f35780636b20c45414610313578063731133e9146103265780638456cb591461033957806385e5fc6b1461034157806391d148541461035457806395d89b4114610367578063a217fddf1461036f578063a22cb46514610377578063b310afe91461038a578063bd85b0391461039d578063d5391393146103b0578063d547741f146103c5578063e63ab1e9146103d8578063e985e9c5146103ed578063f242432a14610400578063f5298aca14610413575b600080fd5b6101ad6101a836600461168b565b610426565b6040519081526020015b60405180910390f35b6101d36101ce3660046116cb565b61044e565b60405190151581526020016101b7565b6101eb610459565b6040516101b79190611735565b6101eb610206366004611748565b6104e7565b6006546101ad565b6102266102213660046118a4565b610589565b005b6101ad610236366004611748565b6105b4565b61022661024936600461199e565b6105c9565b61022661025c3660046119f4565b610645565b61022661026f366004611a9d565b61069e565b610226610282366004611a9d565b6106c0565b6101eb610295366004611748565b6106f8565b610226610711565b6101eb6102b0366004611748565b610734565b6102c86102c3366004611ac9565b61074d565b6040516101b79190611b67565b6101d36102e3366004611748565b61081d565b60045460ff166101d3565b6101ad610301366004611748565b600c6020526000908152604090205481565b610226610321366004611b7a565b610830565b610226610334366004611bed565b61087e565b6102266108a2565b6101eb61034f366004611748565b6108c2565b6101d3610362366004611a9d565b6108db565b6101eb610906565b6101ad600081565b610226610385366004611c41565b610913565b610226610398366004611c7d565b610922565b6101ad6103ab366004611748565b610991565b6101ad6000805160206120ab83398151915281565b6102266103d3366004611a9d565b6109a3565b6101ad60008051602061208b83398151915281565b6101d36103fb366004611d16565b6109bf565b61022661040e366004611d40565b6109ed565b610226610421366004611da4565b610a3d565b6000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b600061044882610a73565b6007805461046690611dd7565b80601f016020809104026020016040519081016040528092919081815260200182805461049290611dd7565b80156104df5780601f106104b4576101008083540402835291602001916104df565b820191906000526020600020905b8154815290600101906020018083116104c257829003601f168201915b505050505081565b6000818152600b6020526040902080546060919061050490611dd7565b80601f016020809104026020016040519081016040528092919081815260200182805461053090611dd7565b801561057d5780601f106105525761010080835404028352916020019161057d565b820191906000526020600020905b81548152906001019060200180831161056057829003601f168201915b50505050509050919050565b6000805160206120ab8339815191526105a181610a98565b6105ad85858585610aa2565b5050505050565b60009081526003602052604090206001015490565b6000805160206120ab8339815191526105e181610a98565b60005b855181101561063d5761062b86828151811061060257610602611e11565b60200260200101518686848151811061061d5761061d611e11565b60200260200101518661087e565b8061063581611e3d565b9150506105e4565b505050505050565b336001600160a01b0386168114801590610666575061066486826109bf565b155b1561069157808660405163711bec9160e11b8152600401610688929190611e56565b60405180910390fd5b61063d8686868686610ada565b6106a7826105b4565b6106b081610a98565b6106ba8383610b3a565b50505050565b6001600160a01b03811633146106e95760405163334bd91960e11b815260040160405180910390fd5b6106f38282610bce565b505050565b600a602052600090815260409020805461046690611dd7565b60008051602061208b83398151915261072981610a98565b610731610c3b565b50565b600b602052600090815260409020805461046690611dd7565b6060815183511461077e5781518351604051635b05999160e01b815260048101929092526024820152604401610688565b600083516001600160401b0381111561079957610799611761565b6040519080825280602002602001820160405280156107c2578160200160208202803683370190505b50905060005b8451811015610815576107e86107de8683610c87565b6101a88684610c87565b8282815181106107fa576107fa611e11565b602090810291909101015261080e81611e3d565b90506107c8565b509392505050565b60008061082983610991565b1192915050565b6001600160a01b0383163314801590610850575061084e83336109bf565b155b1561087357335b8360405163711bec9160e11b8152600401610688929190611e56565b6106f3838383610c95565b6000805160206120ab83398151915261089681610a98565b6105ad85858585610cdb565b60008051602061208b8339815191526108ba81610a98565b610731610d24565b6009602052600090815260409020805461046690611dd7565b60009182526003602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6008805461046690611dd7565b61091e338383610d61565b5050565b600061092d81610a98565b60008681526009602052604090206109458682611eb6565b506000868152600a6020526040902061095e8582611eb6565b506000868152600b602052604090206109778482611eb6565b50506000948552600c602052604090942093909355505050565b60009081526005602052604090205490565b6109ac826105b4565b6109b581610a98565b6106ba8383610bce565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b336001600160a01b0386168114801590610a0e5750610a0c86826109bf565b155b15610a3057808660405163711bec9160e11b8152600401610688929190611e56565b61063d8686868686610df7565b6001600160a01b0383163314801590610a5d5750610a5b83336109bf565b155b15610a685733610857565b6106f3838383610e71565b60006001600160e01b03198216637965db0b60e01b1480610448575061044882610ec8565b6107318133610f18565b6001600160a01b038416610acc576000604051632bfa23e760e11b81526004016106889190611f75565b6106ba600085858585610f51565b6001600160a01b038416610b04576000604051632bfa23e760e11b81526004016106889190611f75565b6001600160a01b038516610b2d576000604051626a0d4560e21b81526004016106889190611f75565b6105ad8585858585610f51565b6000610b4683836108db565b610bc65760008381526003602090815260408083206001600160a01b03861684529091529020805460ff19166001179055610b7e3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610448565b506000610448565b6000610bda83836108db565b15610bc65760008381526003602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610448565b610c43610fb6565b6004805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610c7d9190611f75565b60405180910390a1565b602090810291909101015190565b6001600160a01b038316610cbe576000604051626a0d4560e21b81526004016106889190611f75565b6106f3836000848460405180602001604052806000815250610f51565b6001600160a01b038416610d05576000604051632bfa23e760e11b81526004016106889190611f75565b600080610d128585610fdb565b9150915061063d600087848487610f51565b610d2c611003565b6004805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610c703390565b6001600160a01b038216610d8a57600060405162ced3e160e81b81526004016106889190611f75565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038416610e21576000604051632bfa23e760e11b81526004016106889190611f75565b6001600160a01b038516610e4a576000604051626a0d4560e21b81526004016106889190611f75565b600080610e578585610fdb565b91509150610e688787848487610f51565b50505050505050565b6001600160a01b038316610e9a576000604051626a0d4560e21b81526004016106889190611f75565b600080610ea78484610fdb565b915091506105ad856000848460405180602001604052806000815250610f51565b60006001600160e01b03198216636cdb3d1360e11b1480610ef957506001600160e01b031982166303a24d0760e21b145b8061044857506301ffc9a760e01b6001600160e01b0319831614610448565b610f2282826108db565b61091e5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610688565b610f5d85858585611027565b6001600160a01b038416156105ad5782513390600103610fa8576000610f838582610c87565b90506000610f918582610c87565b9050610fa18389898585896110e1565b505061063d565b61063d8187878787876111f3565b60045460ff16610fd957604051638dfc202b60e01b815260040160405180910390fd5b565b6040805160018082526020820194909452808201938452606081019290925260808201905291565b60045460ff1615610fd95760405163d93c066560e01b815260040160405180910390fd5b611033848484846112d3565b60005b82518110156105ad5761106183828151811061105457611054611e11565b6020026020010151610991565b600c600085848151811061107757611077611e11565b602002602001015181526020019081526020016000205410156110cf5760405162461bcd60e51b815260206004820152601060248201526f12185c990818d85c081c995858da195960821b6044820152606401610688565b806110d981611e3d565b915050611036565b6001600160a01b0384163b1561063d5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906111259089908990889088908890600401611f89565b6020604051808303816000875af1925050508015611160575060408051601f3d908101601f1916820190925261115d91810190611fce565b60015b6111c0573d80801561118e576040519150601f19603f3d011682016040523d82523d6000602084013e611193565b606091505b5080516000036111b85784604051632bfa23e760e11b81526004016106889190611f75565b805181602001fd5b6001600160e01b0319811663f23a6e6160e01b14610e685784604051632bfa23e760e11b81526004016106889190611f75565b6001600160a01b0384163b1561063d5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906112379089908990889088908890600401611feb565b6020604051808303816000875af1925050508015611272575060408051601f3d908101601f1916820190925261126f91810190611fce565b60015b6112a0573d80801561118e576040519150601f19603f3d011682016040523d82523d6000602084013e611193565b6001600160e01b0319811663bc197c8160e01b14610e685784604051632bfa23e760e11b81526004016106889190611f75565b6112df8484848461142d565b6001600160a01b038416611392576000805b835181101561137857600083828151811061130e5761130e611e11565b60200260200101519050806005600087858151811061132f5761132f611e11565b6020026020010151815260200190815260200160002060008282546113549190612049565b9091555061136490508184612049565b9250508061137190611e3d565b90506112f1565b50806006600082825461138b9190612049565b9091555050505b6001600160a01b0383166106ba576000805b835181101561141c5760008382815181106113c1576113c1611e11565b6020026020010151905080600560008785815181106113e2576113e2611e11565b60200260200101518152602001908152602001600020600082825403925050819055508083019250508061141590611e3d565b90506113a4565b506006805491909103905550505050565b611435611003565b6106ba84848484805182511461146b5781518151604051635b05999160e01b815260048101929092526024820152604401610688565b3360005b83518110156115845760006114848583610c87565b905060006114928584610c87565b90506001600160a01b0388161561152c576000828152602081815260408083206001600160a01b038c16845290915290205481811015611505576040516303dee4c560e01b81526001600160a01b038a166004820152602481018290526044810183905260648101849052608401610688565b6000838152602081815260408083206001600160a01b038d16845290915290209082900390555b6001600160a01b03871615611571576000828152602081815260408083206001600160a01b038b1684529091528120805483929061156b908490612049565b90915550505b50508061157d90611e3d565b905061146f565b50825160010361161157600061159a8482610c87565b905060006115a88482610c87565b9050856001600160a01b0316876001600160a01b0316846001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628585604051611602929190918252602082015260400190565b60405180910390a450506105ad565b836001600160a01b0316856001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161166092919061205c565b60405180910390a45050505050565b80356001600160a01b038116811461168657600080fd5b919050565b6000806040838503121561169e57600080fd5b6116a78361166f565b946020939093013593505050565b6001600160e01b03198116811461073157600080fd5b6000602082840312156116dd57600080fd5b81356116e8816116b5565b9392505050565b6000815180845260005b81811015611715576020818501810151868301820152016116f9565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006116e860208301846116ef565b60006020828403121561175a57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561179f5761179f611761565b604052919050565b60006001600160401b038211156117c0576117c0611761565b5060051b60200190565b600082601f8301126117db57600080fd5b813560206117f06117eb836117a7565b611777565b82815260059290921b8401810191818101908684111561180f57600080fd5b8286015b8481101561182a5780358352918301918301611813565b509695505050505050565b600082601f83011261184657600080fd5b81356001600160401b0381111561185f5761185f611761565b611872601f8201601f1916602001611777565b81815284602083860101111561188757600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156118ba57600080fd5b6118c38561166f565b935060208501356001600160401b03808211156118df57600080fd5b6118eb888389016117ca565b9450604087013591508082111561190157600080fd5b61190d888389016117ca565b9350606087013591508082111561192357600080fd5b5061193087828801611835565b91505092959194509250565b600082601f83011261194d57600080fd5b8135602061195d6117eb836117a7565b82815260059290921b8401810191818101908684111561197c57600080fd5b8286015b8481101561182a576119918161166f565b8352918301918301611980565b600080600080608085870312156119b457600080fd5b84356001600160401b03808211156119cb57600080fd5b6119d78883890161193c565b955060208701359450604087013591508082111561190157600080fd5b600080600080600060a08688031215611a0c57600080fd5b611a158661166f565b9450611a236020870161166f565b935060408601356001600160401b0380821115611a3f57600080fd5b611a4b89838a016117ca565b94506060880135915080821115611a6157600080fd5b611a6d89838a016117ca565b93506080880135915080821115611a8357600080fd5b50611a9088828901611835565b9150509295509295909350565b60008060408385031215611ab057600080fd5b82359150611ac06020840161166f565b90509250929050565b60008060408385031215611adc57600080fd5b82356001600160401b0380821115611af357600080fd5b611aff8683870161193c565b93506020850135915080821115611b1557600080fd5b50611b22858286016117ca565b9150509250929050565b600081518084526020808501945080840160005b83811015611b5c57815187529582019590820190600101611b40565b509495945050505050565b6020815260006116e86020830184611b2c565b600080600060608486031215611b8f57600080fd5b611b988461166f565b925060208401356001600160401b0380821115611bb457600080fd5b611bc0878388016117ca565b93506040860135915080821115611bd657600080fd5b50611be3868287016117ca565b9150509250925092565b60008060008060808587031215611c0357600080fd5b611c0c8561166f565b9350602085013592506040850135915060608501356001600160401b03811115611c3557600080fd5b61193087828801611835565b60008060408385031215611c5457600080fd5b611c5d8361166f565b915060208301358015158114611c7257600080fd5b809150509250929050565b600080600080600060a08688031215611c9557600080fd5b8535945060208601356001600160401b0380821115611cb357600080fd5b611cbf89838a01611835565b95506040880135915080821115611cd557600080fd5b611ce189838a01611835565b94506060880135915080821115611cf757600080fd5b50611d0488828901611835565b95989497509295608001359392505050565b60008060408385031215611d2957600080fd5b611d328361166f565b9150611ac06020840161166f565b600080600080600060a08688031215611d5857600080fd5b611d618661166f565b9450611d6f6020870161166f565b9350604086013592506060860135915060808601356001600160401b03811115611d9857600080fd5b611a9088828901611835565b600080600060608486031215611db957600080fd5b611dc28461166f565b95602085013595506040909401359392505050565b600181811c90821680611deb57607f821691505b602082108103611e0b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4f57611e4f611e27565b5060010190565b6001600160a01b0392831681529116602082015260400190565b601f8211156106f357600081815260208120601f850160051c81016020861015611e975750805b601f850160051c820191505b8181101561063d57828155600101611ea3565b81516001600160401b03811115611ecf57611ecf611761565b611ee381611edd8454611dd7565b84611e70565b602080601f831160018114611f185760008415611f005750858301515b600019600386901b1c1916600185901b17855561063d565b600085815260208120601f198616915b82811015611f4757888601518255948401946001909101908401611f28565b5085821015611f655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0391909116815260200190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090611fc3908301846116ef565b979650505050505050565b600060208284031215611fe057600080fd5b81516116e8816116b5565b6001600160a01b0386811682528516602082015260a06040820181905260009061201790830186611b2c565b82810360608401526120298186611b2c565b9050828103608084015261203d81856116ef565b98975050505050505050565b8082018082111561044857610448611e27565b60408152600061206f6040830185611b2c565b82810360208401526120818185611b2c565b9594505050505056fe65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a264697066735822122091a87e5f05863a3c2d112c6e0be3b1d4ca18b534028c34ba2f0110dbad9e8c5a64736f6c63430008140033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101955760003560e01c8062fdd58e1461019a57806301ffc9a7146101c057806306fdde03146101e35780630e89341c146101f857806318160ddd1461020b5780631f7fdffa14610213578063248a9ca3146102285780632c4e920c1461023b5780632eb2c2d61461024e5780632f2ff15d1461026157806336568abe146102745780633a59a7af146102875780633f4ba83a1461029a5780634132ec8d146102a25780634e1273f4146102b55780634f558e79146102d55780635c975abb146102e8578063621277cb146102f35780636b20c45414610313578063731133e9146103265780638456cb591461033957806385e5fc6b1461034157806391d148541461035457806395d89b4114610367578063a217fddf1461036f578063a22cb46514610377578063b310afe91461038a578063bd85b0391461039d578063d5391393146103b0578063d547741f146103c5578063e63ab1e9146103d8578063e985e9c5146103ed578063f242432a14610400578063f5298aca14610413575b600080fd5b6101ad6101a836600461168b565b610426565b6040519081526020015b60405180910390f35b6101d36101ce3660046116cb565b61044e565b60405190151581526020016101b7565b6101eb610459565b6040516101b79190611735565b6101eb610206366004611748565b6104e7565b6006546101ad565b6102266102213660046118a4565b610589565b005b6101ad610236366004611748565b6105b4565b61022661024936600461199e565b6105c9565b61022661025c3660046119f4565b610645565b61022661026f366004611a9d565b61069e565b610226610282366004611a9d565b6106c0565b6101eb610295366004611748565b6106f8565b610226610711565b6101eb6102b0366004611748565b610734565b6102c86102c3366004611ac9565b61074d565b6040516101b79190611b67565b6101d36102e3366004611748565b61081d565b60045460ff166101d3565b6101ad610301366004611748565b600c6020526000908152604090205481565b610226610321366004611b7a565b610830565b610226610334366004611bed565b61087e565b6102266108a2565b6101eb61034f366004611748565b6108c2565b6101d3610362366004611a9d565b6108db565b6101eb610906565b6101ad600081565b610226610385366004611c41565b610913565b610226610398366004611c7d565b610922565b6101ad6103ab366004611748565b610991565b6101ad6000805160206120ab83398151915281565b6102266103d3366004611a9d565b6109a3565b6101ad60008051602061208b83398151915281565b6101d36103fb366004611d16565b6109bf565b61022661040e366004611d40565b6109ed565b610226610421366004611da4565b610a3d565b6000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b600061044882610a73565b6007805461046690611dd7565b80601f016020809104026020016040519081016040528092919081815260200182805461049290611dd7565b80156104df5780601f106104b4576101008083540402835291602001916104df565b820191906000526020600020905b8154815290600101906020018083116104c257829003601f168201915b505050505081565b6000818152600b6020526040902080546060919061050490611dd7565b80601f016020809104026020016040519081016040528092919081815260200182805461053090611dd7565b801561057d5780601f106105525761010080835404028352916020019161057d565b820191906000526020600020905b81548152906001019060200180831161056057829003601f168201915b50505050509050919050565b6000805160206120ab8339815191526105a181610a98565b6105ad85858585610aa2565b5050505050565b60009081526003602052604090206001015490565b6000805160206120ab8339815191526105e181610a98565b60005b855181101561063d5761062b86828151811061060257610602611e11565b60200260200101518686848151811061061d5761061d611e11565b60200260200101518661087e565b8061063581611e3d565b9150506105e4565b505050505050565b336001600160a01b0386168114801590610666575061066486826109bf565b155b1561069157808660405163711bec9160e11b8152600401610688929190611e56565b60405180910390fd5b61063d8686868686610ada565b6106a7826105b4565b6106b081610a98565b6106ba8383610b3a565b50505050565b6001600160a01b03811633146106e95760405163334bd91960e11b815260040160405180910390fd5b6106f38282610bce565b505050565b600a602052600090815260409020805461046690611dd7565b60008051602061208b83398151915261072981610a98565b610731610c3b565b50565b600b602052600090815260409020805461046690611dd7565b6060815183511461077e5781518351604051635b05999160e01b815260048101929092526024820152604401610688565b600083516001600160401b0381111561079957610799611761565b6040519080825280602002602001820160405280156107c2578160200160208202803683370190505b50905060005b8451811015610815576107e86107de8683610c87565b6101a88684610c87565b8282815181106107fa576107fa611e11565b602090810291909101015261080e81611e3d565b90506107c8565b509392505050565b60008061082983610991565b1192915050565b6001600160a01b0383163314801590610850575061084e83336109bf565b155b1561087357335b8360405163711bec9160e11b8152600401610688929190611e56565b6106f3838383610c95565b6000805160206120ab83398151915261089681610a98565b6105ad85858585610cdb565b60008051602061208b8339815191526108ba81610a98565b610731610d24565b6009602052600090815260409020805461046690611dd7565b60009182526003602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6008805461046690611dd7565b61091e338383610d61565b5050565b600061092d81610a98565b60008681526009602052604090206109458682611eb6565b506000868152600a6020526040902061095e8582611eb6565b506000868152600b602052604090206109778482611eb6565b50506000948552600c602052604090942093909355505050565b60009081526005602052604090205490565b6109ac826105b4565b6109b581610a98565b6106ba8383610bce565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b336001600160a01b0386168114801590610a0e5750610a0c86826109bf565b155b15610a3057808660405163711bec9160e11b8152600401610688929190611e56565b61063d8686868686610df7565b6001600160a01b0383163314801590610a5d5750610a5b83336109bf565b155b15610a685733610857565b6106f3838383610e71565b60006001600160e01b03198216637965db0b60e01b1480610448575061044882610ec8565b6107318133610f18565b6001600160a01b038416610acc576000604051632bfa23e760e11b81526004016106889190611f75565b6106ba600085858585610f51565b6001600160a01b038416610b04576000604051632bfa23e760e11b81526004016106889190611f75565b6001600160a01b038516610b2d576000604051626a0d4560e21b81526004016106889190611f75565b6105ad8585858585610f51565b6000610b4683836108db565b610bc65760008381526003602090815260408083206001600160a01b03861684529091529020805460ff19166001179055610b7e3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610448565b506000610448565b6000610bda83836108db565b15610bc65760008381526003602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610448565b610c43610fb6565b6004805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610c7d9190611f75565b60405180910390a1565b602090810291909101015190565b6001600160a01b038316610cbe576000604051626a0d4560e21b81526004016106889190611f75565b6106f3836000848460405180602001604052806000815250610f51565b6001600160a01b038416610d05576000604051632bfa23e760e11b81526004016106889190611f75565b600080610d128585610fdb565b9150915061063d600087848487610f51565b610d2c611003565b6004805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610c703390565b6001600160a01b038216610d8a57600060405162ced3e160e81b81526004016106889190611f75565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038416610e21576000604051632bfa23e760e11b81526004016106889190611f75565b6001600160a01b038516610e4a576000604051626a0d4560e21b81526004016106889190611f75565b600080610e578585610fdb565b91509150610e688787848487610f51565b50505050505050565b6001600160a01b038316610e9a576000604051626a0d4560e21b81526004016106889190611f75565b600080610ea78484610fdb565b915091506105ad856000848460405180602001604052806000815250610f51565b60006001600160e01b03198216636cdb3d1360e11b1480610ef957506001600160e01b031982166303a24d0760e21b145b8061044857506301ffc9a760e01b6001600160e01b0319831614610448565b610f2282826108db565b61091e5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610688565b610f5d85858585611027565b6001600160a01b038416156105ad5782513390600103610fa8576000610f838582610c87565b90506000610f918582610c87565b9050610fa18389898585896110e1565b505061063d565b61063d8187878787876111f3565b60045460ff16610fd957604051638dfc202b60e01b815260040160405180910390fd5b565b6040805160018082526020820194909452808201938452606081019290925260808201905291565b60045460ff1615610fd95760405163d93c066560e01b815260040160405180910390fd5b611033848484846112d3565b60005b82518110156105ad5761106183828151811061105457611054611e11565b6020026020010151610991565b600c600085848151811061107757611077611e11565b602002602001015181526020019081526020016000205410156110cf5760405162461bcd60e51b815260206004820152601060248201526f12185c990818d85c081c995858da195960821b6044820152606401610688565b806110d981611e3d565b915050611036565b6001600160a01b0384163b1561063d5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906111259089908990889088908890600401611f89565b6020604051808303816000875af1925050508015611160575060408051601f3d908101601f1916820190925261115d91810190611fce565b60015b6111c0573d80801561118e576040519150601f19603f3d011682016040523d82523d6000602084013e611193565b606091505b5080516000036111b85784604051632bfa23e760e11b81526004016106889190611f75565b805181602001fd5b6001600160e01b0319811663f23a6e6160e01b14610e685784604051632bfa23e760e11b81526004016106889190611f75565b6001600160a01b0384163b1561063d5760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906112379089908990889088908890600401611feb565b6020604051808303816000875af1925050508015611272575060408051601f3d908101601f1916820190925261126f91810190611fce565b60015b6112a0573d80801561118e576040519150601f19603f3d011682016040523d82523d6000602084013e611193565b6001600160e01b0319811663bc197c8160e01b14610e685784604051632bfa23e760e11b81526004016106889190611f75565b6112df8484848461142d565b6001600160a01b038416611392576000805b835181101561137857600083828151811061130e5761130e611e11565b60200260200101519050806005600087858151811061132f5761132f611e11565b6020026020010151815260200190815260200160002060008282546113549190612049565b9091555061136490508184612049565b9250508061137190611e3d565b90506112f1565b50806006600082825461138b9190612049565b9091555050505b6001600160a01b0383166106ba576000805b835181101561141c5760008382815181106113c1576113c1611e11565b6020026020010151905080600560008785815181106113e2576113e2611e11565b60200260200101518152602001908152602001600020600082825403925050819055508083019250508061141590611e3d565b90506113a4565b506006805491909103905550505050565b611435611003565b6106ba84848484805182511461146b5781518151604051635b05999160e01b815260048101929092526024820152604401610688565b3360005b83518110156115845760006114848583610c87565b905060006114928584610c87565b90506001600160a01b0388161561152c576000828152602081815260408083206001600160a01b038c16845290915290205481811015611505576040516303dee4c560e01b81526001600160a01b038a166004820152602481018290526044810183905260648101849052608401610688565b6000838152602081815260408083206001600160a01b038d16845290915290209082900390555b6001600160a01b03871615611571576000828152602081815260408083206001600160a01b038b1684529091528120805483929061156b908490612049565b90915550505b50508061157d90611e3d565b905061146f565b50825160010361161157600061159a8482610c87565b905060006115a88482610c87565b9050856001600160a01b0316876001600160a01b0316846001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628585604051611602929190918252602082015260400190565b60405180910390a450506105ad565b836001600160a01b0316856001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161166092919061205c565b60405180910390a45050505050565b80356001600160a01b038116811461168657600080fd5b919050565b6000806040838503121561169e57600080fd5b6116a78361166f565b946020939093013593505050565b6001600160e01b03198116811461073157600080fd5b6000602082840312156116dd57600080fd5b81356116e8816116b5565b9392505050565b6000815180845260005b81811015611715576020818501810151868301820152016116f9565b506000602082860101526020601f19601f83011685010191505092915050565b6020815260006116e860208301846116ef565b60006020828403121561175a57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561179f5761179f611761565b604052919050565b60006001600160401b038211156117c0576117c0611761565b5060051b60200190565b600082601f8301126117db57600080fd5b813560206117f06117eb836117a7565b611777565b82815260059290921b8401810191818101908684111561180f57600080fd5b8286015b8481101561182a5780358352918301918301611813565b509695505050505050565b600082601f83011261184657600080fd5b81356001600160401b0381111561185f5761185f611761565b611872601f8201601f1916602001611777565b81815284602083860101111561188757600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156118ba57600080fd5b6118c38561166f565b935060208501356001600160401b03808211156118df57600080fd5b6118eb888389016117ca565b9450604087013591508082111561190157600080fd5b61190d888389016117ca565b9350606087013591508082111561192357600080fd5b5061193087828801611835565b91505092959194509250565b600082601f83011261194d57600080fd5b8135602061195d6117eb836117a7565b82815260059290921b8401810191818101908684111561197c57600080fd5b8286015b8481101561182a576119918161166f565b8352918301918301611980565b600080600080608085870312156119b457600080fd5b84356001600160401b03808211156119cb57600080fd5b6119d78883890161193c565b955060208701359450604087013591508082111561190157600080fd5b600080600080600060a08688031215611a0c57600080fd5b611a158661166f565b9450611a236020870161166f565b935060408601356001600160401b0380821115611a3f57600080fd5b611a4b89838a016117ca565b94506060880135915080821115611a6157600080fd5b611a6d89838a016117ca565b93506080880135915080821115611a8357600080fd5b50611a9088828901611835565b9150509295509295909350565b60008060408385031215611ab057600080fd5b82359150611ac06020840161166f565b90509250929050565b60008060408385031215611adc57600080fd5b82356001600160401b0380821115611af357600080fd5b611aff8683870161193c565b93506020850135915080821115611b1557600080fd5b50611b22858286016117ca565b9150509250929050565b600081518084526020808501945080840160005b83811015611b5c57815187529582019590820190600101611b40565b509495945050505050565b6020815260006116e86020830184611b2c565b600080600060608486031215611b8f57600080fd5b611b988461166f565b925060208401356001600160401b0380821115611bb457600080fd5b611bc0878388016117ca565b93506040860135915080821115611bd657600080fd5b50611be3868287016117ca565b9150509250925092565b60008060008060808587031215611c0357600080fd5b611c0c8561166f565b9350602085013592506040850135915060608501356001600160401b03811115611c3557600080fd5b61193087828801611835565b60008060408385031215611c5457600080fd5b611c5d8361166f565b915060208301358015158114611c7257600080fd5b809150509250929050565b600080600080600060a08688031215611c9557600080fd5b8535945060208601356001600160401b0380821115611cb357600080fd5b611cbf89838a01611835565b95506040880135915080821115611cd557600080fd5b611ce189838a01611835565b94506060880135915080821115611cf757600080fd5b50611d0488828901611835565b95989497509295608001359392505050565b60008060408385031215611d2957600080fd5b611d328361166f565b9150611ac06020840161166f565b600080600080600060a08688031215611d5857600080fd5b611d618661166f565b9450611d6f6020870161166f565b9350604086013592506060860135915060808601356001600160401b03811115611d9857600080fd5b611a9088828901611835565b600080600060608486031215611db957600080fd5b611dc28461166f565b95602085013595506040909401359392505050565b600181811c90821680611deb57607f821691505b602082108103611e0b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4f57611e4f611e27565b5060010190565b6001600160a01b0392831681529116602082015260400190565b601f8211156106f357600081815260208120601f850160051c81016020861015611e975750805b601f850160051c820191505b8181101561063d57828155600101611ea3565b81516001600160401b03811115611ecf57611ecf611761565b611ee381611edd8454611dd7565b84611e70565b602080601f831160018114611f185760008415611f005750858301515b600019600386901b1c1916600185901b17855561063d565b600085815260208120601f198616915b82811015611f4757888601518255948401946001909101908401611f28565b5085821015611f655787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6001600160a01b0391909116815260200190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090611fc3908301846116ef565b979650505050505050565b600060208284031215611fe057600080fd5b81516116e8816116b5565b6001600160a01b0386811682528516602082015260a06040820181905260009061201790830186611b2c565b82810360608401526120298186611b2c565b9050828103608084015261203d81856116ef565b98975050505050505050565b8082018082111561044857610448611e27565b60408152600061206f6040830185611b2c565b82810360208401526120818185611b2c565b9594505050505056fe65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a264697066735822122091a87e5f05863a3c2d112c6e0be3b1d4ca18b534028c34ba2f0110dbad9e8c5a64736f6c63430008140033
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
[ Download: CSV Export ]
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.