Contract is not verified. However, we found a verified contract with the same bytecode in Blockscout DB 0x0ce64a17290592c199e6c0d0eed41b1431d4e203.
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
Verify & Publish
All metadata displayed below is from that contract. In order to verify current contract, click Verify & Publish button
- Contract name:
- CertificateToken
- Optimization enabled
- true
- Compiler version
- v0.8.7+commit.e28d00a7
- Optimization runs
- 200
- Verified at
- 2023-03-07T04:53:42.097926Z
Contract source code
// File: @openzeppelin\contracts-upgradeable\utils\CountersUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library CountersUpgradeable {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
// File: @openzeppelin\contracts-upgradeable\utils\introspection\IERC165Upgradeable.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin\contracts-upgradeable\token\ERC1155\IERC1155Upgradeable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155Upgradeable is IERC165Upgradeable {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
// File: @openzeppelin\contracts-upgradeable\token\ERC1155\IERC1155ReceiverUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
/**
* @dev _Available since v3.1._
*/
interface IERC1155ReceiverUpgradeable is IERC165Upgradeable {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin\contracts-upgradeable\token\ERC1155\extensions\IERC1155MetadataURIUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURIUpgradeable is IERC1155Upgradeable {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}
// File: @openzeppelin\contracts-upgradeable\utils\AddressUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin\contracts-upgradeable\proxy\utils\Initializable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
* initialization step. This is essential to configure modules that are added through upgrades and that require
* initialization.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
}
// File: @openzeppelin\contracts-upgradeable\utils\ContextUpgradeable.sol
// 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 ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
// File: @openzeppelin\contracts-upgradeable\utils\introspection\ERC165Upgradeable.sol
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
// File: @openzeppelin\contracts-upgradeable\token\ERC1155\ERC1155Upgradeable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable {
using AddressUpgradeable for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
function __ERC1155_init(string memory uri_) internal onlyInitializing {
__ERC1155_init_unchained(uri_);
}
function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
return
interfaceId == type(IERC1155Upgradeable).interfaceId ||
interfaceId == type(IERC1155MetadataURIUpgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: address zero is not a valid owner");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `ids` and `amounts` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155ReceiverUpgradeable.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155ReceiverUpgradeable.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[47] private __gap;
}
// File: @openzeppelin\contracts-upgradeable\token\ERC1155\extensions\ERC1155BurnableUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/extensions/ERC1155Burnable.sol)
pragma solidity ^0.8.0;
/**
* @dev Extension of {ERC1155} that allows token holders to destroy both their
* own tokens and those that they have been approved to use.
*
* _Available since v3.1._
*/
abstract contract ERC1155BurnableUpgradeable is Initializable, ERC1155Upgradeable {
function __ERC1155Burnable_init() internal onlyInitializing {
}
function __ERC1155Burnable_init_unchained() internal onlyInitializing {
}
function burn(
address account,
uint256 id,
uint256 value
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_burn(account, id, value);
}
function burnBatch(
address account,
uint256[] memory ids,
uint256[] memory values
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not token owner nor approved"
);
_burnBatch(account, ids, values);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
// File: @openzeppelin\contracts-upgradeable\access\IAccessControlUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}
// File: @openzeppelin\contracts-upgradeable\utils\StringsUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
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);
}
}
// File: @openzeppelin\contracts-upgradeable\access\AccessControlUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
/**
* @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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
function __AccessControl_init() internal onlyInitializing {
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
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(IAccessControlUpgradeable).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 ",
StringsUpgradeable.toHexString(uint160(account), 20),
" is missing role ",
StringsUpgradeable.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());
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
// File: contracts\NFT_Permission.sol
pragma solidity ^0.8.7;
interface InterfaceNFTPermission {
function checkAdminRole(address account) external view returns (bool);
function checkMinterRole(address account) external view returns (bool);
function checkBurnerRole(address account) external view returns (bool);
function checkTransferRole(address account) external view returns (bool);
function checkAccessRole(address account) external view returns (bool);
function checkTokenAccessRole(address account, string memory _role) external view returns (bool);
function getAddressRole(address account) external view returns (string memory);
}
contract NFTPermission is Initializable, AccessControlUpgradeable, InterfaceNFTPermission{
struct TokenAccessRole {
string permission;
bool accountExist;
}
string[] public roles;
bytes32 private constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 private constant BURNER_ROLE = keccak256("BURNER_ROLE");
bytes32 private constant TRANSFER_ROLE = keccak256("TRANSFER_ROLE");
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(address _admin) initializer public {
__AccessControl_init();
_grantRole(DEFAULT_ADMIN_ROLE, _admin);
_grantRole(BURNER_ROLE, _admin);
_grantRole(TRANSFER_ROLE, _admin);
_grantRole(MINTER_ROLE, _admin);
tokenAccessRoleAccountExist[_admin].permission = "DEFAULT ADMIN";
tokenAccessRoleAccountExist[_admin].accountExist = true;
roles.push("DEFAULT ADMIN");
}
// walletAddress => TokenAccessRole
mapping(address => TokenAccessRole) public tokenAccessRoleAccountExist;
mapping(string => bool) public mapRoleExist;
//Permission
modifier onlyAdmin() {
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "Require admin role.");
_;
}
function listRole() public view returns(string[] memory) {
return roles;
}
function setTokenAccessRole(address account, string memory role) public onlyAdmin
{
require(!tokenAccessRoleAccountExist[account].accountExist,"Account already exists.");
grantRole(keccak256(abi.encodePacked(role)),account);
grantRole(MINTER_ROLE,account);
grantRole(BURNER_ROLE,account);
grantRole(TRANSFER_ROLE,account);
if(!mapRoleExist[role]){
roles.push(role);
}
mapRoleExist[role] = true;
tokenAccessRoleAccountExist[account].accountExist = true;
tokenAccessRoleAccountExist[account].permission = role;
}
function revokeTokenAccessRole(address account) public onlyAdmin
{
require(tokenAccessRoleAccountExist[account].accountExist,"Account isn't exist.");
require(!hasRole(DEFAULT_ADMIN_ROLE,account), "Can't revoke admin role.");
revokeRole(keccak256(abi.encodePacked(tokenAccessRoleAccountExist[account].permission)),account);
revokeRole(MINTER_ROLE,account);
revokeRole(BURNER_ROLE,account);
revokeRole(TRANSFER_ROLE,account);
delete tokenAccessRoleAccountExist[account];
}
function checkAdminRole(address account) external view override returns (bool){
return hasRole(DEFAULT_ADMIN_ROLE, account);
}
function checkMinterRole(address account) external view override returns (bool){
return hasRole(MINTER_ROLE, account);
}
function checkBurnerRole(address account) external view override returns (bool){
return hasRole(BURNER_ROLE, account);
}
function checkTransferRole(address account) external view override returns (bool){
return hasRole(TRANSFER_ROLE, account);
}
function checkAccessRole(address account) external view override returns (bool){
return tokenAccessRoleAccountExist[account].accountExist;
}
function checkTokenAccessRole(address account, string memory _role) external view override returns (bool){
return hasRole(keccak256(abi.encodePacked(_role)), account);
}
function getAddressRole(address account) external view override returns (string memory){
return tokenAccessRoleAccountExist[account].permission;
}
}
// File: contracts\NFT_Token.sol
pragma solidity ^0.8.7;
interface InterfaceCertificateToken {
function currentTokenId() external view returns (uint256);
function burnToken(address _account, uint256 _id, uint256 _amount, address _sender, string memory _role) external;
function mintToken(address _account, uint256 _id, uint256 _amount, bytes memory _data, address _sender, address _contractAddress, string memory _externalId, string memory _uri, string memory _tokenType) external;
function safeTransferTokenFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data, address _sender, string memory _role) external;
function safeBatchTransferTokenFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data, address _sender, string memory _role) external;
//badge
function addUserBadge(address _user, uint256 _tokenId, address _sender) external;
function findBadgeIndex(address _receiver, uint256 _tokenId) external view returns (int);
function removeBadgeList(address _receiver, int _index, address _sender, string memory _role) external;
//certificate
function addUserCertificate(address _user, uint256 _tokenId, address _sender) external;
function findCertificateIndex(address _receiver, uint256 _tokenId) external view returns (int);
function removeCertificateList(address _receiver, int _index, address _sender, string memory _role) external;
}
contract CertificateToken is Initializable, ERC1155Upgradeable, ERC1155BurnableUpgradeable, AccessControlUpgradeable, InterfaceCertificateToken {
struct TokenInfo {
address contractAddress;
string externalId;
string tokenType;
string uri;
}
mapping(uint256 => TokenInfo) mapTokenInfo;
// walletAddress => badge list
mapping(address => uint256[]) private mapUserBadge;
// walletAddress => certificate list
mapping(address => uint256[]) private mapUserCertificate;
address NFTPermissionAddress;
string public TokenName;
using CountersUpgradeable for CountersUpgradeable.Counter;
CountersUpgradeable.Counter private tokenId;
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(string memory _tokenName, address _nftPermissionAddress) initializer public {
__ERC1155_init("");
__ERC1155Burnable_init();
__AccessControl_init();
TokenName = _tokenName;
NFTPermissionAddress = _nftPermissionAddress;
tokenId.increment();
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC1155Upgradeable, AccessControlUpgradeable)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
function setTokenName(string memory _tokenName) public {
TokenName = _tokenName;
}
function setUri(uint256 _tokenId, string memory _uri) public {
require(InterfaceNFTPermission(NFTPermissionAddress).checkAdminRole(msg.sender),"only admin role.");
require(_tokenId < tokenId.current() && _tokenId != 0, "token isn't exist");
mapTokenInfo[_tokenId].uri = _uri;
}
function name() external view returns (string memory) {
return TokenName;
}
function symbol() external pure returns (string memory) {
return "CERT";
}
function currentTokenId() external view override returns (uint256) {
return tokenId.current();
}
function uri(uint256 _tokenId) public override view returns (string memory) {
return mapTokenInfo[_tokenId].uri;
}
function burnToken(address _account, uint256 _id, uint256 _amount, address _sender, string memory _role) external override {
require(InterfaceNFTPermission(NFTPermissionAddress).checkBurnerRole(_sender),"only burner role");
require(InterfaceNFTPermission(NFTPermissionAddress).checkTokenAccessRole(_sender, _role) || InterfaceNFTPermission(NFTPermissionAddress).checkAdminRole(_sender),"Invalid token access role.");
_burn(_account, _id, _amount);
}
function mintToken(address _account, uint256 _id, uint256 _amount, bytes memory _data, address _sender, address _contractAddress, string memory _externalId, string memory _uri, string memory _tokenType) external override {
require(InterfaceNFTPermission(NFTPermissionAddress).checkMinterRole(_sender),"only minter role");
require(InterfaceNFTPermission(NFTPermissionAddress).checkAccessRole(_sender),"Need token access role.");
_mint(_account, _id, _amount, _data);
TokenInfo memory tokenInfo = TokenInfo(_contractAddress, _externalId, _tokenType, _uri);
mapTokenInfo[_id] = tokenInfo;
tokenId.increment();
}
function safeTransferTokenFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data, address _sender, string memory _role) external override {
require(InterfaceNFTPermission(NFTPermissionAddress).checkTransferRole(_sender),"only transfer role");
require(InterfaceNFTPermission(NFTPermissionAddress).checkTokenAccessRole(_sender, _role) || InterfaceNFTPermission(NFTPermissionAddress).checkAdminRole(_sender),"Invalid token access role.");
_safeTransferFrom(_from, _to, _id, _amount, _data);
}
function safeBatchTransferTokenFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data, address _sender, string memory _role) external override {
require(InterfaceNFTPermission(NFTPermissionAddress).checkTransferRole(_sender),"only transfer role");
for (uint i = 0; i < _ids.length; i++) {
require(InterfaceNFTPermission(NFTPermissionAddress).checkTokenAccessRole(_sender, _role) || InterfaceNFTPermission(NFTPermissionAddress).checkAdminRole(_sender),"Invalid token access role.");
require(_ids[i] > 0, "token 0 isn't exist.");
}
_safeBatchTransferFrom(_from, _to, _ids, _amounts, _data);
}
function getTokenInfo(uint _id) public view returns (TokenInfo memory){
return mapTokenInfo[_id];
}
// Badge
function addUserBadge(address _user, uint256 _tokenId, address _sender) external override {
require(InterfaceNFTPermission(NFTPermissionAddress).checkMinterRole(_sender) || InterfaceNFTPermission(NFTPermissionAddress).checkTransferRole(_sender),"only minter role or transfer role");
mapUserBadge[_user].push(_tokenId);
}
function findBadgeIndex(address _receiver, uint256 _tokenId) external override view returns (int) {
uint256[] storage list = mapUserBadge[_receiver];
for (uint i = 0; i < list.length; i++) {
if (list[i] == _tokenId) {
return int(i);
}
}
return - 1;
}
function removeBadgeList(address _receiver, int _index, address _sender, string memory _role) external override {
require(InterfaceNFTPermission(NFTPermissionAddress).checkBurnerRole(_sender),"only burner role");
require(InterfaceNFTPermission(NFTPermissionAddress).checkTokenAccessRole(_sender, _role) || InterfaceNFTPermission(NFTPermissionAddress).checkAdminRole(_sender),"Invalid token access role.");
require(_index >= 0, "not found index");
uint256 [] storage mapList = mapUserBadge[_receiver];
require(uint(_index) < mapList.length, "not found index");
if (balanceOf(_receiver, mapList[uint(_index)]) == 0) {
for (uint i = uint(_index); i < mapList.length - 1; i++) {
mapList[i] = mapList[i + 1];
}
mapList.pop();
mapUserBadge[_receiver] = mapList;
}
}
function listUserBadge(address _wallet) public view returns (uint256[] memory){
return mapUserBadge[_wallet];
}
// Certificate
function addUserCertificate(address _user, uint256 _tokenId, address _sender) external override {
require(InterfaceNFTPermission(NFTPermissionAddress).checkMinterRole(_sender) || InterfaceNFTPermission(NFTPermissionAddress).checkTransferRole(_sender),"only minter role or transfer role");
mapUserCertificate[_user].push(_tokenId);
}
function findCertificateIndex(address _receiver, uint256 _tokenId) external override view returns (int) {
uint256[] storage list = mapUserCertificate[_receiver];
for (uint i = 0; i < list.length; i++) {
if (list[i] == _tokenId) {
return int(i);
}
}
return - 1;
}
function removeCertificateList(address _receiver, int _index, address _sender, string memory _role) external override {
require(InterfaceNFTPermission(NFTPermissionAddress).checkBurnerRole(_sender),"only burner role");
require(InterfaceNFTPermission(NFTPermissionAddress).checkTokenAccessRole(_sender, _role) || InterfaceNFTPermission(NFTPermissionAddress).checkAdminRole(_sender),"Invalid token access role.");
require(_index >= 0, "not found index");
uint256 [] storage mapList = mapUserCertificate[_receiver];
require(uint(_index) < mapList.length, "not found index");
if (balanceOf(_receiver, mapList[uint(_index)]) == 0) {
for (uint i = uint(_index); i < mapList.length - 1; i++) {
mapList[i] = mapList[i + 1];
}
mapList.pop();
mapUserCertificate[_receiver] = mapList;
}
}
function listUserCertificate(address _wallet) public view returns (uint256[] memory){
return mapUserCertificate[_wallet];
}
}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"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":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"previousAdminRole","internalType":"bytes32","indexed":true},{"type":"bytes32","name":"newAdminRole","internalType":"bytes32","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32","indexed":true},{"type":"address","name":"account","internalType":"address","indexed":true},{"type":"address","name":"sender","internalType":"address","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":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"TokenName","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addUserBadge","inputs":[{"type":"address","name":"_user","internalType":"address"},{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"address","name":"_sender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addUserCertificate","inputs":[{"type":"address","name":"_user","internalType":"address"},{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"address","name":"_sender","internalType":"address"}]},{"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":"nonpayable","outputs":[],"name":"burnToken","inputs":[{"type":"address","name":"_account","internalType":"address"},{"type":"uint256","name":"_id","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"address","name":"_sender","internalType":"address"},{"type":"string","name":"_role","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"currentTokenId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"int256","name":"","internalType":"int256"}],"name":"findBadgeIndex","inputs":[{"type":"address","name":"_receiver","internalType":"address"},{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"int256","name":"","internalType":"int256"}],"name":"findCertificateIndex","inputs":[{"type":"address","name":"_receiver","internalType":"address"},{"type":"uint256","name":"_tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct CertificateToken.TokenInfo","components":[{"type":"address","name":"contractAddress","internalType":"address"},{"type":"string","name":"externalId","internalType":"string"},{"type":"string","name":"tokenType","internalType":"string"},{"type":"string","name":"uri","internalType":"string"}]}],"name":"getTokenInfo","inputs":[{"type":"uint256","name":"_id","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"string","name":"_tokenName","internalType":"string"},{"type":"address","name":"_nftPermissionAddress","internalType":"address"}]},{"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":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"listUserBadge","inputs":[{"type":"address","name":"_wallet","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"listUserCertificate","inputs":[{"type":"address","name":"_wallet","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintToken","inputs":[{"type":"address","name":"_account","internalType":"address"},{"type":"uint256","name":"_id","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"},{"type":"address","name":"_sender","internalType":"address"},{"type":"address","name":"_contractAddress","internalType":"address"},{"type":"string","name":"_externalId","internalType":"string"},{"type":"string","name":"_uri","internalType":"string"},{"type":"string","name":"_tokenType","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeBadgeList","inputs":[{"type":"address","name":"_receiver","internalType":"address"},{"type":"int256","name":"_index","internalType":"int256"},{"type":"address","name":"_sender","internalType":"address"},{"type":"string","name":"_role","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeCertificateList","inputs":[{"type":"address","name":"_receiver","internalType":"address"},{"type":"int256","name":"_index","internalType":"int256"},{"type":"address","name":"_sender","internalType":"address"},{"type":"string","name":"_role","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"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":"nonpayable","outputs":[],"name":"safeBatchTransferTokenFrom","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":"address","name":"_sender","internalType":"address"},{"type":"string","name":"_role","internalType":"string"}]},{"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":"safeTransferTokenFrom","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":"address","name":"_sender","internalType":"address"},{"type":"string","name":"_role","internalType":"string"}]},{"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":"setTokenName","inputs":[{"type":"string","name":"_tokenName","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setUri","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"},{"type":"string","name":"_uri","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"uri","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]}]
Contract Creation Code
0x60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61423380620000f46000396000f3fe608060405234801561001057600080fd5b506004361061021a5760003560e01c806391d1485411610125578063c34850ab116100ad578063e057be601161007c578063e057be60146104a9578063e1796e68146104bc578063e985e9c5146104cf578063f242432a1461050b578063f5298aca1461051e57600080fd5b8063c34850ab1461045d578063c72c917614610470578063d547741f14610483578063d96934251461049657600080fd5b8063a4f29aad116100f4578063a4f29aad14610409578063ac1ede341461041c578063b00f89981461042f578063b6d7855a14610442578063c0c234d31461044a57600080fd5b806391d14854146103bb57806395d89b41146103ce578063a217fddf146103ee578063a22cb465146103f657600080fd5b806335dc324f116101a85780636b20c454116101775780636b20c4541461034f57806371ad994614610362578063782f08ae146103755780637ab4339d146103885780638c7a63ae1461039b57600080fd5b806335dc324f146102f657806336568abe146103095780633f111eae1461031c5780634e1273f41461032f57600080fd5b80630e89341c116101ef5780630e89341c146102855780631a87b5f114610298578063248a9ca3146102ad5780632eb2c2d6146102d05780632f2ff15d146102e357600080fd5b80629a9b7b1461021f578062fdd58e1461023a57806301ffc9a71461024d57806306fdde0314610270575b600080fd5b610227610531565b6040519081526020015b60405180910390f35b610227610248366004613638565b610542565b61026061025b366004613944565b6105dd565b6040519015158152602001610231565b6102786105e8565b6040516102319190613c1e565b610278610293366004613908565b61067a565b6102ab6102a63660046135d1565b61071f565b005b6102276102bb366004613908565b600090815260c9602052604090206001015490565b6102ab6102de3660046132e0565b610a21565b6102ab6102f1366004613921565b610a66565b610227610304366004613638565b610a90565b6102ab610317366004613921565b610afe565b6102ab61032a366004613662565b610b7c565b61034261033d36600461381b565b610cc5565b6040516102319190613bdd565b6102ab61035d366004613527565b610dee565b610227610370366004613638565b610e31565b6102ab6103833660046139fe565b610e93565b6102ab6103963660046139ba565b610fc3565b6103ae6103a9366004613908565b61112e565b6040516102319190613f3c565b6102606103c9366004613921565b61134b565b60408051808201909152600481526310d1549560e21b6020820152610278565b610227600081565b6102ab61040436600461359a565b611376565b6102ab61041736600461397e565b611381565b6102ab61042a366004613662565b611394565b6102ab61043d366004613389565b6114dd565b610278611751565b6102ab6104583660046135d1565b6117df565b6102ab61046b3660046134cb565b611ac8565b6102ab61047e3660046136d1565b611cb4565b6102ab610491366004613921565b611e79565b6103426104a4366004613292565b611e9e565b6103426104b7366004613292565b611f09565b6102ab6104ca366004613729565b611f73565b6102606104dd3660046132ad565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b6102ab610519366004613467565b6121bc565b6102ab61052c36600461369e565b612201565b600061053d6101005490565b905090565b60006001600160a01b0383166105b25760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006105d782612244565b606060ff80546105f79061405a565b80601f01602080910402602001604051908101604052809291908181526020018280546106239061405a565b80156106705780601f1061064557610100808354040283529160200191610670565b820191906000526020600020905b81548152906001019060200180831161065357829003601f168201915b5050505050905090565b600081815260fb6020526040902060030180546060919061069a9061405a565b80601f01602080910402602001604051908101604052809291908181526020018280546106c69061405a565b80156107135780601f106106e857610100808354040283529160200191610713565b820191906000526020600020905b8154815290600101906020018083116106f657829003601f168201915b50505050509050919050565b60fe5460405163081c456360e41b81526001600160a01b038481166004830152909116906381c456309060240160206040518083038186803b15801561076457600080fd5b505afa158015610778573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079c91906138eb565b6107b85760405162461bcd60e51b81526004016105a990613d0c565b60fe54604051636b7a9dbd60e01b81526001600160a01b0390911690636b7a9dbd906107ea9085908590600401613bb9565b60206040518083038186803b15801561080257600080fd5b505afa158015610816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083a91906138eb565b806108bd575060fe546040516371c35f1760e11b81526001600160a01b0384811660048301529091169063e386be2e9060240160206040518083038186803b15801561088557600080fd5b505afa158015610899573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108bd91906138eb565b6108d95760405162461bcd60e51b81526004016105a990613e53565b60008312156108fa5760405162461bcd60e51b81526004016105a990613f13565b6001600160a01b038416600090815260fc60205260409020805484106109325760405162461bcd60e51b81526004016105a990613f13565b6109588582868154811061094857610948614108565b9060005260206000200154610542565b610a1a57835b815461096c90600190614000565b8110156109ca578161097f826001613fc9565b8154811061098f5761098f614108565b90600052602060002001548282815481106109ac576109ac614108565b600091825260209091200155806109c2816140c1565b91505061095e565b50808054806109db576109db6140f2565b6000828152602080822083016000199081018390559092019092556001600160a01b038716825260fc9052604090208154610a18919083906130b3565b505b5050505050565b6001600160a01b038516331480610a3d5750610a3d85336104dd565b610a595760405162461bcd60e51b81526004016105a990613c31565b610a1a8585858585612269565b600082815260c96020526040902060010154610a818161241c565b610a8b8383612429565b505050565b6001600160a01b038216600090815260fd60205260408120815b8154811015610af25783828281548110610ac657610ac6614108565b90600052602060002001541415610ae05791506105d79050565b80610aea816140c1565b915050610aaa565b50600019949350505050565b6001600160a01b0381163314610b6e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105a9565b610b7882826124af565b5050565b60fe546040516352935f3960e11b81526001600160a01b0383811660048301529091169063a526be729060240160206040518083038186803b158015610bc157600080fd5b505afa158015610bd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf991906138eb565b80610c7c575060fe5460405163094d62f960e01b81526001600160a01b0383811660048301529091169063094d62f99060240160206040518083038186803b158015610c4457600080fd5b505afa158015610c58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7c91906138eb565b610c985760405162461bcd60e51b81526004016105a990613e8a565b506001600160a01b03909116600090815260fc602090815260408220805460018101825590835291200155565b60608151835114610d2a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105a9565b600083516001600160401b03811115610d4557610d4561411e565b604051908082528060200260200182016040528015610d6e578160200160208202803683370190505b50905060005b8451811015610de657610db9858281518110610d9257610d92614108565b6020026020010151858381518110610dac57610dac614108565b6020026020010151610542565b828281518110610dcb57610dcb614108565b6020908102919091010152610ddf816140c1565b9050610d74565b509392505050565b6001600160a01b038316331480610e0a5750610e0a83336104dd565b610e265760405162461bcd60e51b81526004016105a990613c31565b610a8b838383612516565b6001600160a01b038216600090815260fc60205260408120815b8154811015610af25783828281548110610e6757610e67614108565b90600052602060002001541415610e815791506105d79050565b80610e8b816140c1565b915050610e4b565b60fe546040516371c35f1760e11b81523360048201526001600160a01b039091169063e386be2e9060240160206040518083038186803b158015610ed657600080fd5b505afa158015610eea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0e91906138eb565b610f4d5760405162461bcd60e51b815260206004820152601060248201526f37b7363c9030b236b4b7103937b6329760811b60448201526064016105a9565b6101005482108015610f5e57508115155b610f9e5760405162461bcd60e51b81526020600482015260116024820152701d1bdad95b881a5cdb89dd08195e1a5cdd607a1b60448201526064016105a9565b600082815260fb602090815260409091208251610a8b92600390920191840190613103565b600054610100900460ff1615808015610fe35750600054600160ff909116105b80610ffd5750303b158015610ffd575060005460ff166001145b6110605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105a9565b6000805460ff191660011790558015611083576000805461ff0019166101001790555b61109b604051806020016040528060008152506126c5565b6110a36126f5565b6110ab6126f5565b82516110be9060ff906020860190613103565b5060fe80546001600160a01b0319166001600160a01b038416179055610100805460010190558015610a8b576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b611162604051806080016040528060006001600160a01b031681526020016060815260200160608152602001606081525090565b600082815260fb602090815260409182902082516080810190935280546001600160a01b03168352600181018054919284019161119e9061405a565b80601f01602080910402602001604051908101604052809291908181526020018280546111ca9061405a565b80156112175780601f106111ec57610100808354040283529160200191611217565b820191906000526020600020905b8154815290600101906020018083116111fa57829003601f168201915b505050505081526020016002820180546112309061405a565b80601f016020809104026020016040519081016040528092919081815260200182805461125c9061405a565b80156112a95780601f1061127e576101008083540402835291602001916112a9565b820191906000526020600020905b81548152906001019060200180831161128c57829003601f168201915b505050505081526020016003820180546112c29061405a565b80601f01602080910402602001604051908101604052809291908181526020018280546112ee9061405a565b801561133b5780601f106113105761010080835404028352916020019161133b565b820191906000526020600020905b81548152906001019060200180831161131e57829003601f168201915b5050505050815250509050919050565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610b7833838361271e565b8051610b789060ff906020840190613103565b60fe546040516352935f3960e11b81526001600160a01b0383811660048301529091169063a526be729060240160206040518083038186803b1580156113d957600080fd5b505afa1580156113ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141191906138eb565b80611494575060fe5460405163094d62f960e01b81526001600160a01b0383811660048301529091169063094d62f99060240160206040518083038186803b15801561145c57600080fd5b505afa158015611470573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149491906138eb565b6114b05760405162461bcd60e51b81526004016105a990613e8a565b506001600160a01b03909116600090815260fd602090815260408220805460018101825590835291200155565b60fe5460405163094d62f960e01b81526001600160a01b0384811660048301529091169063094d62f99060240160206040518083038186803b15801561152257600080fd5b505afa158015611536573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155a91906138eb565b61159b5760405162461bcd60e51b81526020600482015260126024820152716f6e6c79207472616e7366657220726f6c6560701b60448201526064016105a9565b60005b855181101561173a5760fe54604051636b7a9dbd60e01b81526001600160a01b0390911690636b7a9dbd906115d99086908690600401613bb9565b60206040518083038186803b1580156115f157600080fd5b505afa158015611605573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162991906138eb565b806116ac575060fe546040516371c35f1760e11b81526001600160a01b0385811660048301529091169063e386be2e9060240160206040518083038186803b15801561167457600080fd5b505afa158015611688573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ac91906138eb565b6116c85760405162461bcd60e51b81526004016105a990613e53565b60008682815181106116dc576116dc614108565b6020026020010151116117285760405162461bcd60e51b81526020600482015260146024820152733a37b5b2b710181034b9b713ba1032bc34b9ba1760611b60448201526064016105a9565b80611732816140c1565b91505061159e565b506117488787878787612269565b50505050505050565b60ff805461175e9061405a565b80601f016020809104026020016040519081016040528092919081815260200182805461178a9061405a565b80156117d75780601f106117ac576101008083540402835291602001916117d7565b820191906000526020600020905b8154815290600101906020018083116117ba57829003601f168201915b505050505081565b60fe5460405163081c456360e41b81526001600160a01b038481166004830152909116906381c456309060240160206040518083038186803b15801561182457600080fd5b505afa158015611838573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185c91906138eb565b6118785760405162461bcd60e51b81526004016105a990613d0c565b60fe54604051636b7a9dbd60e01b81526001600160a01b0390911690636b7a9dbd906118aa9085908590600401613bb9565b60206040518083038186803b1580156118c257600080fd5b505afa1580156118d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118fa91906138eb565b8061197d575060fe546040516371c35f1760e11b81526001600160a01b0384811660048301529091169063e386be2e9060240160206040518083038186803b15801561194557600080fd5b505afa158015611959573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197d91906138eb565b6119995760405162461bcd60e51b81526004016105a990613e53565b60008312156119ba5760405162461bcd60e51b81526004016105a990613f13565b6001600160a01b038416600090815260fd60205260409020805484106119f25760405162461bcd60e51b81526004016105a990613f13565b611a088582868154811061094857610948614108565b610a1a57835b8154611a1c90600190614000565b811015611a7a5781611a2f826001613fc9565b81548110611a3f57611a3f614108565b9060005260206000200154828281548110611a5c57611a5c614108565b60009182526020909120015580611a72816140c1565b915050611a0e565b5080805480611a8b57611a8b6140f2565b6000828152602080822083016000199081018390559092019092556001600160a01b038716825260fd9052604090208154610a18919083906130b3565b60fe5460405163094d62f960e01b81526001600160a01b0384811660048301529091169063094d62f99060240160206040518083038186803b158015611b0d57600080fd5b505afa158015611b21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4591906138eb565b611b865760405162461bcd60e51b81526020600482015260126024820152716f6e6c79207472616e7366657220726f6c6560701b60448201526064016105a9565b60fe54604051636b7a9dbd60e01b81526001600160a01b0390911690636b7a9dbd90611bb89085908590600401613bb9565b60206040518083038186803b158015611bd057600080fd5b505afa158015611be4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0891906138eb565b80611c8b575060fe546040516371c35f1760e11b81526001600160a01b0384811660048301529091169063e386be2e9060240160206040518083038186803b158015611c5357600080fd5b505afa158015611c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8b91906138eb565b611ca75760405162461bcd60e51b81526004016105a990613e53565b61174887878787876127ff565b60fe5460405163081c456360e41b81526001600160a01b038481166004830152909116906381c456309060240160206040518083038186803b158015611cf957600080fd5b505afa158015611d0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d3191906138eb565b611d4d5760405162461bcd60e51b81526004016105a990613d0c565b60fe54604051636b7a9dbd60e01b81526001600160a01b0390911690636b7a9dbd90611d7f9085908590600401613bb9565b60206040518083038186803b158015611d9757600080fd5b505afa158015611dab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dcf91906138eb565b80611e52575060fe546040516371c35f1760e11b81526001600160a01b0384811660048301529091169063e386be2e9060240160206040518083038186803b158015611e1a57600080fd5b505afa158015611e2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5291906138eb565b611e6e5760405162461bcd60e51b81526004016105a990613e53565b610a1a858585612949565b600082815260c96020526040902060010154611e948161241c565b610a8b83836124af565b6001600160a01b038116600090815260fd602090815260409182902080548351818402810184019094528084526060939283018282801561071357602002820191906000526020600020905b815481526020019060010190808311611eea5750505050509050919050565b6001600160a01b038116600090815260fc60209081526040918290208054835181840281018401909452808452606093928301828280156107135760200282019190600052602060002090815481526020019060010190808311611eea5750505050509050919050565b60fe546040516352935f3960e11b81526001600160a01b0387811660048301529091169063a526be729060240160206040518083038186803b158015611fb857600080fd5b505afa158015611fcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ff091906138eb565b61202f5760405162461bcd60e51b815260206004820152601060248201526f6f6e6c79206d696e74657220726f6c6560801b60448201526064016105a9565b60fe5460405163155c217560e11b81526001600160a01b03878116600483015290911690632ab842ea9060240160206040518083038186803b15801561207457600080fd5b505afa158015612088573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ac91906138eb565b6120f85760405162461bcd60e51b815260206004820152601760248201527f4e65656420746f6b656e2061636365737320726f6c652e00000000000000000060448201526064016105a9565b61210489898989612a6f565b604080516080810182526001600160a01b03868116825260208083018781528385018690526060840187905260008d815260fb835294909420835181546001600160a01b0319169316929092178255925180519293849361216b9260018501920190613103565b5060408201518051612187916002840191602090910190613103565b50606082015180516121a3916003840191602090910190613103565b5050610100805460010190555050505050505050505050565b6001600160a01b0385163314806121d857506121d885336104dd565b6121f45760405162461bcd60e51b81526004016105a990613c31565b610a1a85858585856127ff565b6001600160a01b03831633148061221d575061221d83336104dd565b6122395760405162461bcd60e51b81526004016105a990613c31565b610a8b838383612949565b60006001600160e01b03198216637965db0b60e01b14806105d757506105d782612b9a565b815183511461228a5760405162461bcd60e51b81526004016105a990613ecb565b6001600160a01b0384166122b05760405162461bcd60e51b81526004016105a990613d36565b336122bf818787878787610a18565b60005b84518110156123a85760008582815181106122df576122df614108565b6020026020010151905060008583815181106122fd576122fd614108565b60209081029190910181015160008481526065835260408082206001600160a01b038e16835290935291909120549091508181101561234e5760405162461bcd60e51b81526004016105a990613dbe565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061238d908490613fc9565b92505081905550505050806123a1906140c1565b90506122c2565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516123f8929190613bf0565b60405180910390a461240e818787878787610a18565b610a18818787878787612bea565b6124268133612d55565b50565b612433828261134b565b610b7857600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561246b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6124b9828261134b565b15610b7857600082815260c9602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b03831661253c5760405162461bcd60e51b81526004016105a990613d7b565b805182511461255d5760405162461bcd60e51b81526004016105a990613ecb565b600033905061258081856000868660405180602001604052806000815250610a18565b60005b83518110156126485760008482815181106125a0576125a0614108565b6020026020010151905060008483815181106125be576125be614108565b60209081029190910181015160008481526065835260408082206001600160a01b038c16835290935291909120549091508181101561260f5760405162461bcd60e51b81526004016105a990613cc8565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580612640816140c1565b915050612583565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612699929190613bf0565b60405180910390a46126bf81856000868660405180602001604052806000815250610a18565b50505050565b600054610100900460ff166126ec5760405162461bcd60e51b81526004016105a990613e08565b61242681612db9565b600054610100900460ff1661271c5760405162461bcd60e51b81526004016105a990613e08565b565b816001600160a01b0316836001600160a01b031614156127925760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016105a9565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166128255760405162461bcd60e51b81526004016105a990613d36565b33600061283185612de9565b9050600061283e85612de9565b905061284e838989858589610a18565b60008681526065602090815260408083206001600160a01b038c168452909152902054858110156128915760405162461bcd60e51b81526004016105a990613dbe565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906128d0908490613fc9565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612930848a8a86868a610a18565b61293e848a8a8a8a8a612e34565b505050505050505050565b6001600160a01b03831661296f5760405162461bcd60e51b81526004016105a990613d7b565b33600061297b84612de9565b9050600061298884612de9565b90506129a883876000858560405180602001604052806000815250610a18565b60008581526065602090815260408083206001600160a01b038a168452909152902054848110156129eb5760405162461bcd60e51b81526004016105a990613cc8565b60008681526065602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461174884886000868660405180602001604052806000815250610a18565b6001600160a01b038416612acf5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016105a9565b336000612adb85612de9565b90506000612ae885612de9565b9050612af983600089858589610a18565b60008681526065602090815260408083206001600160a01b038b16845290915281208054879290612b2b908490613fc9565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612b8b83600089858589610a18565b61174883600089898989612e34565b60006001600160e01b03198216636cdb3d1360e11b1480612bcb57506001600160e01b031982166303a24d0760e21b145b806105d757506301ffc9a760e01b6001600160e01b03198316146105d7565b6001600160a01b0384163b15610a185760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612c2e9089908990889088908890600401613b16565b602060405180830381600087803b158015612c4857600080fd5b505af1925050508015612c78575060408051601f3d908101601f19168201909252612c7591810190613961565b60015b612d2557612c84614134565b806308c379a01415612cbe5750612c99614150565b80612ca45750612cc0565b8060405162461bcd60e51b81526004016105a99190613c1e565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105a9565b6001600160e01b0319811663bc197c8160e01b146117485760405162461bcd60e51b81526004016105a990613c80565b612d5f828261134b565b610b7857612d77816001600160a01b03166014612efe565b612d82836020612efe565b604051602001612d93929190613aa1565b60408051601f198184030181529082905262461bcd60e51b82526105a991600401613c1e565b600054610100900460ff16612de05760405162461bcd60e51b81526004016105a990613e08565b612426816130a0565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612e2357612e23614108565b602090810291909101015292915050565b6001600160a01b0384163b15610a185760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612e789089908990889088908890600401613b74565b602060405180830381600087803b158015612e9257600080fd5b505af1925050508015612ec2575060408051601f3d908101601f19168201909252612ebf91810190613961565b60015b612ece57612c84614134565b6001600160e01b0319811663f23a6e6160e01b146117485760405162461bcd60e51b81526004016105a990613c80565b60606000612f0d836002613fe1565b612f18906002613fc9565b6001600160401b03811115612f2f57612f2f61411e565b6040519080825280601f01601f191660200182016040528015612f59576020820181803683370190505b509050600360fc1b81600081518110612f7457612f74614108565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612fa357612fa3614108565b60200101906001600160f81b031916908160001a9053506000612fc7846002613fe1565b612fd2906001613fc9565b90505b600181111561304a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061300657613006614108565b1a60f81b82828151811061301c5761301c614108565b60200101906001600160f81b031916908160001a90535060049490941c9361304381614043565b9050612fd5565b5083156130995760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105a9565b9392505050565b8051610b78906067906020840190613103565b8280548282559060005260206000209081019282156130f35760005260206000209182015b828111156130f35782548255916001019190600101906130d8565b506130ff929150613177565b5090565b82805461310f9061405a565b90600052602060002090601f01602090048101928261313157600085556130f3565b82601f1061314a57805160ff19168380011785556130f3565b828001600101855582156130f3579182015b828111156130f357825182559160200191906001019061315c565b5b808211156130ff5760008155600101613178565b80356001600160a01b03811681146131a357600080fd5b919050565b600082601f8301126131b957600080fd5b813560206131c682613fa6565b6040516131d38282614095565b8381528281019150858301600585901b870184018810156131f357600080fd5b60005b85811015613212578135845292840192908401906001016131f6565b5090979650505050505050565b600082601f83011261323057600080fd5b81356001600160401b038111156132495761324961411e565b604051613260601f8301601f191660200182614095565b81815284602083860101111561327557600080fd5b816020850160208301376000918101602001919091529392505050565b6000602082840312156132a457600080fd5b6130998261318c565b600080604083850312156132c057600080fd5b6132c98361318c565b91506132d76020840161318c565b90509250929050565b600080600080600060a086880312156132f857600080fd5b6133018661318c565b945061330f6020870161318c565b935060408601356001600160401b038082111561332b57600080fd5b61333789838a016131a8565b9450606088013591508082111561334d57600080fd5b61335989838a016131a8565b9350608088013591508082111561336f57600080fd5b5061337c8882890161321f565b9150509295509295909350565b600080600080600080600060e0888a0312156133a457600080fd5b6133ad8861318c565b96506133bb6020890161318c565b955060408801356001600160401b03808211156133d757600080fd5b6133e38b838c016131a8565b965060608a01359150808211156133f957600080fd5b6134058b838c016131a8565b955060808a013591508082111561341b57600080fd5b6134278b838c0161321f565b945061343560a08b0161318c565b935060c08a013591508082111561344b57600080fd5b506134588a828b0161321f565b91505092959891949750929550565b600080600080600060a0868803121561347f57600080fd5b6134888661318c565b94506134966020870161318c565b9350604086013592506060860135915060808601356001600160401b038111156134bf57600080fd5b61337c8882890161321f565b600080600080600080600060e0888a0312156134e657600080fd5b6134ef8861318c565b96506134fd6020890161318c565b9550604088013594506060880135935060808801356001600160401b038082111561341b57600080fd5b60008060006060848603121561353c57600080fd5b6135458461318c565b925060208401356001600160401b038082111561356157600080fd5b61356d878388016131a8565b9350604086013591508082111561358357600080fd5b50613590868287016131a8565b9150509250925092565b600080604083850312156135ad57600080fd5b6135b68361318c565b915060208301356135c6816141d9565b809150509250929050565b600080600080608085870312156135e757600080fd5b6135f08561318c565b9350602085013592506136056040860161318c565b915060608501356001600160401b0381111561362057600080fd5b61362c8782880161321f565b91505092959194509250565b6000806040838503121561364b57600080fd5b6136548361318c565b946020939093013593505050565b60008060006060848603121561367757600080fd5b6136808461318c565b9250602084013591506136956040850161318c565b90509250925092565b6000806000606084860312156136b357600080fd5b6136bc8461318c565b95602085013595506040909401359392505050565b600080600080600060a086880312156136e957600080fd5b6136f28661318c565b9450602086013593506040860135925061370e6060870161318c565b915060808601356001600160401b038111156134bf57600080fd5b60008060008060008060008060006101208a8c03121561374857600080fd5b6137518a61318c565b985060208a0135975060408a0135965060608a01356001600160401b038082111561377b57600080fd5b6137878d838e0161321f565b975061379560808d0161318c565b96506137a360a08d0161318c565b955060c08c01359150808211156137b957600080fd5b6137c58d838e0161321f565b945060e08c01359150808211156137db57600080fd5b6137e78d838e0161321f565b93506101008c01359150808211156137fe57600080fd5b5061380b8c828d0161321f565b9150509295985092959850929598565b6000806040838503121561382e57600080fd5b82356001600160401b038082111561384557600080fd5b818501915085601f83011261385957600080fd5b8135602061386682613fa6565b6040516138738282614095565b8381528281019150858301600585901b870184018b101561389357600080fd5b600096505b848710156138bd576138a98161318c565b835260019690960195918301918301613898565b50965050860135925050808211156138d457600080fd5b506138e1858286016131a8565b9150509250929050565b6000602082840312156138fd57600080fd5b8151613099816141d9565b60006020828403121561391a57600080fd5b5035919050565b6000806040838503121561393457600080fd5b823591506132d76020840161318c565b60006020828403121561395657600080fd5b8135613099816141e7565b60006020828403121561397357600080fd5b8151613099816141e7565b60006020828403121561399057600080fd5b81356001600160401b038111156139a657600080fd5b6139b28482850161321f565b949350505050565b600080604083850312156139cd57600080fd5b82356001600160401b038111156139e357600080fd5b6139ef8582860161321f565b9250506132d76020840161318c565b60008060408385031215613a1157600080fd5b8235915060208301356001600160401b03811115613a2e57600080fd5b6138e18582860161321f565b600081518084526020808501945080840160005b83811015613a6a57815187529582019590820190600101613a4e565b509495945050505050565b60008151808452613a8d816020860160208601614017565b601f01601f19169290920160200192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613ad9816017850160208801614017565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613b0a816028840160208801614017565b01602801949350505050565b6001600160a01b0386811682528516602082015260a060408201819052600090613b4290830186613a3a565b8281036060840152613b548186613a3a565b90508281036080840152613b688185613a75565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613bae90830184613a75565b979650505050505050565b6001600160a01b03831681526040602082018190526000906139b290830184613a75565b6020815260006130996020830184613a3a565b604081526000613c036040830185613a3a565b8281036020840152613c158185613a3a565b95945050505050565b6020815260006130996020830184613a75565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b60208082526010908201526f6f6e6c79206275726e657220726f6c6560801b604082015260600190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252601a908201527f496e76616c696420746f6b656e2061636365737320726f6c652e000000000000604082015260600190565b60208082526021908201527f6f6e6c79206d696e74657220726f6c65206f72207472616e7366657220726f6c6040820152606560f81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b6020808252600f908201526e0dcdee840ccdeeadcc840d2dcc8caf608b1b604082015260600190565b602080825282516001600160a01b03168282015282015160806040830152600090613f6a60a0840182613a75565b90506040840151601f1980858403016060860152613f888383613a75565b9250606086015191508085840301608086015250613c158282613a75565b60006001600160401b03821115613fbf57613fbf61411e565b5060051b60200190565b60008219821115613fdc57613fdc6140dc565b500190565b6000816000190483118215151615613ffb57613ffb6140dc565b500290565b600082821015614012576140126140dc565b500390565b60005b8381101561403257818101518382015260200161401a565b838111156126bf5750506000910152565b600081614052576140526140dc565b506000190190565b600181811c9082168061406e57607f821691505b6020821081141561408f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b03811182821017156140ba576140ba61411e565b6040525050565b60006000198214156140d5576140d56140dc565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d111561414d5760046000803e5060005160e01c5b90565b600060443d101561415e5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561418d57505050505090565b82850191508151818111156141a55750505050505090565b843d87010160208285010111156141bf5750505050505090565b6141ce60208286010187614095565b509095945050505050565b801515811461242657600080fd5b6001600160e01b03198116811461242657600080fdfea264697066735822122039c769038e2a21ea3fdb594d260ef1b65c89aa0bc25bc1b74ef4f0d22379161364736f6c63430008070033
Deployed ByteCode
0x608060405234801561001057600080fd5b506004361061021a5760003560e01c806391d1485411610125578063c34850ab116100ad578063e057be601161007c578063e057be60146104a9578063e1796e68146104bc578063e985e9c5146104cf578063f242432a1461050b578063f5298aca1461051e57600080fd5b8063c34850ab1461045d578063c72c917614610470578063d547741f14610483578063d96934251461049657600080fd5b8063a4f29aad116100f4578063a4f29aad14610409578063ac1ede341461041c578063b00f89981461042f578063b6d7855a14610442578063c0c234d31461044a57600080fd5b806391d14854146103bb57806395d89b41146103ce578063a217fddf146103ee578063a22cb465146103f657600080fd5b806335dc324f116101a85780636b20c454116101775780636b20c4541461034f57806371ad994614610362578063782f08ae146103755780637ab4339d146103885780638c7a63ae1461039b57600080fd5b806335dc324f146102f657806336568abe146103095780633f111eae1461031c5780634e1273f41461032f57600080fd5b80630e89341c116101ef5780630e89341c146102855780631a87b5f114610298578063248a9ca3146102ad5780632eb2c2d6146102d05780632f2ff15d146102e357600080fd5b80629a9b7b1461021f578062fdd58e1461023a57806301ffc9a71461024d57806306fdde0314610270575b600080fd5b610227610531565b6040519081526020015b60405180910390f35b610227610248366004613638565b610542565b61026061025b366004613944565b6105dd565b6040519015158152602001610231565b6102786105e8565b6040516102319190613c1e565b610278610293366004613908565b61067a565b6102ab6102a63660046135d1565b61071f565b005b6102276102bb366004613908565b600090815260c9602052604090206001015490565b6102ab6102de3660046132e0565b610a21565b6102ab6102f1366004613921565b610a66565b610227610304366004613638565b610a90565b6102ab610317366004613921565b610afe565b6102ab61032a366004613662565b610b7c565b61034261033d36600461381b565b610cc5565b6040516102319190613bdd565b6102ab61035d366004613527565b610dee565b610227610370366004613638565b610e31565b6102ab6103833660046139fe565b610e93565b6102ab6103963660046139ba565b610fc3565b6103ae6103a9366004613908565b61112e565b6040516102319190613f3c565b6102606103c9366004613921565b61134b565b60408051808201909152600481526310d1549560e21b6020820152610278565b610227600081565b6102ab61040436600461359a565b611376565b6102ab61041736600461397e565b611381565b6102ab61042a366004613662565b611394565b6102ab61043d366004613389565b6114dd565b610278611751565b6102ab6104583660046135d1565b6117df565b6102ab61046b3660046134cb565b611ac8565b6102ab61047e3660046136d1565b611cb4565b6102ab610491366004613921565b611e79565b6103426104a4366004613292565b611e9e565b6103426104b7366004613292565b611f09565b6102ab6104ca366004613729565b611f73565b6102606104dd3660046132ad565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b6102ab610519366004613467565b6121bc565b6102ab61052c36600461369e565b612201565b600061053d6101005490565b905090565b60006001600160a01b0383166105b25760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006105d782612244565b606060ff80546105f79061405a565b80601f01602080910402602001604051908101604052809291908181526020018280546106239061405a565b80156106705780601f1061064557610100808354040283529160200191610670565b820191906000526020600020905b81548152906001019060200180831161065357829003601f168201915b5050505050905090565b600081815260fb6020526040902060030180546060919061069a9061405a565b80601f01602080910402602001604051908101604052809291908181526020018280546106c69061405a565b80156107135780601f106106e857610100808354040283529160200191610713565b820191906000526020600020905b8154815290600101906020018083116106f657829003601f168201915b50505050509050919050565b60fe5460405163081c456360e41b81526001600160a01b038481166004830152909116906381c456309060240160206040518083038186803b15801561076457600080fd5b505afa158015610778573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079c91906138eb565b6107b85760405162461bcd60e51b81526004016105a990613d0c565b60fe54604051636b7a9dbd60e01b81526001600160a01b0390911690636b7a9dbd906107ea9085908590600401613bb9565b60206040518083038186803b15801561080257600080fd5b505afa158015610816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083a91906138eb565b806108bd575060fe546040516371c35f1760e11b81526001600160a01b0384811660048301529091169063e386be2e9060240160206040518083038186803b15801561088557600080fd5b505afa158015610899573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108bd91906138eb565b6108d95760405162461bcd60e51b81526004016105a990613e53565b60008312156108fa5760405162461bcd60e51b81526004016105a990613f13565b6001600160a01b038416600090815260fc60205260409020805484106109325760405162461bcd60e51b81526004016105a990613f13565b6109588582868154811061094857610948614108565b9060005260206000200154610542565b610a1a57835b815461096c90600190614000565b8110156109ca578161097f826001613fc9565b8154811061098f5761098f614108565b90600052602060002001548282815481106109ac576109ac614108565b600091825260209091200155806109c2816140c1565b91505061095e565b50808054806109db576109db6140f2565b6000828152602080822083016000199081018390559092019092556001600160a01b038716825260fc9052604090208154610a18919083906130b3565b505b5050505050565b6001600160a01b038516331480610a3d5750610a3d85336104dd565b610a595760405162461bcd60e51b81526004016105a990613c31565b610a1a8585858585612269565b600082815260c96020526040902060010154610a818161241c565b610a8b8383612429565b505050565b6001600160a01b038216600090815260fd60205260408120815b8154811015610af25783828281548110610ac657610ac6614108565b90600052602060002001541415610ae05791506105d79050565b80610aea816140c1565b915050610aaa565b50600019949350505050565b6001600160a01b0381163314610b6e5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105a9565b610b7882826124af565b5050565b60fe546040516352935f3960e11b81526001600160a01b0383811660048301529091169063a526be729060240160206040518083038186803b158015610bc157600080fd5b505afa158015610bd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf991906138eb565b80610c7c575060fe5460405163094d62f960e01b81526001600160a01b0383811660048301529091169063094d62f99060240160206040518083038186803b158015610c4457600080fd5b505afa158015610c58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7c91906138eb565b610c985760405162461bcd60e51b81526004016105a990613e8a565b506001600160a01b03909116600090815260fc602090815260408220805460018101825590835291200155565b60608151835114610d2a5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105a9565b600083516001600160401b03811115610d4557610d4561411e565b604051908082528060200260200182016040528015610d6e578160200160208202803683370190505b50905060005b8451811015610de657610db9858281518110610d9257610d92614108565b6020026020010151858381518110610dac57610dac614108565b6020026020010151610542565b828281518110610dcb57610dcb614108565b6020908102919091010152610ddf816140c1565b9050610d74565b509392505050565b6001600160a01b038316331480610e0a5750610e0a83336104dd565b610e265760405162461bcd60e51b81526004016105a990613c31565b610a8b838383612516565b6001600160a01b038216600090815260fc60205260408120815b8154811015610af25783828281548110610e6757610e67614108565b90600052602060002001541415610e815791506105d79050565b80610e8b816140c1565b915050610e4b565b60fe546040516371c35f1760e11b81523360048201526001600160a01b039091169063e386be2e9060240160206040518083038186803b158015610ed657600080fd5b505afa158015610eea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0e91906138eb565b610f4d5760405162461bcd60e51b815260206004820152601060248201526f37b7363c9030b236b4b7103937b6329760811b60448201526064016105a9565b6101005482108015610f5e57508115155b610f9e5760405162461bcd60e51b81526020600482015260116024820152701d1bdad95b881a5cdb89dd08195e1a5cdd607a1b60448201526064016105a9565b600082815260fb602090815260409091208251610a8b92600390920191840190613103565b600054610100900460ff1615808015610fe35750600054600160ff909116105b80610ffd5750303b158015610ffd575060005460ff166001145b6110605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105a9565b6000805460ff191660011790558015611083576000805461ff0019166101001790555b61109b604051806020016040528060008152506126c5565b6110a36126f5565b6110ab6126f5565b82516110be9060ff906020860190613103565b5060fe80546001600160a01b0319166001600160a01b038416179055610100805460010190558015610a8b576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b611162604051806080016040528060006001600160a01b031681526020016060815260200160608152602001606081525090565b600082815260fb602090815260409182902082516080810190935280546001600160a01b03168352600181018054919284019161119e9061405a565b80601f01602080910402602001604051908101604052809291908181526020018280546111ca9061405a565b80156112175780601f106111ec57610100808354040283529160200191611217565b820191906000526020600020905b8154815290600101906020018083116111fa57829003601f168201915b505050505081526020016002820180546112309061405a565b80601f016020809104026020016040519081016040528092919081815260200182805461125c9061405a565b80156112a95780601f1061127e576101008083540402835291602001916112a9565b820191906000526020600020905b81548152906001019060200180831161128c57829003601f168201915b505050505081526020016003820180546112c29061405a565b80601f01602080910402602001604051908101604052809291908181526020018280546112ee9061405a565b801561133b5780601f106113105761010080835404028352916020019161133b565b820191906000526020600020905b81548152906001019060200180831161131e57829003601f168201915b5050505050815250509050919050565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b610b7833838361271e565b8051610b789060ff906020840190613103565b60fe546040516352935f3960e11b81526001600160a01b0383811660048301529091169063a526be729060240160206040518083038186803b1580156113d957600080fd5b505afa1580156113ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141191906138eb565b80611494575060fe5460405163094d62f960e01b81526001600160a01b0383811660048301529091169063094d62f99060240160206040518083038186803b15801561145c57600080fd5b505afa158015611470573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149491906138eb565b6114b05760405162461bcd60e51b81526004016105a990613e8a565b506001600160a01b03909116600090815260fd602090815260408220805460018101825590835291200155565b60fe5460405163094d62f960e01b81526001600160a01b0384811660048301529091169063094d62f99060240160206040518083038186803b15801561152257600080fd5b505afa158015611536573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155a91906138eb565b61159b5760405162461bcd60e51b81526020600482015260126024820152716f6e6c79207472616e7366657220726f6c6560701b60448201526064016105a9565b60005b855181101561173a5760fe54604051636b7a9dbd60e01b81526001600160a01b0390911690636b7a9dbd906115d99086908690600401613bb9565b60206040518083038186803b1580156115f157600080fd5b505afa158015611605573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162991906138eb565b806116ac575060fe546040516371c35f1760e11b81526001600160a01b0385811660048301529091169063e386be2e9060240160206040518083038186803b15801561167457600080fd5b505afa158015611688573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ac91906138eb565b6116c85760405162461bcd60e51b81526004016105a990613e53565b60008682815181106116dc576116dc614108565b6020026020010151116117285760405162461bcd60e51b81526020600482015260146024820152733a37b5b2b710181034b9b713ba1032bc34b9ba1760611b60448201526064016105a9565b80611732816140c1565b91505061159e565b506117488787878787612269565b50505050505050565b60ff805461175e9061405a565b80601f016020809104026020016040519081016040528092919081815260200182805461178a9061405a565b80156117d75780601f106117ac576101008083540402835291602001916117d7565b820191906000526020600020905b8154815290600101906020018083116117ba57829003601f168201915b505050505081565b60fe5460405163081c456360e41b81526001600160a01b038481166004830152909116906381c456309060240160206040518083038186803b15801561182457600080fd5b505afa158015611838573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185c91906138eb565b6118785760405162461bcd60e51b81526004016105a990613d0c565b60fe54604051636b7a9dbd60e01b81526001600160a01b0390911690636b7a9dbd906118aa9085908590600401613bb9565b60206040518083038186803b1580156118c257600080fd5b505afa1580156118d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118fa91906138eb565b8061197d575060fe546040516371c35f1760e11b81526001600160a01b0384811660048301529091169063e386be2e9060240160206040518083038186803b15801561194557600080fd5b505afa158015611959573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197d91906138eb565b6119995760405162461bcd60e51b81526004016105a990613e53565b60008312156119ba5760405162461bcd60e51b81526004016105a990613f13565b6001600160a01b038416600090815260fd60205260409020805484106119f25760405162461bcd60e51b81526004016105a990613f13565b611a088582868154811061094857610948614108565b610a1a57835b8154611a1c90600190614000565b811015611a7a5781611a2f826001613fc9565b81548110611a3f57611a3f614108565b9060005260206000200154828281548110611a5c57611a5c614108565b60009182526020909120015580611a72816140c1565b915050611a0e565b5080805480611a8b57611a8b6140f2565b6000828152602080822083016000199081018390559092019092556001600160a01b038716825260fd9052604090208154610a18919083906130b3565b60fe5460405163094d62f960e01b81526001600160a01b0384811660048301529091169063094d62f99060240160206040518083038186803b158015611b0d57600080fd5b505afa158015611b21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4591906138eb565b611b865760405162461bcd60e51b81526020600482015260126024820152716f6e6c79207472616e7366657220726f6c6560701b60448201526064016105a9565b60fe54604051636b7a9dbd60e01b81526001600160a01b0390911690636b7a9dbd90611bb89085908590600401613bb9565b60206040518083038186803b158015611bd057600080fd5b505afa158015611be4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0891906138eb565b80611c8b575060fe546040516371c35f1760e11b81526001600160a01b0384811660048301529091169063e386be2e9060240160206040518083038186803b158015611c5357600080fd5b505afa158015611c67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c8b91906138eb565b611ca75760405162461bcd60e51b81526004016105a990613e53565b61174887878787876127ff565b60fe5460405163081c456360e41b81526001600160a01b038481166004830152909116906381c456309060240160206040518083038186803b158015611cf957600080fd5b505afa158015611d0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d3191906138eb565b611d4d5760405162461bcd60e51b81526004016105a990613d0c565b60fe54604051636b7a9dbd60e01b81526001600160a01b0390911690636b7a9dbd90611d7f9085908590600401613bb9565b60206040518083038186803b158015611d9757600080fd5b505afa158015611dab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dcf91906138eb565b80611e52575060fe546040516371c35f1760e11b81526001600160a01b0384811660048301529091169063e386be2e9060240160206040518083038186803b158015611e1a57600080fd5b505afa158015611e2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e5291906138eb565b611e6e5760405162461bcd60e51b81526004016105a990613e53565b610a1a858585612949565b600082815260c96020526040902060010154611e948161241c565b610a8b83836124af565b6001600160a01b038116600090815260fd602090815260409182902080548351818402810184019094528084526060939283018282801561071357602002820191906000526020600020905b815481526020019060010190808311611eea5750505050509050919050565b6001600160a01b038116600090815260fc60209081526040918290208054835181840281018401909452808452606093928301828280156107135760200282019190600052602060002090815481526020019060010190808311611eea5750505050509050919050565b60fe546040516352935f3960e11b81526001600160a01b0387811660048301529091169063a526be729060240160206040518083038186803b158015611fb857600080fd5b505afa158015611fcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ff091906138eb565b61202f5760405162461bcd60e51b815260206004820152601060248201526f6f6e6c79206d696e74657220726f6c6560801b60448201526064016105a9565b60fe5460405163155c217560e11b81526001600160a01b03878116600483015290911690632ab842ea9060240160206040518083038186803b15801561207457600080fd5b505afa158015612088573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ac91906138eb565b6120f85760405162461bcd60e51b815260206004820152601760248201527f4e65656420746f6b656e2061636365737320726f6c652e00000000000000000060448201526064016105a9565b61210489898989612a6f565b604080516080810182526001600160a01b03868116825260208083018781528385018690526060840187905260008d815260fb835294909420835181546001600160a01b0319169316929092178255925180519293849361216b9260018501920190613103565b5060408201518051612187916002840191602090910190613103565b50606082015180516121a3916003840191602090910190613103565b5050610100805460010190555050505050505050505050565b6001600160a01b0385163314806121d857506121d885336104dd565b6121f45760405162461bcd60e51b81526004016105a990613c31565b610a1a85858585856127ff565b6001600160a01b03831633148061221d575061221d83336104dd565b6122395760405162461bcd60e51b81526004016105a990613c31565b610a8b838383612949565b60006001600160e01b03198216637965db0b60e01b14806105d757506105d782612b9a565b815183511461228a5760405162461bcd60e51b81526004016105a990613ecb565b6001600160a01b0384166122b05760405162461bcd60e51b81526004016105a990613d36565b336122bf818787878787610a18565b60005b84518110156123a85760008582815181106122df576122df614108565b6020026020010151905060008583815181106122fd576122fd614108565b60209081029190910181015160008481526065835260408082206001600160a01b038e16835290935291909120549091508181101561234e5760405162461bcd60e51b81526004016105a990613dbe565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061238d908490613fc9565b92505081905550505050806123a1906140c1565b90506122c2565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516123f8929190613bf0565b60405180910390a461240e818787878787610a18565b610a18818787878787612bea565b6124268133612d55565b50565b612433828261134b565b610b7857600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561246b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6124b9828261134b565b15610b7857600082815260c9602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b03831661253c5760405162461bcd60e51b81526004016105a990613d7b565b805182511461255d5760405162461bcd60e51b81526004016105a990613ecb565b600033905061258081856000868660405180602001604052806000815250610a18565b60005b83518110156126485760008482815181106125a0576125a0614108565b6020026020010151905060008483815181106125be576125be614108565b60209081029190910181015160008481526065835260408082206001600160a01b038c16835290935291909120549091508181101561260f5760405162461bcd60e51b81526004016105a990613cc8565b60009283526065602090815260408085206001600160a01b038b1686529091529092209103905580612640816140c1565b915050612583565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612699929190613bf0565b60405180910390a46126bf81856000868660405180602001604052806000815250610a18565b50505050565b600054610100900460ff166126ec5760405162461bcd60e51b81526004016105a990613e08565b61242681612db9565b600054610100900460ff1661271c5760405162461bcd60e51b81526004016105a990613e08565b565b816001600160a01b0316836001600160a01b031614156127925760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016105a9565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166128255760405162461bcd60e51b81526004016105a990613d36565b33600061283185612de9565b9050600061283e85612de9565b905061284e838989858589610a18565b60008681526065602090815260408083206001600160a01b038c168452909152902054858110156128915760405162461bcd60e51b81526004016105a990613dbe565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906128d0908490613fc9565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612930848a8a86868a610a18565b61293e848a8a8a8a8a612e34565b505050505050505050565b6001600160a01b03831661296f5760405162461bcd60e51b81526004016105a990613d7b565b33600061297b84612de9565b9050600061298884612de9565b90506129a883876000858560405180602001604052806000815250610a18565b60008581526065602090815260408083206001600160a01b038a168452909152902054848110156129eb5760405162461bcd60e51b81526004016105a990613cc8565b60008681526065602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461174884886000868660405180602001604052806000815250610a18565b6001600160a01b038416612acf5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016105a9565b336000612adb85612de9565b90506000612ae885612de9565b9050612af983600089858589610a18565b60008681526065602090815260408083206001600160a01b038b16845290915281208054879290612b2b908490613fc9565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612b8b83600089858589610a18565b61174883600089898989612e34565b60006001600160e01b03198216636cdb3d1360e11b1480612bcb57506001600160e01b031982166303a24d0760e21b145b806105d757506301ffc9a760e01b6001600160e01b03198316146105d7565b6001600160a01b0384163b15610a185760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190612c2e9089908990889088908890600401613b16565b602060405180830381600087803b158015612c4857600080fd5b505af1925050508015612c78575060408051601f3d908101601f19168201909252612c7591810190613961565b60015b612d2557612c84614134565b806308c379a01415612cbe5750612c99614150565b80612ca45750612cc0565b8060405162461bcd60e51b81526004016105a99190613c1e565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105a9565b6001600160e01b0319811663bc197c8160e01b146117485760405162461bcd60e51b81526004016105a990613c80565b612d5f828261134b565b610b7857612d77816001600160a01b03166014612efe565b612d82836020612efe565b604051602001612d93929190613aa1565b60408051601f198184030181529082905262461bcd60e51b82526105a991600401613c1e565b600054610100900460ff16612de05760405162461bcd60e51b81526004016105a990613e08565b612426816130a0565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110612e2357612e23614108565b602090810291909101015292915050565b6001600160a01b0384163b15610a185760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190612e789089908990889088908890600401613b74565b602060405180830381600087803b158015612e9257600080fd5b505af1925050508015612ec2575060408051601f3d908101601f19168201909252612ebf91810190613961565b60015b612ece57612c84614134565b6001600160e01b0319811663f23a6e6160e01b146117485760405162461bcd60e51b81526004016105a990613c80565b60606000612f0d836002613fe1565b612f18906002613fc9565b6001600160401b03811115612f2f57612f2f61411e565b6040519080825280601f01601f191660200182016040528015612f59576020820181803683370190505b509050600360fc1b81600081518110612f7457612f74614108565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612fa357612fa3614108565b60200101906001600160f81b031916908160001a9053506000612fc7846002613fe1565b612fd2906001613fc9565b90505b600181111561304a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061300657613006614108565b1a60f81b82828151811061301c5761301c614108565b60200101906001600160f81b031916908160001a90535060049490941c9361304381614043565b9050612fd5565b5083156130995760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105a9565b9392505050565b8051610b78906067906020840190613103565b8280548282559060005260206000209081019282156130f35760005260206000209182015b828111156130f35782548255916001019190600101906130d8565b506130ff929150613177565b5090565b82805461310f9061405a565b90600052602060002090601f01602090048101928261313157600085556130f3565b82601f1061314a57805160ff19168380011785556130f3565b828001600101855582156130f3579182015b828111156130f357825182559160200191906001019061315c565b5b808211156130ff5760008155600101613178565b80356001600160a01b03811681146131a357600080fd5b919050565b600082601f8301126131b957600080fd5b813560206131c682613fa6565b6040516131d38282614095565b8381528281019150858301600585901b870184018810156131f357600080fd5b60005b85811015613212578135845292840192908401906001016131f6565b5090979650505050505050565b600082601f83011261323057600080fd5b81356001600160401b038111156132495761324961411e565b604051613260601f8301601f191660200182614095565b81815284602083860101111561327557600080fd5b816020850160208301376000918101602001919091529392505050565b6000602082840312156132a457600080fd5b6130998261318c565b600080604083850312156132c057600080fd5b6132c98361318c565b91506132d76020840161318c565b90509250929050565b600080600080600060a086880312156132f857600080fd5b6133018661318c565b945061330f6020870161318c565b935060408601356001600160401b038082111561332b57600080fd5b61333789838a016131a8565b9450606088013591508082111561334d57600080fd5b61335989838a016131a8565b9350608088013591508082111561336f57600080fd5b5061337c8882890161321f565b9150509295509295909350565b600080600080600080600060e0888a0312156133a457600080fd5b6133ad8861318c565b96506133bb6020890161318c565b955060408801356001600160401b03808211156133d757600080fd5b6133e38b838c016131a8565b965060608a01359150808211156133f957600080fd5b6134058b838c016131a8565b955060808a013591508082111561341b57600080fd5b6134278b838c0161321f565b945061343560a08b0161318c565b935060c08a013591508082111561344b57600080fd5b506134588a828b0161321f565b91505092959891949750929550565b600080600080600060a0868803121561347f57600080fd5b6134888661318c565b94506134966020870161318c565b9350604086013592506060860135915060808601356001600160401b038111156134bf57600080fd5b61337c8882890161321f565b600080600080600080600060e0888a0312156134e657600080fd5b6134ef8861318c565b96506134fd6020890161318c565b9550604088013594506060880135935060808801356001600160401b038082111561341b57600080fd5b60008060006060848603121561353c57600080fd5b6135458461318c565b925060208401356001600160401b038082111561356157600080fd5b61356d878388016131a8565b9350604086013591508082111561358357600080fd5b50613590868287016131a8565b9150509250925092565b600080604083850312156135ad57600080fd5b6135b68361318c565b915060208301356135c6816141d9565b809150509250929050565b600080600080608085870312156135e757600080fd5b6135f08561318c565b9350602085013592506136056040860161318c565b915060608501356001600160401b0381111561362057600080fd5b61362c8782880161321f565b91505092959194509250565b6000806040838503121561364b57600080fd5b6136548361318c565b946020939093013593505050565b60008060006060848603121561367757600080fd5b6136808461318c565b9250602084013591506136956040850161318c565b90509250925092565b6000806000606084860312156136b357600080fd5b6136bc8461318c565b95602085013595506040909401359392505050565b600080600080600060a086880312156136e957600080fd5b6136f28661318c565b9450602086013593506040860135925061370e6060870161318c565b915060808601356001600160401b038111156134bf57600080fd5b60008060008060008060008060006101208a8c03121561374857600080fd5b6137518a61318c565b985060208a0135975060408a0135965060608a01356001600160401b038082111561377b57600080fd5b6137878d838e0161321f565b975061379560808d0161318c565b96506137a360a08d0161318c565b955060c08c01359150808211156137b957600080fd5b6137c58d838e0161321f565b945060e08c01359150808211156137db57600080fd5b6137e78d838e0161321f565b93506101008c01359150808211156137fe57600080fd5b5061380b8c828d0161321f565b9150509295985092959850929598565b6000806040838503121561382e57600080fd5b82356001600160401b038082111561384557600080fd5b818501915085601f83011261385957600080fd5b8135602061386682613fa6565b6040516138738282614095565b8381528281019150858301600585901b870184018b101561389357600080fd5b600096505b848710156138bd576138a98161318c565b835260019690960195918301918301613898565b50965050860135925050808211156138d457600080fd5b506138e1858286016131a8565b9150509250929050565b6000602082840312156138fd57600080fd5b8151613099816141d9565b60006020828403121561391a57600080fd5b5035919050565b6000806040838503121561393457600080fd5b823591506132d76020840161318c565b60006020828403121561395657600080fd5b8135613099816141e7565b60006020828403121561397357600080fd5b8151613099816141e7565b60006020828403121561399057600080fd5b81356001600160401b038111156139a657600080fd5b6139b28482850161321f565b949350505050565b600080604083850312156139cd57600080fd5b82356001600160401b038111156139e357600080fd5b6139ef8582860161321f565b9250506132d76020840161318c565b60008060408385031215613a1157600080fd5b8235915060208301356001600160401b03811115613a2e57600080fd5b6138e18582860161321f565b600081518084526020808501945080840160005b83811015613a6a57815187529582019590820190600101613a4e565b509495945050505050565b60008151808452613a8d816020860160208601614017565b601f01601f19169290920160200192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613ad9816017850160208801614017565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613b0a816028840160208801614017565b01602801949350505050565b6001600160a01b0386811682528516602082015260a060408201819052600090613b4290830186613a3a565b8281036060840152613b548186613a3a565b90508281036080840152613b688185613a75565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613bae90830184613a75565b979650505050505050565b6001600160a01b03831681526040602082018190526000906139b290830184613a75565b6020815260006130996020830184613a3a565b604081526000613c036040830185613a3a565b8281036020840152613c158185613a3a565b95945050505050565b6020815260006130996020830184613a75565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b60208082526010908201526f6f6e6c79206275726e657220726f6c6560801b604082015260600190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252601a908201527f496e76616c696420746f6b656e2061636365737320726f6c652e000000000000604082015260600190565b60208082526021908201527f6f6e6c79206d696e74657220726f6c65206f72207472616e7366657220726f6c6040820152606560f81b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b6020808252600f908201526e0dcdee840ccdeeadcc840d2dcc8caf608b1b604082015260600190565b602080825282516001600160a01b03168282015282015160806040830152600090613f6a60a0840182613a75565b90506040840151601f1980858403016060860152613f888383613a75565b9250606086015191508085840301608086015250613c158282613a75565b60006001600160401b03821115613fbf57613fbf61411e565b5060051b60200190565b60008219821115613fdc57613fdc6140dc565b500190565b6000816000190483118215151615613ffb57613ffb6140dc565b500290565b600082821015614012576140126140dc565b500390565b60005b8381101561403257818101518382015260200161401a565b838111156126bf5750506000910152565b600081614052576140526140dc565b506000190190565b600181811c9082168061406e57607f821691505b6020821081141561408f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b03811182821017156140ba576140ba61411e565b6040525050565b60006000198214156140d5576140d56140dc565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d111561414d5760046000803e5060005160e01c5b90565b600060443d101561415e5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561418d57505050505090565b82850191508151818111156141a55750505050505090565b843d87010160208285010111156141bf5750505050505090565b6141ce60208286010187614095565b509095945050505050565b801515811461242657600080fd5b6001600160e01b03198116811461242657600080fdfea264697066735822122039c769038e2a21ea3fdb594d260ef1b65c89aa0bc25bc1b74ef4f0d22379161364736f6c63430008070033