Address Details
contract
token
0x943793cBC0802794856D9F8dba1024682338AdA0
- Token
- 0x943793-38ada0
- Creator
- 0x7f451e–36dc0c at 0x0862fd–8d3175
- 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
- 11 Transactions
- Transfers
- 0 Transfers
- Gas Used
- 499,598
- Last Balance Update
- 14865884
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- PlastikPRGV2
- Optimization enabled
- false
- Compiler version
- v0.8.9+commit.e5eed63a
- EVM Version
- london
- Verified at
- 2023-01-24T19:34:39.055243Z
contracts/PlastikPRGV2.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "./UtilsV2.sol"; import "./VerifiedAccounts.sol"; import "./PlastikCryptoV2.sol"; import "./PlastikRoleV2.sol"; /// @custom:security-contact daniel@nozama.green contract PlastikPRGV2 is Ownable, ERC1155URIStorage, ERC1155Burnable, ERC1155Supply { mapping(uint256 => mapping(address => mapping(uint256 => uint256))) public attachedPRGToNFT; //tokenId => NFTAdress => tokenIdNFTAdrress => amount mapping(address => bool) whiteListSenders; event PRGNFTMinted(address indexed mintTo, uint256 tokenId, uint256 amount); event TheArtOfRecycling( address indexed sustainableUser, uint256 tokenId, uint256 amount, address indexed nftAddress, uint256 indexed nftTokenId ); VerifiedAccounts internal verifiedAccounts; PlastikCryptoV2 internal plastikCrypto; PlastikRoleV2 internal plastikRole; constructor(address _addressVerification, address _plastikCrypto, address _plastikRole) ERC1155("https://plastiks.io/ipfs") { verifiedAccounts = VerifiedAccounts(_addressVerification); plastikCrypto = PlastikCryptoV2(_plastikCrypto); plastikRole = PlastikRoleV2(_plastikRole); whiteListSenders[_msgSender()] = true; } modifier onlyMinter() { if (_msgSender() != owner()) { plastikRole.verifyMinterRole(_msgSender()); } _; } function setBaseURI(string memory newuri) public onlyOwner { _setBaseURI(newuri); } function setVerification(address _verifiedAddress) public onlyOwner returns (bool) { verifiedAccounts = VerifiedAccounts(_verifiedAddress); return true; } function mint( address to, uint256 id, uint256 amount, string memory tokenURI, bytes memory data ) external onlyMinter returns (uint256) { require( verifiedAccounts.isVerified(to), "Creator is not a verified recycler" ); _mint(to, id, amount, data); _setURI(id, tokenURI); emit PRGNFTMinted(to, id, amount); return id; } function mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, string[] memory uris, bytes memory data ) public onlyMinter { require( verifiedAccounts.isVerified(to), "Creator is not a verified recycler" ); require( uris.length == amounts.length, "ERC1155: uris and amounts length mismatch" ); _mintBatch(to, ids, amounts, data); for (uint256 i = 0; i < uris.length; i++) { _setURI(ids[i], uris[i]); emit PRGNFTMinted(to, ids[i], amounts[i]); } } function safeLazyMint( address buyer, uint256 amount, PRGVoucher calldata voucher, bytes memory signature, bytes memory data ) external payable onlyMinter 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.verifyPRGVoucher(voucher, signature); require( signer == voucher.creatorAddress, "Creator Address does not match" ); require( verifiedAccounts.isVerified(voucher.creatorAddress), "Creator is not a verified recycler" ); if (!exists(voucher.tokenId)) { _mint(signer, voucher.tokenId, voucher.amount, data); _setURI(voucher.tokenId, voucher.tokenURI); emit PRGNFTMinted(signer, voucher.tokenId, voucher.amount); } safeTransferFrom(signer, buyer, voucher.tokenId, amount, data); return voucher.tokenId; } function uri(uint256 tokenId) public view virtual override(ERC1155, ERC1155URIStorage) returns (string memory) { return super.uri(tokenId); } function attachPRGToNFT( address sustainableUser, uint256 tokenId, uint256 amount, address nftTokenAddress, uint256 nftTokenId ) public onlyMinter returns (bool) { attachedPRGToNFT[tokenId][nftTokenAddress][nftTokenId] += amount; emit TheArtOfRecycling( sustainableUser, tokenId, amount, nftTokenAddress, nftTokenId ); return true; } function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal override(ERC1155, ERC1155Supply) { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); require( from == address(0) || whiteListSenders[from] || verifiedAccounts.isVerified(from), "from account is not a verified recycler" ); } function addWhiteListSenderAddress(address _address, bool value) onlyOwner public returns(bool) { whiteListSenders[_address] = value; return true; } function supportsInterface(bytes4 interfaceId) public view override(ERC1155) returns (bool) { return super.supportsInterface(interfaceId); } }
/_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/AccessControlEnumerable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
/_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/IAccessControlEnumerable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
/_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/token/ERC1155/ERC1155.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155.sol"; import "./IERC1155Receiver.sol"; import "./extensions/IERC1155MetadataURI.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256) public view virtual override returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: address zero is not a valid owner"); return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, to, ids, amounts, data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _afterTokenTransfer(operator, from, to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the amounts in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); _balances[id][to] += amount; emit TransferSingle(operator, address(0), to, id, amount); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _afterTokenTransfer(operator, address(0), to, ids, amounts, data); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } /** * @dev Destroys `amount` tokens of token type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `amount` tokens of token type `id`. */ function _burn( address from, uint256 id, uint256 amount ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); uint256[] memory ids = _asSingletonArray(id); uint256[] memory amounts = _asSingletonArray(amount); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } emit TransferSingle(operator, from, address(0), id, amount); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. */ function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(from != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][from] = fromBalance - amount; } } emit TransferBatch(operator, from, address(0), ids, amounts); _afterTokenTransfer(operator, from, address(0), ids, amounts, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC1155: setting approval status for self"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Hook that is called before any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `ids` and `amounts` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting * and burning, as well as batched variants. * * The same hook is called on both single and batched variants. For single * transfers, the length of the `id` and `amount` arrays will be 1. * * Calling conditions (for each `id` and `amount` pair): * * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens * of token type `id` will be transferred to `to`. * - When `from` is zero, `amount` tokens of token type `id` will be minted * for `to`. * - when `to` is zero, `amount` of ``from``'s tokens of token type `id` * will be burned. * - `from` and `to` are never both zero. * - `ids` and `amounts` have the same, non-zero length. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } }
/_openzeppelin/contracts/token/ERC1155/IERC1155.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
/_openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
/_openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract ERC1155Burnable is ERC1155 { function burn( address account, uint256 id, uint256 value ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not token owner nor approved" ); _burn(account, id, value); } function burnBatch( address account, uint256[] memory ids, uint256[] memory values ) public virtual { require( account == _msgSender() || isApprovedForAll(account, _msgSender()), "ERC1155: caller is not token owner nor approved" ); _burnBatch(account, ids, values); } }
/_openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155Supply.sol) pragma solidity ^0.8.0; import "../ERC1155.sol"; /** * @dev Extension of ERC1155 that adds tracking of total supply per id. * * Useful for scenarios where Fungible and Non-fungible tokens have to be * clearly identified. Note: While a totalSupply of 1 might mean the * corresponding is an NFT, there is no guarantees that no other token with the * same id are not going to be minted. */ abstract contract ERC1155Supply is ERC1155 { mapping(uint256 => uint256) private _totalSupply; /** * @dev Total amount of tokens in with a given id. */ function totalSupply(uint256 id) public view virtual returns (uint256) { return _totalSupply[id]; } /** * @dev Indicates whether any token exist with a given id, or not. */ function exists(uint256 id) public view virtual returns (bool) { return ERC1155Supply.totalSupply(id) > 0; } /** * @dev See {ERC1155-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); if (from == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { _totalSupply[ids[i]] += amounts[i]; } } if (to == address(0)) { for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 supply = _totalSupply[id]; require(supply >= amount, "ERC1155: burn amount exceeds totalSupply"); unchecked { _totalSupply[id] = supply - amount; } } } } }
/_openzeppelin/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155URIStorage.sol) pragma solidity ^0.8.0; import "../../../utils/Strings.sol"; import "../ERC1155.sol"; /** * @dev ERC1155 token with storage based token URI management. * Inspired by the ERC721URIStorage extension * * _Available since v4.6._ */ abstract contract ERC1155URIStorage is ERC1155 { using Strings for uint256; // Optional base URI string private _baseURI = ""; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the concatenation of the `_baseURI` * and the token-specific uri if the latter is set * * This enables the following behaviors: * * - if `_tokenURIs[tokenId]` is set, then the result is the concatenation * of `_baseURI` and `_tokenURIs[tokenId]` (keep in mind that `_baseURI` * is empty per default); * * - if `_tokenURIs[tokenId]` is NOT set then we fallback to `super.uri()` * which in most cases will contain `ERC1155._uri`; * * - if `_tokenURIs[tokenId]` is NOT set, and if the parents do not have a * uri value set, then the result is empty. */ function uri(uint256 tokenId) public view virtual override returns (string memory) { string memory tokenURI = _tokenURIs[tokenId]; // If token URI is set, concatenate base URI and tokenURI (via abi.encodePacked). return bytes(tokenURI).length > 0 ? string(abi.encodePacked(_baseURI, tokenURI)) : super.uri(tokenId); } /** * @dev Sets `tokenURI` as the tokenURI of `tokenId`. */ function _setURI(uint256 tokenId, string memory tokenURI) internal virtual { _tokenURIs[tokenId] = tokenURI; emit URI(uri(tokenId), tokenId); } /** * @dev Sets `baseURI` as the `_baseURI` for all tokens */ function _setBaseURI(string memory baseURI) internal virtual { _baseURI = baseURI; } }
/_openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
/_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); }
/_openzeppelin/contracts/utils/structs/EnumerableSet.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
/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/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); }
/contracts/VerifiedAccounts.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; contract VerifiedAccounts is Ownable, AccessControlEnumerable { bytes32 public constant VALIDATOR_ROLE = keccak256("VALIDATOR_ROLE"); mapping(address => bool) verifyAddresses; event Verified(address indexed _address); event Unverified(address indexed _address); constructor() Ownable() { _grantRole(DEFAULT_ADMIN_ROLE, _msgSender()); _setupRole(VALIDATOR_ROLE, _msgSender()); verifyAddresses[_msgSender()] = true; } function addVerifyAddress(address _address, bool value) public { require(hasRole(VALIDATOR_ROLE, msg.sender), "Only validators can verify"); verifyAddresses[_address] = value; if (value) { emit Verified(_address); } else { emit Unverified(_address); } } function isVerified(address _address) public view returns (bool) { return verifyAddresses[_address]; } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_addressVerification","internalType":"address"},{"type":"address","name":"_plastikCrypto","internalType":"address"},{"type":"address","name":"_plastikRole","internalType":"address"}]},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"account","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":"PRGNFTMinted","inputs":[{"type":"address","name":"mintTo","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TheArtOfRecycling","inputs":[{"type":"address","name":"sustainableUser","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"address","name":"nftAddress","internalType":"address","indexed":true},{"type":"uint256","name":"nftTokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"TransferBatch","inputs":[{"type":"address","name":"operator","internalType":"address","indexed":true},{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256[]","name":"ids","internalType":"uint256[]","indexed":false},{"type":"uint256[]","name":"values","internalType":"uint256[]","indexed":false}],"anonymous":false},{"type":"event","name":"TransferSingle","inputs":[{"type":"address","name":"operator","internalType":"address","indexed":true},{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"id","internalType":"uint256","indexed":false},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"URI","inputs":[{"type":"string","name":"value","internalType":"string","indexed":false},{"type":"uint256","name":"id","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"addWhiteListSenderAddress","inputs":[{"type":"address","name":"_address","internalType":"address"},{"type":"bool","name":"value","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"attachPRGToNFT","inputs":[{"type":"address","name":"sustainableUser","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"nftTokenAddress","internalType":"address"},{"type":"uint256","name":"nftTokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"attachedPRGToNFT","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"id","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"balanceOfBatch","inputs":[{"type":"address[]","name":"accounts","internalType":"address[]"},{"type":"uint256[]","name":"ids","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burn","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burnBatch","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"uint256[]","name":"ids","internalType":"uint256[]"},{"type":"uint256[]","name":"values","internalType":"uint256[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"exists","inputs":[{"type":"uint256","name":"id","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"account","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mint","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"string","name":"tokenURI","internalType":"string"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintBatch","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256[]","name":"ids","internalType":"uint256[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"},{"type":"string[]","name":"uris","internalType":"string[]"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeBatchTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256[]","name":"ids","internalType":"uint256[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"safeLazyMint","inputs":[{"type":"address","name":"buyer","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"tuple","name":"voucher","internalType":"struct PRGVoucher","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":"bytes","name":"signature","internalType":"bytes"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"amount","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":"newuri","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"setVerification","inputs":[{"type":"address","name":"_verifiedAddress","internalType":"address"}]},{"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":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[{"type":"uint256","name":"id","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"uri","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]}]
Contract Creation Code
0x608060405260405180602001604052806000815250600490805190602001906200002b929190620002e2565b503480156200003957600080fd5b5060405162005c8f38038062005c8f83398181016040528101906200005f9190620003fc565b6040518060400160405280601881526020017f68747470733a2f2f706c617374696b732e696f2f697066730000000000000000815250620000b5620000a9620001fa60201b60201c565b6200020260201b60201c565b620000c681620002c660201b60201c565b5082600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160086000620001a0620001fa60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050620004bd565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8060039080519060200190620002de929190620002e2565b5050565b828054620002f09062000487565b90600052602060002090601f01602090048101928262000314576000855562000360565b82601f106200032f57805160ff191683800117855562000360565b8280016001018555821562000360579182015b828111156200035f57825182559160200191906001019062000342565b5b5090506200036f919062000373565b5090565b5b808211156200038e57600081600090555060010162000374565b5090565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620003c48262000397565b9050919050565b620003d681620003b7565b8114620003e257600080fd5b50565b600081519050620003f681620003cb565b92915050565b60008060006060848603121562000418576200041762000392565b5b60006200042886828701620003e5565b93505060206200043b86828701620003e5565b92505060406200044e86828701620003e5565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620004a057607f821691505b60208210811415620004b757620004b662000458565b5b50919050565b6157c280620004cd6000396000f3fe60806040526004361061013f5760003560e01c8063715018a6116100b6578063bd85b0391161006f578063bd85b039146104a8578063bd969c25146104e5578063e985e9c514610522578063f242432a1461055f578063f2fde38b14610588578063f5298aca146105b15761013f565b8063715018a61461039a5780638da5cb5b146103b1578063971f8bb1146103dc578063a22cb46514610419578063a4b645eb14610442578063b9571e841461047f5761013f565b80634e1273f4116101085780634e1273f4146102615780634f558e791461029e5780634f78a38f146102db57806355f804b31461030b5780635ccd3b82146103345780636b20c454146103715761013f565b8062fdd58e1461014457806301ffc9a7146101815780630e89341c146101be5780632eb2c2d6146101fb5780633ff38b8614610224575b600080fd5b34801561015057600080fd5b5061016b60048036038101906101669190613650565b6105da565b604051610178919061369f565b60405180910390f35b34801561018d57600080fd5b506101a860048036038101906101a39190613712565b6106a4565b6040516101b5919061375a565b60405180910390f35b3480156101ca57600080fd5b506101e560048036038101906101e09190613775565b6106b6565b6040516101f2919061383b565b60405180910390f35b34801561020757600080fd5b50610222600480360381019061021d9190613a5a565b6106c8565b005b34801561023057600080fd5b5061024b60048036038101906102469190613b29565b610769565b604051610258919061369f565b60405180910390f35b34801561026d57600080fd5b5061028860048036038101906102839190613c3f565b61079b565b6040516102959190613d75565b60405180910390f35b3480156102aa57600080fd5b506102c560048036038101906102c09190613775565b6108b4565b6040516102d2919061375a565b60405180910390f35b6102f560048036038101906102f09190613dbb565b6108c8565b604051610302919061369f565b60405180910390f35b34801561031757600080fd5b50610332600480360381019061032d9190613f2b565b610d4b565b005b34801561034057600080fd5b5061035b60048036038101906103569190613fa0565b610d5f565b604051610368919061375a565b60405180910390f35b34801561037d57600080fd5b5061039860048036038101906103939190613fe0565b610dca565b005b3480156103a657600080fd5b506103af610e67565b005b3480156103bd57600080fd5b506103c6610e7b565b6040516103d3919061407a565b60405180910390f35b3480156103e857600080fd5b5061040360048036038101906103fe9190614095565b610ea4565b604051610410919061375a565b60405180910390f35b34801561042557600080fd5b50610440600480360381019061043b9190613fa0565b610ef8565b005b34801561044e57600080fd5b50610469600480360381019061046491906140c2565b610f0e565b604051610476919061369f565b60405180910390f35b34801561048b57600080fd5b506104a660048036038101906104a19190614256565b611140565b005b3480156104b457600080fd5b506104cf60048036038101906104ca9190613775565b611437565b6040516104dc919061369f565b60405180910390f35b3480156104f157600080fd5b5061050c60048036038101906105079190614341565b611454565b604051610519919061375a565b60405180910390f35b34801561052e57600080fd5b50610549600480360381019061054491906143bc565b611617565b604051610556919061375a565b60405180910390f35b34801561056b57600080fd5b50610586600480360381019061058191906143fc565b6116ab565b005b34801561059457600080fd5b506105af60048036038101906105aa9190614095565b61174c565b005b3480156105bd57600080fd5b506105d860048036038101906105d39190614493565b6117d0565b005b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561064b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064290614558565b60405180910390fd5b6001600083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006106af8261186d565b9050919050565b60606106c18261194f565b9050919050565b6106d0611a34565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480610716575061071585610710611a34565b611617565b5b610755576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074c906145ea565b60405180910390fd5b6107628585858585611a3c565b5050505050565b600760205282600052604060002060205281600052604060002060205280600052604060002060009250925050505481565b606081518351146107e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d89061467c565b60405180910390fd5b6000835167ffffffffffffffff8111156107fe576107fd613862565b5b60405190808252806020026020018201604052801561082c5781602001602082028036833780820191505090505b50905060005b84518110156108a9576108798582815181106108515761085061469c565b5b602002602001015185838151811061086c5761086b61469c565b5b60200260200101516105da565b82828151811061088c5761088b61469c565b5b602002602001018181525050806108a2906146fa565b9050610832565b508091505092915050565b6000806108c083611437565b119050919050565b60006108d2610e7b565b73ffffffffffffffffffffffffffffffffffffffff166108f0611a34565b73ffffffffffffffffffffffffffffffffffffffff161461099e57600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e610951611a34565b6040518263ffffffff1660e01b815260040161096d919061407a565b60006040518083038186803b15801561098557600080fd5b505afa158015610999573d6000803e3d6000fd5b505050505b3073ffffffffffffffffffffffffffffffffffffffff168460000160208101906109c89190614095565b73ffffffffffffffffffffffffffffffffffffffff1614610a1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a15906147b5565b60405180910390fd5b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b0f271c586866040518363ffffffff1660e01b8152600401610a7d9291906149b7565b60206040518083038186803b158015610a9557600080fd5b505afa158015610aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acd9190614a03565b9050846080016020810190610ae29190614095565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610b4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4690614a7c565b60405180910390fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9209e33866080016020810190610ba09190614095565b6040518263ffffffff1660e01b8152600401610bbc919061407a565b60206040518083038186803b158015610bd457600080fd5b505afa158015610be8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0c9190614ab1565b610c4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4290614b50565b60405180910390fd5b610c5885602001356108b4565b610d2957610c70818660200135876040013586611d61565b610cd08560200135868060600190610c889190614b7f565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050611f13565b8073ffffffffffffffffffffffffffffffffffffffff167f4eb95501a95e043f8b49c559a5af0433864f18d84996f3588f390425442b1b9086602001358760400135604051610d20929190614be2565b60405180910390a25b610d3a8188876020013589876116ab565b846020013591505095945050505050565b610d53611f7f565b610d5c81611ffd565b50565b6000610d69611f7f565b81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b610dd2611a34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480610e185750610e1783610e12611a34565b611617565b5b610e57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4e906145ea565b60405180910390fd5b610e62838383612017565b505050565b610e6f611f7f565b610e7960006122e8565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610eae611f7f565b81600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b610f0a610f03611a34565b83836123ac565b5050565b6000610f18610e7b565b73ffffffffffffffffffffffffffffffffffffffff16610f36611a34565b73ffffffffffffffffffffffffffffffffffffffff1614610fe457600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e610f97611a34565b6040518263ffffffff1660e01b8152600401610fb3919061407a565b60006040518083038186803b158015610fcb57600080fd5b505afa158015610fdf573d6000803e3d6000fd5b505050505b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9209e33876040518263ffffffff1660e01b815260040161103f919061407a565b60206040518083038186803b15801561105757600080fd5b505afa15801561106b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108f9190614ab1565b6110ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c590614b50565b60405180910390fd5b6110da86868685611d61565b6110e48584611f13565b8573ffffffffffffffffffffffffffffffffffffffff167f4eb95501a95e043f8b49c559a5af0433864f18d84996f3588f390425442b1b90868660405161112c929190614be2565b60405180910390a284905095945050505050565b611148610e7b565b73ffffffffffffffffffffffffffffffffffffffff16611166611a34565b73ffffffffffffffffffffffffffffffffffffffff161461121457600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e6111c7611a34565b6040518263ffffffff1660e01b81526004016111e3919061407a565b60006040518083038186803b1580156111fb57600080fd5b505afa15801561120f573d6000803e3d6000fd5b505050505b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9209e33866040518263ffffffff1660e01b815260040161126f919061407a565b60206040518083038186803b15801561128757600080fd5b505afa15801561129b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112bf9190614ab1565b6112fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f590614b50565b60405180910390fd5b8251825114611342576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133990614c7d565b60405180910390fd5b61134e85858584612519565b60005b825181101561142f576113988582815181106113705761136f61469c565b5b602002602001015184838151811061138b5761138a61469c565b5b6020026020010151611f13565b8573ffffffffffffffffffffffffffffffffffffffff167f4eb95501a95e043f8b49c559a5af0433864f18d84996f3588f390425442b1b908683815181106113e3576113e261469c565b5b60200260200101518684815181106113fe576113fd61469c565b5b6020026020010151604051611414929190614be2565b60405180910390a28080611427906146fa565b915050611351565b505050505050565b600060066000838152602001908152602001600020549050919050565b600061145e610e7b565b73ffffffffffffffffffffffffffffffffffffffff1661147c611a34565b73ffffffffffffffffffffffffffffffffffffffff161461152a57600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e6114dd611a34565b6040518263ffffffff1660e01b81526004016114f9919061407a565b60006040518083038186803b15801561151157600080fd5b505afa158015611525573d6000803e3d6000fd5b505050505b836007600087815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600082825461159b9190614c9d565b92505081905550818373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fb5c7c18afbb1bf0dff47fdc95c47e01d3e90f4de9e6490eed1e786d7bcf5be008888604051611602929190614be2565b60405180910390a46001905095945050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6116b3611a34565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614806116f957506116f8856116f3611a34565b611617565b5b611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f906145ea565b60405180910390fd5b6117458585858585612747565b5050505050565b611754611f7f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bb90614d65565b60405180910390fd5b6117cd816122e8565b50565b6117d8611a34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061181e575061181d83611818611a34565b611617565b5b61185d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611854906145ea565b60405180910390fd5b6118688383836129e6565b505050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061193857507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80611948575061194782612c2f565b5b9050919050565b6060600060056000848152602001908152602001600020805461197190614db4565b80601f016020809104026020016040519081016040528092919081815260200182805461199d90614db4565b80156119ea5780601f106119bf576101008083540402835291602001916119ea565b820191906000526020600020905b8154815290600101906020018083116119cd57829003601f168201915b505050505090506000815111611a0857611a0383612c99565b611a2c565b600481604051602001611a1c929190614eb6565b6040516020818303038152906040525b915050919050565b600033905090565b8151835114611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7790614f4c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611af0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae790614fde565b60405180910390fd5b6000611afa611a34565b9050611b0a818787878787612d2d565b60005b8451811015611cbe576000858281518110611b2b57611b2a61469c565b5b602002602001015190506000858381518110611b4a57611b4961469c565b5b6020026020010151905060006001600084815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611bec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be390615070565b60405180910390fd5b8181036001600085815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816001600085815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611ca39190614c9d565b9250508190555050505080611cb7906146fa565b9050611b0d565b508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611d35929190615090565b60405180910390a4611d4b818787878787612eb8565b611d59818787878787612ec0565b505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611dd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc890615139565b60405180910390fd5b6000611ddb611a34565b90506000611de8856130a7565b90506000611df5856130a7565b9050611e0683600089858589612d2d565b846001600088815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611e669190614c9d565b925050819055508673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628989604051611ee4929190614be2565b60405180910390a4611efb83600089858589612eb8565b611f0a83600089898989613121565b50505050505050565b80600560008481526020019081526020016000209080519060200190611f3a929190613505565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b611f66846106b6565b604051611f73919061383b565b60405180910390a25050565b611f87611a34565b73ffffffffffffffffffffffffffffffffffffffff16611fa5610e7b565b73ffffffffffffffffffffffffffffffffffffffff1614611ffb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff2906151a5565b60405180910390fd5b565b8060049080519060200190612013929190613505565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207e90615237565b60405180910390fd5b80518251146120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c290614f4c565b60405180910390fd5b60006120d5611a34565b90506120f581856000868660405180602001604052806000815250612d2d565b60005b83518110156122445760008482815181106121165761211561469c565b5b6020026020010151905060008483815181106121355761213461469c565b5b6020026020010151905060006001600084815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156121d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ce906152c9565b60405180910390fd5b8181036001600085815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050808061223c906146fa565b9150506120f8565b50600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516122bc929190615090565b60405180910390a46122e281856000868660405180602001604052806000815250612eb8565b50505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561241b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124129061535b565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161250c919061375a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612589576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161258090615139565b60405180910390fd5b81518351146125cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c490614f4c565b60405180910390fd5b60006125d7611a34565b90506125e881600087878787612d2d565b60005b84518110156126a2578381815181106126075761260661469c565b5b6020026020010151600160008784815181106126265761262561469c565b5b6020026020010151815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546126889190614c9d565b92505081905550808061269a906146fa565b9150506125eb565b508473ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161271a929190615090565b60405180910390a461273181600087878787612eb8565b61274081600087878787612ec0565b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156127b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127ae90614fde565b60405180910390fd5b60006127c1611a34565b905060006127ce856130a7565b905060006127db856130a7565b90506127eb838989858589612d2d565b60006001600088815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905085811015612883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161287a90615070565b60405180910390fd5b8581036001600089815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550856001600089815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461293a9190614c9d565b925050819055508773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628a8a6040516129b7929190614be2565b60405180910390a46129cd848a8a86868a612eb8565b6129db848a8a8a8a8a613121565b505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612a56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4d90615237565b60405180910390fd5b6000612a60611a34565b90506000612a6d846130a7565b90506000612a7a846130a7565b9050612a9a83876000858560405180602001604052806000815250612d2d565b60006001600087815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905084811015612b32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b29906152c9565b60405180910390fd5b8481036001600088815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628989604051612c00929190614be2565b60405180910390a4612c2684886000868660405180602001604052806000815250612eb8565b50505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b606060038054612ca890614db4565b80601f0160208091040260200160405190810160405280929190818152602001828054612cd490614db4565b8015612d215780601f10612cf657610100808354040283529160200191612d21565b820191906000526020600020905b815481529060010190602001808311612d0457829003601f168201915b50505050509050919050565b612d3b868686868686613308565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480612dbf5750600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80612e715750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9209e33866040518263ffffffff1660e01b8152600401612e20919061407a565b60206040518083038186803b158015612e3857600080fd5b505afa158015612e4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e709190614ab1565b5b612eb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ea7906153ed565b60405180910390fd5b505050505050565b505050505050565b612edf8473ffffffffffffffffffffffffffffffffffffffff166134da565b1561309f578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b8152600401612f2595949392919061540d565b602060405180830381600087803b158015612f3f57600080fd5b505af1925050508015612f7057506040513d601f19601f82011682018060405250810190612f6d919061548a565b60015b61301657612f7c6154c4565b806308c379a01415612fd95750612f916154e6565b80612f9c5750612fdb565b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fd0919061383b565b60405180910390fd5b505b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161300d906155ee565b60405180910390fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461309d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161309490615680565b60405180910390fd5b505b505050505050565b60606000600167ffffffffffffffff8111156130c6576130c5613862565b5b6040519080825280602002602001820160405280156130f45781602001602082028036833780820191505090505b509050828160008151811061310c5761310b61469c565b5b60200260200101818152505080915050919050565b6131408473ffffffffffffffffffffffffffffffffffffffff166134da565b15613300578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b81526004016131869594939291906156a0565b602060405180830381600087803b1580156131a057600080fd5b505af19250505080156131d157506040513d601f19601f820116820180604052508101906131ce919061548a565b60015b613277576131dd6154c4565b806308c379a0141561323a57506131f26154e6565b806131fd575061323c565b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613231919061383b565b60405180910390fd5b505b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161326e906155ee565b60405180910390fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146132fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132f590615680565b60405180910390fd5b505b505050505050565b6133168686868686866134fd565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156133c85760005b83518110156133c65782818151811061336a5761336961469c565b5b6020026020010151600660008684815181106133895761338861469c565b5b6020026020010151815260200190815260200160002060008282546133ae9190614c9d565b92505081905550806133bf906146fa565b905061334e565b505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156134d25760005b83518110156134d057600084828151811061341e5761341d61469c565b5b60200260200101519050600084838151811061343d5761343c61469c565b5b60200260200101519050600060066000848152602001908152602001600020549050818110156134a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016134999061576c565b60405180910390fd5b8181036006600085815260200190815260200160002081905550505050806134c9906146fa565b9050613400565b505b505050505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b505050505050565b82805461351190614db4565b90600052602060002090601f016020900481019282613533576000855561357a565b82601f1061354c57805160ff191683800117855561357a565b8280016001018555821561357a579182015b8281111561357957825182559160200191906001019061355e565b5b509050613587919061358b565b5090565b5b808211156135a457600081600090555060010161358c565b5090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006135e7826135bc565b9050919050565b6135f7816135dc565b811461360257600080fd5b50565b600081359050613614816135ee565b92915050565b6000819050919050565b61362d8161361a565b811461363857600080fd5b50565b60008135905061364a81613624565b92915050565b60008060408385031215613667576136666135b2565b5b600061367585828601613605565b92505060206136868582860161363b565b9150509250929050565b6136998161361a565b82525050565b60006020820190506136b46000830184613690565b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6136ef816136ba565b81146136fa57600080fd5b50565b60008135905061370c816136e6565b92915050565b600060208284031215613728576137276135b2565b5b6000613736848285016136fd565b91505092915050565b60008115159050919050565b6137548161373f565b82525050565b600060208201905061376f600083018461374b565b92915050565b60006020828403121561378b5761378a6135b2565b5b60006137998482850161363b565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156137dc5780820151818401526020810190506137c1565b838111156137eb576000848401525b50505050565b6000601f19601f8301169050919050565b600061380d826137a2565b61381781856137ad565b93506138278185602086016137be565b613830816137f1565b840191505092915050565b600060208201905081810360008301526138558184613802565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61389a826137f1565b810181811067ffffffffffffffff821117156138b9576138b8613862565b5b80604052505050565b60006138cc6135a8565b90506138d88282613891565b919050565b600067ffffffffffffffff8211156138f8576138f7613862565b5b602082029050602081019050919050565b600080fd5b600061392161391c846138dd565b6138c2565b9050808382526020820190506020840283018581111561394457613943613909565b5b835b8181101561396d5780613959888261363b565b845260208401935050602081019050613946565b5050509392505050565b600082601f83011261398c5761398b61385d565b5b813561399c84826020860161390e565b91505092915050565b600080fd5b600067ffffffffffffffff8211156139c5576139c4613862565b5b6139ce826137f1565b9050602081019050919050565b82818337600083830152505050565b60006139fd6139f8846139aa565b6138c2565b905082815260208101848484011115613a1957613a186139a5565b5b613a248482856139db565b509392505050565b600082601f830112613a4157613a4061385d565b5b8135613a518482602086016139ea565b91505092915050565b600080600080600060a08688031215613a7657613a756135b2565b5b6000613a8488828901613605565b9550506020613a9588828901613605565b945050604086013567ffffffffffffffff811115613ab657613ab56135b7565b5b613ac288828901613977565b935050606086013567ffffffffffffffff811115613ae357613ae26135b7565b5b613aef88828901613977565b925050608086013567ffffffffffffffff811115613b1057613b0f6135b7565b5b613b1c88828901613a2c565b9150509295509295909350565b600080600060608486031215613b4257613b416135b2565b5b6000613b508682870161363b565b9350506020613b6186828701613605565b9250506040613b728682870161363b565b9150509250925092565b600067ffffffffffffffff821115613b9757613b96613862565b5b602082029050602081019050919050565b6000613bbb613bb684613b7c565b6138c2565b90508083825260208201905060208402830185811115613bde57613bdd613909565b5b835b81811015613c075780613bf38882613605565b845260208401935050602081019050613be0565b5050509392505050565b600082601f830112613c2657613c2561385d565b5b8135613c36848260208601613ba8565b91505092915050565b60008060408385031215613c5657613c556135b2565b5b600083013567ffffffffffffffff811115613c7457613c736135b7565b5b613c8085828601613c11565b925050602083013567ffffffffffffffff811115613ca157613ca06135b7565b5b613cad85828601613977565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613cec8161361a565b82525050565b6000613cfe8383613ce3565b60208301905092915050565b6000602082019050919050565b6000613d2282613cb7565b613d2c8185613cc2565b9350613d3783613cd3565b8060005b83811015613d68578151613d4f8882613cf2565b9750613d5a83613d0a565b925050600181019050613d3b565b5085935050505092915050565b60006020820190508181036000830152613d8f8184613d17565b905092915050565b600080fd5b600060a08284031215613db257613db1613d97565b5b81905092915050565b600080600080600060a08688031215613dd757613dd66135b2565b5b6000613de588828901613605565b9550506020613df68882890161363b565b945050604086013567ffffffffffffffff811115613e1757613e166135b7565b5b613e2388828901613d9c565b935050606086013567ffffffffffffffff811115613e4457613e436135b7565b5b613e5088828901613a2c565b925050608086013567ffffffffffffffff811115613e7157613e706135b7565b5b613e7d88828901613a2c565b9150509295509295909350565b600067ffffffffffffffff821115613ea557613ea4613862565b5b613eae826137f1565b9050602081019050919050565b6000613ece613ec984613e8a565b6138c2565b905082815260208101848484011115613eea57613ee96139a5565b5b613ef58482856139db565b509392505050565b600082601f830112613f1257613f1161385d565b5b8135613f22848260208601613ebb565b91505092915050565b600060208284031215613f4157613f406135b2565b5b600082013567ffffffffffffffff811115613f5f57613f5e6135b7565b5b613f6b84828501613efd565b91505092915050565b613f7d8161373f565b8114613f8857600080fd5b50565b600081359050613f9a81613f74565b92915050565b60008060408385031215613fb757613fb66135b2565b5b6000613fc585828601613605565b9250506020613fd685828601613f8b565b9150509250929050565b600080600060608486031215613ff957613ff86135b2565b5b600061400786828701613605565b935050602084013567ffffffffffffffff811115614028576140276135b7565b5b61403486828701613977565b925050604084013567ffffffffffffffff811115614055576140546135b7565b5b61406186828701613977565b9150509250925092565b614074816135dc565b82525050565b600060208201905061408f600083018461406b565b92915050565b6000602082840312156140ab576140aa6135b2565b5b60006140b984828501613605565b91505092915050565b600080600080600060a086880312156140de576140dd6135b2565b5b60006140ec88828901613605565b95505060206140fd8882890161363b565b945050604061410e8882890161363b565b935050606086013567ffffffffffffffff81111561412f5761412e6135b7565b5b61413b88828901613efd565b925050608086013567ffffffffffffffff81111561415c5761415b6135b7565b5b61416888828901613a2c565b9150509295509295909350565b600067ffffffffffffffff8211156141905761418f613862565b5b602082029050602081019050919050565b60006141b46141af84614175565b6138c2565b905080838252602082019050602084028301858111156141d7576141d6613909565b5b835b8181101561421e57803567ffffffffffffffff8111156141fc576141fb61385d565b5b8086016142098982613efd565b855260208501945050506020810190506141d9565b5050509392505050565b600082601f83011261423d5761423c61385d565b5b813561424d8482602086016141a1565b91505092915050565b600080600080600060a08688031215614272576142716135b2565b5b600061428088828901613605565b955050602086013567ffffffffffffffff8111156142a1576142a06135b7565b5b6142ad88828901613977565b945050604086013567ffffffffffffffff8111156142ce576142cd6135b7565b5b6142da88828901613977565b935050606086013567ffffffffffffffff8111156142fb576142fa6135b7565b5b61430788828901614228565b925050608086013567ffffffffffffffff811115614328576143276135b7565b5b61433488828901613a2c565b9150509295509295909350565b600080600080600060a0868803121561435d5761435c6135b2565b5b600061436b88828901613605565b955050602061437c8882890161363b565b945050604061438d8882890161363b565b935050606061439e88828901613605565b92505060806143af8882890161363b565b9150509295509295909350565b600080604083850312156143d3576143d26135b2565b5b60006143e185828601613605565b92505060206143f285828601613605565b9150509250929050565b600080600080600060a08688031215614418576144176135b2565b5b600061442688828901613605565b955050602061443788828901613605565b94505060406144488882890161363b565b93505060606144598882890161363b565b925050608086013567ffffffffffffffff81111561447a576144796135b7565b5b61448688828901613a2c565b9150509295509295909350565b6000806000606084860312156144ac576144ab6135b2565b5b60006144ba86828701613605565b93505060206144cb8682870161363b565b92505060406144dc8682870161363b565b9150509250925092565b7f455243313135353a2061646472657373207a65726f206973206e6f742061207660008201527f616c6964206f776e657200000000000000000000000000000000000000000000602082015250565b6000614542602a836137ad565b915061454d826144e6565b604082019050919050565b6000602082019050818103600083015261457181614535565b9050919050565b7f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60008201527f6572206e6f7220617070726f7665640000000000000000000000000000000000602082015250565b60006145d4602f836137ad565b91506145df82614578565b604082019050919050565b60006020820190508181036000830152614603816145c7565b9050919050565b7f455243313135353a206163636f756e747320616e6420696473206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b60006146666029836137ad565b91506146718261460a565b604082019050919050565b6000602082019050818103600083015261469581614659565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006147058261361a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614738576147376146cb565b5b600182019050919050565b7f54686520766f7563686572206d75737420626520666f72207468697320636f6e60008201527f7472616374000000000000000000000000000000000000000000000000000000602082015250565b600061479f6025836137ad565b91506147aa82614743565b604082019050919050565b600060208201905081810360008301526147ce81614792565b9050919050565b60006147e46020840184613605565b905092915050565b6147f5816135dc565b82525050565b600061480a602084018461363b565b905092915050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261483e5761483d61481c565b5b83810192508235915060208301925067ffffffffffffffff82111561486657614865614812565b5b60018202360384131561487c5761487b614817565b5b509250929050565b600082825260208201905092915050565b60006148a18385614884565b93506148ae8385846139db565b6148b7836137f1565b840190509392505050565b600060a083016148d560008401846147d5565b6148e260008601826147ec565b506148f060208401846147fb565b6148fd6020860182613ce3565b5061490b60408401846147fb565b6149186040860182613ce3565b506149266060840184614821565b8583036060870152614939838284614895565b9250505061494a60808401846147d5565b61495760808601826147ec565b508091505092915050565b600081519050919050565b600082825260208201905092915050565b600061498982614962565b614993818561496d565b93506149a38185602086016137be565b6149ac816137f1565b840191505092915050565b600060408201905081810360008301526149d181856148c2565b905081810360208301526149e5818461497e565b90509392505050565b6000815190506149fd816135ee565b92915050565b600060208284031215614a1957614a186135b2565b5b6000614a27848285016149ee565b91505092915050565b7f43726561746f72204164647265737320646f6573206e6f74206d617463680000600082015250565b6000614a66601e836137ad565b9150614a7182614a30565b602082019050919050565b60006020820190508181036000830152614a9581614a59565b9050919050565b600081519050614aab81613f74565b92915050565b600060208284031215614ac757614ac66135b2565b5b6000614ad584828501614a9c565b91505092915050565b7f43726561746f72206973206e6f7420612076657269666965642072656379636c60008201527f6572000000000000000000000000000000000000000000000000000000000000602082015250565b6000614b3a6022836137ad565b9150614b4582614ade565b604082019050919050565b60006020820190508181036000830152614b6981614b2d565b9050919050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112614b9c57614b9b614b70565b5b80840192508235915067ffffffffffffffff821115614bbe57614bbd614b75565b5b602083019250600182023603831315614bda57614bd9614b7a565b5b509250929050565b6000604082019050614bf76000830185613690565b614c046020830184613690565b9392505050565b7f455243313135353a207572697320616e6420616d6f756e7473206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b6000614c676029836137ad565b9150614c7282614c0b565b604082019050919050565b60006020820190508181036000830152614c9681614c5a565b9050919050565b6000614ca88261361a565b9150614cb38361361a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614ce857614ce76146cb565b5b828201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614d4f6026836137ad565b9150614d5a82614cf3565b604082019050919050565b60006020820190508181036000830152614d7e81614d42565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680614dcc57607f821691505b60208210811415614de057614ddf614d85565b5b50919050565b600081905092915050565b60008190508160005260206000209050919050565b60008154614e1381614db4565b614e1d8186614de6565b94506001821660008114614e385760018114614e4957614e7c565b60ff19831686528186019350614e7c565b614e5285614df1565b60005b83811015614e7457815481890152600182019150602081019050614e55565b838801955050505b50505092915050565b6000614e90826137a2565b614e9a8185614de6565b9350614eaa8185602086016137be565b80840191505092915050565b6000614ec28285614e06565b9150614ece8284614e85565b91508190509392505050565b7f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060008201527f6d69736d61746368000000000000000000000000000000000000000000000000602082015250565b6000614f366028836137ad565b9150614f4182614eda565b604082019050919050565b60006020820190508181036000830152614f6581614f29565b9050919050565b7f455243313135353a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000614fc86025836137ad565b9150614fd382614f6c565b604082019050919050565b60006020820190508181036000830152614ff781614fbb565b9050919050565b7f455243313135353a20696e73756666696369656e742062616c616e636520666f60008201527f72207472616e7366657200000000000000000000000000000000000000000000602082015250565b600061505a602a836137ad565b915061506582614ffe565b604082019050919050565b600060208201905081810360008301526150898161504d565b9050919050565b600060408201905081810360008301526150aa8185613d17565b905081810360208301526150be8184613d17565b90509392505050565b7f455243313135353a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b60006151236021836137ad565b915061512e826150c7565b604082019050919050565b6000602082019050818103600083015261515281615116565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061518f6020836137ad565b915061519a82615159565b602082019050919050565b600060208201905081810360008301526151be81615182565b9050919050565b7f455243313135353a206275726e2066726f6d20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006152216023836137ad565b915061522c826151c5565b604082019050919050565b6000602082019050818103600083015261525081615214565b9050919050565b7f455243313135353a206275726e20616d6f756e7420657863656564732062616c60008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b60006152b36024836137ad565b91506152be82615257565b604082019050919050565b600060208201905081810360008301526152e2816152a6565b9050919050565b7f455243313135353a2073657474696e6720617070726f76616c2073746174757360008201527f20666f722073656c660000000000000000000000000000000000000000000000602082015250565b60006153456029836137ad565b9150615350826152e9565b604082019050919050565b6000602082019050818103600083015261537481615338565b9050919050565b7f66726f6d206163636f756e74206973206e6f742061207665726966696564207260008201527f656379636c657200000000000000000000000000000000000000000000000000602082015250565b60006153d76027836137ad565b91506153e28261537b565b604082019050919050565b60006020820190508181036000830152615406816153ca565b9050919050565b600060a082019050615422600083018861406b565b61542f602083018761406b565b81810360408301526154418186613d17565b905081810360608301526154558185613d17565b90508181036080830152615469818461497e565b90509695505050505050565b600081519050615484816136e6565b92915050565b6000602082840312156154a05761549f6135b2565b5b60006154ae84828501615475565b91505092915050565b60008160e01c9050919050565b600060033d11156154e35760046000803e6154e06000516154b7565b90505b90565b600060443d10156154f657615579565b6154fe6135a8565b60043d036004823e80513d602482011167ffffffffffffffff82111715615526575050615579565b808201805167ffffffffffffffff8111156155445750505050615579565b80602083010160043d038501811115615561575050505050615579565b61557082602001850186613891565b82955050505050505b90565b7f455243313135353a207472616e7366657220746f206e6f6e204552433131353560008201527f526563656976657220696d706c656d656e746572000000000000000000000000602082015250565b60006155d86034836137ad565b91506155e38261557c565b604082019050919050565b60006020820190508181036000830152615607816155cb565b9050919050565b7f455243313135353a204552433131353552656365697665722072656a6563746560008201527f6420746f6b656e73000000000000000000000000000000000000000000000000602082015250565b600061566a6028836137ad565b91506156758261560e565b604082019050919050565b600060208201905081810360008301526156998161565d565b9050919050565b600060a0820190506156b5600083018861406b565b6156c2602083018761406b565b6156cf6040830186613690565b6156dc6060830185613690565b81810360808301526156ee818461497e565b90509695505050505050565b7f455243313135353a206275726e20616d6f756e74206578636565647320746f7460008201527f616c537570706c79000000000000000000000000000000000000000000000000602082015250565b60006157566028836137ad565b9150615761826156fa565b604082019050919050565b6000602082019050818103600083015261578581615749565b905091905056fea26469706673582212200fd00f8bdf25b60a9e0c0d60b685c06fd61a000dec14b6766331e0b212d11ac164736f6c6343000809003300000000000000000000000044f935e6a6b55c71a088e26d730199bcee48de2500000000000000000000000094deb9eb2a265774fbe7654768bffa5accc2c8c70000000000000000000000008c69c8a46069ba4263d84418c052e3d8835dee9c
Deployed ByteCode
0x60806040526004361061013f5760003560e01c8063715018a6116100b6578063bd85b0391161006f578063bd85b039146104a8578063bd969c25146104e5578063e985e9c514610522578063f242432a1461055f578063f2fde38b14610588578063f5298aca146105b15761013f565b8063715018a61461039a5780638da5cb5b146103b1578063971f8bb1146103dc578063a22cb46514610419578063a4b645eb14610442578063b9571e841461047f5761013f565b80634e1273f4116101085780634e1273f4146102615780634f558e791461029e5780634f78a38f146102db57806355f804b31461030b5780635ccd3b82146103345780636b20c454146103715761013f565b8062fdd58e1461014457806301ffc9a7146101815780630e89341c146101be5780632eb2c2d6146101fb5780633ff38b8614610224575b600080fd5b34801561015057600080fd5b5061016b60048036038101906101669190613650565b6105da565b604051610178919061369f565b60405180910390f35b34801561018d57600080fd5b506101a860048036038101906101a39190613712565b6106a4565b6040516101b5919061375a565b60405180910390f35b3480156101ca57600080fd5b506101e560048036038101906101e09190613775565b6106b6565b6040516101f2919061383b565b60405180910390f35b34801561020757600080fd5b50610222600480360381019061021d9190613a5a565b6106c8565b005b34801561023057600080fd5b5061024b60048036038101906102469190613b29565b610769565b604051610258919061369f565b60405180910390f35b34801561026d57600080fd5b5061028860048036038101906102839190613c3f565b61079b565b6040516102959190613d75565b60405180910390f35b3480156102aa57600080fd5b506102c560048036038101906102c09190613775565b6108b4565b6040516102d2919061375a565b60405180910390f35b6102f560048036038101906102f09190613dbb565b6108c8565b604051610302919061369f565b60405180910390f35b34801561031757600080fd5b50610332600480360381019061032d9190613f2b565b610d4b565b005b34801561034057600080fd5b5061035b60048036038101906103569190613fa0565b610d5f565b604051610368919061375a565b60405180910390f35b34801561037d57600080fd5b5061039860048036038101906103939190613fe0565b610dca565b005b3480156103a657600080fd5b506103af610e67565b005b3480156103bd57600080fd5b506103c6610e7b565b6040516103d3919061407a565b60405180910390f35b3480156103e857600080fd5b5061040360048036038101906103fe9190614095565b610ea4565b604051610410919061375a565b60405180910390f35b34801561042557600080fd5b50610440600480360381019061043b9190613fa0565b610ef8565b005b34801561044e57600080fd5b50610469600480360381019061046491906140c2565b610f0e565b604051610476919061369f565b60405180910390f35b34801561048b57600080fd5b506104a660048036038101906104a19190614256565b611140565b005b3480156104b457600080fd5b506104cf60048036038101906104ca9190613775565b611437565b6040516104dc919061369f565b60405180910390f35b3480156104f157600080fd5b5061050c60048036038101906105079190614341565b611454565b604051610519919061375a565b60405180910390f35b34801561052e57600080fd5b50610549600480360381019061054491906143bc565b611617565b604051610556919061375a565b60405180910390f35b34801561056b57600080fd5b50610586600480360381019061058191906143fc565b6116ab565b005b34801561059457600080fd5b506105af60048036038101906105aa9190614095565b61174c565b005b3480156105bd57600080fd5b506105d860048036038101906105d39190614493565b6117d0565b005b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561064b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064290614558565b60405180910390fd5b6001600083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006106af8261186d565b9050919050565b60606106c18261194f565b9050919050565b6106d0611a34565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480610716575061071585610710611a34565b611617565b5b610755576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074c906145ea565b60405180910390fd5b6107628585858585611a3c565b5050505050565b600760205282600052604060002060205281600052604060002060205280600052604060002060009250925050505481565b606081518351146107e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d89061467c565b60405180910390fd5b6000835167ffffffffffffffff8111156107fe576107fd613862565b5b60405190808252806020026020018201604052801561082c5781602001602082028036833780820191505090505b50905060005b84518110156108a9576108798582815181106108515761085061469c565b5b602002602001015185838151811061086c5761086b61469c565b5b60200260200101516105da565b82828151811061088c5761088b61469c565b5b602002602001018181525050806108a2906146fa565b9050610832565b508091505092915050565b6000806108c083611437565b119050919050565b60006108d2610e7b565b73ffffffffffffffffffffffffffffffffffffffff166108f0611a34565b73ffffffffffffffffffffffffffffffffffffffff161461099e57600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e610951611a34565b6040518263ffffffff1660e01b815260040161096d919061407a565b60006040518083038186803b15801561098557600080fd5b505afa158015610999573d6000803e3d6000fd5b505050505b3073ffffffffffffffffffffffffffffffffffffffff168460000160208101906109c89190614095565b73ffffffffffffffffffffffffffffffffffffffff1614610a1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a15906147b5565b60405180910390fd5b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b0f271c586866040518363ffffffff1660e01b8152600401610a7d9291906149b7565b60206040518083038186803b158015610a9557600080fd5b505afa158015610aa9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acd9190614a03565b9050846080016020810190610ae29190614095565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610b4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4690614a7c565b60405180910390fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9209e33866080016020810190610ba09190614095565b6040518263ffffffff1660e01b8152600401610bbc919061407a565b60206040518083038186803b158015610bd457600080fd5b505afa158015610be8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0c9190614ab1565b610c4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4290614b50565b60405180910390fd5b610c5885602001356108b4565b610d2957610c70818660200135876040013586611d61565b610cd08560200135868060600190610c889190614b7f565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050611f13565b8073ffffffffffffffffffffffffffffffffffffffff167f4eb95501a95e043f8b49c559a5af0433864f18d84996f3588f390425442b1b9086602001358760400135604051610d20929190614be2565b60405180910390a25b610d3a8188876020013589876116ab565b846020013591505095945050505050565b610d53611f7f565b610d5c81611ffd565b50565b6000610d69611f7f565b81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b610dd2611a34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480610e185750610e1783610e12611a34565b611617565b5b610e57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4e906145ea565b60405180910390fd5b610e62838383612017565b505050565b610e6f611f7f565b610e7960006122e8565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610eae611f7f565b81600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b610f0a610f03611a34565b83836123ac565b5050565b6000610f18610e7b565b73ffffffffffffffffffffffffffffffffffffffff16610f36611a34565b73ffffffffffffffffffffffffffffffffffffffff1614610fe457600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e610f97611a34565b6040518263ffffffff1660e01b8152600401610fb3919061407a565b60006040518083038186803b158015610fcb57600080fd5b505afa158015610fdf573d6000803e3d6000fd5b505050505b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9209e33876040518263ffffffff1660e01b815260040161103f919061407a565b60206040518083038186803b15801561105757600080fd5b505afa15801561106b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108f9190614ab1565b6110ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c590614b50565b60405180910390fd5b6110da86868685611d61565b6110e48584611f13565b8573ffffffffffffffffffffffffffffffffffffffff167f4eb95501a95e043f8b49c559a5af0433864f18d84996f3588f390425442b1b90868660405161112c929190614be2565b60405180910390a284905095945050505050565b611148610e7b565b73ffffffffffffffffffffffffffffffffffffffff16611166611a34565b73ffffffffffffffffffffffffffffffffffffffff161461121457600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e6111c7611a34565b6040518263ffffffff1660e01b81526004016111e3919061407a565b60006040518083038186803b1580156111fb57600080fd5b505afa15801561120f573d6000803e3d6000fd5b505050505b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9209e33866040518263ffffffff1660e01b815260040161126f919061407a565b60206040518083038186803b15801561128757600080fd5b505afa15801561129b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112bf9190614ab1565b6112fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f590614b50565b60405180910390fd5b8251825114611342576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133990614c7d565b60405180910390fd5b61134e85858584612519565b60005b825181101561142f576113988582815181106113705761136f61469c565b5b602002602001015184838151811061138b5761138a61469c565b5b6020026020010151611f13565b8573ffffffffffffffffffffffffffffffffffffffff167f4eb95501a95e043f8b49c559a5af0433864f18d84996f3588f390425442b1b908683815181106113e3576113e261469c565b5b60200260200101518684815181106113fe576113fd61469c565b5b6020026020010151604051611414929190614be2565b60405180910390a28080611427906146fa565b915050611351565b505050505050565b600060066000838152602001908152602001600020549050919050565b600061145e610e7b565b73ffffffffffffffffffffffffffffffffffffffff1661147c611a34565b73ffffffffffffffffffffffffffffffffffffffff161461152a57600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632657131e6114dd611a34565b6040518263ffffffff1660e01b81526004016114f9919061407a565b60006040518083038186803b15801561151157600080fd5b505afa158015611525573d6000803e3d6000fd5b505050505b836007600087815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600082825461159b9190614c9d565b92505081905550818373ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fb5c7c18afbb1bf0dff47fdc95c47e01d3e90f4de9e6490eed1e786d7bcf5be008888604051611602929190614be2565b60405180910390a46001905095945050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6116b3611a34565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614806116f957506116f8856116f3611a34565b611617565b5b611738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172f906145ea565b60405180910390fd5b6117458585858585612747565b5050505050565b611754611f7f565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bb90614d65565b60405180910390fd5b6117cd816122e8565b50565b6117d8611a34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061181e575061181d83611818611a34565b611617565b5b61185d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611854906145ea565b60405180910390fd5b6118688383836129e6565b505050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061193857507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80611948575061194782612c2f565b5b9050919050565b6060600060056000848152602001908152602001600020805461197190614db4565b80601f016020809104026020016040519081016040528092919081815260200182805461199d90614db4565b80156119ea5780601f106119bf576101008083540402835291602001916119ea565b820191906000526020600020905b8154815290600101906020018083116119cd57829003601f168201915b505050505090506000815111611a0857611a0383612c99565b611a2c565b600481604051602001611a1c929190614eb6565b6040516020818303038152906040525b915050919050565b600033905090565b8151835114611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7790614f4c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611af0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ae790614fde565b60405180910390fd5b6000611afa611a34565b9050611b0a818787878787612d2d565b60005b8451811015611cbe576000858281518110611b2b57611b2a61469c565b5b602002602001015190506000858381518110611b4a57611b4961469c565b5b6020026020010151905060006001600084815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611bec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be390615070565b60405180910390fd5b8181036001600085815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816001600085815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611ca39190614c9d565b9250508190555050505080611cb7906146fa565b9050611b0d565b508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611d35929190615090565b60405180910390a4611d4b818787878787612eb8565b611d59818787878787612ec0565b505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611dd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc890615139565b60405180910390fd5b6000611ddb611a34565b90506000611de8856130a7565b90506000611df5856130a7565b9050611e0683600089858589612d2d565b846001600088815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611e669190614c9d565b925050819055508673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628989604051611ee4929190614be2565b60405180910390a4611efb83600089858589612eb8565b611f0a83600089898989613121565b50505050505050565b80600560008481526020019081526020016000209080519060200190611f3a929190613505565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b611f66846106b6565b604051611f73919061383b565b60405180910390a25050565b611f87611a34565b73ffffffffffffffffffffffffffffffffffffffff16611fa5610e7b565b73ffffffffffffffffffffffffffffffffffffffff1614611ffb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff2906151a5565b60405180910390fd5b565b8060049080519060200190612013929190613505565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207e90615237565b60405180910390fd5b80518251146120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c290614f4c565b60405180910390fd5b60006120d5611a34565b90506120f581856000868660405180602001604052806000815250612d2d565b60005b83518110156122445760008482815181106121165761211561469c565b5b6020026020010151905060008483815181106121355761213461469c565b5b6020026020010151905060006001600084815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156121d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ce906152c9565b60405180910390fd5b8181036001600085815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050808061223c906146fa565b9150506120f8565b50600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516122bc929190615090565b60405180910390a46122e281856000868660405180602001604052806000815250612eb8565b50505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561241b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124129061535b565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161250c919061375a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612589576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161258090615139565b60405180910390fd5b81518351146125cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c490614f4c565b60405180910390fd5b60006125d7611a34565b90506125e881600087878787612d2d565b60005b84518110156126a2578381815181106126075761260661469c565b5b6020026020010151600160008784815181106126265761262561469c565b5b6020026020010151815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546126889190614c9d565b92505081905550808061269a906146fa565b9150506125eb565b508473ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161271a929190615090565b60405180910390a461273181600087878787612eb8565b61274081600087878787612ec0565b5050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156127b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127ae90614fde565b60405180910390fd5b60006127c1611a34565b905060006127ce856130a7565b905060006127db856130a7565b90506127eb838989858589612d2d565b60006001600088815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905085811015612883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161287a90615070565b60405180910390fd5b8581036001600089815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550856001600089815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461293a9190614c9d565b925050819055508773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628a8a6040516129b7929190614be2565b60405180910390a46129cd848a8a86868a612eb8565b6129db848a8a8a8a8a613121565b505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612a56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4d90615237565b60405180910390fd5b6000612a60611a34565b90506000612a6d846130a7565b90506000612a7a846130a7565b9050612a9a83876000858560405180602001604052806000815250612d2d565b60006001600087815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905084811015612b32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b29906152c9565b60405180910390fd5b8481036001600088815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628989604051612c00929190614be2565b60405180910390a4612c2684886000868660405180602001604052806000815250612eb8565b50505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b606060038054612ca890614db4565b80601f0160208091040260200160405190810160405280929190818152602001828054612cd490614db4565b8015612d215780601f10612cf657610100808354040283529160200191612d21565b820191906000526020600020905b815481529060010190602001808311612d0457829003601f168201915b50505050509050919050565b612d3b868686868686613308565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480612dbf5750600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80612e715750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9209e33866040518263ffffffff1660e01b8152600401612e20919061407a565b60206040518083038186803b158015612e3857600080fd5b505afa158015612e4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e709190614ab1565b5b612eb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ea7906153ed565b60405180910390fd5b505050505050565b505050505050565b612edf8473ffffffffffffffffffffffffffffffffffffffff166134da565b1561309f578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b8152600401612f2595949392919061540d565b602060405180830381600087803b158015612f3f57600080fd5b505af1925050508015612f7057506040513d601f19601f82011682018060405250810190612f6d919061548a565b60015b61301657612f7c6154c4565b806308c379a01415612fd95750612f916154e6565b80612f9c5750612fdb565b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fd0919061383b565b60405180910390fd5b505b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161300d906155ee565b60405180910390fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461309d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161309490615680565b60405180910390fd5b505b505050505050565b60606000600167ffffffffffffffff8111156130c6576130c5613862565b5b6040519080825280602002602001820160405280156130f45781602001602082028036833780820191505090505b509050828160008151811061310c5761310b61469c565b5b60200260200101818152505080915050919050565b6131408473ffffffffffffffffffffffffffffffffffffffff166134da565b15613300578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b81526004016131869594939291906156a0565b602060405180830381600087803b1580156131a057600080fd5b505af19250505080156131d157506040513d601f19601f820116820180604052508101906131ce919061548a565b60015b613277576131dd6154c4565b806308c379a0141561323a57506131f26154e6565b806131fd575061323c565b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613231919061383b565b60405180910390fd5b505b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161326e906155ee565b60405180910390fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146132fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132f590615680565b60405180910390fd5b505b505050505050565b6133168686868686866134fd565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156133c85760005b83518110156133c65782818151811061336a5761336961469c565b5b6020026020010151600660008684815181106133895761338861469c565b5b6020026020010151815260200190815260200160002060008282546133ae9190614c9d565b92505081905550806133bf906146fa565b905061334e565b505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156134d25760005b83518110156134d057600084828151811061341e5761341d61469c565b5b60200260200101519050600084838151811061343d5761343c61469c565b5b60200260200101519050600060066000848152602001908152602001600020549050818110156134a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016134999061576c565b60405180910390fd5b8181036006600085815260200190815260200160002081905550505050806134c9906146fa565b9050613400565b505b505050505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b505050505050565b82805461351190614db4565b90600052602060002090601f016020900481019282613533576000855561357a565b82601f1061354c57805160ff191683800117855561357a565b8280016001018555821561357a579182015b8281111561357957825182559160200191906001019061355e565b5b509050613587919061358b565b5090565b5b808211156135a457600081600090555060010161358c565b5090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006135e7826135bc565b9050919050565b6135f7816135dc565b811461360257600080fd5b50565b600081359050613614816135ee565b92915050565b6000819050919050565b61362d8161361a565b811461363857600080fd5b50565b60008135905061364a81613624565b92915050565b60008060408385031215613667576136666135b2565b5b600061367585828601613605565b92505060206136868582860161363b565b9150509250929050565b6136998161361a565b82525050565b60006020820190506136b46000830184613690565b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6136ef816136ba565b81146136fa57600080fd5b50565b60008135905061370c816136e6565b92915050565b600060208284031215613728576137276135b2565b5b6000613736848285016136fd565b91505092915050565b60008115159050919050565b6137548161373f565b82525050565b600060208201905061376f600083018461374b565b92915050565b60006020828403121561378b5761378a6135b2565b5b60006137998482850161363b565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156137dc5780820151818401526020810190506137c1565b838111156137eb576000848401525b50505050565b6000601f19601f8301169050919050565b600061380d826137a2565b61381781856137ad565b93506138278185602086016137be565b613830816137f1565b840191505092915050565b600060208201905081810360008301526138558184613802565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61389a826137f1565b810181811067ffffffffffffffff821117156138b9576138b8613862565b5b80604052505050565b60006138cc6135a8565b90506138d88282613891565b919050565b600067ffffffffffffffff8211156138f8576138f7613862565b5b602082029050602081019050919050565b600080fd5b600061392161391c846138dd565b6138c2565b9050808382526020820190506020840283018581111561394457613943613909565b5b835b8181101561396d5780613959888261363b565b845260208401935050602081019050613946565b5050509392505050565b600082601f83011261398c5761398b61385d565b5b813561399c84826020860161390e565b91505092915050565b600080fd5b600067ffffffffffffffff8211156139c5576139c4613862565b5b6139ce826137f1565b9050602081019050919050565b82818337600083830152505050565b60006139fd6139f8846139aa565b6138c2565b905082815260208101848484011115613a1957613a186139a5565b5b613a248482856139db565b509392505050565b600082601f830112613a4157613a4061385d565b5b8135613a518482602086016139ea565b91505092915050565b600080600080600060a08688031215613a7657613a756135b2565b5b6000613a8488828901613605565b9550506020613a9588828901613605565b945050604086013567ffffffffffffffff811115613ab657613ab56135b7565b5b613ac288828901613977565b935050606086013567ffffffffffffffff811115613ae357613ae26135b7565b5b613aef88828901613977565b925050608086013567ffffffffffffffff811115613b1057613b0f6135b7565b5b613b1c88828901613a2c565b9150509295509295909350565b600080600060608486031215613b4257613b416135b2565b5b6000613b508682870161363b565b9350506020613b6186828701613605565b9250506040613b728682870161363b565b9150509250925092565b600067ffffffffffffffff821115613b9757613b96613862565b5b602082029050602081019050919050565b6000613bbb613bb684613b7c565b6138c2565b90508083825260208201905060208402830185811115613bde57613bdd613909565b5b835b81811015613c075780613bf38882613605565b845260208401935050602081019050613be0565b5050509392505050565b600082601f830112613c2657613c2561385d565b5b8135613c36848260208601613ba8565b91505092915050565b60008060408385031215613c5657613c556135b2565b5b600083013567ffffffffffffffff811115613c7457613c736135b7565b5b613c8085828601613c11565b925050602083013567ffffffffffffffff811115613ca157613ca06135b7565b5b613cad85828601613977565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613cec8161361a565b82525050565b6000613cfe8383613ce3565b60208301905092915050565b6000602082019050919050565b6000613d2282613cb7565b613d2c8185613cc2565b9350613d3783613cd3565b8060005b83811015613d68578151613d4f8882613cf2565b9750613d5a83613d0a565b925050600181019050613d3b565b5085935050505092915050565b60006020820190508181036000830152613d8f8184613d17565b905092915050565b600080fd5b600060a08284031215613db257613db1613d97565b5b81905092915050565b600080600080600060a08688031215613dd757613dd66135b2565b5b6000613de588828901613605565b9550506020613df68882890161363b565b945050604086013567ffffffffffffffff811115613e1757613e166135b7565b5b613e2388828901613d9c565b935050606086013567ffffffffffffffff811115613e4457613e436135b7565b5b613e5088828901613a2c565b925050608086013567ffffffffffffffff811115613e7157613e706135b7565b5b613e7d88828901613a2c565b9150509295509295909350565b600067ffffffffffffffff821115613ea557613ea4613862565b5b613eae826137f1565b9050602081019050919050565b6000613ece613ec984613e8a565b6138c2565b905082815260208101848484011115613eea57613ee96139a5565b5b613ef58482856139db565b509392505050565b600082601f830112613f1257613f1161385d565b5b8135613f22848260208601613ebb565b91505092915050565b600060208284031215613f4157613f406135b2565b5b600082013567ffffffffffffffff811115613f5f57613f5e6135b7565b5b613f6b84828501613efd565b91505092915050565b613f7d8161373f565b8114613f8857600080fd5b50565b600081359050613f9a81613f74565b92915050565b60008060408385031215613fb757613fb66135b2565b5b6000613fc585828601613605565b9250506020613fd685828601613f8b565b9150509250929050565b600080600060608486031215613ff957613ff86135b2565b5b600061400786828701613605565b935050602084013567ffffffffffffffff811115614028576140276135b7565b5b61403486828701613977565b925050604084013567ffffffffffffffff811115614055576140546135b7565b5b61406186828701613977565b9150509250925092565b614074816135dc565b82525050565b600060208201905061408f600083018461406b565b92915050565b6000602082840312156140ab576140aa6135b2565b5b60006140b984828501613605565b91505092915050565b600080600080600060a086880312156140de576140dd6135b2565b5b60006140ec88828901613605565b95505060206140fd8882890161363b565b945050604061410e8882890161363b565b935050606086013567ffffffffffffffff81111561412f5761412e6135b7565b5b61413b88828901613efd565b925050608086013567ffffffffffffffff81111561415c5761415b6135b7565b5b61416888828901613a2c565b9150509295509295909350565b600067ffffffffffffffff8211156141905761418f613862565b5b602082029050602081019050919050565b60006141b46141af84614175565b6138c2565b905080838252602082019050602084028301858111156141d7576141d6613909565b5b835b8181101561421e57803567ffffffffffffffff8111156141fc576141fb61385d565b5b8086016142098982613efd565b855260208501945050506020810190506141d9565b5050509392505050565b600082601f83011261423d5761423c61385d565b5b813561424d8482602086016141a1565b91505092915050565b600080600080600060a08688031215614272576142716135b2565b5b600061428088828901613605565b955050602086013567ffffffffffffffff8111156142a1576142a06135b7565b5b6142ad88828901613977565b945050604086013567ffffffffffffffff8111156142ce576142cd6135b7565b5b6142da88828901613977565b935050606086013567ffffffffffffffff8111156142fb576142fa6135b7565b5b61430788828901614228565b925050608086013567ffffffffffffffff811115614328576143276135b7565b5b61433488828901613a2c565b9150509295509295909350565b600080600080600060a0868803121561435d5761435c6135b2565b5b600061436b88828901613605565b955050602061437c8882890161363b565b945050604061438d8882890161363b565b935050606061439e88828901613605565b92505060806143af8882890161363b565b9150509295509295909350565b600080604083850312156143d3576143d26135b2565b5b60006143e185828601613605565b92505060206143f285828601613605565b9150509250929050565b600080600080600060a08688031215614418576144176135b2565b5b600061442688828901613605565b955050602061443788828901613605565b94505060406144488882890161363b565b93505060606144598882890161363b565b925050608086013567ffffffffffffffff81111561447a576144796135b7565b5b61448688828901613a2c565b9150509295509295909350565b6000806000606084860312156144ac576144ab6135b2565b5b60006144ba86828701613605565b93505060206144cb8682870161363b565b92505060406144dc8682870161363b565b9150509250925092565b7f455243313135353a2061646472657373207a65726f206973206e6f742061207660008201527f616c6964206f776e657200000000000000000000000000000000000000000000602082015250565b6000614542602a836137ad565b915061454d826144e6565b604082019050919050565b6000602082019050818103600083015261457181614535565b9050919050565b7f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60008201527f6572206e6f7220617070726f7665640000000000000000000000000000000000602082015250565b60006145d4602f836137ad565b91506145df82614578565b604082019050919050565b60006020820190508181036000830152614603816145c7565b9050919050565b7f455243313135353a206163636f756e747320616e6420696473206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b60006146666029836137ad565b91506146718261460a565b604082019050919050565b6000602082019050818103600083015261469581614659565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006147058261361a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614738576147376146cb565b5b600182019050919050565b7f54686520766f7563686572206d75737420626520666f72207468697320636f6e60008201527f7472616374000000000000000000000000000000000000000000000000000000602082015250565b600061479f6025836137ad565b91506147aa82614743565b604082019050919050565b600060208201905081810360008301526147ce81614792565b9050919050565b60006147e46020840184613605565b905092915050565b6147f5816135dc565b82525050565b600061480a602084018461363b565b905092915050565b600080fd5b600080fd5b600080fd5b6000808335600160200384360303811261483e5761483d61481c565b5b83810192508235915060208301925067ffffffffffffffff82111561486657614865614812565b5b60018202360384131561487c5761487b614817565b5b509250929050565b600082825260208201905092915050565b60006148a18385614884565b93506148ae8385846139db565b6148b7836137f1565b840190509392505050565b600060a083016148d560008401846147d5565b6148e260008601826147ec565b506148f060208401846147fb565b6148fd6020860182613ce3565b5061490b60408401846147fb565b6149186040860182613ce3565b506149266060840184614821565b8583036060870152614939838284614895565b9250505061494a60808401846147d5565b61495760808601826147ec565b508091505092915050565b600081519050919050565b600082825260208201905092915050565b600061498982614962565b614993818561496d565b93506149a38185602086016137be565b6149ac816137f1565b840191505092915050565b600060408201905081810360008301526149d181856148c2565b905081810360208301526149e5818461497e565b90509392505050565b6000815190506149fd816135ee565b92915050565b600060208284031215614a1957614a186135b2565b5b6000614a27848285016149ee565b91505092915050565b7f43726561746f72204164647265737320646f6573206e6f74206d617463680000600082015250565b6000614a66601e836137ad565b9150614a7182614a30565b602082019050919050565b60006020820190508181036000830152614a9581614a59565b9050919050565b600081519050614aab81613f74565b92915050565b600060208284031215614ac757614ac66135b2565b5b6000614ad584828501614a9c565b91505092915050565b7f43726561746f72206973206e6f7420612076657269666965642072656379636c60008201527f6572000000000000000000000000000000000000000000000000000000000000602082015250565b6000614b3a6022836137ad565b9150614b4582614ade565b604082019050919050565b60006020820190508181036000830152614b6981614b2d565b9050919050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112614b9c57614b9b614b70565b5b80840192508235915067ffffffffffffffff821115614bbe57614bbd614b75565b5b602083019250600182023603831315614bda57614bd9614b7a565b5b509250929050565b6000604082019050614bf76000830185613690565b614c046020830184613690565b9392505050565b7f455243313135353a207572697320616e6420616d6f756e7473206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b6000614c676029836137ad565b9150614c7282614c0b565b604082019050919050565b60006020820190508181036000830152614c9681614c5a565b9050919050565b6000614ca88261361a565b9150614cb38361361a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614ce857614ce76146cb565b5b828201905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000614d4f6026836137ad565b9150614d5a82614cf3565b604082019050919050565b60006020820190508181036000830152614d7e81614d42565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680614dcc57607f821691505b60208210811415614de057614ddf614d85565b5b50919050565b600081905092915050565b60008190508160005260206000209050919050565b60008154614e1381614db4565b614e1d8186614de6565b94506001821660008114614e385760018114614e4957614e7c565b60ff19831686528186019350614e7c565b614e5285614df1565b60005b83811015614e7457815481890152600182019150602081019050614e55565b838801955050505b50505092915050565b6000614e90826137a2565b614e9a8185614de6565b9350614eaa8185602086016137be565b80840191505092915050565b6000614ec28285614e06565b9150614ece8284614e85565b91508190509392505050565b7f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060008201527f6d69736d61746368000000000000000000000000000000000000000000000000602082015250565b6000614f366028836137ad565b9150614f4182614eda565b604082019050919050565b60006020820190508181036000830152614f6581614f29565b9050919050565b7f455243313135353a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000614fc86025836137ad565b9150614fd382614f6c565b604082019050919050565b60006020820190508181036000830152614ff781614fbb565b9050919050565b7f455243313135353a20696e73756666696369656e742062616c616e636520666f60008201527f72207472616e7366657200000000000000000000000000000000000000000000602082015250565b600061505a602a836137ad565b915061506582614ffe565b604082019050919050565b600060208201905081810360008301526150898161504d565b9050919050565b600060408201905081810360008301526150aa8185613d17565b905081810360208301526150be8184613d17565b90509392505050565b7f455243313135353a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b60006151236021836137ad565b915061512e826150c7565b604082019050919050565b6000602082019050818103600083015261515281615116565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061518f6020836137ad565b915061519a82615159565b602082019050919050565b600060208201905081810360008301526151be81615182565b9050919050565b7f455243313135353a206275726e2066726f6d20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006152216023836137ad565b915061522c826151c5565b604082019050919050565b6000602082019050818103600083015261525081615214565b9050919050565b7f455243313135353a206275726e20616d6f756e7420657863656564732062616c60008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b60006152b36024836137ad565b91506152be82615257565b604082019050919050565b600060208201905081810360008301526152e2816152a6565b9050919050565b7f455243313135353a2073657474696e6720617070726f76616c2073746174757360008201527f20666f722073656c660000000000000000000000000000000000000000000000602082015250565b60006153456029836137ad565b9150615350826152e9565b604082019050919050565b6000602082019050818103600083015261537481615338565b9050919050565b7f66726f6d206163636f756e74206973206e6f742061207665726966696564207260008201527f656379636c657200000000000000000000000000000000000000000000000000602082015250565b60006153d76027836137ad565b91506153e28261537b565b604082019050919050565b60006020820190508181036000830152615406816153ca565b9050919050565b600060a082019050615422600083018861406b565b61542f602083018761406b565b81810360408301526154418186613d17565b905081810360608301526154558185613d17565b90508181036080830152615469818461497e565b90509695505050505050565b600081519050615484816136e6565b92915050565b6000602082840312156154a05761549f6135b2565b5b60006154ae84828501615475565b91505092915050565b60008160e01c9050919050565b600060033d11156154e35760046000803e6154e06000516154b7565b90505b90565b600060443d10156154f657615579565b6154fe6135a8565b60043d036004823e80513d602482011167ffffffffffffffff82111715615526575050615579565b808201805167ffffffffffffffff8111156155445750505050615579565b80602083010160043d038501811115615561575050505050615579565b61557082602001850186613891565b82955050505050505b90565b7f455243313135353a207472616e7366657220746f206e6f6e204552433131353560008201527f526563656976657220696d706c656d656e746572000000000000000000000000602082015250565b60006155d86034836137ad565b91506155e38261557c565b604082019050919050565b60006020820190508181036000830152615607816155cb565b9050919050565b7f455243313135353a204552433131353552656365697665722072656a6563746560008201527f6420746f6b656e73000000000000000000000000000000000000000000000000602082015250565b600061566a6028836137ad565b91506156758261560e565b604082019050919050565b600060208201905081810360008301526156998161565d565b9050919050565b600060a0820190506156b5600083018861406b565b6156c2602083018761406b565b6156cf6040830186613690565b6156dc6060830185613690565b81810360808301526156ee818461497e565b90509695505050505050565b7f455243313135353a206275726e20616d6f756e74206578636565647320746f7460008201527f616c537570706c79000000000000000000000000000000000000000000000000602082015250565b60006157566028836137ad565b9150615761826156fa565b604082019050919050565b6000602082019050818103600083015261578581615749565b905091905056fea26469706673582212200fd00f8bdf25b60a9e0c0d60b685c06fd61a000dec14b6766331e0b212d11ac164736f6c63430008090033