Address Details
contract
token
0xc0D19FdA019122af480eD4E2BdEfFc18Ae80abC1
- Token
- PlastikNFTV3 (PLASTIK)
- Creator
- 0x7f451e–36dc0c at 0x4b129e–417ab5
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 30 Transactions
- Transfers
- 0 Transfers
- Gas Used
- 1,582,839
- Last Balance Update
- 16302765
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- PlastikNFTV3
- Optimization enabled
- false
- Compiler version
- v0.8.9+commit.e5eed63a
- EVM Version
- london
- Verified at
- 2023-01-23T14:38:23.151024Z
contracts/PlastikNFTV3.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./UtilsV2.sol"; import "./PlastikBaseERC721V3.sol"; /// @custom:security-contact [email protected] contract PlastikNFTV3 is PlastikBaseERC721V3, IPlastikArtLazyMint { event PlastikNFTMinted(address mintTo, uint256 tokenId); constructor( IPlastikRoyaltyCal _royaltyCal, PlastikCryptoV2 _plastikCrypto, PlastikRoleV2 _plastikRole, string memory name, string memory symbol ) PlastikBaseERC721V3( _royaltyCal, _plastikCrypto, _plastikRole, name, symbol ) {} function safeLazyMint( address buyer, NFTVoucherV2 calldata voucher, bytes calldata signature ) external payable onlyMinterRoleOrOwner returns (uint256) { require(voucher.tokenAddress == address(this), "The voucher must be for this contract"); // must be compatible with eth_signTypedDataV4 in MetaMask address signer = plastikCrypto.verifyNFTVoucher(voucher, signature); require( signer == voucher.creatorAddress, "Creator Address does not match" ); // mint to signer first to establish on-chain history _safeMint(signer, voucher.tokenId); _setTokenURI(voucher.tokenId, voucher.tokenURI); emit PlastikNFTMinted(signer, voucher.tokenId); royaltyCal.setTokenRoyalty(voucher.tokenId, signer, voucher.royalty); // transfer to the buyer transferFrom(signer, buyer, voucher.tokenId); return voucher.tokenId; } function safeMint(string memory tokenURI, uint256 tokenId, uint96 royaltyFee) onlyMinterRoleOrOwner public returns (uint256) { _safeMint(msg.sender, tokenId); _setTokenURI(tokenId, tokenURI); emit PlastikNFTMinted(msg.sender, tokenId); royaltyCal.setTokenRoyalty(tokenId, msg.sender, royaltyFee); return tokenId; } }
/_openzeppelin/contracts/access/AccessControl.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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: * * ``` * 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}: * * ``` * 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. */ 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(uint160(account), 20), " 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()); } } }
/_openzeppelin/contracts/access/IAccessControl.sol
// 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; }
/_openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
/_openzeppelin/contracts/interfaces/IERC2981.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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); }
/_openzeppelin/contracts/token/ERC721/ERC721.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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 = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = 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); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(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. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
/_openzeppelin/contracts/token/ERC721/IERC721.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
/_openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// 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); }
/_openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/extensions/ERC721Burnable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../../utils/Context.sol"; /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be burned (destroyed). */ abstract contract ERC721Burnable is Context, ERC721 { /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _burn(tokenId); } }
/_openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
/_openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/extensions/ERC721URIStorage.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; /** * @dev ERC721 token with storage based token URI management. */ abstract contract ERC721URIStorage is ERC721 { using Strings for uint256; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory _tokenURI = _tokenURIs[tokenId]; string memory base = _baseURI(); // If there is no base URI, return the token URI. if (bytes(base).length == 0) { return _tokenURI; } // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(base, _tokenURI)); } return super.tokenURI(tokenId); } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual { require(_exists(tokenId), "ERC721URIStorage: URI set of nonexistent token"); _tokenURIs[tokenId] = _tokenURI; } /** * @dev See {ERC721-_burn}. This override additionally checks to see if a * token-specific URI was set for the token, and if so, it deletes the token URI from * the storage mapping. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); if (bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } } }
/_openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
/_openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
// 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); }
/_openzeppelin/contracts/token/common/ERC2981.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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]; } }
/_openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
/_openzeppelin/contracts/utils/Context.sol
// 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; } }
/_openzeppelin/contracts/utils/Strings.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
/_openzeppelin/contracts/utils/cryptography/ECDSA.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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 } 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"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' 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) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ 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 if (signature.length == 64) { bytes32 r; bytes32 vs; // 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)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } 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 (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // 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) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @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) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
/_openzeppelin/contracts/utils/cryptography/draft-EIP712.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.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]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // 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 _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @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) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, 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); } }
/_openzeppelin/contracts/utils/introspection/ERC165.sol
// 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; } }
/_openzeppelin/contracts/utils/introspection/IERC165.sol
// 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); }
/contracts/PlastikBaseERC721V3.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol"; import "./PlastikCryptoV2.sol"; import "./PlastikRoleV2.sol"; import "./UtilsV2.sol"; import "./PlastikRoyaltyCal.sol"; /// @custom:security-contact [email protected] abstract contract PlastikBaseERC721V3 is Ownable, ERC721, ERC721Enumerable, ERC721URIStorage, ERC721Burnable, IERC2981 { string internal __baseURI; IPlastikRoyaltyCal internal royaltyCal; PlastikCryptoV2 internal plastikCrypto; PlastikRoleV2 internal plastikRole; constructor( IPlastikRoyaltyCal _royaltyCal, PlastikCryptoV2 _plastikCrypto, PlastikRoleV2 _plastikRole, string memory name, string memory symbol ) ERC721(name, symbol) { __baseURI = Constants.BASE_URI; royaltyCal = _royaltyCal; plastikCrypto = _plastikCrypto; plastikRole = _plastikRole; } function _baseURI() internal view override returns (string memory) { return __baseURI; } function setBaseURI(string memory baseURI_) public onlyOwner { __baseURI = baseURI_; } modifier onlyMinterRoleOrOwner() { if (_msgSender() != owner()) { plastikRole.verifyMinterRole(_msgSender()); } _; } function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view virtual override returns (address, uint256) { return royaltyCal.royaltyInfo(_tokenId, _salePrice); } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override(ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); } function _burn(uint256 tokenId) internal virtual override(ERC721, ERC721URIStorage) { super._burn(tokenId); royaltyCal.resetTokenRoyalty(tokenId); } function tokenURI(uint256 tokenId) public view virtual override(ERC721, ERC721URIStorage) returns (string memory) { return super.tokenURI(tokenId); } function supportsInterface(bytes4 interfaceId) public view override(ERC721, IERC165, ERC721Enumerable) returns (bool) { return interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IERC721Enumerable).interfaceId || interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } }
/contracts/PlastikCryptoV2.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol"; import "./UtilsV2.sol"; contract PlastikCryptoV2 is Ownable, EIP712 { address priceValidator; constructor(address _priceSigner) EIP712("PLASTIK", "2.0") { priceValidator = _priceSigner; } function setPriceValidator(address newValidator) public onlyOwner returns (bool) { priceValidator = newValidator; return true; } /// @notice Verifies the signature for a given NFTVoucher, returning the address of the signer. /// @dev Will revert if the signature is invalid. Does not verify that the signer is authorized to mint NFTs. /// @param voucher An NFTVoucher describing an unminted NFT. function verifyNFTVoucher( NFTVoucherV2 calldata voucher, bytes memory signature ) public view returns (address) { bytes32 digest = _hashTypedDataV4( keccak256( abi.encode( Constants.NFTVOUCHERV2_TYPEHASH, voucher.tokenAddress, voucher.tokenId, voucher.amount, keccak256(bytes(voucher.tokenURI)), voucher.creatorAddress, voucher.royalty ) ) ); return ECDSA.recover(digest, signature); } function verifyPriceSignature( address sender, PlastikSellPrice calldata item, bytes calldata signature, address ercToken ) public view returns (address) { bytes32 digest = _hashTypedDataV4( keccak256( abi.encode( Constants.PLASTIKSELLPRICEREQUEST_TYPEHASH, item.buyer, item.ratio, item.decimals, item.currency, item.timestamp, item.tokenAddress ) ) ); address sig = ECDSA.recover(digest, signature); require(sig == priceValidator, "Price validator invalid"); require(sender == item.buyer, "Buyer sign price invalid"); require(ercToken == item.tokenAddress, "ercToken invalid"); require( block.timestamp < item.timestamp + 10 minutes, "Price is expired" ); return sig; } function verifySellerSign( SellRequest calldata item, bytes calldata signature ) public view returns (address) { bytes32 digest = _hashTypedDataV4( keccak256( abi.encode( Constants.SELLREQUEST_TYPEHASH, item.tokenAddress, item.tokenId, item.price, item.amount, item.erc20Address, item.ngoFeePct, item.sellerAddress ) ) ); return ECDSA.recover(digest, signature); } function verifySellerSellRequest( address seller, SellRequest calldata sellRequest, address tokenAddress, uint256 tokenId ) public pure { require(seller == sellRequest.sellerAddress, "Invalid seller address"); require( sellRequest.tokenAddress == tokenAddress, "Invalid token address" ); require(sellRequest.tokenId == tokenId, "Invalid token id"); } function verifyPRGVoucher(PRGVoucher calldata voucher, bytes memory signature) public view returns (address) { bytes32 digest = _hashTypedDataV4( keccak256( abi.encode( Constants.PRGVOUCHER_TYPEHASH, voucher.tokenAddress, voucher.tokenId, voucher.amount, keccak256(bytes(voucher.tokenURI)), voucher.creatorAddress ) ) ); return ECDSA.recover(digest, signature); } }
/contracts/PlastikRoleV2.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./UtilsV2.sol"; contract PlastikRoleV2 is AccessControl { constructor() { _grantRole(DEFAULT_ADMIN_ROLE, _msgSender()); _grantRole(Constants.MINTER_ROLE, _msgSender()); } function grantMinterRole(address account) public { grantRole(Constants.MINTER_ROLE, account); } function verifyMinterRole(address account) public view { if (!hasRole(Constants.MINTER_ROLE, account)) { revert("Only minter role can mint"); } } }
/contracts/PlastikRoyaltyCal.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/common/ERC2981.sol"; interface IPlastikRoyaltyCal is IERC2981 { function setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) external; function resetTokenRoyalty(uint256 _tokenId) external; } contract PlastikRoyaltyCal is ERC2981, IPlastikRoyaltyCal { event TokenRoyaltySet(uint256 tokenId, address receiver, uint96 fee); event TokenRoyaltyReset(uint256 tokenId); function setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) public { super._setTokenRoyalty(tokenId, receiver, feeNumerator); emit TokenRoyaltySet(tokenId, receiver, feeNumerator); } function resetTokenRoyalty(uint256 tokenId) public { super._resetTokenRoyalty(tokenId); emit TokenRoyaltyReset(tokenId); } }
/contracts/UtilsV2.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; library Constants { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 constant NFTVOUCHER_TYPEHASH = keccak256( "NFTVoucher(address tokenAddress,uint256 tokenId,string tokenURI,address creatorAddress,uint96 royalty)" ); bytes32 constant NFTVOUCHERV2_TYPEHASH = keccak256( "NFTVoucherV2(address tokenAddress,uint256 tokenId,uint256 amount,string tokenURI,address creatorAddress,uint96 royalty)" ); bytes32 constant PRGVOUCHER_TYPEHASH = keccak256( "PRGVoucher(address tokenAddress,uint256 tokenId,uint256 amount,string tokenURI,address creatorAddress)" ); bytes32 constant SELLREQUEST_TYPEHASH = keccak256( "SellRequest(address tokenAddress,uint256 tokenId,uint256 price,uint256 amount,address erc20Address,uint96 ngoFeePct,address sellerAddress)" ); bytes32 constant PLASTIKSELLPRICEREQUEST_TYPEHASH = keccak256( "PlastikSellPrice(address buyer,uint256 ratio,uint256 decimals,uint96 currency,uint256 timestamp,address tokenAddress)" ); bytes32 constant BIDREQUEST_TYPEHASH = keccak256( "BidRequest(address tokenAddress,uint256 tokenId,address erc20Address,address sellerAddress,address bidderAddress,uint256 biddingPrice)" ); string public constant BASE_URI = "https://plastiks.io/ipfs/"; } /// @notice Represents an un-minted NFT, which has not yet been recorded into the blockchain. A signed voucher can be redeemed for a real NFT using the redeem function. struct NFTVoucher { /// @notice The address of the ERC721 or ERC1155 address tokenAddress; /// @notice The id of the token to be redeemed. Must be unique - if another token with this ID already exists, the redeem function will revert. uint256 tokenId; /// @notice The metadata URI to associate with this token. string tokenURI; /// @notice The address of the original signer of this lazy minting address creatorAddress; /// @notice The royalty percentage for the original creator (offset 2 digits) uint96 royalty; } /// @notice Represents an un-minted NFT, which has not yet been recorded into the blockchain. A signed voucher can be redeemed for a real NFT using the redeem function. struct NFTVoucherV2 { /// @notice The address of the ERC721 or ERC1155 address tokenAddress; /// @notice The id of the token to be redeemed. Must be unique - if another token with this ID already exists, the redeem function will revert. uint256 tokenId; /// @notice The amount of tokens to mint uint256 amount; /// @notice The metadata URI to associate with this token. string tokenURI; /// @notice The address of the original signer of this lazy minting address creatorAddress; /// @notice The royalty percentage for the original creator (offset 2 digits) uint96 royalty; } struct PRGVoucher { /// @notice The address of the ERC721 or ERC1155 address tokenAddress; /// @notice The id of the token to be redeemed. Must be unique - if another token with this ID already exists, the redeem function will revert. uint256 tokenId; /// @notice The amount of tokens to mint uint256 amount; /// @notice The metadata URI to associate with this token. string tokenURI; /// @notice The address of the original signer of this lazy minting address creatorAddress; } struct SellRequest { address tokenAddress; uint256 tokenId; uint256 price; uint256 amount; address erc20Address; uint96 ngoFeePct; address sellerAddress; } struct PlastikSellPrice { address buyer; uint256 ratio; uint256 decimals; uint96 currency; uint256 timestamp; address tokenAddress; } interface IPlastikArtLazyMint { function safeLazyMint( address buyer, NFTVoucherV2 calldata voucher, bytes calldata signature ) external payable returns (uint256); } interface IPlastikRRGLazyMint { function safeLazyMint( address buyer, NFTVoucherV2 calldata voucher, bytes calldata signature ) external payable returns (uint256); } interface IPlastikPRGLazyMint { function safeLazyMint( address buyer, PRGVoucher calldata voucher, bytes calldata signature ) external payable returns (uint256); }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_royaltyCal","internalType":"contract IPlastikRoyaltyCal"},{"type":"address","name":"_plastikCrypto","internalType":"contract PlastikCryptoV2"},{"type":"address","name":"_plastikRole","internalType":"contract PlastikRoleV2"},{"type":"string","name":"name","internalType":"string"},{"type":"string","name":"symbol","internalType":"string"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"approved","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"operator","internalType":"address","indexed":true},{"type":"bool","name":"approved","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"PlastikNFTMinted","inputs":[{"type":"address","name":"mintTo","internalType":"address","indexed":false},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"approve","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getApproved","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}],"name":"royaltyInfo","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"uint256","name":"_salePrice","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"safeLazyMint","inputs":[{"type":"address","name":"buyer","internalType":"address"},{"type":"tuple","name":"voucher","internalType":"struct NFTVoucherV2","components":[{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"string","name":"tokenURI","internalType":"string"},{"type":"address","name":"creatorAddress","internalType":"address"},{"type":"uint96","name":"royalty","internalType":"uint96"}]},{"type":"bytes","name":"signature","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"safeMint","inputs":[{"type":"string","name":"tokenURI","internalType":"string"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"uint96","name":"royaltyFee","internalType":"uint96"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBaseURI","inputs":[{"type":"string","name":"baseURI_","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenByIndex","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenOfOwnerByIndex","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"tokenURI","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x60806040523480156200001157600080fd5b5060405162004ee438038062004ee48339818101604052810190620000379190620005cf565b848484848481816200005e62000052620001b360201b60201c565b620001bb60201b60201c565b8160019080519060200190620000769291906200027f565b5080600290805190602001906200008f9291906200027f565b5050506040518060400160405280601981526020017f68747470733a2f2f706c617374696b732e696f2f697066732f00000000000000815250600c9080519060200190620000df9291906200027f565b5084600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050505050505050620006fa565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8280546200028d90620006c4565b90600052602060002090601f016020900481019282620002b15760008555620002fd565b82601f10620002cc57805160ff1916838001178555620002fd565b82800160010185558215620002fd579182015b82811115620002fc578251825591602001919060010190620002df565b5b5090506200030c919062000310565b5090565b5b808211156200032b57600081600090555060010162000311565b5090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620003708262000343565b9050919050565b6000620003848262000363565b9050919050565b620003968162000377565b8114620003a257600080fd5b50565b600081519050620003b6816200038b565b92915050565b6000620003c98262000363565b9050919050565b620003db81620003bc565b8114620003e757600080fd5b50565b600081519050620003fb81620003d0565b92915050565b60006200040e8262000363565b9050919050565b620004208162000401565b81146200042c57600080fd5b50565b600081519050620004408162000415565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200049b8262000450565b810181811067ffffffffffffffff82111715620004bd57620004bc62000461565b5b80604052505050565b6000620004d26200032f565b9050620004e0828262000490565b919050565b600067ffffffffffffffff82111562000503576200050262000461565b5b6200050e8262000450565b9050602081019050919050565b60005b838110156200053b5780820151818401526020810190506200051e565b838111156200054b576000848401525b50505050565b6000620005686200056284620004e5565b620004c6565b9050828152602081018484840111156200058757620005866200044b565b5b620005948482856200051b565b509392505050565b600082601f830112620005b457620005b362000446565b5b8151620005c684826020860162000551565b91505092915050565b600080600080600060a08688031215620005ee57620005ed62000339565b5b6000620005fe88828901620003a5565b95505060206200061188828901620003ea565b945050604062000624888289016200042f565b935050606086015167ffffffffffffffff8111156200064857620006476200033e565b5b62000656888289016200059c565b925050608086015167ffffffffffffffff8111156200067a57620006796200033e565b5b62000688888289016200059c565b9150509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620006dd57607f821691505b60208210811415620006f457620006f362000695565b5b50919050565b6147da806200070a6000396000f3fe60806040526004361061014b5760003560e01c80636352211e116100b6578063a22cb4651161006f578063a22cb465146104bc578063a9badddf146104e5578063b88d4fde14610522578063c87b56dd1461054b578063e985e9c514610588578063f2fde38b146105c55761014b565b80636352211e146103a557806370a08231146103e2578063715018a61461041f57806386f7dfc3146104365780638da5cb5b1461046657806395d89b41146104915761014b565b80632a55205a116101085780632a55205a146102725780632f745c59146102b057806342842e0e146102ed57806342966c68146103165780634f6ccce71461033f57806355f804b31461037c5761014b565b806301ffc9a71461015057806306fdde031461018d578063081812fc146101b8578063095ea7b3146101f557806318160ddd1461021e57806323b872dd14610249575b600080fd5b34801561015c57600080fd5b5061017760048036038101906101729190612e56565b6105ee565b6040516101849190612e9e565b60405180910390f35b34801561019957600080fd5b506101a2610738565b6040516101af9190612f52565b60405180910390f35b3480156101c457600080fd5b506101df60048036038101906101da9190612faa565b6107ca565b6040516101ec9190613018565b60405180910390f35b34801561020157600080fd5b5061021c6004803603810190610217919061305f565b610810565b005b34801561022a57600080fd5b50610233610928565b60405161024091906130ae565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b91906130c9565b610935565b005b34801561027e57600080fd5b506102996004803603810190610294919061311c565b610995565b6040516102a792919061315c565b60405180910390f35b3480156102bc57600080fd5b506102d760048036038101906102d2919061305f565b610a4f565b6040516102e491906130ae565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f91906130c9565b610af4565b005b34801561032257600080fd5b5061033d60048036038101906103389190612faa565b610b14565b005b34801561034b57600080fd5b5061036660048036038101906103619190612faa565b610b70565b60405161037391906130ae565b60405180910390f35b34801561038857600080fd5b506103a3600480360381019061039e91906132ba565b610be1565b005b3480156103b157600080fd5b506103cc60048036038101906103c79190612faa565b610c03565b6040516103d99190613018565b60405180910390f35b3480156103ee57600080fd5b5061040960048036038101906104049190613303565b610cb5565b60405161041691906130ae565b60405180910390f35b34801561042b57600080fd5b50610434610d6d565b005b610450600480360381019061044b91906133b4565b610d81565b60405161045d91906130ae565b60405180910390f35b34801561047257600080fd5b5061047b61117b565b6040516104889190613018565b60405180910390f35b34801561049d57600080fd5b506104a66111a4565b6040516104b39190612f52565b60405180910390f35b3480156104c857600080fd5b506104e360048036038101906104de9190613470565b611236565b005b3480156104f157600080fd5b5061050c600480360381019061050791906134f4565b61124c565b60405161051991906130ae565b60405180910390f35b34801561052e57600080fd5b5061054960048036038101906105449190613604565b61140a565b005b34801561055757600080fd5b50610572600480360381019061056d9190612faa565b61146c565b60405161057f9190612f52565b60405180910390f35b34801561059457600080fd5b506105af60048036038101906105aa9190613687565b61147e565b6040516105bc9190612e9e565b60405180910390f35b3480156105d157600080fd5b506105ec60048036038101906105e79190613303565b611512565b005b60007f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106b957507f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061072157507f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610731575061073082611596565b5b9050919050565b606060018054610747906136f6565b80601f0160208091040260200160405190810160405280929190818152602001828054610773906136f6565b80156107c05780601f10610795576101008083540402835291602001916107c0565b820191906000526020600020905b8154815290600101906020018083116107a357829003601f168201915b5050505050905090565b60006107d582611610565b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061081b82610c03565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561088c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108839061379a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166108ab61165b565b73ffffffffffffffffffffffffffffffffffffffff1614806108da57506108d9816108d461165b565b61147e565b5b610919576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109109061382c565b60405180910390fd5b6109238383611663565b505050565b6000600980549050905090565b61094661094061165b565b8261171c565b610985576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097c906138be565b60405180910390fd5b6109908383836117b1565b505050565b600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632a55205a85856040518363ffffffff1660e01b81526004016109f59291906138de565b604080518083038186803b158015610a0c57600080fd5b505afa158015610a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a449190613931565b915091509250929050565b6000610a5a83610cb5565b8210610a9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a92906139e3565b60405180910390fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b610b0f8383836040518060200160405280600081525061140a565b505050565b610b25610b1f61165b565b8261171c565b610b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5b906138be565b60405180910390fd5b610b6d81611a18565b50565b6000610b7a610928565b8210610bbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bb290613a75565b60405180910390fd5b60098281548110610bcf57610bce613a95565b5b90600052602060002001549050919050565b610be9611ab1565b80600c9080519060200190610bff929190612d07565b5050565b6000806003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610cac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca390613b10565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1d90613ba2565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610d75611ab1565b610d7f6000611b2f565b565b6000610d8b61117b565b73ffffffffffffffffffffffffffffffffffffffff16610da961165b565b73ffffffffffffffffffffffffffffffffffffffff1614610e5757600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e610e0a61165b565b6040518263ffffffff1660e01b8152600401610e269190613018565b60006040518083038186803b158015610e3e57600080fd5b505afa158015610e52573d6000803e3d6000fd5b505050505b3073ffffffffffffffffffffffffffffffffffffffff16846000016020810190610e819190613303565b73ffffffffffffffffffffffffffffffffffffffff1614610ed7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ece90613c34565b60405180910390fd5b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d879253a8686866040518463ffffffff1660e01b8152600401610f3893929190613e6f565b60206040518083038186803b158015610f5057600080fd5b505afa158015610f64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f889190613ea8565b9050846080016020810190610f9d9190613303565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461100a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100190613f21565b60405180910390fd5b611018818660200135611bf3565b61107885602001358680606001906110309190613f50565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050611c11565b7f6096becae9000a69ba5373170a4963544a42f71cc937a76fc0d7741745bcbd168186602001356040516110ad92919061315c565b60405180910390a1600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635944c7538660200135838860a001602081019061110c9190613fb3565b6040518463ffffffff1660e01b815260040161112a93929190613fef565b600060405180830381600087803b15801561114457600080fd5b505af1158015611158573d6000803e3d6000fd5b5050505061116b81878760200135610935565b8460200135915050949350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600280546111b3906136f6565b80601f01602080910402602001604051908101604052809291908181526020018280546111df906136f6565b801561122c5780601f106112015761010080835404028352916020019161122c565b820191906000526020600020905b81548152906001019060200180831161120f57829003601f168201915b5050505050905090565b61124861124161165b565b8383611c85565b5050565b600061125661117b565b73ffffffffffffffffffffffffffffffffffffffff1661127461165b565b73ffffffffffffffffffffffffffffffffffffffff161461132257600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e6112d561165b565b6040518263ffffffff1660e01b81526004016112f19190613018565b60006040518083038186803b15801561130957600080fd5b505afa15801561131d573d6000803e3d6000fd5b505050505b61132c3384611bf3565b6113368385611c11565b7f6096becae9000a69ba5373170a4963544a42f71cc937a76fc0d7741745bcbd16338460405161136792919061315c565b60405180910390a1600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635944c7538433856040518463ffffffff1660e01b81526004016113ce93929190613fef565b600060405180830381600087803b1580156113e857600080fd5b505af11580156113fc573d6000803e3d6000fd5b505050508290509392505050565b61141b61141561165b565b8361171c565b61145a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611451906138be565b60405180910390fd5b61146684848484611df2565b50505050565b606061147782611e4e565b9050919050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61151a611ab1565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190614098565b60405180910390fd5b61159381611b2f565b50565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611609575061160882611f61565b5b9050919050565b61161981612043565b611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164f90613b10565b60405180910390fd5b50565b600033905090565b816005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166116d683610c03565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061172883610c03565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061176a5750611769818561147e565b5b806117a857508373ffffffffffffffffffffffffffffffffffffffff16611790846107ca565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166117d182610c03565b73ffffffffffffffffffffffffffffffffffffffff1614611827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181e9061412a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611897576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188e906141bc565b60405180910390fd5b6118a28383836120af565b6118ad600082611663565b6001600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546118fd919061420b565b925050819055506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611954919061423f565b92505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611a138383836120bf565b505050565b611a21816120c4565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638a616bc0826040518263ffffffff1660e01b8152600401611a7c91906130ae565b600060405180830381600087803b158015611a9657600080fd5b505af1158015611aaa573d6000803e3d6000fd5b5050505050565b611ab961165b565b73ffffffffffffffffffffffffffffffffffffffff16611ad761117b565b73ffffffffffffffffffffffffffffffffffffffff1614611b2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b24906142e1565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b611c0d828260405180602001604052806000815250612117565b5050565b611c1a82612043565b611c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5090614373565b60405180910390fd5b80600b60008481526020019081526020016000209080519060200190611c80929190612d07565b505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611cf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ceb906143df565b60405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611de59190612e9e565b60405180910390a3505050565b611dfd8484846117b1565b611e0984848484612172565b611e48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3f90614471565b60405180910390fd5b50505050565b6060611e5982611610565b6000600b60008481526020019081526020016000208054611e79906136f6565b80601f0160208091040260200160405190810160405280929190818152602001828054611ea5906136f6565b8015611ef25780601f10611ec757610100808354040283529160200191611ef2565b820191906000526020600020905b815481529060010190602001808311611ed557829003601f168201915b505050505090506000611f03612309565b9050600081511415611f19578192505050611f5c565b600082511115611f4e578082604051602001611f369291906144cd565b60405160208183030381529060405292505050611f5c565b611f578461239b565b925050505b919050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061202c57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061203c575061203b82612403565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6120ba83838361246d565b505050565b505050565b6120cd81612581565b6000600b600083815260200190815260200160002080546120ed906136f6565b90501461211457600b600082815260200190815260200160002060006121139190612d8d565b5b50565b612121838361269e565b61212e6000848484612172565b61216d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216490614471565b60405180910390fd5b505050565b60006121938473ffffffffffffffffffffffffffffffffffffffff16612878565b156122fc578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026121bc61165b565b8786866040518563ffffffff1660e01b81526004016121de9493929190614535565b602060405180830381600087803b1580156121f857600080fd5b505af192505050801561222957506040513d601f19601f820116820180604052508101906122269190614596565b60015b6122ac573d8060008114612259576040519150601f19603f3d011682016040523d82523d6000602084013e61225e565b606091505b506000815114156122a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161229b90614471565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612301565b600190505b949350505050565b6060600c8054612318906136f6565b80601f0160208091040260200160405190810160405280929190818152602001828054612344906136f6565b80156123915780601f1061236657610100808354040283529160200191612391565b820191906000526020600020905b81548152906001019060200180831161237457829003601f168201915b5050505050905090565b60606123a682611610565b60006123b0612309565b905060008151116123d057604051806020016040528060008152506123fb565b806123da8461289b565b6040516020016123eb9291906144cd565b6040516020818303038152906040525b915050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6124788383836129fc565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156124bb576124b681612a01565b6124fa565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146124f9576124f88382612a4a565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561253d5761253881612bb7565b61257c565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461257b5761257a8282612c88565b5b5b505050565b600061258c82610c03565b905061259a816000846120af565b6125a5600083611663565b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546125f5919061420b565b925050819055506003600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461269a816000846120bf565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561270e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127059061460f565b60405180910390fd5b61271781612043565b15612757576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161274e9061467b565b60405180910390fd5b612763600083836120af565b6001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546127b3919061423f565b92505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612874600083836120bf565b5050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b606060008214156128e3576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506129f7565b600082905060005b600082146129155780806128fe9061469b565b915050600a8261290e9190614713565b91506128eb565b60008167ffffffffffffffff8111156129315761293061318f565b5b6040519080825280601f01601f1916602001820160405280156129635781602001600182028036833780820191505090505b5090505b600085146129f05760018261297c919061420b565b9150600a8561298b9190614744565b6030612997919061423f565b60f81b8183815181106129ad576129ac613a95565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856129e99190614713565b9450612967565b8093505050505b919050565b505050565b600980549050600a600083815260200190815260200160002081905550600981908060018154018082558091505060019003906000526020600020016000909190919091505550565b60006001612a5784610cb5565b612a61919061420b565b9050600060086000848152602001908152602001600020549050818114612b46576000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816008600083815260200190815260200160002081905550505b6008600084815260200190815260200160002060009055600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600980549050612bcb919061420b565b90506000600a6000848152602001908152602001600020549050600060098381548110612bfb57612bfa613a95565b5b906000526020600020015490508060098381548110612c1d57612c1c613a95565b5b906000526020600020018190555081600a600083815260200190815260200160002081905550600a6000858152602001908152602001600020600090556009805480612c6c57612c6b614775565b5b6001900381819060005260206000200160009055905550505050565b6000612c9383610cb5565b905081600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806008600084815260200190815260200160002081905550505050565b828054612d13906136f6565b90600052602060002090601f016020900481019282612d355760008555612d7c565b82601f10612d4e57805160ff1916838001178555612d7c565b82800160010185558215612d7c579182015b82811115612d7b578251825591602001919060010190612d60565b5b509050612d899190612dcd565b5090565b508054612d99906136f6565b6000825580601f10612dab5750612dca565b601f016020900490600052602060002090810190612dc99190612dcd565b5b50565b5b80821115612de6576000816000905550600101612dce565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612e3381612dfe565b8114612e3e57600080fd5b50565b600081359050612e5081612e2a565b92915050565b600060208284031215612e6c57612e6b612df4565b5b6000612e7a84828501612e41565b91505092915050565b60008115159050919050565b612e9881612e83565b82525050565b6000602082019050612eb36000830184612e8f565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ef3578082015181840152602081019050612ed8565b83811115612f02576000848401525b50505050565b6000601f19601f8301169050919050565b6000612f2482612eb9565b612f2e8185612ec4565b9350612f3e818560208601612ed5565b612f4781612f08565b840191505092915050565b60006020820190508181036000830152612f6c8184612f19565b905092915050565b6000819050919050565b612f8781612f74565b8114612f9257600080fd5b50565b600081359050612fa481612f7e565b92915050565b600060208284031215612fc057612fbf612df4565b5b6000612fce84828501612f95565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061300282612fd7565b9050919050565b61301281612ff7565b82525050565b600060208201905061302d6000830184613009565b92915050565b61303c81612ff7565b811461304757600080fd5b50565b60008135905061305981613033565b92915050565b6000806040838503121561307657613075612df4565b5b60006130848582860161304a565b925050602061309585828601612f95565b9150509250929050565b6130a881612f74565b82525050565b60006020820190506130c3600083018461309f565b92915050565b6000806000606084860312156130e2576130e1612df4565b5b60006130f08682870161304a565b93505060206131018682870161304a565b925050604061311286828701612f95565b9150509250925092565b6000806040838503121561313357613132612df4565b5b600061314185828601612f95565b925050602061315285828601612f95565b9150509250929050565b60006040820190506131716000830185613009565b61317e602083018461309f565b9392505050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6131c782612f08565b810181811067ffffffffffffffff821117156131e6576131e561318f565b5b80604052505050565b60006131f9612dea565b905061320582826131be565b919050565b600067ffffffffffffffff8211156132255761322461318f565b5b61322e82612f08565b9050602081019050919050565b82818337600083830152505050565b600061325d6132588461320a565b6131ef565b9050828152602081018484840111156132795761327861318a565b5b61328484828561323b565b509392505050565b600082601f8301126132a1576132a0613185565b5b81356132b184826020860161324a565b91505092915050565b6000602082840312156132d0576132cf612df4565b5b600082013567ffffffffffffffff8111156132ee576132ed612df9565b5b6132fa8482850161328c565b91505092915050565b60006020828403121561331957613318612df4565b5b60006133278482850161304a565b91505092915050565b600080fd5b600060c0828403121561334b5761334a613330565b5b81905092915050565b600080fd5b600080fd5b60008083601f84011261337457613373613185565b5b8235905067ffffffffffffffff81111561339157613390613354565b5b6020830191508360018202830111156133ad576133ac613359565b5b9250929050565b600080600080606085870312156133ce576133cd612df4565b5b60006133dc8782880161304a565b945050602085013567ffffffffffffffff8111156133fd576133fc612df9565b5b61340987828801613335565b935050604085013567ffffffffffffffff81111561342a57613429612df9565b5b6134368782880161335e565b925092505092959194509250565b61344d81612e83565b811461345857600080fd5b50565b60008135905061346a81613444565b92915050565b6000806040838503121561348757613486612df4565b5b60006134958582860161304a565b92505060206134a68582860161345b565b9150509250929050565b60006bffffffffffffffffffffffff82169050919050565b6134d1816134b0565b81146134dc57600080fd5b50565b6000813590506134ee816134c8565b92915050565b60008060006060848603121561350d5761350c612df4565b5b600084013567ffffffffffffffff81111561352b5761352a612df9565b5b6135378682870161328c565b935050602061354886828701612f95565b9250506040613559868287016134df565b9150509250925092565b600067ffffffffffffffff82111561357e5761357d61318f565b5b61358782612f08565b9050602081019050919050565b60006135a76135a284613563565b6131ef565b9050828152602081018484840111156135c3576135c261318a565b5b6135ce84828561323b565b509392505050565b600082601f8301126135eb576135ea613185565b5b81356135fb848260208601613594565b91505092915050565b6000806000806080858703121561361e5761361d612df4565b5b600061362c8782880161304a565b945050602061363d8782880161304a565b935050604061364e87828801612f95565b925050606085013567ffffffffffffffff81111561366f5761366e612df9565b5b61367b878288016135d6565b91505092959194509250565b6000806040838503121561369e5761369d612df4565b5b60006136ac8582860161304a565b92505060206136bd8582860161304a565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061370e57607f821691505b60208210811415613722576137216136c7565b5b50919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000613784602183612ec4565b915061378f82613728565b604082019050919050565b600060208201905081810360008301526137b381613777565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c0000602082015250565b6000613816603e83612ec4565b9150613821826137ba565b604082019050919050565b6000602082019050818103600083015261384581613809565b9050919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206e6f7220617070726f766564000000000000000000000000000000000000602082015250565b60006138a8602e83612ec4565b91506138b38261384c565b604082019050919050565b600060208201905081810360008301526138d78161389b565b9050919050565b60006040820190506138f3600083018561309f565b613900602083018461309f565b9392505050565b60008151905061391681613033565b92915050565b60008151905061392b81612f7e565b92915050565b6000806040838503121561394857613947612df4565b5b600061395685828601613907565b92505060206139678582860161391c565b9150509250929050565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b60006139cd602b83612ec4565b91506139d882613971565b604082019050919050565b600060208201905081810360008301526139fc816139c0565b9050919050565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b6000613a5f602c83612ec4565b9150613a6a82613a03565b604082019050919050565b60006020820190508181036000830152613a8e81613a52565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b6000613afa601883612ec4565b9150613b0582613ac4565b602082019050919050565b60006020820190508181036000830152613b2981613aed565b9050919050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b6000613b8c602983612ec4565b9150613b9782613b30565b604082019050919050565b60006020820190508181036000830152613bbb81613b7f565b9050919050565b7f54686520766f7563686572206d75737420626520666f72207468697320636f6e60008201527f7472616374000000000000000000000000000000000000000000000000000000602082015250565b6000613c1e602583612ec4565b9150613c2982613bc2565b604082019050919050565b60006020820190508181036000830152613c4d81613c11565b9050919050565b6000613c63602084018461304a565b905092915050565b613c7481612ff7565b82525050565b6000613c896020840184612f95565b905092915050565b613c9a81612f74565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613ccc57613ccb613caa565b5b83810192508235915060208301925067ffffffffffffffff821115613cf457613cf3613ca0565b5b600182023603841315613d0a57613d09613ca5565b5b509250929050565b600082825260208201905092915050565b6000613d2f8385613d12565b9350613d3c83858461323b565b613d4583612f08565b840190509392505050565b6000613d5f60208401846134df565b905092915050565b613d70816134b0565b82525050565b600060c08301613d896000840184613c54565b613d966000860182613c6b565b50613da46020840184613c7a565b613db16020860182613c91565b50613dbf6040840184613c7a565b613dcc6040860182613c91565b50613dda6060840184613caf565b8583036060870152613ded838284613d23565b92505050613dfe6080840184613c54565b613e0b6080860182613c6b565b50613e1960a0840184613d50565b613e2660a0860182613d67565b508091505092915050565b600082825260208201905092915050565b6000613e4e8385613e31565b9350613e5b83858461323b565b613e6483612f08565b840190509392505050565b60006040820190508181036000830152613e898186613d76565b90508181036020830152613e9e818486613e42565b9050949350505050565b600060208284031215613ebe57613ebd612df4565b5b6000613ecc84828501613907565b91505092915050565b7f43726561746f72204164647265737320646f6573206e6f74206d617463680000600082015250565b6000613f0b601e83612ec4565b9150613f1682613ed5565b602082019050919050565b60006020820190508181036000830152613f3a81613efe565b9050919050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613f6d57613f6c613f41565b5b80840192508235915067ffffffffffffffff821115613f8f57613f8e613f46565b5b602083019250600182023603831315613fab57613faa613f4b565b5b509250929050565b600060208284031215613fc957613fc8612df4565b5b6000613fd7848285016134df565b91505092915050565b613fe9816134b0565b82525050565b6000606082019050614004600083018661309f565b6140116020830185613009565b61401e6040830184613fe0565b949350505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614082602683612ec4565b915061408d82614026565b604082019050919050565b600060208201905081810360008301526140b181614075565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b6000614114602583612ec4565b915061411f826140b8565b604082019050919050565b6000602082019050818103600083015261414381614107565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006141a6602483612ec4565b91506141b18261414a565b604082019050919050565b600060208201905081810360008301526141d581614199565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061421682612f74565b915061422183612f74565b925082821015614234576142336141dc565b5b828203905092915050565b600061424a82612f74565b915061425583612f74565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561428a576142896141dc565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006142cb602083612ec4565b91506142d682614295565b602082019050919050565b600060208201905081810360008301526142fa816142be565b9050919050565b7f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60008201527f6578697374656e7420746f6b656e000000000000000000000000000000000000602082015250565b600061435d602e83612ec4565b915061436882614301565b604082019050919050565b6000602082019050818103600083015261438c81614350565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b60006143c9601983612ec4565b91506143d482614393565b602082019050919050565b600060208201905081810360008301526143f8816143bc565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b600061445b603283612ec4565b9150614466826143ff565b604082019050919050565b6000602082019050818103600083015261448a8161444e565b9050919050565b600081905092915050565b60006144a782612eb9565b6144b18185614491565b93506144c1818560208601612ed5565b80840191505092915050565b60006144d9828561449c565b91506144e5828461449c565b91508190509392505050565b600081519050919050565b6000614507826144f1565b6145118185613e31565b9350614521818560208601612ed5565b61452a81612f08565b840191505092915050565b600060808201905061454a6000830187613009565b6145576020830186613009565b614564604083018561309f565b818103606083015261457681846144fc565b905095945050505050565b60008151905061459081612e2a565b92915050565b6000602082840312156145ac576145ab612df4565b5b60006145ba84828501614581565b91505092915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006145f9602083612ec4565b9150614604826145c3565b602082019050919050565b60006020820190508181036000830152614628816145ec565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000614665601c83612ec4565b91506146708261462f565b602082019050919050565b6000602082019050818103600083015261469481614658565b9050919050565b60006146a682612f74565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156146d9576146d86141dc565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061471e82612f74565b915061472983612f74565b925082614739576147386146e4565b5b828204905092915050565b600061474f82612f74565b915061475a83612f74565b92508261476a576147696146e4565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220c3299b9e9fe106a2559afa66c5f5cb8f1efec3b8fe71a166e1de113970012b7b64736f6c63430008090033000000000000000000000000ed2780b46cb90bc0b1a5d5d9c7567a38bf3e80830000000000000000000000004d60a77ddcd2d4b9f765c7826891bf170ec75f51000000000000000000000000af7cc7976b771648a1ba829ba01bf590e576a2ed00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000c506c617374696b4e4654563300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007504c415354494b00000000000000000000000000000000000000000000000000
Deployed ByteCode
0x60806040526004361061014b5760003560e01c80636352211e116100b6578063a22cb4651161006f578063a22cb465146104bc578063a9badddf146104e5578063b88d4fde14610522578063c87b56dd1461054b578063e985e9c514610588578063f2fde38b146105c55761014b565b80636352211e146103a557806370a08231146103e2578063715018a61461041f57806386f7dfc3146104365780638da5cb5b1461046657806395d89b41146104915761014b565b80632a55205a116101085780632a55205a146102725780632f745c59146102b057806342842e0e146102ed57806342966c68146103165780634f6ccce71461033f57806355f804b31461037c5761014b565b806301ffc9a71461015057806306fdde031461018d578063081812fc146101b8578063095ea7b3146101f557806318160ddd1461021e57806323b872dd14610249575b600080fd5b34801561015c57600080fd5b5061017760048036038101906101729190612e56565b6105ee565b6040516101849190612e9e565b60405180910390f35b34801561019957600080fd5b506101a2610738565b6040516101af9190612f52565b60405180910390f35b3480156101c457600080fd5b506101df60048036038101906101da9190612faa565b6107ca565b6040516101ec9190613018565b60405180910390f35b34801561020157600080fd5b5061021c6004803603810190610217919061305f565b610810565b005b34801561022a57600080fd5b50610233610928565b60405161024091906130ae565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b91906130c9565b610935565b005b34801561027e57600080fd5b506102996004803603810190610294919061311c565b610995565b6040516102a792919061315c565b60405180910390f35b3480156102bc57600080fd5b506102d760048036038101906102d2919061305f565b610a4f565b6040516102e491906130ae565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f91906130c9565b610af4565b005b34801561032257600080fd5b5061033d60048036038101906103389190612faa565b610b14565b005b34801561034b57600080fd5b5061036660048036038101906103619190612faa565b610b70565b60405161037391906130ae565b60405180910390f35b34801561038857600080fd5b506103a3600480360381019061039e91906132ba565b610be1565b005b3480156103b157600080fd5b506103cc60048036038101906103c79190612faa565b610c03565b6040516103d99190613018565b60405180910390f35b3480156103ee57600080fd5b5061040960048036038101906104049190613303565b610cb5565b60405161041691906130ae565b60405180910390f35b34801561042b57600080fd5b50610434610d6d565b005b610450600480360381019061044b91906133b4565b610d81565b60405161045d91906130ae565b60405180910390f35b34801561047257600080fd5b5061047b61117b565b6040516104889190613018565b60405180910390f35b34801561049d57600080fd5b506104a66111a4565b6040516104b39190612f52565b60405180910390f35b3480156104c857600080fd5b506104e360048036038101906104de9190613470565b611236565b005b3480156104f157600080fd5b5061050c600480360381019061050791906134f4565b61124c565b60405161051991906130ae565b60405180910390f35b34801561052e57600080fd5b5061054960048036038101906105449190613604565b61140a565b005b34801561055757600080fd5b50610572600480360381019061056d9190612faa565b61146c565b60405161057f9190612f52565b60405180910390f35b34801561059457600080fd5b506105af60048036038101906105aa9190613687565b61147e565b6040516105bc9190612e9e565b60405180910390f35b3480156105d157600080fd5b506105ec60048036038101906105e79190613303565b611512565b005b60007f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106b957507f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061072157507f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610731575061073082611596565b5b9050919050565b606060018054610747906136f6565b80601f0160208091040260200160405190810160405280929190818152602001828054610773906136f6565b80156107c05780601f10610795576101008083540402835291602001916107c0565b820191906000526020600020905b8154815290600101906020018083116107a357829003601f168201915b5050505050905090565b60006107d582611610565b6005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061081b82610c03565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561088c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108839061379a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166108ab61165b565b73ffffffffffffffffffffffffffffffffffffffff1614806108da57506108d9816108d461165b565b61147e565b5b610919576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109109061382c565b60405180910390fd5b6109238383611663565b505050565b6000600980549050905090565b61094661094061165b565b8261171c565b610985576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097c906138be565b60405180910390fd5b6109908383836117b1565b505050565b600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632a55205a85856040518363ffffffff1660e01b81526004016109f59291906138de565b604080518083038186803b158015610a0c57600080fd5b505afa158015610a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a449190613931565b915091509250929050565b6000610a5a83610cb5565b8210610a9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a92906139e3565b60405180910390fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b610b0f8383836040518060200160405280600081525061140a565b505050565b610b25610b1f61165b565b8261171c565b610b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5b906138be565b60405180910390fd5b610b6d81611a18565b50565b6000610b7a610928565b8210610bbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bb290613a75565b60405180910390fd5b60098281548110610bcf57610bce613a95565b5b90600052602060002001549050919050565b610be9611ab1565b80600c9080519060200190610bff929190612d07565b5050565b6000806003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610cac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca390613b10565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1d90613ba2565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610d75611ab1565b610d7f6000611b2f565b565b6000610d8b61117b565b73ffffffffffffffffffffffffffffffffffffffff16610da961165b565b73ffffffffffffffffffffffffffffffffffffffff1614610e5757600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e610e0a61165b565b6040518263ffffffff1660e01b8152600401610e269190613018565b60006040518083038186803b158015610e3e57600080fd5b505afa158015610e52573d6000803e3d6000fd5b505050505b3073ffffffffffffffffffffffffffffffffffffffff16846000016020810190610e819190613303565b73ffffffffffffffffffffffffffffffffffffffff1614610ed7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ece90613c34565b60405180910390fd5b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d879253a8686866040518463ffffffff1660e01b8152600401610f3893929190613e6f565b60206040518083038186803b158015610f5057600080fd5b505afa158015610f64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f889190613ea8565b9050846080016020810190610f9d9190613303565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461100a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100190613f21565b60405180910390fd5b611018818660200135611bf3565b61107885602001358680606001906110309190613f50565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050611c11565b7f6096becae9000a69ba5373170a4963544a42f71cc937a76fc0d7741745bcbd168186602001356040516110ad92919061315c565b60405180910390a1600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635944c7538660200135838860a001602081019061110c9190613fb3565b6040518463ffffffff1660e01b815260040161112a93929190613fef565b600060405180830381600087803b15801561114457600080fd5b505af1158015611158573d6000803e3d6000fd5b5050505061116b81878760200135610935565b8460200135915050949350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600280546111b3906136f6565b80601f01602080910402602001604051908101604052809291908181526020018280546111df906136f6565b801561122c5780601f106112015761010080835404028352916020019161122c565b820191906000526020600020905b81548152906001019060200180831161120f57829003601f168201915b5050505050905090565b61124861124161165b565b8383611c85565b5050565b600061125661117b565b73ffffffffffffffffffffffffffffffffffffffff1661127461165b565b73ffffffffffffffffffffffffffffffffffffffff161461132257600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e6112d561165b565b6040518263ffffffff1660e01b81526004016112f19190613018565b60006040518083038186803b15801561130957600080fd5b505afa15801561131d573d6000803e3d6000fd5b505050505b61132c3384611bf3565b6113368385611c11565b7f6096becae9000a69ba5373170a4963544a42f71cc937a76fc0d7741745bcbd16338460405161136792919061315c565b60405180910390a1600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635944c7538433856040518463ffffffff1660e01b81526004016113ce93929190613fef565b600060405180830381600087803b1580156113e857600080fd5b505af11580156113fc573d6000803e3d6000fd5b505050508290509392505050565b61141b61141561165b565b8361171c565b61145a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611451906138be565b60405180910390fd5b61146684848484611df2565b50505050565b606061147782611e4e565b9050919050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61151a611ab1565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190614098565b60405180910390fd5b61159381611b2f565b50565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611609575061160882611f61565b5b9050919050565b61161981612043565b611658576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164f90613b10565b60405180910390fd5b50565b600033905090565b816005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166116d683610c03565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061172883610c03565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061176a5750611769818561147e565b5b806117a857508373ffffffffffffffffffffffffffffffffffffffff16611790846107ca565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166117d182610c03565b73ffffffffffffffffffffffffffffffffffffffff1614611827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181e9061412a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611897576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188e906141bc565b60405180910390fd5b6118a28383836120af565b6118ad600082611663565b6001600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546118fd919061420b565b925050819055506001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611954919061423f565b92505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611a138383836120bf565b505050565b611a21816120c4565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638a616bc0826040518263ffffffff1660e01b8152600401611a7c91906130ae565b600060405180830381600087803b158015611a9657600080fd5b505af1158015611aaa573d6000803e3d6000fd5b5050505050565b611ab961165b565b73ffffffffffffffffffffffffffffffffffffffff16611ad761117b565b73ffffffffffffffffffffffffffffffffffffffff1614611b2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b24906142e1565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b611c0d828260405180602001604052806000815250612117565b5050565b611c1a82612043565b611c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5090614373565b60405180910390fd5b80600b60008481526020019081526020016000209080519060200190611c80929190612d07565b505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611cf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ceb906143df565b60405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611de59190612e9e565b60405180910390a3505050565b611dfd8484846117b1565b611e0984848484612172565b611e48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3f90614471565b60405180910390fd5b50505050565b6060611e5982611610565b6000600b60008481526020019081526020016000208054611e79906136f6565b80601f0160208091040260200160405190810160405280929190818152602001828054611ea5906136f6565b8015611ef25780601f10611ec757610100808354040283529160200191611ef2565b820191906000526020600020905b815481529060010190602001808311611ed557829003601f168201915b505050505090506000611f03612309565b9050600081511415611f19578192505050611f5c565b600082511115611f4e578082604051602001611f369291906144cd565b60405160208183030381529060405292505050611f5c565b611f578461239b565b925050505b919050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061202c57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061203c575061203b82612403565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6120ba83838361246d565b505050565b505050565b6120cd81612581565b6000600b600083815260200190815260200160002080546120ed906136f6565b90501461211457600b600082815260200190815260200160002060006121139190612d8d565b5b50565b612121838361269e565b61212e6000848484612172565b61216d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216490614471565b60405180910390fd5b505050565b60006121938473ffffffffffffffffffffffffffffffffffffffff16612878565b156122fc578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026121bc61165b565b8786866040518563ffffffff1660e01b81526004016121de9493929190614535565b602060405180830381600087803b1580156121f857600080fd5b505af192505050801561222957506040513d601f19601f820116820180604052508101906122269190614596565b60015b6122ac573d8060008114612259576040519150601f19603f3d011682016040523d82523d6000602084013e61225e565b606091505b506000815114156122a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161229b90614471565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612301565b600190505b949350505050565b6060600c8054612318906136f6565b80601f0160208091040260200160405190810160405280929190818152602001828054612344906136f6565b80156123915780601f1061236657610100808354040283529160200191612391565b820191906000526020600020905b81548152906001019060200180831161237457829003601f168201915b5050505050905090565b60606123a682611610565b60006123b0612309565b905060008151116123d057604051806020016040528060008152506123fb565b806123da8461289b565b6040516020016123eb9291906144cd565b6040516020818303038152906040525b915050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6124788383836129fc565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156124bb576124b681612a01565b6124fa565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146124f9576124f88382612a4a565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561253d5761253881612bb7565b61257c565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461257b5761257a8282612c88565b5b5b505050565b600061258c82610c03565b905061259a816000846120af565b6125a5600083611663565b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546125f5919061420b565b925050819055506003600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461269a816000846120bf565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561270e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127059061460f565b60405180910390fd5b61271781612043565b15612757576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161274e9061467b565b60405180910390fd5b612763600083836120af565b6001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546127b3919061423f565b92505081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612874600083836120bf565b5050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b606060008214156128e3576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506129f7565b600082905060005b600082146129155780806128fe9061469b565b915050600a8261290e9190614713565b91506128eb565b60008167ffffffffffffffff8111156129315761293061318f565b5b6040519080825280601f01601f1916602001820160405280156129635781602001600182028036833780820191505090505b5090505b600085146129f05760018261297c919061420b565b9150600a8561298b9190614744565b6030612997919061423f565b60f81b8183815181106129ad576129ac613a95565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856129e99190614713565b9450612967565b8093505050505b919050565b505050565b600980549050600a600083815260200190815260200160002081905550600981908060018154018082558091505060019003906000526020600020016000909190919091505550565b60006001612a5784610cb5565b612a61919061420b565b9050600060086000848152602001908152602001600020549050818114612b46576000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816008600083815260200190815260200160002081905550505b6008600084815260200190815260200160002060009055600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600980549050612bcb919061420b565b90506000600a6000848152602001908152602001600020549050600060098381548110612bfb57612bfa613a95565b5b906000526020600020015490508060098381548110612c1d57612c1c613a95565b5b906000526020600020018190555081600a600083815260200190815260200160002081905550600a6000858152602001908152602001600020600090556009805480612c6c57612c6b614775565b5b6001900381819060005260206000200160009055905550505050565b6000612c9383610cb5565b905081600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806008600084815260200190815260200160002081905550505050565b828054612d13906136f6565b90600052602060002090601f016020900481019282612d355760008555612d7c565b82601f10612d4e57805160ff1916838001178555612d7c565b82800160010185558215612d7c579182015b82811115612d7b578251825591602001919060010190612d60565b5b509050612d899190612dcd565b5090565b508054612d99906136f6565b6000825580601f10612dab5750612dca565b601f016020900490600052602060002090810190612dc99190612dcd565b5b50565b5b80821115612de6576000816000905550600101612dce565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612e3381612dfe565b8114612e3e57600080fd5b50565b600081359050612e5081612e2a565b92915050565b600060208284031215612e6c57612e6b612df4565b5b6000612e7a84828501612e41565b91505092915050565b60008115159050919050565b612e9881612e83565b82525050565b6000602082019050612eb36000830184612e8f565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612ef3578082015181840152602081019050612ed8565b83811115612f02576000848401525b50505050565b6000601f19601f8301169050919050565b6000612f2482612eb9565b612f2e8185612ec4565b9350612f3e818560208601612ed5565b612f4781612f08565b840191505092915050565b60006020820190508181036000830152612f6c8184612f19565b905092915050565b6000819050919050565b612f8781612f74565b8114612f9257600080fd5b50565b600081359050612fa481612f7e565b92915050565b600060208284031215612fc057612fbf612df4565b5b6000612fce84828501612f95565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061300282612fd7565b9050919050565b61301281612ff7565b82525050565b600060208201905061302d6000830184613009565b92915050565b61303c81612ff7565b811461304757600080fd5b50565b60008135905061305981613033565b92915050565b6000806040838503121561307657613075612df4565b5b60006130848582860161304a565b925050602061309585828601612f95565b9150509250929050565b6130a881612f74565b82525050565b60006020820190506130c3600083018461309f565b92915050565b6000806000606084860312156130e2576130e1612df4565b5b60006130f08682870161304a565b93505060206131018682870161304a565b925050604061311286828701612f95565b9150509250925092565b6000806040838503121561313357613132612df4565b5b600061314185828601612f95565b925050602061315285828601612f95565b9150509250929050565b60006040820190506131716000830185613009565b61317e602083018461309f565b9392505050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6131c782612f08565b810181811067ffffffffffffffff821117156131e6576131e561318f565b5b80604052505050565b60006131f9612dea565b905061320582826131be565b919050565b600067ffffffffffffffff8211156132255761322461318f565b5b61322e82612f08565b9050602081019050919050565b82818337600083830152505050565b600061325d6132588461320a565b6131ef565b9050828152602081018484840111156132795761327861318a565b5b61328484828561323b565b509392505050565b600082601f8301126132a1576132a0613185565b5b81356132b184826020860161324a565b91505092915050565b6000602082840312156132d0576132cf612df4565b5b600082013567ffffffffffffffff8111156132ee576132ed612df9565b5b6132fa8482850161328c565b91505092915050565b60006020828403121561331957613318612df4565b5b60006133278482850161304a565b91505092915050565b600080fd5b600060c0828403121561334b5761334a613330565b5b81905092915050565b600080fd5b600080fd5b60008083601f84011261337457613373613185565b5b8235905067ffffffffffffffff81111561339157613390613354565b5b6020830191508360018202830111156133ad576133ac613359565b5b9250929050565b600080600080606085870312156133ce576133cd612df4565b5b60006133dc8782880161304a565b945050602085013567ffffffffffffffff8111156133fd576133fc612df9565b5b61340987828801613335565b935050604085013567ffffffffffffffff81111561342a57613429612df9565b5b6134368782880161335e565b925092505092959194509250565b61344d81612e83565b811461345857600080fd5b50565b60008135905061346a81613444565b92915050565b6000806040838503121561348757613486612df4565b5b60006134958582860161304a565b92505060206134a68582860161345b565b9150509250929050565b60006bffffffffffffffffffffffff82169050919050565b6134d1816134b0565b81146134dc57600080fd5b50565b6000813590506134ee816134c8565b92915050565b60008060006060848603121561350d5761350c612df4565b5b600084013567ffffffffffffffff81111561352b5761352a612df9565b5b6135378682870161328c565b935050602061354886828701612f95565b9250506040613559868287016134df565b9150509250925092565b600067ffffffffffffffff82111561357e5761357d61318f565b5b61358782612f08565b9050602081019050919050565b60006135a76135a284613563565b6131ef565b9050828152602081018484840111156135c3576135c261318a565b5b6135ce84828561323b565b509392505050565b600082601f8301126135eb576135ea613185565b5b81356135fb848260208601613594565b91505092915050565b6000806000806080858703121561361e5761361d612df4565b5b600061362c8782880161304a565b945050602061363d8782880161304a565b935050604061364e87828801612f95565b925050606085013567ffffffffffffffff81111561366f5761366e612df9565b5b61367b878288016135d6565b91505092959194509250565b6000806040838503121561369e5761369d612df4565b5b60006136ac8582860161304a565b92505060206136bd8582860161304a565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061370e57607f821691505b60208210811415613722576137216136c7565b5b50919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000613784602183612ec4565b915061378f82613728565b604082019050919050565b600060208201905081810360008301526137b381613777565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c0000602082015250565b6000613816603e83612ec4565b9150613821826137ba565b604082019050919050565b6000602082019050818103600083015261384581613809565b9050919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206e6f7220617070726f766564000000000000000000000000000000000000602082015250565b60006138a8602e83612ec4565b91506138b38261384c565b604082019050919050565b600060208201905081810360008301526138d78161389b565b9050919050565b60006040820190506138f3600083018561309f565b613900602083018461309f565b9392505050565b60008151905061391681613033565b92915050565b60008151905061392b81612f7e565b92915050565b6000806040838503121561394857613947612df4565b5b600061395685828601613907565b92505060206139678582860161391c565b9150509250929050565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b60006139cd602b83612ec4565b91506139d882613971565b604082019050919050565b600060208201905081810360008301526139fc816139c0565b9050919050565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b6000613a5f602c83612ec4565b9150613a6a82613a03565b604082019050919050565b60006020820190508181036000830152613a8e81613a52565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b6000613afa601883612ec4565b9150613b0582613ac4565b602082019050919050565b60006020820190508181036000830152613b2981613aed565b9050919050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b6000613b8c602983612ec4565b9150613b9782613b30565b604082019050919050565b60006020820190508181036000830152613bbb81613b7f565b9050919050565b7f54686520766f7563686572206d75737420626520666f72207468697320636f6e60008201527f7472616374000000000000000000000000000000000000000000000000000000602082015250565b6000613c1e602583612ec4565b9150613c2982613bc2565b604082019050919050565b60006020820190508181036000830152613c4d81613c11565b9050919050565b6000613c63602084018461304a565b905092915050565b613c7481612ff7565b82525050565b6000613c896020840184612f95565b905092915050565b613c9a81612f74565b82525050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613ccc57613ccb613caa565b5b83810192508235915060208301925067ffffffffffffffff821115613cf457613cf3613ca0565b5b600182023603841315613d0a57613d09613ca5565b5b509250929050565b600082825260208201905092915050565b6000613d2f8385613d12565b9350613d3c83858461323b565b613d4583612f08565b840190509392505050565b6000613d5f60208401846134df565b905092915050565b613d70816134b0565b82525050565b600060c08301613d896000840184613c54565b613d966000860182613c6b565b50613da46020840184613c7a565b613db16020860182613c91565b50613dbf6040840184613c7a565b613dcc6040860182613c91565b50613dda6060840184613caf565b8583036060870152613ded838284613d23565b92505050613dfe6080840184613c54565b613e0b6080860182613c6b565b50613e1960a0840184613d50565b613e2660a0860182613d67565b508091505092915050565b600082825260208201905092915050565b6000613e4e8385613e31565b9350613e5b83858461323b565b613e6483612f08565b840190509392505050565b60006040820190508181036000830152613e898186613d76565b90508181036020830152613e9e818486613e42565b9050949350505050565b600060208284031215613ebe57613ebd612df4565b5b6000613ecc84828501613907565b91505092915050565b7f43726561746f72204164647265737320646f6573206e6f74206d617463680000600082015250565b6000613f0b601e83612ec4565b9150613f1682613ed5565b602082019050919050565b60006020820190508181036000830152613f3a81613efe565b9050919050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613f6d57613f6c613f41565b5b80840192508235915067ffffffffffffffff821115613f8f57613f8e613f46565b5b602083019250600182023603831315613fab57613faa613f4b565b5b509250929050565b600060208284031215613fc957613fc8612df4565b5b6000613fd7848285016134df565b91505092915050565b613fe9816134b0565b82525050565b6000606082019050614004600083018661309f565b6140116020830185613009565b61401e6040830184613fe0565b949350505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614082602683612ec4565b915061408d82614026565b604082019050919050565b600060208201905081810360008301526140b181614075565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b6000614114602583612ec4565b915061411f826140b8565b604082019050919050565b6000602082019050818103600083015261414381614107565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006141a6602483612ec4565b91506141b18261414a565b604082019050919050565b600060208201905081810360008301526141d581614199565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061421682612f74565b915061422183612f74565b925082821015614234576142336141dc565b5b828203905092915050565b600061424a82612f74565b915061425583612f74565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561428a576142896141dc565b5b828201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006142cb602083612ec4565b91506142d682614295565b602082019050919050565b600060208201905081810360008301526142fa816142be565b9050919050565b7f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60008201527f6578697374656e7420746f6b656e000000000000000000000000000000000000602082015250565b600061435d602e83612ec4565b915061436882614301565b604082019050919050565b6000602082019050818103600083015261438c81614350565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b60006143c9601983612ec4565b91506143d482614393565b602082019050919050565b600060208201905081810360008301526143f8816143bc565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b600061445b603283612ec4565b9150614466826143ff565b604082019050919050565b6000602082019050818103600083015261448a8161444e565b9050919050565b600081905092915050565b60006144a782612eb9565b6144b18185614491565b93506144c1818560208601612ed5565b80840191505092915050565b60006144d9828561449c565b91506144e5828461449c565b91508190509392505050565b600081519050919050565b6000614507826144f1565b6145118185613e31565b9350614521818560208601612ed5565b61452a81612f08565b840191505092915050565b600060808201905061454a6000830187613009565b6145576020830186613009565b614564604083018561309f565b818103606083015261457681846144fc565b905095945050505050565b60008151905061459081612e2a565b92915050565b6000602082840312156145ac576145ab612df4565b5b60006145ba84828501614581565b91505092915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006145f9602083612ec4565b9150614604826145c3565b602082019050919050565b60006020820190508181036000830152614628816145ec565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000614665601c83612ec4565b91506146708261462f565b602082019050919050565b6000602082019050818103600083015261469481614658565b9050919050565b60006146a682612f74565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156146d9576146d86141dc565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061471e82612f74565b915061472983612f74565b925082614739576147386146e4565b5b828204905092915050565b600061474f82612f74565b915061475a83612f74565b92508261476a576147696146e4565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220c3299b9e9fe106a2559afa66c5f5cb8f1efec3b8fe71a166e1de113970012b7b64736f6c63430008090033