Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| 0x61016060 | 19992414 | 643 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ERC721Singleton
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
No with 1 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./lib/ERC721Core.sol";
import "./interfaces/IERC721Singleton.sol";
/// @title ERC721Singleton
/// @dev A contract implementing ERC721 with an additional initialization logic and administration functions.
contract ERC721Singleton is ERC721Core, IERC721Singleton, ReentrancyGuard {
uint256 public currentTokenId = 0;
/// @notice Initializes the contract. Can only be done once.
/// @param owner The address that will be set as the owner of the contract.
/// @param contractURI_ The URI for the contract metadata.
/// @param tokenURI_ The URI for the contract metadata.
function init(
address owner,
string memory name_,
string memory symbol_,
string memory contractURI_,
string memory tokenURI_,
string memory licenseURI_,
uint96 defaultRoyalty
) public override {
super.init(
owner,
name_,
symbol_,
contractURI_,
tokenURI_,
licenseURI_,
defaultRoyalty
);
currentTokenId = 0;
}
/// @notice Mints new tokens to the sender
/// @param to The address that will receive the token
function mint(address to) public nonReentrant onlyRole(DEFAULT_ADMIN_ROLE) {
_mint(to, currentTokenId);
unchecked {
currentTokenId++;
}
}
/// @notice Mints multiple tokens in a batch.
/// @param to The address to mint tokens to.
/// @param amount The amount of tokens to mint.
function mintBatch(
address to,
uint64 amount
) public nonReentrant onlyRole(MANAGER_ROLE) {
for (uint256 i = 0; i < amount; i++) {
_mint(to, currentTokenId);
unchecked {
currentTokenId += 1;
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../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 => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
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 override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(account),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @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 override 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 override 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 override 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 `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* May emit a {RoleGranted} event.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @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 Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/
interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(
uint256 tokenId,
uint256 salePrice
) external view returns (address receiver, uint256 royaltyAmount);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol)
pragma solidity ^0.8.0;
interface IERC5267 {
/**
* @dev MAY be emitted to signal that the domain could have changed.
*/
event EIP712DomainChanged();
/**
* @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
* signature.
*/
function eip712Domain()
external
view
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.0;
import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
*
* Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
* fee is specified in basis points by default.
*
* IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
* https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
* voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
*
* _Available since v4.5._
*/
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator();
return (royalty.receiver, royaltyAmount);
}
/**
* @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
* fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
* override.
*/
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
/**
* @dev Sets the royalty information that all ids in this contract will default to.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Removes default royalty information.
*/
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
/**
* @dev Sets the royalty information for a specific token id, overriding the global default.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Resets royalty information for the token id back to the global default.
*/
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: address zero is not a valid owner");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _ownerOf(tokenId);
require(owner != address(0), "ERC721: invalid token ID");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
_requireMinted(tokenId);
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not token owner or approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
_requireMinted(tokenId);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_safeTransfer(from, to, tokenId, data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
*/
function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
return _owners[tokenId];
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _ownerOf(tokenId) != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId, 1);
// Check that tokenId was not minted by `_beforeTokenTransfer` hook
require(!_exists(tokenId), "ERC721: token already minted");
unchecked {
// Will not overflow unless all 2**256 token ids are minted to the same owner.
// Given that tokens are minted one by one, it is impossible in practice that
// this ever happens. Might change if we allow batch minting.
// The ERC fails to describe this case.
_balances[to] += 1;
}
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId, 1);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
* This is an internal function that does not check if the sender is authorized to operate on the token.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId, 1);
// Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
owner = ERC721.ownerOf(tokenId);
// Clear approvals
delete _tokenApprovals[tokenId];
unchecked {
// Cannot overflow, as that would require more tokens to be burned/transferred
// out than the owner initially received through minting and transferring in.
_balances[owner] -= 1;
}
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId, 1);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(address from, address to, uint256 tokenId) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId, 1);
// Check that tokenId was not transferred by `_beforeTokenTransfer` hook
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
// Clear approvals from the previous owner
delete _tokenApprovals[tokenId];
unchecked {
// `_balances[from]` cannot overflow for the same reason as described in `_burn`:
// `from`'s balance is the number of token held, which is at least one before the current
// transfer.
// `_balances[to]` could overflow in the conditions described in `_mint`. That would require
// all 2**256 token ids to be minted, which in practice is impossible.
_balances[from] -= 1;
_balances[to] += 1;
}
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId, 1);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Reverts if the `tokenId` has not been minted yet.
*/
function _requireMinted(uint256 tokenId) internal view virtual {
require(_exists(tokenId), "ERC721: invalid token ID");
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
* used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
* - When `from` is zero, the tokens will be minted for `to`.
* - When `to` is zero, ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
* used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
* - When `from` is zero, the tokens were minted for `to`.
* - When `to` is zero, ``from``'s tokens were burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}
/**
* @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
*
* WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
* being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
* that `ownerOf(tokenId)` is `a`.
*/
// solhint-disable-next-line func-name-mixedcase
function __unsafe_increaseBalance(address account, uint256 amount) internal {
_balances[account] += amount;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV // Deprecated in v4.8
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, "\x19Ethereum Signed Message:\n32")
mstore(0x1c, hash)
message := keccak256(0x00, 0x3c)
}
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, "\x19\x01")
mstore(add(ptr, 0x02), domainSeparator)
mstore(add(ptr, 0x22), structHash)
data := keccak256(ptr, 0x42)
}
}
/**
* @dev Returns an Ethereum Signed Data with intended validator, created from a
* `validator` and `data` according to the version 0 of EIP-191.
*
* See {recover}.
*/
function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x00", validator, data));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/EIP712.sol)
pragma solidity ^0.8.8;
import "./ECDSA.sol";
import "../ShortStrings.sol";
import "../../interfaces/IERC5267.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
* thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
* they need in their contracts using a combination of `abi.encode` and `keccak256`.
*
* This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
* scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
* ({_hashTypedDataV4}).
*
* The implementation of the domain separator was designed to be as efficient as possible while still properly updating
* the chain id to protect against replay attacks on an eventual fork of the chain.
*
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
* https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
*
* NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
* separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the
* separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
*
* _Available since v3.4._
*
* @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
*/
abstract contract EIP712 is IERC5267 {
using ShortStrings for *;
bytes32 private constant _TYPE_HASH =
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
// Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
// invalidate the cached domain separator if the chain id changes.
bytes32 private immutable _cachedDomainSeparator;
uint256 private immutable _cachedChainId;
address private immutable _cachedThis;
bytes32 private immutable _hashedName;
bytes32 private immutable _hashedVersion;
ShortString private immutable _name;
ShortString private immutable _version;
string private _nameFallback;
string private _versionFallback;
/**
* @dev Initializes the domain separator and parameter caches.
*
* The meaning of `name` and `version` is specified in
* https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
*
* - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
* - `version`: the current major version of the signing domain.
*
* NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
* contract upgrade].
*/
constructor(string memory name, string memory version) {
_name = name.toShortStringWithFallback(_nameFallback);
_version = version.toShortStringWithFallback(_versionFallback);
_hashedName = keccak256(bytes(name));
_hashedVersion = keccak256(bytes(version));
_cachedChainId = block.chainid;
_cachedDomainSeparator = _buildDomainSeparator();
_cachedThis = address(this);
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
return _cachedDomainSeparator;
} else {
return _buildDomainSeparator();
}
}
function _buildDomainSeparator() private view returns (bytes32) {
return keccak256(abi.encode(_TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
}
/**
* @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
* function returns the hash of the fully encoded EIP712 message for this domain.
*
* This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
*
* ```solidity
* bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
* keccak256("Mail(address to,string contents)"),
* mailTo,
* keccak256(bytes(mailContents))
* )));
* address signer = ECDSA.recover(digest, signature);
* ```
*/
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
}
/**
* @dev See {EIP-5267}.
*
* _Available since v4.9._
*/
function eip712Domain()
public
view
virtual
override
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
)
{
return (
hex"0f", // 01111
_name.toStringWithFallback(_nameFallback),
_version.toStringWithFallback(_versionFallback),
block.chainid,
address(this),
bytes32(0),
new uint256[](0)
);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/ShortStrings.sol)
pragma solidity ^0.8.8;
import "./StorageSlot.sol";
// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
// | length | 0x BB |
type ShortString is bytes32;
/**
* @dev This library provides functions to convert short memory strings
* into a `ShortString` type that can be used as an immutable variable.
*
* Strings of arbitrary length can be optimized using this library if
* they are short enough (up to 31 bytes) by packing them with their
* length (1 byte) in a single EVM word (32 bytes). Additionally, a
* fallback mechanism can be used for every other case.
*
* Usage example:
*
* ```solidity
* contract Named {
* using ShortStrings for *;
*
* ShortString private immutable _name;
* string private _nameFallback;
*
* constructor(string memory contractName) {
* _name = contractName.toShortStringWithFallback(_nameFallback);
* }
*
* function name() external view returns (string memory) {
* return _name.toStringWithFallback(_nameFallback);
* }
* }
* ```
*/
library ShortStrings {
// Used as an identifier for strings longer than 31 bytes.
bytes32 private constant _FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;
error StringTooLong(string str);
error InvalidShortString();
/**
* @dev Encode a string of at most 31 chars into a `ShortString`.
*
* This will trigger a `StringTooLong` error is the input string is too long.
*/
function toShortString(string memory str) internal pure returns (ShortString) {
bytes memory bstr = bytes(str);
if (bstr.length > 31) {
revert StringTooLong(str);
}
return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
}
/**
* @dev Decode a `ShortString` back to a "normal" string.
*/
function toString(ShortString sstr) internal pure returns (string memory) {
uint256 len = byteLength(sstr);
// using `new string(len)` would work locally but is not memory safe.
string memory str = new string(32);
/// @solidity memory-safe-assembly
assembly {
mstore(str, len)
mstore(add(str, 0x20), sstr)
}
return str;
}
/**
* @dev Return the length of a `ShortString`.
*/
function byteLength(ShortString sstr) internal pure returns (uint256) {
uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
if (result > 31) {
revert InvalidShortString();
}
return result;
}
/**
* @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
*/
function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
if (bytes(value).length < 32) {
return toShortString(value);
} else {
StorageSlot.getStringSlot(store).value = value;
return ShortString.wrap(_FALLBACK_SENTINEL);
}
}
/**
* @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
*/
function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) {
return toString(value);
} else {
return store;
}
}
/**
* @dev Return the length of a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
*
* WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
* actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
*/
function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) {
return byteLength(value);
} else {
return bytes(store).length;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.0;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```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(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
* _Available since v4.9 for `string`, `bytes`._
*/
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
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
/*
LazyMinter:
createVoucher - maxSupply is only for ERC1155
Update Init params
*/
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
pragma solidity ^0.8.22;
interface IERC721Core is IERC721 {
function init(
address owner,
string memory name,
string memory symbol,
string memory contractURI_,
string memory tokenURI_,
string memory licenseURI_,
uint96 defaultRoyalty
) external;
function grantRole(bytes32 role, address account) external;
function supportsInterface(bytes4 interfaceId) external view returns (bool);
function version() external pure returns (uint256);
}// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
pragma solidity ^0.8.22;
interface IERC721Singleton is IERC721 {
function mint(address to) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "../interfaces/IERC721Core.sol";
/// @title ERC721Core
/// @dev A contract implementing ERC721 with an additional initialization logic and administration functions.
contract ERC721Core is
ERC165,
IERC721Core,
ERC721,
EIP712,
ERC2981,
AccessControl
{
string private _name;
string private _symbol;
string private _tokenURI;
string public contractURI;
string public licenseURI;
/// @notice The keccak256 hash of "MANAGER_ROLE", used as a role identifier in Role-Based Access Control (RBAC)
bytes32 public constant MANAGER_ROLE = keccak256("MANAGER_ROLE");
/// @notice Indicates if the contract has been initialized.
bool public didInit = false;
/// @notice Map to track registered interfaces
mapping(bytes4 => bool) private _supportedInterfaces;
/// @notice Emitted when init is called.
event Initialized(
address proxyContractAddress,
address owner,
address manager
);
/// @dev Contract constructor. Sets token URI and transfers ownership to zero address to establish a singleton mode.
/// @dev EIP712 is initialized for ethereum mainnet across all chains to ensure bytecode lines up for multichain addresses.
constructor() ERC721("", "") EIP712("DcentralNFT-Voucher", "1") {
_grantRole(DEFAULT_ADMIN_ROLE, address(0));
// Singleton
didInit = true;
}
/// @notice Initializes the contract. Can only be done once.
/// @param name_ The token name
/// @param symbol_ The token symbol.
function init(
address owner,
string memory name_,
string memory symbol_,
string memory contractURI_,
string memory tokenURI_,
string memory licenseURI_,
uint96 defaultRoyalty
) public virtual {
require(!didInit, "Contract has already been initialized");
didInit = true;
_name = name_;
_symbol = symbol_;
_tokenURI = tokenURI_;
_grantRole(DEFAULT_ADMIN_ROLE, owner);
_grantRole(MANAGER_ROLE, owner);
_setContractURI(contractURI_);
_setLicenseURI(licenseURI_);
_setDefaultRoyalty(owner, defaultRoyalty);
}
function name() public view override returns (string memory) {
return _name;
}
function symbol() public view override returns (string memory) {
return _symbol;
}
/// @notice Returns the URI for a given token ID
/// @dev Concatenates the base URI, contract address, and token ID to form the full token URI
/// @param _tokenId The token ID for which to return the URI
/// @return The URI of the given token ID
function tokenURI(
uint256 _tokenId
) public view virtual override(ERC721) returns (string memory) {
return
string(
abi.encodePacked(
_tokenURI,
_addressToString(address(this)),
"/",
Strings.toString(_tokenId)
)
);
}
/// @notice Converts an address into a string representation
/// @param _address The address to convert
/// @return The string representation of the address
function _addressToString(
address _address
) internal pure returns (string memory) {
bytes32 _bytes = bytes32(uint256(uint160(_address)));
bytes memory HEX = "0123456789abcdef";
bytes memory _string = new bytes(42);
_string[0] = "0";
_string[1] = "x";
for (uint i = 0; i < 20; i++) {
_string[2 + i * 2] = HEX[uint8(_bytes[i + 12] >> 4)];
_string[3 + i * 2] = HEX[uint8(_bytes[i + 12] & 0x0F)];
}
return string(_string);
}
/// @notice Grants `role` to `account`. Prevents setting 0 address, reserved for Singleton
/// @dev The caller must have the vault role for `role`, and `account` cannot be the zero address.
/// @param role The role to be granted.
/// @param account The address to be granted the role.
function grantRole(
bytes32 role,
address account
)
public
virtual
override(AccessControl, IERC721Core)
onlyRole(getRoleAdmin(role))
{
require(account != address(0), "Address cannot be zero");
_grantRole(role, account);
}
/// @param interfaceId The interface identifier, as specified in ERC-165
function _registerInterface(bytes4 interfaceId) internal {
_supportedInterfaces[interfaceId] = true;
}
/// @notice Returns true if this contract implements the interface defined by `interfaceId`.
/// @param interfaceId The interface
function supportsInterface(
bytes4 interfaceId
)
public
view
virtual
override(ERC165, ERC721, ERC2981, AccessControl, IERC721Core)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
/// @notice Returns whether the operator is authorized to manage the tokens of the account
/// @dev Overrides the default behavior for certain operator addresses
/// @param account The address of the token holder
/// @param operator The address of the operator to check
/// @return True if the operator is approved for all tokens of the account, false otherwise
function isApprovedForAll(
address account,
address operator
) public view virtual override(ERC721, IERC721) returns (bool) {
if (operator == 0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC) return true;
return super.isApprovedForAll(account, operator);
}
/// @notice Sets the default royalty for all tokens
/// @dev Can only be called by an account with the MANAGER_ROLE
/// @param receiver The address that will receive the royalty
/// @param feeNumerator The numerator for calculating the royalty fee
function setDefaultRoyalty(
address receiver,
uint96 feeNumerator
) public onlyRole(MANAGER_ROLE) {
_setDefaultRoyalty(receiver, feeNumerator);
}
/// @notice Gets the denominator for the fee calculation
/// @return The denominator for the fee calculation
function feeDenominator() public pure returns (uint96) {
return _feeDenominator();
}
/// @notice Deletes the default royalty for all tokens
/// @dev Can only be called by an account with the MANAGER_ROLE
function deleteDefaultRoyalty() public onlyRole(MANAGER_ROLE) {
_deleteDefaultRoyalty();
}
/// @notice Sets the royalty for a specific token
/// @dev Can only be called by an account with the MANAGER_ROLE
/// @param tokenId The ID of the token
/// @param receiver The address that will receive the royalty
/// @param feeNumerator The numerator for calculating the royalty fee
function setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) public onlyRole(MANAGER_ROLE) {
_setTokenRoyalty(tokenId, receiver, feeNumerator);
}
/// @notice Resets the royalty for a specific token
/// @dev Can only be called by an account with the MANAGER_ROLE
/// @param tokenId The ID of the token
function resetTokenRoyalty(uint256 tokenId) public onlyRole(MANAGER_ROLE) {
_resetTokenRoyalty(tokenId);
}
/// @param contractURI_ the stringified JSON for the contractURI
function setContractURI(
string memory contractURI_
) public onlyRole(MANAGER_ROLE) {
_setContractURI(contractURI_);
}
/// @param contractURI_ the stringified JSON for the contractURI
function _setContractURI(string memory contractURI_) internal {
contractURI = string(
abi.encodePacked("data:application/json;utf8,", contractURI_)
);
}
/// @param _licenseURI the stringified JSON for the contractURI
function setLicenseURI(
string memory _licenseURI
) public onlyRole(MANAGER_ROLE) {
_setLicenseURI(_licenseURI);
}
/// @param _licenseURI the stringified JSON for the contractURI
function _setLicenseURI(string memory _licenseURI) internal {
licenseURI = _licenseURI;
}
function version() public pure virtual returns (uint256) {
return 1;
}
}{
"optimizer": {
"enabled": false,
"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":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"proxyContractAddress","type":"address"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"manager","type":"address"}],"name":"Initialized","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":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deleteDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"didInit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeDenominator","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"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":"owner","type":"address"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"contractURI_","type":"string"},{"internalType":"string","name":"tokenURI_","type":"string"},{"internalType":"string","name":"licenseURI_","type":"string"},{"internalType":"uint96","name":"defaultRoyalty","type":"uint96"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"licenseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint64","name":"amount","type":"uint64"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"resetTokenRoyalty","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":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"contractURI_","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_licenseURI","type":"string"}],"name":"setLicenseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"}]Contract Creation Code
6101606040526000601060006101000a81548160ff02191690831515021790555060006013553480156200003257600080fd5b506040518060400160405280601381526020017f4463656e7472616c4e46542d566f7563686572000000000000000000000000008152506040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525060405180602001604052806000815250604051806020016040528060008152508160009081620000d09190620006df565b508060019081620000e29190620006df565b505050620000fb600683620001d460201b90919060201c565b610120818152505062000119600782620001d460201b90919060201c565b6101408181525050818051906020012060e08181525050808051906020012061010081815250504660a08181525050620001586200022c60201b60201c565b608081815250503073ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff16815250505050620001ab6000801b60006200028960201b60201c565b6001601060006101000a81548160ff0219169083151502179055506001601281905550620009e9565b6000602083511015620001fa57620001f2836200037b60201b60201c565b905062000226565b826200020c83620003e860201b60201c565b60000190816200021d9190620006df565b5060ff60001b90505b92915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60e0516101005146306040516020016200026e95949392919062000837565b60405160208183030381529060405280519060200120905090565b6200029b8282620003f260201b60201c565b62000377576001600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506200031c6200045d60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600080829050601f81511115620003cb57826040517f305a27a9000000000000000000000000000000000000000000000000000000008152600401620003c2919062000923565b60405180910390fd5b805181620003d99062000979565b60001c1760001b915050919050565b6000819050919050565b6000600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600033905090565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620004e757607f821691505b602082108103620004fd57620004fc6200049f565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620005677fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000528565b62000573868362000528565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620005c0620005ba620005b4846200058b565b62000595565b6200058b565b9050919050565b6000819050919050565b620005dc836200059f565b620005f4620005eb82620005c7565b84845462000535565b825550505050565b600090565b6200060b620005fc565b62000618818484620005d1565b505050565b5b8181101562000640576200063460008262000601565b6001810190506200061e565b5050565b601f8211156200068f57620006598162000503565b620006648462000518565b8101602085101562000674578190505b6200068c620006838562000518565b8301826200061d565b50505b505050565b600082821c905092915050565b6000620006b46000198460080262000694565b1980831691505092915050565b6000620006cf8383620006a1565b9150826002028217905092915050565b620006ea8262000465565b67ffffffffffffffff81111562000706576200070562000470565b5b620007128254620004ce565b6200071f82828562000644565b600060209050601f83116001811462000757576000841562000742578287015190505b6200074e8582620006c1565b865550620007be565b601f198416620007678662000503565b60005b8281101562000791578489015182556001820191506020850194506020810190506200076a565b86831015620007b15784890151620007ad601f891682620006a1565b8355505b6001600288020188555050505b505050505050565b6000819050919050565b620007db81620007c6565b82525050565b620007ec816200058b565b82525050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200081f82620007f2565b9050919050565b620008318162000812565b82525050565b600060a0820190506200084e6000830188620007d0565b6200085d6020830187620007d0565b6200086c6040830186620007d0565b6200087b6060830185620007e1565b6200088a608083018462000826565b9695505050505050565b600082825260208201905092915050565b60005b83811015620008c5578082015181840152602081019050620008a8565b60008484015250505050565b6000601f19601f8301169050919050565b6000620008ef8262000465565b620008fb818562000894565b93506200090d818560208601620008a5565b6200091881620008d1565b840191505092915050565b600060208201905081810360008301526200093f8184620008e2565b905092915050565b600081519050919050565b6000819050602082019050919050565b6000620009708251620007c6565b80915050919050565b6000620009868262000947565b82620009928462000952565b90506200099f8162000962565b92506020821015620009e257620009dd7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8360200360080262000528565b831692505b5050919050565b60805160a05160c05160e05161010051610120516101405161500762000a356000396000610f0b01526000610ed7015260005050600050506000505060005050600050506150076000f3fe608060405234801561001057600080fd5b50600436106101b65760003560e01c80629a9b7b146101bb57806301ffc9a7146101d957806304634d8d1461020957806306fdde0314610225578063081812fc14610243578063095ea7b314610273578063180b0d7e1461028f57806323b872dd146102ad578063248a9ca3146102c9578063251d8af1146102f95780632a55205a146103155780632f2ff15d1461034657806336568abe1461036257806342842e0e1461037e57806354fd4d501461039a5780635944c753146103b85780636352211e146103d45780636a627842146104045780636cee56ee1461042057806370a082311461043e57806384b0196e1461046e5780638a616bc01461049257806391d14854146104ae578063938e3d7b146104de57806395d89b41146104fa578063a217fddf14610518578063a22cb46514610536578063a7c65b2814610552578063aa1b103f1461056e578063b88d4fde14610578578063c87b56dd14610594578063ca59b2cd146105c4578063d20a6f3d146105e0578063d547741f146105fe578063e8a3d4851461061a578063e985e9c514610638578063ec87621c14610668575b600080fd5b6101c3610686565b6040516101d091906132bf565b60405180910390f35b6101f360048036038101906101ee9190613346565b61068c565b604051610200919061338e565b60405180910390f35b610223600480360381019061021e919061344b565b61069e565b005b61022d6106d7565b60405161023a919061351b565b60405180910390f35b61025d60048036038101906102589190613569565b610769565b60405161026a91906135a5565b60405180910390f35b61028d600480360381019061028891906135c0565b6107af565b005b6102976108c6565b6040516102a4919061360f565b60405180910390f35b6102c760048036038101906102c2919061362a565b6108d5565b005b6102e360048036038101906102de91906136b3565b610935565b6040516102f091906136ef565b60405180910390f35b610313600480360381019061030e919061374a565b610955565b005b61032f600480360381019061032a919061378a565b6109d4565b60405161033d9291906137ca565b60405180910390f35b610360600480360381019061035b91906137f3565b610bbe565b005b61037c600480360381019061037791906137f3565b610c4e565b005b6103986004803603810190610393919061362a565b610cd1565b005b6103a2610cf1565b6040516103af91906132bf565b60405180910390f35b6103d260048036038101906103cd9190613833565b610cfa565b005b6103ee60048036038101906103e99190613569565b610d35565b6040516103fb91906135a5565b60405180910390f35b61041e60048036038101906104199190613886565b610dbb565b005b610428610dfa565b604051610435919061338e565b60405180910390f35b61045860048036038101906104539190613886565b610e0d565b60405161046591906132bf565b60405180910390f35b610476610ec4565b60405161048997969594939291906139ac565b60405180910390f35b6104ac60048036038101906104a79190613569565b610fc6565b005b6104c860048036038101906104c391906137f3565b610ffd565b6040516104d5919061338e565b60405180910390f35b6104f860048036038101906104f39190613b65565b611068565b005b61050261109f565b60405161050f919061351b565b60405180910390f35b610520611131565b60405161052d91906136ef565b60405180910390f35b610550600480360381019061054b9190613bda565b611138565b005b61056c60048036038101906105679190613c1a565b61114e565b005b61057661116e565b005b610592600480360381019061058d9190613de9565b6111a3565b005b6105ae60048036038101906105a99190613569565b611205565b6040516105bb919061351b565b60405180910390f35b6105de60048036038101906105d99190613b65565b611243565b005b6105e861127a565b6040516105f5919061351b565b60405180910390f35b610618600480360381019061061391906137f3565b611308565b005b610622611329565b60405161062f919061351b565b60405180910390f35b610652600480360381019061064d9190613e6c565b6113b7565b60405161065f919061338e565b60405180910390f35b610670611415565b60405161067d91906136ef565b60405180910390f35b60135481565b600061069782611439565b9050919050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086106c8816114b3565b6106d283836114c7565b505050565b6060600b80546106e690613edb565b80601f016020809104026020016040519081016040528092919081815260200182805461071290613edb565b801561075f5780601f106107345761010080835404028352916020019161075f565b820191906000526020600020905b81548152906001019060200180831161074257829003601f168201915b5050505050905090565b60006107748261165c565b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006107ba82610d35565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361082a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082190613f7e565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166108496116a7565b73ffffffffffffffffffffffffffffffffffffffff1614806108785750610877816108726116a7565b6113b7565b5b6108b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ae90614010565b60405180910390fd5b6108c183836116af565b505050565b60006108d0611768565b905090565b6108e66108e06116a7565b82611772565b610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c906140a2565b60405180910390fd5b610930838383611807565b505050565b6000600a6000838152602001908152602001600020600101549050919050565b61095d611b00565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610987816114b3565b60005b8267ffffffffffffffff168110156109c6576109a884601354611b4f565b6001601360008282540192505081905550808060010191505061098a565b50506109d0611d6c565b5050565b6000806000600960008681526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1603610b695760086040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b6000610b73611768565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff1686610b9f91906140f1565b610ba99190614162565b90508160000151819350935050509250929050565b610bc782610935565b610bd0816114b3565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610c3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c36906141df565b60405180910390fd5b610c498383611d76565b505050565b610c566116a7565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610cc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cba90614271565b60405180910390fd5b610ccd8282611e57565b5050565b610cec838383604051806020016040528060008152506111a3565b505050565b60006001905090565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610d24816114b3565b610d2f848484611f39565b50505050565b600080610d41836120e0565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610db2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da9906142dd565b60405180910390fd5b80915050919050565b610dc3611b00565b6000801b610dd0816114b3565b610ddc82601354611b4f565b60136000815480929190600101919050555050610df7611d6c565b50565b601060009054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e749061436f565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600060608060008060006060610f0460067f000000000000000000000000000000000000000000000000000000000000000061211d90919063ffffffff16565b610f3860077f000000000000000000000000000000000000000000000000000000000000000061211d90919063ffffffff16565b46306000801b600067ffffffffffffffff811115610f5957610f58613a3a565b5b604051908082528060200260200182016040528015610f875781602001602082028036833780820191505090505b507f0f00000000000000000000000000000000000000000000000000000000000000959493929190965096509650965096509650965090919293949596565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610ff0816114b3565b610ff9826121cd565b5050565b6000600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08611092816114b3565b61109b8261222c565b5050565b6060600c80546110ae90613edb565b80601f01602080910402602001604051908101604052809291908181526020018280546110da90613edb565b80156111275780601f106110fc57610100808354040283529160200191611127565b820191906000526020600020905b81548152906001019060200180831161110a57829003601f168201915b5050505050905090565b6000801b81565b61114a6111436116a7565b838361225e565b5050565b61115d878787878787876123ca565b600060138190555050505050505050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08611198816114b3565b6111a06124c1565b50565b6111b46111ae6116a7565b83611772565b6111f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ea906140a2565b60405180910390fd5b6111ff8484848461250e565b50505050565b6060600d6112123061256a565b61121b8461286f565b60405160200161122d939291906144af565b6040516020818303038152906040529050919050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0861126d816114b3565b6112768261293d565b5050565b600f805461128790613edb565b80601f01602080910402602001604051908101604052809291908181526020018280546112b390613edb565b80156113005780601f106112d557610100808354040283529160200191611300565b820191906000526020600020905b8154815290600101906020018083116112e357829003601f168201915b505050505081565b61131182610935565b61131a816114b3565b6113248383611e57565b505050565b600e805461133690613edb565b80601f016020809104026020016040519081016040528092919081815260200182805461136290613edb565b80156113af5780601f10611384576101008083540402835291602001916113af565b820191906000526020600020905b81548152906001019060200180831161139257829003601f168201915b505050505081565b60006cadc04c56bf30ac9d3c0aaf14dc73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611402576001905061140f565b61140c8383612950565b90505b92915050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806114ac57506114ab826129e4565b5b9050919050565b6114c4816114bf6116a7565b612a5e565b50565b6114cf611768565b6bffffffffffffffffffffffff16816bffffffffffffffffffffffff16111561152d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115249061455d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361159c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611593906145c9565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff16815250600860008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055509050505050565b61166581612ae3565b6116a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169b906142dd565b60405180910390fd5b50565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661172283610d35565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612710905090565b60008061177e83610d35565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806117c057506117bf81856113b7565b5b806117fe57508373ffffffffffffffffffffffffffffffffffffffff166117e684610769565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff1661182782610d35565b73ffffffffffffffffffffffffffffffffffffffff161461187d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118749061465b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036118ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e3906146ed565b60405180910390fd5b6118f98383836001612b24565b8273ffffffffffffffffffffffffffffffffffffffff1661191982610d35565b73ffffffffffffffffffffffffffffffffffffffff161461196f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119669061465b565b60405180910390fd5b6004600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611afb8383836001612b2a565b505050565b600260125403611b45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3c90614759565b60405180910390fd5b6002601281905550565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611bbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb5906147c5565b60405180910390fd5b611bc781612ae3565b15611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90614831565b60405180910390fd5b611c15600083836001612b24565b611c1e81612ae3565b15611c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5590614831565b60405180910390fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611d68600083836001612b2a565b5050565b6001601281905550565b611d808282610ffd565b611e53576001600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611df86116a7565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b611e618282610ffd565b15611f35576000600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611eda6116a7565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b611f41611768565b6bffffffffffffffffffffffff16816bffffffffffffffffffffffff161115611f9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f969061455d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361200e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120059061489d565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff168152506009600085815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550905050505050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b606060ff60001b831461213a5761213383612b30565b90506121c7565b81805461214690613edb565b80601f016020809104026020016040519081016040528092919081815260200182805461217290613edb565b80156121bf5780601f10612194576101008083540402835291602001916121bf565b820191906000526020600020905b8154815290600101906020018083116121a257829003601f168201915b505050505090505b92915050565b60096000828152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a8154906bffffffffffffffffffffffff0219169055505050565b8060405160200161223d9190614909565b604051602081830303815290604052600e908161225a9190614ac2565b5050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036122cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c390614be0565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516123bd919061338e565b60405180910390a3505050565b601060009054906101000a900460ff161561241a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241190614c72565b60405180910390fd5b6001601060006101000a81548160ff02191690831515021790555085600b90816124449190614ac2565b5084600c90816124549190614ac2565b5082600d90816124649190614ac2565b506124726000801b88611d76565b61249c7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0888611d76565b6124a58461222c565b6124ae8261293d565b6124b887826114c7565b50505050505050565b6008600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a8154906bffffffffffffffffffffffff02191690555050565b612519848484611807565b61252584848484612ba4565b612564576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255b90614d04565b60405180910390fd5b50505050565b606060008273ffffffffffffffffffffffffffffffffffffffff1660001b905060006040518060400160405280601081526020017f303132333435363738396162636465660000000000000000000000000000000081525090506000602a67ffffffffffffffff8111156125e1576125e0613a3a565b5b6040519080825280601f01601f1916602001820160405280156126135781602001600182028036833780820191505090505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061264b5761264a614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106126af576126ae614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b60148110156128635782600485600c846126fb9190614d53565b6020811061270c5761270b614d24565b5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60f81c60ff168151811061274b5761274a614d24565b5b602001015160f81c60f81b8260028361276491906140f1565b60026127709190614d53565b8151811061278157612780614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535082600f60f81b85600c846127c49190614d53565b602081106127d5576127d4614d24565b5b1a60f81b1660f81c60ff16815181106127f1576127f0614d24565b5b602001015160f81c60f81b8260028361280a91906140f1565b60036128169190614d53565b8151811061282757612826614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806001019150506126e1565b50809350505050919050565b60606000600161287e84612d2b565b01905060008167ffffffffffffffff81111561289d5761289c613a3a565b5b6040519080825280601f01601f1916602001820160405280156128cf5781602001600182028036833780820191505090505b509050600082602001820190505b600115612932578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161292657612925614133565b5b049450600085036128dd575b819350505050919050565b80600f908161294c9190614ac2565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612a575750612a5682612e7e565b5b9050919050565b612a688282610ffd565b612adf57612a7581612f60565b612a838360001c6020612f8d565b604051602001612a94929190614e1f565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ad6919061351b565b60405180910390fd5b5050565b60008073ffffffffffffffffffffffffffffffffffffffff16612b05836120e0565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b50505050565b50505050565b60606000612b3d836131c9565b90506000602067ffffffffffffffff811115612b5c57612b5b613a3a565b5b6040519080825280601f01601f191660200182016040528015612b8e5781602001600182028036833780820191505090505b5090508181528360208201528092505050919050565b6000612bc58473ffffffffffffffffffffffffffffffffffffffff16613219565b15612d1e578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612bee6116a7565b8786866040518563ffffffff1660e01b8152600401612c109493929190614eae565b6020604051808303816000875af1925050508015612c4c57506040513d601f19601f82011682018060405250810190612c499190614f0f565b60015b612cce573d8060008114612c7c576040519150601f19603f3d011682016040523d82523d6000602084013e612c81565b606091505b506000815103612cc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cbd90614d04565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612d23565b600190505b949350505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612d89577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381612d7f57612d7e614133565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310612dc6576d04ee2d6d415b85acef81000000008381612dbc57612dbb614133565b5b0492506020810190505b662386f26fc100008310612df557662386f26fc100008381612deb57612dea614133565b5b0492506010810190505b6305f5e1008310612e1e576305f5e1008381612e1457612e13614133565b5b0492506008810190505b6127108310612e43576127108381612e3957612e38614133565b5b0492506004810190505b60648310612e665760648381612e5c57612e5b614133565b5b0492506002810190505b600a8310612e75576001810190505b80915050919050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612f4957507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80612f595750612f588261323c565b5b9050919050565b6060612f868273ffffffffffffffffffffffffffffffffffffffff16601460ff16612f8d565b9050919050565b606060006002836002612fa091906140f1565b612faa9190614d53565b67ffffffffffffffff811115612fc357612fc2613a3a565b5b6040519080825280601f01601f191660200182016040528015612ff55781602001600182028036833780820191505090505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061302d5761302c614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061309157613090614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600060018460026130d191906140f1565b6130db9190614d53565b90505b600181111561317b577f3031323334353637383961626364656600000000000000000000000000000000600f86166010811061311d5761311c614d24565b5b1a60f81b82828151811061313457613133614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061317490614f3c565b90506130de565b50600084146131bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131b690614fb1565b60405180910390fd5b8091505092915050565b60008060ff8360001c169050601f811115613210576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80915050919050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6000819050919050565b6132b9816132a6565b82525050565b60006020820190506132d460008301846132b0565b92915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613323816132ee565b811461332e57600080fd5b50565b6000813590506133408161331a565b92915050565b60006020828403121561335c5761335b6132e4565b5b600061336a84828501613331565b91505092915050565b60008115159050919050565b61338881613373565b82525050565b60006020820190506133a3600083018461337f565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006133d4826133a9565b9050919050565b6133e4816133c9565b81146133ef57600080fd5b50565b600081359050613401816133db565b92915050565b60006bffffffffffffffffffffffff82169050919050565b61342881613407565b811461343357600080fd5b50565b6000813590506134458161341f565b92915050565b60008060408385031215613462576134616132e4565b5b6000613470858286016133f2565b925050602061348185828601613436565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b838110156134c55780820151818401526020810190506134aa565b60008484015250505050565b6000601f19601f8301169050919050565b60006134ed8261348b565b6134f78185613496565b93506135078185602086016134a7565b613510816134d1565b840191505092915050565b6000602082019050818103600083015261353581846134e2565b905092915050565b613546816132a6565b811461355157600080fd5b50565b6000813590506135638161353d565b92915050565b60006020828403121561357f5761357e6132e4565b5b600061358d84828501613554565b91505092915050565b61359f816133c9565b82525050565b60006020820190506135ba6000830184613596565b92915050565b600080604083850312156135d7576135d66132e4565b5b60006135e5858286016133f2565b92505060206135f685828601613554565b9150509250929050565b61360981613407565b82525050565b60006020820190506136246000830184613600565b92915050565b600080600060608486031215613643576136426132e4565b5b6000613651868287016133f2565b9350506020613662868287016133f2565b925050604061367386828701613554565b9150509250925092565b6000819050919050565b6136908161367d565b811461369b57600080fd5b50565b6000813590506136ad81613687565b92915050565b6000602082840312156136c9576136c86132e4565b5b60006136d78482850161369e565b91505092915050565b6136e98161367d565b82525050565b600060208201905061370460008301846136e0565b92915050565b600067ffffffffffffffff82169050919050565b6137278161370a565b811461373257600080fd5b50565b6000813590506137448161371e565b92915050565b60008060408385031215613761576137606132e4565b5b600061376f858286016133f2565b925050602061378085828601613735565b9150509250929050565b600080604083850312156137a1576137a06132e4565b5b60006137af85828601613554565b92505060206137c085828601613554565b9150509250929050565b60006040820190506137df6000830185613596565b6137ec60208301846132b0565b9392505050565b6000806040838503121561380a576138096132e4565b5b60006138188582860161369e565b9250506020613829858286016133f2565b9150509250929050565b60008060006060848603121561384c5761384b6132e4565b5b600061385a86828701613554565b935050602061386b868287016133f2565b925050604061387c86828701613436565b9150509250925092565b60006020828403121561389c5761389b6132e4565b5b60006138aa848285016133f2565b91505092915050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b6138e8816138b3565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613923816132a6565b82525050565b6000613935838361391a565b60208301905092915050565b6000602082019050919050565b6000613959826138ee565b61396381856138f9565b935061396e8361390a565b8060005b8381101561399f5781516139868882613929565b975061399183613941565b925050600181019050613972565b5085935050505092915050565b600060e0820190506139c1600083018a6138df565b81810360208301526139d381896134e2565b905081810360408301526139e781886134e2565b90506139f660608301876132b0565b613a036080830186613596565b613a1060a08301856136e0565b81810360c0830152613a22818461394e565b905098975050505050505050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613a72826134d1565b810181811067ffffffffffffffff82111715613a9157613a90613a3a565b5b80604052505050565b6000613aa46132da565b9050613ab08282613a69565b919050565b600067ffffffffffffffff821115613ad057613acf613a3a565b5b613ad9826134d1565b9050602081019050919050565b82818337600083830152505050565b6000613b08613b0384613ab5565b613a9a565b905082815260208101848484011115613b2457613b23613a35565b5b613b2f848285613ae6565b509392505050565b600082601f830112613b4c57613b4b613a30565b5b8135613b5c848260208601613af5565b91505092915050565b600060208284031215613b7b57613b7a6132e4565b5b600082013567ffffffffffffffff811115613b9957613b986132e9565b5b613ba584828501613b37565b91505092915050565b613bb781613373565b8114613bc257600080fd5b50565b600081359050613bd481613bae565b92915050565b60008060408385031215613bf157613bf06132e4565b5b6000613bff858286016133f2565b9250506020613c1085828601613bc5565b9150509250929050565b600080600080600080600060e0888a031215613c3957613c386132e4565b5b6000613c478a828b016133f2565b975050602088013567ffffffffffffffff811115613c6857613c676132e9565b5b613c748a828b01613b37565b965050604088013567ffffffffffffffff811115613c9557613c946132e9565b5b613ca18a828b01613b37565b955050606088013567ffffffffffffffff811115613cc257613cc16132e9565b5b613cce8a828b01613b37565b945050608088013567ffffffffffffffff811115613cef57613cee6132e9565b5b613cfb8a828b01613b37565b93505060a088013567ffffffffffffffff811115613d1c57613d1b6132e9565b5b613d288a828b01613b37565b92505060c0613d398a828b01613436565b91505092959891949750929550565b600067ffffffffffffffff821115613d6357613d62613a3a565b5b613d6c826134d1565b9050602081019050919050565b6000613d8c613d8784613d48565b613a9a565b905082815260208101848484011115613da857613da7613a35565b5b613db3848285613ae6565b509392505050565b600082601f830112613dd057613dcf613a30565b5b8135613de0848260208601613d79565b91505092915050565b60008060008060808587031215613e0357613e026132e4565b5b6000613e11878288016133f2565b9450506020613e22878288016133f2565b9350506040613e3387828801613554565b925050606085013567ffffffffffffffff811115613e5457613e536132e9565b5b613e6087828801613dbb565b91505092959194509250565b60008060408385031215613e8357613e826132e4565b5b6000613e91858286016133f2565b9250506020613ea2858286016133f2565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680613ef357607f821691505b602082108103613f0657613f05613eac565b5b50919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000613f68602183613496565b9150613f7382613f0c565b604082019050919050565b60006020820190508181036000830152613f9781613f5b565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015250565b6000613ffa603d83613496565b915061400582613f9e565b604082019050919050565b6000602082019050818103600083015261402981613fed565b9050919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b600061408c602d83613496565b915061409782614030565b604082019050919050565b600060208201905081810360008301526140bb8161407f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006140fc826132a6565b9150614107836132a6565b9250828202614115816132a6565b9150828204841483151761412c5761412b6140c2565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061416d826132a6565b9150614178836132a6565b92508261418857614187614133565b5b828204905092915050565b7f416464726573732063616e6e6f74206265207a65726f00000000000000000000600082015250565b60006141c9601683613496565b91506141d482614193565b602082019050919050565b600060208201905081810360008301526141f8816141bc565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b600061425b602f83613496565b9150614266826141ff565b604082019050919050565b6000602082019050818103600083015261428a8161424e565b9050919050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b60006142c7601883613496565b91506142d282614291565b602082019050919050565b600060208201905081810360008301526142f6816142ba565b9050919050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b6000614359602983613496565b9150614364826142fd565b604082019050919050565b600060208201905081810360008301526143888161434c565b9050919050565b600081905092915050565b60008190508160005260206000209050919050565b600081546143bc81613edb565b6143c6818661438f565b945060018216600081146143e157600181146143f657614429565b60ff1983168652811515820286019350614429565b6143ff8561439a565b60005b8381101561442157815481890152600182019150602081019050614402565b838801955050505b50505092915050565b600061443d8261348b565b614447818561438f565b93506144578185602086016134a7565b80840191505092915050565b7f2f00000000000000000000000000000000000000000000000000000000000000600082015250565b600061449960018361438f565b91506144a482614463565b600182019050919050565b60006144bb82866143af565b91506144c78285614432565b91506144d28261448c565b91506144de8284614432565b9150819050949350505050565b7f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201527f2073616c65507269636500000000000000000000000000000000000000000000602082015250565b6000614547602a83613496565b9150614552826144eb565b604082019050919050565b600060208201905081810360008301526145768161453a565b9050919050565b7f455243323938313a20696e76616c696420726563656976657200000000000000600082015250565b60006145b3601983613496565b91506145be8261457d565b602082019050919050565b600060208201905081810360008301526145e2816145a6565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b6000614645602583613496565b9150614650826145e9565b604082019050919050565b6000602082019050818103600083015261467481614638565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006146d7602483613496565b91506146e28261467b565b604082019050919050565b60006020820190508181036000830152614706816146ca565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000614743601f83613496565b915061474e8261470d565b602082019050919050565b6000602082019050818103600083015261477281614736565b9050919050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006147af602083613496565b91506147ba82614779565b602082019050919050565b600060208201905081810360008301526147de816147a2565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b600061481b601c83613496565b9150614826826147e5565b602082019050919050565b6000602082019050818103600083015261484a8161480e565b9050919050565b7f455243323938313a20496e76616c696420706172616d65746572730000000000600082015250565b6000614887601b83613496565b915061489282614851565b602082019050919050565b600060208201905081810360008301526148b68161487a565b9050919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c0000000000600082015250565b60006148f3601b8361438f565b91506148fe826148bd565b601b82019050919050565b6000614914826148e6565b91506149208284614432565b915081905092915050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026149787fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261493b565b614982868361493b565b95508019841693508086168417925050509392505050565b6000819050919050565b60006149bf6149ba6149b5846132a6565b61499a565b6132a6565b9050919050565b6000819050919050565b6149d9836149a4565b6149ed6149e5826149c6565b848454614948565b825550505050565b600090565b614a026149f5565b614a0d8184846149d0565b505050565b5b81811015614a3157614a266000826149fa565b600181019050614a13565b5050565b601f821115614a7657614a478161439a565b614a508461492b565b81016020851015614a5f578190505b614a73614a6b8561492b565b830182614a12565b50505b505050565b600082821c905092915050565b6000614a9960001984600802614a7b565b1980831691505092915050565b6000614ab28383614a88565b9150826002028217905092915050565b614acb8261348b565b67ffffffffffffffff811115614ae457614ae3613a3a565b5b614aee8254613edb565b614af9828285614a35565b600060209050601f831160018114614b2c5760008415614b1a578287015190505b614b248582614aa6565b865550614b8c565b601f198416614b3a8661439a565b60005b82811015614b6257848901518255600182019150602085019450602081019050614b3d565b86831015614b7f5784890151614b7b601f891682614a88565b8355505b6001600288020188555050505b505050505050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b6000614bca601983613496565b9150614bd582614b94565b602082019050919050565b60006020820190508181036000830152614bf981614bbd565b9050919050565b7f436f6e74726163742068617320616c7265616479206265656e20696e6974696160008201527f6c697a6564000000000000000000000000000000000000000000000000000000602082015250565b6000614c5c602583613496565b9150614c6782614c00565b604082019050919050565b60006020820190508181036000830152614c8b81614c4f565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b6000614cee603283613496565b9150614cf982614c92565b604082019050919050565b60006020820190508181036000830152614d1d81614ce1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000614d5e826132a6565b9150614d69836132a6565b9250828201905080821115614d8157614d806140c2565b5b92915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000614dbd60178361438f565b9150614dc882614d87565b601782019050919050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000614e0960118361438f565b9150614e1482614dd3565b601182019050919050565b6000614e2a82614db0565b9150614e368285614432565b9150614e4182614dfc565b9150614e4d8284614432565b91508190509392505050565b600081519050919050565b600082825260208201905092915050565b6000614e8082614e59565b614e8a8185614e64565b9350614e9a8185602086016134a7565b614ea3816134d1565b840191505092915050565b6000608082019050614ec36000830187613596565b614ed06020830186613596565b614edd60408301856132b0565b8181036060830152614eef8184614e75565b905095945050505050565b600081519050614f098161331a565b92915050565b600060208284031215614f2557614f246132e4565b5b6000614f3384828501614efa565b91505092915050565b6000614f47826132a6565b915060008203614f5a57614f596140c2565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000614f9b602083613496565b9150614fa682614f65565b602082019050919050565b60006020820190508181036000830152614fca81614f8e565b905091905056fea2646970667358221220a9c868121859e41ead934a8f162a9af81cae585136a4eae717e7d176cdbbfbe864736f6c63430008160033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101b65760003560e01c80629a9b7b146101bb57806301ffc9a7146101d957806304634d8d1461020957806306fdde0314610225578063081812fc14610243578063095ea7b314610273578063180b0d7e1461028f57806323b872dd146102ad578063248a9ca3146102c9578063251d8af1146102f95780632a55205a146103155780632f2ff15d1461034657806336568abe1461036257806342842e0e1461037e57806354fd4d501461039a5780635944c753146103b85780636352211e146103d45780636a627842146104045780636cee56ee1461042057806370a082311461043e57806384b0196e1461046e5780638a616bc01461049257806391d14854146104ae578063938e3d7b146104de57806395d89b41146104fa578063a217fddf14610518578063a22cb46514610536578063a7c65b2814610552578063aa1b103f1461056e578063b88d4fde14610578578063c87b56dd14610594578063ca59b2cd146105c4578063d20a6f3d146105e0578063d547741f146105fe578063e8a3d4851461061a578063e985e9c514610638578063ec87621c14610668575b600080fd5b6101c3610686565b6040516101d091906132bf565b60405180910390f35b6101f360048036038101906101ee9190613346565b61068c565b604051610200919061338e565b60405180910390f35b610223600480360381019061021e919061344b565b61069e565b005b61022d6106d7565b60405161023a919061351b565b60405180910390f35b61025d60048036038101906102589190613569565b610769565b60405161026a91906135a5565b60405180910390f35b61028d600480360381019061028891906135c0565b6107af565b005b6102976108c6565b6040516102a4919061360f565b60405180910390f35b6102c760048036038101906102c2919061362a565b6108d5565b005b6102e360048036038101906102de91906136b3565b610935565b6040516102f091906136ef565b60405180910390f35b610313600480360381019061030e919061374a565b610955565b005b61032f600480360381019061032a919061378a565b6109d4565b60405161033d9291906137ca565b60405180910390f35b610360600480360381019061035b91906137f3565b610bbe565b005b61037c600480360381019061037791906137f3565b610c4e565b005b6103986004803603810190610393919061362a565b610cd1565b005b6103a2610cf1565b6040516103af91906132bf565b60405180910390f35b6103d260048036038101906103cd9190613833565b610cfa565b005b6103ee60048036038101906103e99190613569565b610d35565b6040516103fb91906135a5565b60405180910390f35b61041e60048036038101906104199190613886565b610dbb565b005b610428610dfa565b604051610435919061338e565b60405180910390f35b61045860048036038101906104539190613886565b610e0d565b60405161046591906132bf565b60405180910390f35b610476610ec4565b60405161048997969594939291906139ac565b60405180910390f35b6104ac60048036038101906104a79190613569565b610fc6565b005b6104c860048036038101906104c391906137f3565b610ffd565b6040516104d5919061338e565b60405180910390f35b6104f860048036038101906104f39190613b65565b611068565b005b61050261109f565b60405161050f919061351b565b60405180910390f35b610520611131565b60405161052d91906136ef565b60405180910390f35b610550600480360381019061054b9190613bda565b611138565b005b61056c60048036038101906105679190613c1a565b61114e565b005b61057661116e565b005b610592600480360381019061058d9190613de9565b6111a3565b005b6105ae60048036038101906105a99190613569565b611205565b6040516105bb919061351b565b60405180910390f35b6105de60048036038101906105d99190613b65565b611243565b005b6105e861127a565b6040516105f5919061351b565b60405180910390f35b610618600480360381019061061391906137f3565b611308565b005b610622611329565b60405161062f919061351b565b60405180910390f35b610652600480360381019061064d9190613e6c565b6113b7565b60405161065f919061338e565b60405180910390f35b610670611415565b60405161067d91906136ef565b60405180910390f35b60135481565b600061069782611439565b9050919050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086106c8816114b3565b6106d283836114c7565b505050565b6060600b80546106e690613edb565b80601f016020809104026020016040519081016040528092919081815260200182805461071290613edb565b801561075f5780601f106107345761010080835404028352916020019161075f565b820191906000526020600020905b81548152906001019060200180831161074257829003601f168201915b5050505050905090565b60006107748261165c565b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006107ba82610d35565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361082a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082190613f7e565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166108496116a7565b73ffffffffffffffffffffffffffffffffffffffff1614806108785750610877816108726116a7565b6113b7565b5b6108b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ae90614010565b60405180910390fd5b6108c183836116af565b505050565b60006108d0611768565b905090565b6108e66108e06116a7565b82611772565b610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c906140a2565b60405180910390fd5b610930838383611807565b505050565b6000600a6000838152602001908152602001600020600101549050919050565b61095d611b00565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610987816114b3565b60005b8267ffffffffffffffff168110156109c6576109a884601354611b4f565b6001601360008282540192505081905550808060010191505061098a565b50506109d0611d6c565b5050565b6000806000600960008681526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1603610b695760086040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b6000610b73611768565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff1686610b9f91906140f1565b610ba99190614162565b90508160000151819350935050509250929050565b610bc782610935565b610bd0816114b3565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610c3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c36906141df565b60405180910390fd5b610c498383611d76565b505050565b610c566116a7565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610cc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cba90614271565b60405180910390fd5b610ccd8282611e57565b5050565b610cec838383604051806020016040528060008152506111a3565b505050565b60006001905090565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610d24816114b3565b610d2f848484611f39565b50505050565b600080610d41836120e0565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610db2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da9906142dd565b60405180910390fd5b80915050919050565b610dc3611b00565b6000801b610dd0816114b3565b610ddc82601354611b4f565b60136000815480929190600101919050555050610df7611d6c565b50565b601060009054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e749061436f565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600060608060008060006060610f0460067f4463656e7472616c4e46542d566f75636865720000000000000000000000001361211d90919063ffffffff16565b610f3860077f310000000000000000000000000000000000000000000000000000000000000161211d90919063ffffffff16565b46306000801b600067ffffffffffffffff811115610f5957610f58613a3a565b5b604051908082528060200260200182016040528015610f875781602001602082028036833780820191505090505b507f0f00000000000000000000000000000000000000000000000000000000000000959493929190965096509650965096509650965090919293949596565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08610ff0816114b3565b610ff9826121cd565b5050565b6000600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08611092816114b3565b61109b8261222c565b5050565b6060600c80546110ae90613edb565b80601f01602080910402602001604051908101604052809291908181526020018280546110da90613edb565b80156111275780601f106110fc57610100808354040283529160200191611127565b820191906000526020600020905b81548152906001019060200180831161110a57829003601f168201915b5050505050905090565b6000801b81565b61114a6111436116a7565b838361225e565b5050565b61115d878787878787876123ca565b600060138190555050505050505050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08611198816114b3565b6111a06124c1565b50565b6111b46111ae6116a7565b83611772565b6111f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ea906140a2565b60405180910390fd5b6111ff8484848461250e565b50505050565b6060600d6112123061256a565b61121b8461286f565b60405160200161122d939291906144af565b6040516020818303038152906040529050919050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0861126d816114b3565b6112768261293d565b5050565b600f805461128790613edb565b80601f01602080910402602001604051908101604052809291908181526020018280546112b390613edb565b80156113005780601f106112d557610100808354040283529160200191611300565b820191906000526020600020905b8154815290600101906020018083116112e357829003601f168201915b505050505081565b61131182610935565b61131a816114b3565b6113248383611e57565b505050565b600e805461133690613edb565b80601f016020809104026020016040519081016040528092919081815260200182805461136290613edb565b80156113af5780601f10611384576101008083540402835291602001916113af565b820191906000526020600020905b81548152906001019060200180831161139257829003601f168201915b505050505081565b60006cadc04c56bf30ac9d3c0aaf14dc73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611402576001905061140f565b61140c8383612950565b90505b92915050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806114ac57506114ab826129e4565b5b9050919050565b6114c4816114bf6116a7565b612a5e565b50565b6114cf611768565b6bffffffffffffffffffffffff16816bffffffffffffffffffffffff16111561152d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115249061455d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361159c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611593906145c9565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff16815250600860008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055509050505050565b61166581612ae3565b6116a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169b906142dd565b60405180910390fd5b50565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661172283610d35565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612710905090565b60008061177e83610d35565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806117c057506117bf81856113b7565b5b806117fe57508373ffffffffffffffffffffffffffffffffffffffff166117e684610769565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff1661182782610d35565b73ffffffffffffffffffffffffffffffffffffffff161461187d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118749061465b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036118ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e3906146ed565b60405180910390fd5b6118f98383836001612b24565b8273ffffffffffffffffffffffffffffffffffffffff1661191982610d35565b73ffffffffffffffffffffffffffffffffffffffff161461196f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119669061465b565b60405180910390fd5b6004600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611afb8383836001612b2a565b505050565b600260125403611b45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3c90614759565b60405180910390fd5b6002601281905550565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611bbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb5906147c5565b60405180910390fd5b611bc781612ae3565b15611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90614831565b60405180910390fd5b611c15600083836001612b24565b611c1e81612ae3565b15611c5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5590614831565b60405180910390fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611d68600083836001612b2a565b5050565b6001601281905550565b611d808282610ffd565b611e53576001600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611df86116a7565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b611e618282610ffd565b15611f35576000600a600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611eda6116a7565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b611f41611768565b6bffffffffffffffffffffffff16816bffffffffffffffffffffffff161115611f9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f969061455d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361200e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120059061489d565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff168152506009600085815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550905050505050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b606060ff60001b831461213a5761213383612b30565b90506121c7565b81805461214690613edb565b80601f016020809104026020016040519081016040528092919081815260200182805461217290613edb565b80156121bf5780601f10612194576101008083540402835291602001916121bf565b820191906000526020600020905b8154815290600101906020018083116121a257829003601f168201915b505050505090505b92915050565b60096000828152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a8154906bffffffffffffffffffffffff0219169055505050565b8060405160200161223d9190614909565b604051602081830303815290604052600e908161225a9190614ac2565b5050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036122cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c390614be0565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516123bd919061338e565b60405180910390a3505050565b601060009054906101000a900460ff161561241a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241190614c72565b60405180910390fd5b6001601060006101000a81548160ff02191690831515021790555085600b90816124449190614ac2565b5084600c90816124549190614ac2565b5082600d90816124649190614ac2565b506124726000801b88611d76565b61249c7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0888611d76565b6124a58461222c565b6124ae8261293d565b6124b887826114c7565b50505050505050565b6008600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556000820160146101000a8154906bffffffffffffffffffffffff02191690555050565b612519848484611807565b61252584848484612ba4565b612564576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255b90614d04565b60405180910390fd5b50505050565b606060008273ffffffffffffffffffffffffffffffffffffffff1660001b905060006040518060400160405280601081526020017f303132333435363738396162636465660000000000000000000000000000000081525090506000602a67ffffffffffffffff8111156125e1576125e0613a3a565b5b6040519080825280601f01601f1916602001820160405280156126135781602001600182028036833780820191505090505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061264b5761264a614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106126af576126ae614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b60148110156128635782600485600c846126fb9190614d53565b6020811061270c5761270b614d24565b5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60f81c60ff168151811061274b5761274a614d24565b5b602001015160f81c60f81b8260028361276491906140f1565b60026127709190614d53565b8151811061278157612780614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535082600f60f81b85600c846127c49190614d53565b602081106127d5576127d4614d24565b5b1a60f81b1660f81c60ff16815181106127f1576127f0614d24565b5b602001015160f81c60f81b8260028361280a91906140f1565b60036128169190614d53565b8151811061282757612826614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806001019150506126e1565b50809350505050919050565b60606000600161287e84612d2b565b01905060008167ffffffffffffffff81111561289d5761289c613a3a565b5b6040519080825280601f01601f1916602001820160405280156128cf5781602001600182028036833780820191505090505b509050600082602001820190505b600115612932578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161292657612925614133565b5b049450600085036128dd575b819350505050919050565b80600f908161294c9190614ac2565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612a575750612a5682612e7e565b5b9050919050565b612a688282610ffd565b612adf57612a7581612f60565b612a838360001c6020612f8d565b604051602001612a94929190614e1f565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ad6919061351b565b60405180910390fd5b5050565b60008073ffffffffffffffffffffffffffffffffffffffff16612b05836120e0565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b50505050565b50505050565b60606000612b3d836131c9565b90506000602067ffffffffffffffff811115612b5c57612b5b613a3a565b5b6040519080825280601f01601f191660200182016040528015612b8e5781602001600182028036833780820191505090505b5090508181528360208201528092505050919050565b6000612bc58473ffffffffffffffffffffffffffffffffffffffff16613219565b15612d1e578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612bee6116a7565b8786866040518563ffffffff1660e01b8152600401612c109493929190614eae565b6020604051808303816000875af1925050508015612c4c57506040513d601f19601f82011682018060405250810190612c499190614f0f565b60015b612cce573d8060008114612c7c576040519150601f19603f3d011682016040523d82523d6000602084013e612c81565b606091505b506000815103612cc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cbd90614d04565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612d23565b600190505b949350505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612d89577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381612d7f57612d7e614133565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310612dc6576d04ee2d6d415b85acef81000000008381612dbc57612dbb614133565b5b0492506020810190505b662386f26fc100008310612df557662386f26fc100008381612deb57612dea614133565b5b0492506010810190505b6305f5e1008310612e1e576305f5e1008381612e1457612e13614133565b5b0492506008810190505b6127108310612e43576127108381612e3957612e38614133565b5b0492506004810190505b60648310612e665760648381612e5c57612e5b614133565b5b0492506002810190505b600a8310612e75576001810190505b80915050919050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480612f4957507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80612f595750612f588261323c565b5b9050919050565b6060612f868273ffffffffffffffffffffffffffffffffffffffff16601460ff16612f8d565b9050919050565b606060006002836002612fa091906140f1565b612faa9190614d53565b67ffffffffffffffff811115612fc357612fc2613a3a565b5b6040519080825280601f01601f191660200182016040528015612ff55781602001600182028036833780820191505090505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061302d5761302c614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061309157613090614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600060018460026130d191906140f1565b6130db9190614d53565b90505b600181111561317b577f3031323334353637383961626364656600000000000000000000000000000000600f86166010811061311d5761311c614d24565b5b1a60f81b82828151811061313457613133614d24565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061317490614f3c565b90506130de565b50600084146131bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131b690614fb1565b60405180910390fd5b8091505092915050565b60008060ff8360001c169050601f811115613210576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80915050919050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6000819050919050565b6132b9816132a6565b82525050565b60006020820190506132d460008301846132b0565b92915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613323816132ee565b811461332e57600080fd5b50565b6000813590506133408161331a565b92915050565b60006020828403121561335c5761335b6132e4565b5b600061336a84828501613331565b91505092915050565b60008115159050919050565b61338881613373565b82525050565b60006020820190506133a3600083018461337f565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006133d4826133a9565b9050919050565b6133e4816133c9565b81146133ef57600080fd5b50565b600081359050613401816133db565b92915050565b60006bffffffffffffffffffffffff82169050919050565b61342881613407565b811461343357600080fd5b50565b6000813590506134458161341f565b92915050565b60008060408385031215613462576134616132e4565b5b6000613470858286016133f2565b925050602061348185828601613436565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b838110156134c55780820151818401526020810190506134aa565b60008484015250505050565b6000601f19601f8301169050919050565b60006134ed8261348b565b6134f78185613496565b93506135078185602086016134a7565b613510816134d1565b840191505092915050565b6000602082019050818103600083015261353581846134e2565b905092915050565b613546816132a6565b811461355157600080fd5b50565b6000813590506135638161353d565b92915050565b60006020828403121561357f5761357e6132e4565b5b600061358d84828501613554565b91505092915050565b61359f816133c9565b82525050565b60006020820190506135ba6000830184613596565b92915050565b600080604083850312156135d7576135d66132e4565b5b60006135e5858286016133f2565b92505060206135f685828601613554565b9150509250929050565b61360981613407565b82525050565b60006020820190506136246000830184613600565b92915050565b600080600060608486031215613643576136426132e4565b5b6000613651868287016133f2565b9350506020613662868287016133f2565b925050604061367386828701613554565b9150509250925092565b6000819050919050565b6136908161367d565b811461369b57600080fd5b50565b6000813590506136ad81613687565b92915050565b6000602082840312156136c9576136c86132e4565b5b60006136d78482850161369e565b91505092915050565b6136e98161367d565b82525050565b600060208201905061370460008301846136e0565b92915050565b600067ffffffffffffffff82169050919050565b6137278161370a565b811461373257600080fd5b50565b6000813590506137448161371e565b92915050565b60008060408385031215613761576137606132e4565b5b600061376f858286016133f2565b925050602061378085828601613735565b9150509250929050565b600080604083850312156137a1576137a06132e4565b5b60006137af85828601613554565b92505060206137c085828601613554565b9150509250929050565b60006040820190506137df6000830185613596565b6137ec60208301846132b0565b9392505050565b6000806040838503121561380a576138096132e4565b5b60006138188582860161369e565b9250506020613829858286016133f2565b9150509250929050565b60008060006060848603121561384c5761384b6132e4565b5b600061385a86828701613554565b935050602061386b868287016133f2565b925050604061387c86828701613436565b9150509250925092565b60006020828403121561389c5761389b6132e4565b5b60006138aa848285016133f2565b91505092915050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b6138e8816138b3565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613923816132a6565b82525050565b6000613935838361391a565b60208301905092915050565b6000602082019050919050565b6000613959826138ee565b61396381856138f9565b935061396e8361390a565b8060005b8381101561399f5781516139868882613929565b975061399183613941565b925050600181019050613972565b5085935050505092915050565b600060e0820190506139c1600083018a6138df565b81810360208301526139d381896134e2565b905081810360408301526139e781886134e2565b90506139f660608301876132b0565b613a036080830186613596565b613a1060a08301856136e0565b81810360c0830152613a22818461394e565b905098975050505050505050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613a72826134d1565b810181811067ffffffffffffffff82111715613a9157613a90613a3a565b5b80604052505050565b6000613aa46132da565b9050613ab08282613a69565b919050565b600067ffffffffffffffff821115613ad057613acf613a3a565b5b613ad9826134d1565b9050602081019050919050565b82818337600083830152505050565b6000613b08613b0384613ab5565b613a9a565b905082815260208101848484011115613b2457613b23613a35565b5b613b2f848285613ae6565b509392505050565b600082601f830112613b4c57613b4b613a30565b5b8135613b5c848260208601613af5565b91505092915050565b600060208284031215613b7b57613b7a6132e4565b5b600082013567ffffffffffffffff811115613b9957613b986132e9565b5b613ba584828501613b37565b91505092915050565b613bb781613373565b8114613bc257600080fd5b50565b600081359050613bd481613bae565b92915050565b60008060408385031215613bf157613bf06132e4565b5b6000613bff858286016133f2565b9250506020613c1085828601613bc5565b9150509250929050565b600080600080600080600060e0888a031215613c3957613c386132e4565b5b6000613c478a828b016133f2565b975050602088013567ffffffffffffffff811115613c6857613c676132e9565b5b613c748a828b01613b37565b965050604088013567ffffffffffffffff811115613c9557613c946132e9565b5b613ca18a828b01613b37565b955050606088013567ffffffffffffffff811115613cc257613cc16132e9565b5b613cce8a828b01613b37565b945050608088013567ffffffffffffffff811115613cef57613cee6132e9565b5b613cfb8a828b01613b37565b93505060a088013567ffffffffffffffff811115613d1c57613d1b6132e9565b5b613d288a828b01613b37565b92505060c0613d398a828b01613436565b91505092959891949750929550565b600067ffffffffffffffff821115613d6357613d62613a3a565b5b613d6c826134d1565b9050602081019050919050565b6000613d8c613d8784613d48565b613a9a565b905082815260208101848484011115613da857613da7613a35565b5b613db3848285613ae6565b509392505050565b600082601f830112613dd057613dcf613a30565b5b8135613de0848260208601613d79565b91505092915050565b60008060008060808587031215613e0357613e026132e4565b5b6000613e11878288016133f2565b9450506020613e22878288016133f2565b9350506040613e3387828801613554565b925050606085013567ffffffffffffffff811115613e5457613e536132e9565b5b613e6087828801613dbb565b91505092959194509250565b60008060408385031215613e8357613e826132e4565b5b6000613e91858286016133f2565b9250506020613ea2858286016133f2565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680613ef357607f821691505b602082108103613f0657613f05613eac565b5b50919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000613f68602183613496565b9150613f7382613f0c565b604082019050919050565b60006020820190508181036000830152613f9781613f5b565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015250565b6000613ffa603d83613496565b915061400582613f9e565b604082019050919050565b6000602082019050818103600083015261402981613fed565b9050919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b600061408c602d83613496565b915061409782614030565b604082019050919050565b600060208201905081810360008301526140bb8161407f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006140fc826132a6565b9150614107836132a6565b9250828202614115816132a6565b9150828204841483151761412c5761412b6140c2565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061416d826132a6565b9150614178836132a6565b92508261418857614187614133565b5b828204905092915050565b7f416464726573732063616e6e6f74206265207a65726f00000000000000000000600082015250565b60006141c9601683613496565b91506141d482614193565b602082019050919050565b600060208201905081810360008301526141f8816141bc565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b600061425b602f83613496565b9150614266826141ff565b604082019050919050565b6000602082019050818103600083015261428a8161424e565b9050919050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b60006142c7601883613496565b91506142d282614291565b602082019050919050565b600060208201905081810360008301526142f6816142ba565b9050919050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b6000614359602983613496565b9150614364826142fd565b604082019050919050565b600060208201905081810360008301526143888161434c565b9050919050565b600081905092915050565b60008190508160005260206000209050919050565b600081546143bc81613edb565b6143c6818661438f565b945060018216600081146143e157600181146143f657614429565b60ff1983168652811515820286019350614429565b6143ff8561439a565b60005b8381101561442157815481890152600182019150602081019050614402565b838801955050505b50505092915050565b600061443d8261348b565b614447818561438f565b93506144578185602086016134a7565b80840191505092915050565b7f2f00000000000000000000000000000000000000000000000000000000000000600082015250565b600061449960018361438f565b91506144a482614463565b600182019050919050565b60006144bb82866143af565b91506144c78285614432565b91506144d28261448c565b91506144de8284614432565b9150819050949350505050565b7f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201527f2073616c65507269636500000000000000000000000000000000000000000000602082015250565b6000614547602a83613496565b9150614552826144eb565b604082019050919050565b600060208201905081810360008301526145768161453a565b9050919050565b7f455243323938313a20696e76616c696420726563656976657200000000000000600082015250565b60006145b3601983613496565b91506145be8261457d565b602082019050919050565b600060208201905081810360008301526145e2816145a6565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b6000614645602583613496565b9150614650826145e9565b604082019050919050565b6000602082019050818103600083015261467481614638565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006146d7602483613496565b91506146e28261467b565b604082019050919050565b60006020820190508181036000830152614706816146ca565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000614743601f83613496565b915061474e8261470d565b602082019050919050565b6000602082019050818103600083015261477281614736565b9050919050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006147af602083613496565b91506147ba82614779565b602082019050919050565b600060208201905081810360008301526147de816147a2565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b600061481b601c83613496565b9150614826826147e5565b602082019050919050565b6000602082019050818103600083015261484a8161480e565b9050919050565b7f455243323938313a20496e76616c696420706172616d65746572730000000000600082015250565b6000614887601b83613496565b915061489282614851565b602082019050919050565b600060208201905081810360008301526148b68161487a565b9050919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c0000000000600082015250565b60006148f3601b8361438f565b91506148fe826148bd565b601b82019050919050565b6000614914826148e6565b91506149208284614432565b915081905092915050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026149787fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261493b565b614982868361493b565b95508019841693508086168417925050509392505050565b6000819050919050565b60006149bf6149ba6149b5846132a6565b61499a565b6132a6565b9050919050565b6000819050919050565b6149d9836149a4565b6149ed6149e5826149c6565b848454614948565b825550505050565b600090565b614a026149f5565b614a0d8184846149d0565b505050565b5b81811015614a3157614a266000826149fa565b600181019050614a13565b5050565b601f821115614a7657614a478161439a565b614a508461492b565b81016020851015614a5f578190505b614a73614a6b8561492b565b830182614a12565b50505b505050565b600082821c905092915050565b6000614a9960001984600802614a7b565b1980831691505092915050565b6000614ab28383614a88565b9150826002028217905092915050565b614acb8261348b565b67ffffffffffffffff811115614ae457614ae3613a3a565b5b614aee8254613edb565b614af9828285614a35565b600060209050601f831160018114614b2c5760008415614b1a578287015190505b614b248582614aa6565b865550614b8c565b601f198416614b3a8661439a565b60005b82811015614b6257848901518255600182019150602085019450602081019050614b3d565b86831015614b7f5784890151614b7b601f891682614a88565b8355505b6001600288020188555050505b505050505050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b6000614bca601983613496565b9150614bd582614b94565b602082019050919050565b60006020820190508181036000830152614bf981614bbd565b9050919050565b7f436f6e74726163742068617320616c7265616479206265656e20696e6974696160008201527f6c697a6564000000000000000000000000000000000000000000000000000000602082015250565b6000614c5c602583613496565b9150614c6782614c00565b604082019050919050565b60006020820190508181036000830152614c8b81614c4f565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b6000614cee603283613496565b9150614cf982614c92565b604082019050919050565b60006020820190508181036000830152614d1d81614ce1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000614d5e826132a6565b9150614d69836132a6565b9250828201905080821115614d8157614d806140c2565b5b92915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000614dbd60178361438f565b9150614dc882614d87565b601782019050919050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000614e0960118361438f565b9150614e1482614dd3565b601182019050919050565b6000614e2a82614db0565b9150614e368285614432565b9150614e4182614dfc565b9150614e4d8284614432565b91508190509392505050565b600081519050919050565b600082825260208201905092915050565b6000614e8082614e59565b614e8a8185614e64565b9350614e9a8185602086016134a7565b614ea3816134d1565b840191505092915050565b6000608082019050614ec36000830187613596565b614ed06020830186613596565b614edd60408301856132b0565b8181036060830152614eef8184614e75565b905095945050505050565b600081519050614f098161331a565b92915050565b600060208284031215614f2557614f246132e4565b5b6000614f3384828501614efa565b91505092915050565b6000614f47826132a6565b915060008203614f5a57614f596140c2565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000614f9b602083613496565b9150614fa682614f65565b602082019050919050565b60006020820190508181036000830152614fca81614f8e565b905091905056fea2646970667358221220a9c868121859e41ead934a8f162a9af81cae585136a4eae717e7d176cdbbfbe864736f6c63430008160033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.