Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- NanakusaNFTERC1155Upgradeable
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 200
- EVM Version
- default
- Verified at
- 2024-05-15T02:21:41.907123Z
Constructor Arguments
0x000000000000000000000000307e7a9713dbf6f19a2d2a2b670544f4791c4ec2
Arg [0] (address) : 0x307e7a9713dbf6f19a2d2a2b670544f4791c4ec2
contracts/sbinft/token/erc1155/nanakusa/v1/NanakusaNFTERC1155Upgradeable.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/metatx/ERC2771ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol"; import {EIP712Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; import "../interface/INanakusaERC1155.sol"; /** * @title SBINFT Nanakusa NFT ERC1155 Upgradeable Contract * @author SBINFT Co., Ltd. */ contract NanakusaNFTERC1155Upgradeable is Initializable, INanakusaERC1155, ERC2771ContextUpgradeable, EIP712Upgradeable, ERC1155URIStorageUpgradeable, ERC1155PausableUpgradeable, ERC1155BurnableUpgradeable, OwnableUpgradeable, UUPSUpgradeable { using ECDSAUpgradeable for bytes32; bytes32 private constant MINT_DATA_ERC1155_TYPEHASH = keccak256( "MintDataERC1155(address creator,uint256 nftId,uint256 amount,string tokenURI)" ); // Map of pre-approved operators mapping(address => bool) internal _preApprovedOperator; uint256 internal _lastMintedTokenId; /// @custom:oz-upgrades-unsafe-allow constructor constructor( address trustedForwarder ) ERC2771ContextUpgradeable(trustedForwarder) { _disableInitializers(); } /** * @dev Used instead of constructor(must be called once) * * @param _uri string memory * @param _operatorList address[] memory */ function __NanakusaNFTERC1155Upgradeable_init( string memory _uri, address[] memory _operatorList ) external initializer { __EIP712_init("SBINFT Nanakusa NFT ERC1155 Upgradeable", "1.0"); __Ownable_init(); ERC1155Upgradeable.__ERC1155_init(_uri); __ERC1155Pausable_init(); __ERC1155URIStorage_init(); __ERC1155Burnable_init(); __Pausable_init(); __UUPSUpgradeable_init(); addPreApprovedOperator(_operatorList); } /** * @dev See {UUPSUpgradeable._authorizeUpgrade()} * * Requirements: * - onlyAdmin can call */ function _authorizeUpgrade( address _newImplementation ) internal virtual override onlyOwner {} /** * See {ERC2771ContextUpgradeable._msgSender()} */ function _msgSender() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (address sender) { return ERC2771ContextUpgradeable._msgSender(); } /** * See {ERC2771ContextUpgradeable._msgData()} */ function _msgData() internal view virtual override(ContextUpgradeable, ERC2771ContextUpgradeable) returns (bytes calldata) { return ERC2771ContextUpgradeable._msgData(); } /** * @dev Prepares keccak256 hash for MintData * * @param md MintDataERC1155 calldata */ function _hashMintData( MintDataERC1155 calldata md ) internal pure returns (bytes32) { return keccak256( abi.encode( MINT_DATA_ERC1155_TYPEHASH, md.creator, md.nftId, md.amount, keccak256(bytes(md.tokenURI)) ) ); } /** * @dev Verify arguments before minting * * @param md MintDataERC1155 calldata * @param mintSign bytes calldata */ function _verifyMintArguments( MintDataERC1155 calldata md, bytes calldata mintSign ) internal view { require( md.nftId != 0, "NanakusaNFTERC1155:_verifyMintArguments mintData.nftId must be greater than zero" ); require( md.amount != 0, "NanakusaNFTERC1155:_verifyMintArguments mintData.amount must be greater than zero" ); require( bytes(md.tokenURI).length != 0, "NanakusaNFTERC1155:_verifyMintArguments mintData.tokenURI is invalid" ); address owner_ = owner(); // Must be called by [owner] or must be called with [signature from owner] if (_msgSender() != owner_) { // Recoverd address of ERC712 signed data address recoverdAddress = _domainSeparatorV4() .toTypedDataHash(_hashMintData(md)) .recover(mintSign); // Make sure its signed by owner require( recoverdAddress == owner_, "NanakusaNFTERC1155:_verifyMintArguments not signed by Owner" ); } } /** * @dev Mint token * * @param md MintDataERC1155 calldata * @param mintSign bytes calldata */ function mintToken( MintDataERC1155 calldata md, bytes calldata mintSign ) external virtual override whenNotPaused { _verifyMintArguments(md, mintSign); // Mint _mint(md.creator, md.nftId, md.amount, ""); // Set Token URI ERC1155URIStorageUpgradeable._setURI(md.nftId, md.tokenURI); _lastMintedTokenId = md.nftId; } /** * @dev Lazy mint and transfer * * @param transferTo address * @param md MintDataERC1155 calldata * @param mintSign bytes calldata */ function lazyMintAndTransfer( MintDataERC1155 calldata md, address transferTo, bytes calldata mintSign ) external virtual override whenNotPaused { require( transferTo != address(0), "NanakusaNFTERC1155:lazyMintAndTransfer transferTo is invalid" ); _verifyMintArguments(md, mintSign); // Mint _mint(md.creator, md.nftId, md.amount, ""); // Set Token URI ERC1155URIStorageUpgradeable._setURI(md.nftId, md.tokenURI); // Transfer from creator to transferTo _safeTransferFrom(md.creator, transferTo, md.nftId, md.amount, ""); _lastMintedTokenId = md.nftId; } /** * @dev Returns last minted token Id/ NFT Id */ function getLastMintedTokenId() external view virtual override returns (uint256) { return _lastMintedTokenId; } /** * @dev See {INanakusaERC1155.addPreApprovedOperator()} */ function addPreApprovedOperator( address[] memory operatorList ) public virtual override onlyOwner { for (uint256 idx = 0; idx < operatorList.length; idx++) { address operator = operatorList[idx]; if ( operator != address(0) && operator.code.length > 0 && isPreApprovedOperator(operator) == false ) { // Make sure its a valid contract address and not a already per approved operator _preApprovedOperator[operator] = true; emit PreApprovedOperatorAdded(operator); } } } /** * @dev See {INanakusaERC1155.removePreApprovedOperator()} */ function removePreApprovedOperator( address[] memory operatorList ) external virtual override onlyOwner { for (uint256 idx = 0; idx < operatorList.length; idx++) { address operator = operatorList[idx]; if (isPreApprovedOperator(operator)) { // Make sure its a valid per approved operator delete _preApprovedOperator[operator]; emit PreApprovedOperatorRemoved(operator); } } } /** * @dev See {INanakusa.isPreApprovedOperator()} */ function isPreApprovedOperator( address operator ) public view virtual override returns (bool) { return _preApprovedOperator[operator]; } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll( address owner_, address operator ) public view virtual override returns (bool) { return isPreApprovedOperator(operator) || super.isApprovedForAll(owner_, operator); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function pause() external onlyOwner { _pause(); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function unpause() external onlyOwner { _unpause(); } function _beforeTokenTransfer( address _operator, address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data ) internal virtual override(ERC1155PausableUpgradeable, ERC1155Upgradeable) { super._beforeTokenTransfer(_operator, _from, _to, _ids, _amounts, _data); } function uri( uint256 _tokenId ) public view virtual override(ERC1155URIStorageUpgradeable, ERC1155Upgradeable) returns (string memory) { return ERC1155URIStorageUpgradeable.uri(_tokenId); } }
@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @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; }
@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol) pragma solidity ^0.8.0; /** * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified * proxy whose upgrades are fully controlled by the current implementation. */ interface IERC1822ProxiableUpgradeable { /** * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation * address. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. */ function proxiableUUID() external view returns (bytes32); }
@openzeppelin/contracts-upgradeable/metatx/ERC2771ContextUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (metatx/ERC2771Context.sol) pragma solidity ^0.8.9; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Context variant with ERC2771 support. */ abstract contract ERC2771ContextUpgradeable is Initializable, ContextUpgradeable { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable address private immutable _trustedForwarder; /// @custom:oz-upgrades-unsafe-allow constructor constructor(address trustedForwarder) { _trustedForwarder = trustedForwarder; } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return forwarder == _trustedForwarder; } function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. /// @solidity memory-safe-assembly assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return super._msgSender(); } } function _msgData() internal view virtual override returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 20]; } else { return super._msgData(); } } /** * @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; }
@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeaconUpgradeable.sol"; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/StorageSlotUpgradeable.sol"; import "../utils/Initializable.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967UpgradeUpgradeable is Initializable { function __ERC1967Upgrade_init() internal onlyInitializing { } function __ERC1967Upgrade_init_unchained() internal onlyInitializing { } // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { _functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallUUPS( address newImplementation, bytes memory data, bool forceCall ) internal { // Upgrades from old implementations will perform a rollback test. This test requires the new // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing // this special case will break upgrade paths from old UUPS implementation to new ones. if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else { try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) { require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID"); } catch { revert("ERC1967Upgrade: new implementation is not UUPS"); } _upgradeToAndCall(newImplementation, data, forceCall); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { _functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data); } } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function _functionDelegateCall(address target, bytes memory data) private returns (bytes memory) { require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed"); } /** * @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; }
@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeaconUpgradeable { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @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); } } }
@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol) pragma solidity ^0.8.0; import "../../interfaces/draft-IERC1822Upgradeable.sol"; import "../ERC1967/ERC1967UpgradeUpgradeable.sol"; import "./Initializable.sol"; /** * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy. * * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. * * _Available since v4.1._ */ abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable { function __UUPSUpgradeable_init() internal onlyInitializing { } function __UUPSUpgradeable_init_unchained() internal onlyInitializing { } /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment address private immutable __self = address(this); /** * @dev Check that the execution is being performed through a delegatecall call and that the execution context is * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to * fail. */ modifier onlyProxy() { require(address(this) != __self, "Function must be called through delegatecall"); require(_getImplementation() == __self, "Function must be called through active proxy"); _; } /** * @dev Check that the execution is not being performed through a delegate call. This allows a function to be * callable on the implementing contract but not through proxies. */ modifier notDelegated() { require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall"); _; } /** * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the * implementation. It is used to validate that the this implementation remains valid after an upgrade. * * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ function proxiableUUID() external view virtual override notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } /** * @dev Upgrade the implementation of the proxy to `newImplementation`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeTo(address newImplementation) external virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, new bytes(0), false); } /** * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call * encoded in `data`. * * Calls {_authorizeUpgrade}. * * Emits an {Upgraded} event. */ function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy { _authorizeUpgrade(newImplementation); _upgradeToAndCallUUPS(newImplementation, data, true); } /** * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by * {upgradeTo} and {upgradeToAndCall}. * * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity * function _authorizeUpgrade(address) internal override onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; /** * @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; }
@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract PausableUpgradeable is Initializable, ContextUpgradeable { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ function __Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __Pausable_init_unchained() internal onlyInitializing { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } /** * @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; }
@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.0; import "./IERC1155Upgradeable.sol"; import "./IERC1155ReceiverUpgradeable.sol"; import "./extensions/IERC1155MetadataURIUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 * * _Available since v3.1._ */ contract 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; }
@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155ReceiverUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @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); }
@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface 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; }
@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/extensions/ERC1155Burnable.sol) pragma solidity ^0.8.0; import "../ERC1155Upgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. * * _Available since v3.1._ */ abstract contract 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; }
@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155PausableUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol) pragma solidity ^0.8.0; import "../ERC1155Upgradeable.sol"; import "../../../security/PausableUpgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev ERC1155 token with pausable token transfers, minting and burning. * * Useful for scenarios such as preventing trades until the end of an evaluation * period, or having an emergency switch for freezing all token transfers in the * event of a large bug. * * _Available since v3.1._ */ abstract contract ERC1155PausableUpgradeable is Initializable, ERC1155Upgradeable, PausableUpgradeable { function __ERC1155Pausable_init() internal onlyInitializing { __Pausable_init_unchained(); } function __ERC1155Pausable_init_unchained() internal onlyInitializing { } /** * @dev See {ERC1155-_beforeTokenTransfer}. * * Requirements: * * - the contract must not be paused. */ function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual override { super._beforeTokenTransfer(operator, from, to, ids, amounts, data); require(!paused(), "ERC1155Pausable: token transfer while paused"); } /** * @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; }
@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155URIStorage.sol) pragma solidity ^0.8.0; import "../../../utils/StringsUpgradeable.sol"; import "../ERC1155Upgradeable.sol"; import "../../../proxy/utils/Initializable.sol"; /** * @dev ERC1155 token with storage based token URI management. * Inspired by the ERC721URIStorage extension * * _Available since v4.6._ */ abstract contract ERC1155URIStorageUpgradeable is Initializable, ERC1155Upgradeable { function __ERC1155URIStorage_init() internal onlyInitializing { __ERC1155URIStorage_init_unchained(); } function __ERC1155URIStorage_init_unchained() internal onlyInitializing { _baseURI = ""; } using StringsUpgradeable for uint256; // Optional base URI string private _baseURI; // Optional mapping for token URIs mapping(uint256 => string) private _tokenURIs; /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the concatenation of the `_baseURI` * and the token-specific uri if the latter is set * * This enables the following behaviors: * * - if `_tokenURIs[tokenId]` is set, then the result is the concatenation * of `_baseURI` and `_tokenURIs[tokenId]` (keep in mind that `_baseURI` * is empty per default); * * - if `_tokenURIs[tokenId]` is NOT set then we fallback to `super.uri()` * which in most cases will contain `ERC1155._uri`; * * - if `_tokenURIs[tokenId]` is NOT set, and if the parents do not have a * uri value set, then the result is empty. */ function uri(uint256 tokenId) public view virtual override returns (string memory) { string memory tokenURI = _tokenURIs[tokenId]; // If token URI is set, concatenate base URI and tokenURI (via abi.encodePacked). return bytes(tokenURI).length > 0 ? string(abi.encodePacked(_baseURI, tokenURI)) : super.uri(tokenId); } /** * @dev Sets `tokenURI` as the tokenURI of `tokenId`. */ function _setURI(uint256 tokenId, string memory tokenURI) internal virtual { _tokenURIs[tokenId] = tokenURI; emit URI(uri(tokenId), tokenId); } /** * @dev Sets `baseURI` as the `_baseURI` for all tokens */ function _setBaseURI(string memory baseURI) internal virtual { _baseURI = baseURI; } /** * @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[48] private __gap; }
@openzeppelin/contracts-upgradeable/token/ERC1155/extensions/IERC1155MetadataURIUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.0; import "../IERC1155Upgradeable.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * * _Available since v3.1._ */ interface 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); }
@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library 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); } } } }
@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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; }
@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlotUpgradeable { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } }
@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol
// SPDX-License-Identifier: MIT // 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); } }
@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.3) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../StringsUpgradeable.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; import "./ECDSAUpgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ * * @custom:storage-size 52 */ abstract contract EIP712Upgradeable is Initializable { /* solhint-disable var-name-mixedcase */ bytes32 private _HASHED_NAME; bytes32 private _HASHED_VERSION; bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ function __EIP712_init(string memory name, string memory version) internal onlyInitializing { __EIP712_init_unchained(name, version); } function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash()); } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash); } /** * @dev The hash of the name parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712NameHash() internal virtual view returns (bytes32) { return _HASHED_NAME; } /** * @dev The hash of the version parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712VersionHash() internal virtual view returns (bytes32) { return _HASHED_VERSION; } /** * @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; }
@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract 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; }
@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface 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); }
contracts/sbinft/token/erc1155/nanakusa/interface/INanakusaERC1155.sol
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; /** * @title SBINFT Nanakusa ERC1155 protocol * @author SBINFT Co., Ltd. */ interface INanakusaERC1155 { // Emits whenever Pre Approved Operator is Added event PreApprovedOperatorAdded(address operator); // Emits whenever Pre Approved Operator is Removed event PreApprovedOperatorRemoved(address operator); struct MintDataERC1155 { address creator; uint256 nftId; uint256 amount; string tokenURI; } /** * @dev Mint token * * @param mintData MintDataERC1155 calldata * @param mintSign bytes calldata */ function mintToken( MintDataERC1155 calldata mintData, bytes calldata mintSign ) external; /** * @dev Lazy mint and transfer * * @param mintData MintDataERC1155 calldata * @param transferTo address * @param mintSign bytes calldata */ function lazyMintAndTransfer( MintDataERC1155 calldata mintData, address transferTo, bytes calldata mintSign ) external; /** * @dev Returns last minted token Id/ NFT Id */ function getLastMintedTokenId() external view returns (uint256); /** * @dev Add list of Pre Approved Operator * if zero address or already exist then it wont be added and * Event PreApprovedOperatorAdded wont be fired for the respective operator * * @param operatorList address[] memory */ function addPreApprovedOperator(address[] memory operatorList) external; /** * @dev Remove list of Pre Approved Operator * if zero address then * Event PreApprovedOperatorRemoved wont be fired for the respective operator * * @param operatorList address[] memory */ function removePreApprovedOperator(address[] memory operatorList) external; /** * @dev Check the operator is a Pre Approved Operator * * @param operator address */ function isPreApprovedOperator(address operator) external returns (bool); }
Compiler Settings
{"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"trustedForwarder","internalType":"address"}]},{"type":"event","name":"AdminChanged","inputs":[{"type":"address","name":"previousAdmin","internalType":"address","indexed":false},{"type":"address","name":"newAdmin","internalType":"address","indexed":false}],"anonymous":false},{"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":"BeaconUpgraded","inputs":[{"type":"address","name":"beacon","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"PreApprovedOperatorAdded","inputs":[{"type":"address","name":"operator","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"PreApprovedOperatorRemoved","inputs":[{"type":"address","name":"operator","internalType":"address","indexed":false}],"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":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Upgraded","inputs":[{"type":"address","name":"implementation","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"__NanakusaNFTERC1155Upgradeable_init","inputs":[{"type":"string","name":"_uri","internalType":"string"},{"type":"address[]","name":"_operatorList","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addPreApprovedOperator","inputs":[{"type":"address[]","name":"operatorList","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":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLastMintedTokenId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner_","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isPreApprovedOperator","inputs":[{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isTrustedForwarder","inputs":[{"type":"address","name":"forwarder","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"lazyMintAndTransfer","inputs":[{"type":"tuple","name":"md","internalType":"struct INanakusaERC1155.MintDataERC1155","components":[{"type":"address","name":"creator","internalType":"address"},{"type":"uint256","name":"nftId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"string","name":"tokenURI","internalType":"string"}]},{"type":"address","name":"transferTo","internalType":"address"},{"type":"bytes","name":"mintSign","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintToken","inputs":[{"type":"tuple","name":"md","internalType":"struct INanakusaERC1155.MintDataERC1155","components":[{"type":"address","name":"creator","internalType":"address"},{"type":"uint256","name":"nftId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"string","name":"tokenURI","internalType":"string"}]},{"type":"bytes","name":"mintSign","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"proxiableUUID","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removePreApprovedOperator","inputs":[{"type":"address[]","name":"operatorList","internalType":"address[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeBatchTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256[]","name":"ids","internalType":"uint256[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"upgradeTo","inputs":[{"type":"address","name":"newImplementation","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"upgradeToAndCall","inputs":[{"type":"address","name":"newImplementation","internalType":"address"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"uri","inputs":[{"type":"uint256","name":"_tokenId","internalType":"uint256"}]}]
Contract Creation Code
0x60c06040523060a0523480156200001557600080fd5b5060405162003e0938038062003e09833981016040819052620000389162000118565b6001600160a01b0381166080526200004f62000056565b506200014a565b600054610100900460ff1615620000c35760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000116576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012b57600080fd5b81516001600160a01b03811681146200014357600080fd5b9392505050565b60805160a051613c7662000193600039600081816106a3015281816106e3015281816108bd015281816108fd01526109900152600081816102f901526121e30152613c766000f3fe60806040526004361061019b5760003560e01c8063715018a6116100ec578063cad835911161008a578063e985e9c511610064578063e985e9c5146104c5578063f242432a146104e5578063f2fde38b14610505578063f5298aca1461052557600080fd5b8063cad8359114610465578063cb6216b214610485578063e79c2455146104a557600080fd5b806388766103116100c657806388766103146103dc5780638da5cb5b146103fc5780639885726f14610425578063a22cb4651461044557600080fd5b8063715018a61461039c5780637974e46a146103b15780638456cb59146103c757600080fd5b80634e1273f411610159578063572b6c0511610133578063572b6c05146102dc5780635c975abb1461032957806367db2d92146103425780636b20c4541461037c57600080fd5b80634e1273f4146102875780634f1ef286146102b457806352d1902d146102c757600080fd5b8062fdd58e146101a057806301ffc9a7146101d35780630e89341c146102035780632eb2c2d6146102305780633659cfe6146102525780633f4ba83a14610272575b600080fd5b3480156101ac57600080fd5b506101c06101bb366004612ceb565b610545565b6040519081526020015b60405180910390f35b3480156101df57600080fd5b506101f36101ee366004612d2b565b6105e0565b60405190151581526020016101ca565b34801561020f57600080fd5b5061022361021e366004612d48565b610630565b6040516101ca9190612db1565b34801561023c57600080fd5b5061025061024b366004612f17565b61063b565b005b34801561025e57600080fd5b5061025061026d366004612fc0565b610699565b34801561027e57600080fd5b50610250610778565b34801561029357600080fd5b506102a76102a2366004613048565b61078a565b6040516101ca91906130e6565b6102506102c23660046130f9565b6108b3565b3480156102d357600080fd5b506101c0610983565b3480156102e857600080fd5b506101f36102f7366004612fc0565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b34801561033557600080fd5b5061012f5460ff166101f3565b34801561034e57600080fd5b506101f361035d366004612fc0565b6001600160a01b0316600090815261025b602052604090205460ff1690565b34801561038857600080fd5b5061025061039736600461313c565b610a37565b3480156103a857600080fd5b50610250610a91565b3480156103bd57600080fd5b5061025c546101c0565b3480156103d357600080fd5b50610250610aa3565b3480156103e857600080fd5b506102506103f7366004613208565b610ab3565b34801561040857600080fd5b506101c5546040516001600160a01b0390911681526020016101ca565b34801561043157600080fd5b50610250610440366004613270565b610b50565b34801561045157600080fd5b506102506104603660046132e0565b610cd9565b34801561047157600080fd5b5061025061048036600461331c565b610ceb565b34801561049157600080fd5b506102506104a0366004613358565b610dae565b3480156104b157600080fd5b506102506104c036600461331c565b610ebe565b3480156104d157600080fd5b506101f36104e03660046133ce565b610fb4565b3480156104f157600080fd5b50610250610500366004613401565b611008565b34801561051157600080fd5b50610250610520366004612fc0565b61105f565b34801561053157600080fd5b50610250610540366004613465565b6110d5565b60006001600160a01b0383166105b55760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b50600081815260cb602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061061157506001600160e01b031982166303a24d0760e21b145b806105da57506301ffc9a760e01b6001600160e01b03198316146105da565b60606105da8261112a565b610643611209565b6001600160a01b0316856001600160a01b031614806106695750610669856104e0611209565b6106855760405162461bcd60e51b81526004016105ac90613498565b6106928585858585611218565b5050505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036106e15760405162461bcd60e51b81526004016105ac906134e7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661072a600080516020613bda833981519152546001600160a01b031690565b6001600160a01b0316146107505760405162461bcd60e51b81526004016105ac90613533565b610759816113d0565b60408051600080825260208201909252610775918391906113d8565b50565b610780611543565b6107886115bd565b565b606081518351146107ef5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105ac565b600083516001600160401b0381111561080a5761080a612dc4565b604051908082528060200260200182016040528015610833578160200160208202803683370190505b50905060005b84518110156108ab5761087e8582815181106108575761085761357f565b60200260200101518583815181106108715761087161357f565b6020026020010151610545565b8282815181106108905761089061357f565b60209081029190910101526108a4816135ab565b9050610839565b509392505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036108fb5760405162461bcd60e51b81526004016105ac906134e7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610944600080516020613bda833981519152546001600160a01b031690565b6001600160a01b03161461096a5760405162461bcd60e51b81526004016105ac90613533565b610973826113d0565b61097f828260016113d8565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a235760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016105ac565b50600080516020613bda8339815191525b90565b610a3f611209565b6001600160a01b0316836001600160a01b03161480610a655750610a65836104e0611209565b610a815760405162461bcd60e51b81526004016105ac90613498565b610a8c838383611616565b505050565b610a99611543565b61078860006117be565b610aab611543565b610788611811565b610abb611850565b610ac6838383611897565b610af5610ad66020850185612fc0565b8460200135856040013560405180602001604052806000815250611b5b565b610b446020840135610b0a60608601866135c4565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c8b92505050565b50506020013561025c55565b600054610100900460ff1615808015610b705750600054600160ff909116105b80610b8a5750303b158015610b8a575060005460ff166001145b610bed5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105ac565b6000805460ff191660011790558015610c10576000805461ff0019166101001790555b610c4d604051806060016040528060278152602001613bb360279139604051806040016040528060038152602001620312e360ec1b815250611ce8565b610c55611d19565b610c5e83611d48565b610c66611d78565b610c6e611da7565b610c76611dd6565b610c7e611d78565b610c86611dd6565b610c8f82610ebe565b8015610a8c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b61097f610ce4611209565b8383611dfd565b610cf3611543565b60005b815181101561097f576000828281518110610d1357610d1361357f565b60200260200101519050610d40816001600160a01b0316600090815261025b602052604090205460ff1690565b15610d9b576001600160a01b038116600081815261025b6020908152604091829020805460ff1916905590519182527ff8f9e1bebee7b0c58697594ecda657e7f23175d236f37eb4407d7a9eaa13bdaa910160405180910390a15b5080610da6816135ab565b915050610cf6565b610db6611850565b6001600160a01b038316610e325760405162461bcd60e51b815260206004820152603c60248201527f4e616e616b7573614e4654455243313135353a6c617a794d696e74416e64547260448201527f616e73666572207472616e73666572546f20697320696e76616c69640000000060648201526084016105ac565b610e3d848383611897565b610e6c610e4d6020860186612fc0565b8560200135866040013560405180602001604052806000815250611b5b565b610e816020850135610b0a60608701876135c4565b610eb1610e916020860186612fc0565b848660200135876040013560405180602001604052806000815250611edd565b5050506020013561025c55565b610ec6611543565b60005b815181101561097f576000828281518110610ee657610ee661357f565b6020026020010151905060006001600160a01b0316816001600160a01b031614158015610f1d57506000816001600160a01b03163b115b8015610f4357506001600160a01b038116600090815261025b602052604090205460ff16155b15610fa1576001600160a01b038116600081815261025b6020908152604091829020805460ff1916600117905590519182527fc8dfb5ab9ab6cf753862beaaf785f23636e0eab79a3542f13d4073588583f73d910160405180910390a15b5080610fac816135ab565b915050610ec9565b6001600160a01b038116600090815261025b602052604081205460ff168061100157506001600160a01b03808416600090815260cc602090815260408083209386168352929052205460ff165b9392505050565b611010611209565b6001600160a01b0316856001600160a01b031614806110365750611036856104e0611209565b6110525760405162461bcd60e51b81526004016105ac90613498565b6106928585858585611edd565b611067611543565b6001600160a01b0381166110cc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ac565b610775816117be565b6110dd611209565b6001600160a01b0316836001600160a01b031614806111035750611103836104e0611209565b61111f5760405162461bcd60e51b81526004016105ac90613498565b610a8c838383612024565b600081815260fe60205260408120805460609291906111489061360a565b80601f01602080910402602001604051908101604052809291908181526020018280546111749061360a565b80156111c15780601f10611196576101008083540402835291602001916111c1565b820191906000526020600020905b8154815290600101906020018083116111a457829003601f168201915b5050505050905060008151116111df576111da8361214b565b611001565b60fd816040516020016111f392919061363e565b6040516020818303038152906040529392505050565b60006112136121df565b905090565b81518351146112395760405162461bcd60e51b81526004016105ac906136c5565b6001600160a01b03841661125f5760405162461bcd60e51b81526004016105ac9061370d565b6000611269611209565b9050611279818787878787612223565b60005b84518110156113625760008582815181106112995761129961357f565b6020026020010151905060008583815181106112b7576112b761357f565b602090810291909101810151600084815260cb835260408082206001600160a01b038e1683529093529190912054909150818110156113085760405162461bcd60e51b81526004016105ac90613752565b600083815260cb602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061134790849061379c565b925050819055505050508061135b906135ab565b905061127c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516113b29291906137af565b60405180910390a46113c8818787878787612231565b505050505050565b610775611543565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561140b57610a8c8361238c565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611465575060408051601f3d908101601f19168201909252611462918101906137d4565b60015b6114c85760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016105ac565b600080516020613bda83398151915281146115375760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016105ac565b50610a8c838383612428565b61154b611209565b6001600160a01b03166115676101c5546001600160a01b031690565b6001600160a01b0316146107885760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ac565b6115c561244d565b61012f805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6115f9611209565b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b03831661163c5760405162461bcd60e51b81526004016105ac906137ed565b805182511461165d5760405162461bcd60e51b81526004016105ac906136c5565b6000611667611209565b905061168781856000868660405180602001604052806000815250612223565b60005b835181101561174f5760008482815181106116a7576116a761357f565b6020026020010151905060008483815181106116c5576116c561357f565b602090810291909101810151600084815260cb835260408082206001600160a01b038c1683529093529190912054909150818110156117165760405162461bcd60e51b81526004016105ac90613830565b600092835260cb602090815260408085206001600160a01b038b1686529091529092209103905580611747816135ab565b91505061168a565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516117a09291906137af565b60405180910390a46040805160208101909152600090525b50505050565b6101c580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611819611850565b61012f805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586115f9611209565b61012f5460ff16156107885760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016105ac565b82602001356000036119185760405162461bcd60e51b81526020600482015260506024820152600080516020613bfa83398151915260448201527f67756d656e7473206d696e74446174612e6e66744964206d757374206265206760648201526f726561746572207468616e207a65726f60801b608482015260a4016105ac565b826040013560000361199a5760405162461bcd60e51b81526020600482015260516024820152600080516020613bfa83398151915260448201527f67756d656e7473206d696e74446174612e616d6f756e74206d7573742062652060648201527067726561746572207468616e207a65726f60781b608482015260a4016105ac565b6119a760608401846135c4565b9050600003611a1a5760405162461bcd60e51b815260206004820152604460248201819052600080516020613bfa833981519152908201527f67756d656e7473206d696e74446174612e746f6b656e55524920697320696e76606482015263185b1a5960e21b608482015260a4016105ac565b6000611a2f6101c5546001600160a01b031690565b9050806001600160a01b0316611a43611209565b6001600160a01b0316146117b8576000611ae484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611ade9250611a9b9150899050612497565b611aa3612549565b6040805161190160f01b6020808301919091526022820193909352604280820194909452815180820390940184526062019052815191012090565b906125c4565b9050816001600160a01b0316816001600160a01b0316146106925760405162461bcd60e51b815260206004820152603b6024820152600080516020613bfa83398151915260448201527f67756d656e7473206e6f74207369676e6564206279204f776e6572000000000060648201526084016105ac565b6001600160a01b038416611bbb5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016105ac565b6000611bc5611209565b90506000611bd2856125e0565b90506000611bdf856125e0565b9050611bf083600089858589612223565b600086815260cb602090815260408083206001600160a01b038b16845290915281208054879290611c2290849061379c565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611c828360008989898961262b565b50505050505050565b600082815260fe60205260409020611ca382826138ba565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b611ccf84610630565b604051611cdc9190612db1565b60405180910390a25050565b600054610100900460ff16611d0f5760405162461bcd60e51b81526004016105ac90613979565b61097f82826126e6565b600054610100900460ff16611d405760405162461bcd60e51b81526004016105ac90613979565b610788612727565b600054610100900460ff16611d6f5760405162461bcd60e51b81526004016105ac90613979565b6107758161275e565b600054610100900460ff16611d9f5760405162461bcd60e51b81526004016105ac90613979565b61078861278e565b600054610100900460ff16611dce5760405162461bcd60e51b81526004016105ac90613979565b6107886127c2565b600054610100900460ff166107885760405162461bcd60e51b81526004016105ac90613979565b816001600160a01b0316836001600160a01b031603611e705760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016105ac565b6001600160a01b03838116600081815260cc6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038416611f035760405162461bcd60e51b81526004016105ac9061370d565b6000611f0d611209565b90506000611f1a856125e0565b90506000611f27856125e0565b9050611f37838989858589612223565b600086815260cb602090815260408083206001600160a01b038c16845290915290205485811015611f7a5760405162461bcd60e51b81526004016105ac90613752565b600087815260cb602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611fb990849061379c565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612019848a8a8a8a8a61262b565b505050505050505050565b6001600160a01b03831661204a5760405162461bcd60e51b81526004016105ac906137ed565b6000612054611209565b90506000612061846125e0565b9050600061206e846125e0565b905061208e83876000858560405180602001604052806000815250612223565b600085815260cb602090815260408083206001600160a01b038a168452909152902054848110156120d15760405162461bcd60e51b81526004016105ac90613830565b600086815260cb602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052611c82565b606060cd805461215a9061360a565b80601f01602080910402602001604051908101604052809291908181526020018280546121869061360a565b80156121d35780601f106121a8576101008083540402835291602001916121d3565b820191906000526020600020905b8154815290600101906020018083116121b657829003601f168201915b50505050509050919050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316330361221e575060131936013560601c90565b503390565b6113c8868686868686612805565b6001600160a01b0384163b156113c85760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061227590899089908890889088906004016139c4565b6020604051808303816000875af19250505080156122b0575060408051601f3d908101601f191682019092526122ad91810190613a22565b60015b61235c576122bc613a3f565b806308c379a0036122f557506122d0613a5a565b806122db57506122f7565b8060405162461bcd60e51b81526004016105ac9190612db1565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105ac565b6001600160e01b0319811663bc197c8160e01b14611c825760405162461bcd60e51b81526004016105ac90613ae3565b6001600160a01b0381163b6123f95760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016105ac565b600080516020613bda83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6124318361286e565b60008251118061243e5750805b15610a8c576117b883836128ae565b61012f5460ff166107885760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016105ac565b60007fa4b99fa22379b81dc9fae56d21c8d840874068895b9a8b55a17affa15534d21a6124c76020840184612fc0565b602084013560408501356124de60608701876135c4565b6040516124ec929190613b2b565b60405190819003812061252c95949392916020019485526001600160a01b0393909316602085015260408401919091526060830152608082015260a00190565b604051602081830303815290604052805190602001209050919050565b60006112137f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61257860655490565b6066546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60008060006125d385856129a2565b915091506108ab816129e7565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061261a5761261a61357f565b602090810291909101015292915050565b6001600160a01b0384163b156113c85760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061266f9089908990889088908890600401613b3b565b6020604051808303816000875af19250505080156126aa575060408051601f3d908101601f191682019092526126a791810190613a22565b60015b6126b6576122bc613a3f565b6001600160e01b0319811663f23a6e6160e01b14611c825760405162461bcd60e51b81526004016105ac90613ae3565b600054610100900460ff1661270d5760405162461bcd60e51b81526004016105ac90613979565b815160209283012081519190920120606591909155606655565b600054610100900460ff1661274e5760405162461bcd60e51b81526004016105ac90613979565b610788612759611209565b6117be565b600054610100900460ff166127855760405162461bcd60e51b81526004016105ac90613979565b61077581612b9d565b600054610100900460ff166127b55760405162461bcd60e51b81526004016105ac90613979565b61012f805460ff19169055565b600054610100900460ff166127e95760405162461bcd60e51b81526004016105ac90613979565b60408051602081019091526000815260fd9061077590826138ba565b61012f5460ff16156113c85760405162461bcd60e51b815260206004820152602c60248201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060448201526b1dda1a5b19481c185d5cd95960a21b60648201526084016105ac565b6128778161238c565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6129165760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016105ac565b600080846001600160a01b0316846040516129319190613b80565b600060405180830381855af49150503d806000811461296c576040519150601f19603f3d011682016040523d82523d6000602084013e612971565b606091505b50915091506129998282604051806060016040528060278152602001613c1a60279139612ba9565b95945050505050565b60008082516041036129d85760208301516040840151606085015160001a6129cc87828585612be2565b945094505050506129e0565b506000905060025b9250929050565b60008160048111156129fb576129fb613b9c565b03612a035750565b6001816004811115612a1757612a17613b9c565b03612a645760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105ac565b6002816004811115612a7857612a78613b9c565b03612ac55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105ac565b6003816004811115612ad957612ad9613b9c565b03612b315760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105ac565b6004816004811115612b4557612b45613b9c565b036107755760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105ac565b60cd61097f82826138ba565b60608315612bb8575081611001565b825115612bc85782518084602001fd5b8160405162461bcd60e51b81526004016105ac9190612db1565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612c195750600090506003612cc6565b8460ff16601b14158015612c3157508460ff16601c14155b15612c425750600090506004612cc6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612c96573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612cbf57600060019250925050612cc6565b9150600090505b94509492505050565b80356001600160a01b0381168114612ce657600080fd5b919050565b60008060408385031215612cfe57600080fd5b612d0783612ccf565b946020939093013593505050565b6001600160e01b03198116811461077557600080fd5b600060208284031215612d3d57600080fd5b813561100181612d15565b600060208284031215612d5a57600080fd5b5035919050565b60005b83811015612d7c578181015183820152602001612d64565b50506000910152565b60008151808452612d9d816020860160208601612d61565b601f01601f19169290920160200192915050565b6020815260006110016020830184612d85565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612dff57612dff612dc4565b6040525050565b60006001600160401b03821115612e1f57612e1f612dc4565b5060051b60200190565b600082601f830112612e3a57600080fd5b81356020612e4782612e06565b604051612e548282612dda565b83815260059390931b8501820192828101915086841115612e7457600080fd5b8286015b84811015612e8f5780358352918301918301612e78565b509695505050505050565b60006001600160401b03831115612eb357612eb3612dc4565b604051612eca601f8501601f191660200182612dda565b809150838152848484011115612edf57600080fd5b83836020830137600060208583010152509392505050565b600082601f830112612f0857600080fd5b61100183833560208501612e9a565b600080600080600060a08688031215612f2f57600080fd5b612f3886612ccf565b9450612f4660208701612ccf565b935060408601356001600160401b0380821115612f6257600080fd5b612f6e89838a01612e29565b94506060880135915080821115612f8457600080fd5b612f9089838a01612e29565b93506080880135915080821115612fa657600080fd5b50612fb388828901612ef7565b9150509295509295909350565b600060208284031215612fd257600080fd5b61100182612ccf565b600082601f830112612fec57600080fd5b81356020612ff982612e06565b6040516130068282612dda565b83815260059390931b850182019282810191508684111561302657600080fd5b8286015b84811015612e8f5761303b81612ccf565b835291830191830161302a565b6000806040838503121561305b57600080fd5b82356001600160401b038082111561307257600080fd5b61307e86838701612fdb565b9350602085013591508082111561309457600080fd5b506130a185828601612e29565b9150509250929050565b600081518084526020808501945080840160005b838110156130db578151875295820195908201906001016130bf565b509495945050505050565b60208152600061100160208301846130ab565b6000806040838503121561310c57600080fd5b61311583612ccf565b915060208301356001600160401b0381111561313057600080fd5b6130a185828601612ef7565b60008060006060848603121561315157600080fd5b61315a84612ccf565b925060208401356001600160401b038082111561317657600080fd5b61318287838801612e29565b9350604086013591508082111561319857600080fd5b506131a586828701612e29565b9150509250925092565b6000608082840312156131c157600080fd5b50919050565b60008083601f8401126131d957600080fd5b5081356001600160401b038111156131f057600080fd5b6020830191508360208285010111156129e057600080fd5b60008060006040848603121561321d57600080fd5b83356001600160401b038082111561323457600080fd5b613240878388016131af565b9450602086013591508082111561325657600080fd5b50613263868287016131c7565b9497909650939450505050565b6000806040838503121561328357600080fd5b82356001600160401b038082111561329a57600080fd5b818501915085601f8301126132ae57600080fd5b6132bd86833560208501612e9a565b935060208501359150808211156132d357600080fd5b506130a185828601612fdb565b600080604083850312156132f357600080fd5b6132fc83612ccf565b91506020830135801515811461331157600080fd5b809150509250929050565b60006020828403121561332e57600080fd5b81356001600160401b0381111561334457600080fd5b61335084828501612fdb565b949350505050565b6000806000806060858703121561336e57600080fd5b84356001600160401b038082111561338557600080fd5b613391888389016131af565b955061339f60208801612ccf565b945060408701359150808211156133b557600080fd5b506133c2878288016131c7565b95989497509550505050565b600080604083850312156133e157600080fd5b6133ea83612ccf565b91506133f860208401612ccf565b90509250929050565b600080600080600060a0868803121561341957600080fd5b61342286612ccf565b945061343060208701612ccf565b9350604086013592506060860135915060808601356001600160401b0381111561345957600080fd5b612fb388828901612ef7565b60008060006060848603121561347a57600080fd5b61348384612ccf565b95602085013595506040909401359392505050565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016135bd576135bd613595565b5060010190565b6000808335601e198436030181126135db57600080fd5b8301803591506001600160401b038211156135f557600080fd5b6020019150368190038213156129e057600080fd5b600181811c9082168061361e57607f821691505b6020821081036131c157634e487b7160e01b600052602260045260246000fd5b600080845461364c8161360a565b600182811680156136645760018114613679576136a8565b60ff19841687528215158302870194506136a8565b8860005260208060002060005b8581101561369f5781548a820152908401908201613686565b50505082870194505b5050505083516136bc818360208801612d61565b01949350505050565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b808201808211156105da576105da613595565b6040815260006137c260408301856130ab565b828103602084015261299981856130ab565b6000602082840312156137e657600080fd5b5051919050565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b601f821115610a8c57600081815260208120601f850160051c8101602086101561389b5750805b601f850160051c820191505b818110156113c8578281556001016138a7565b81516001600160401b038111156138d3576138d3612dc4565b6138e7816138e1845461360a565b84613874565b602080601f83116001811461391c57600084156139045750858301515b600019600386901b1c1916600185901b1785556113c8565b600085815260208120601f198616915b8281101561394b5788860151825594840194600190910190840161392c565b50858210156139695787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b0386811682528516602082015260a0604082018190526000906139f0908301866130ab565b8281036060840152613a0281866130ab565b90508281036080840152613a168185612d85565b98975050505050505050565b600060208284031215613a3457600080fd5b815161100181612d15565b600060033d1115610a345760046000803e5060005160e01c90565b600060443d1015613a685790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715613a9757505050505090565b8285019150815181811115613aaf5750505050505090565b843d8701016020828501011115613ac95750505050505090565b613ad860208286010187612dda565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b8183823760009101908152919050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613b7590830184612d85565b979650505050505050565b60008251613b92818460208701612d61565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfe5342494e4654204e616e616b757361204e46542045524331313535205570677261646561626c65360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc4e616e616b7573614e4654455243313135353a5f7665726966794d696e744172416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220fc95c70e8314dee67921b037986366f2b70aa039a8ec4ffd3d6075715f92599a64736f6c63430008130033000000000000000000000000307e7a9713dbf6f19a2d2a2b670544f4791c4ec2
Deployed ByteCode
0x60806040526004361061019b5760003560e01c8063715018a6116100ec578063cad835911161008a578063e985e9c511610064578063e985e9c5146104c5578063f242432a146104e5578063f2fde38b14610505578063f5298aca1461052557600080fd5b8063cad8359114610465578063cb6216b214610485578063e79c2455146104a557600080fd5b806388766103116100c657806388766103146103dc5780638da5cb5b146103fc5780639885726f14610425578063a22cb4651461044557600080fd5b8063715018a61461039c5780637974e46a146103b15780638456cb59146103c757600080fd5b80634e1273f411610159578063572b6c0511610133578063572b6c05146102dc5780635c975abb1461032957806367db2d92146103425780636b20c4541461037c57600080fd5b80634e1273f4146102875780634f1ef286146102b457806352d1902d146102c757600080fd5b8062fdd58e146101a057806301ffc9a7146101d35780630e89341c146102035780632eb2c2d6146102305780633659cfe6146102525780633f4ba83a14610272575b600080fd5b3480156101ac57600080fd5b506101c06101bb366004612ceb565b610545565b6040519081526020015b60405180910390f35b3480156101df57600080fd5b506101f36101ee366004612d2b565b6105e0565b60405190151581526020016101ca565b34801561020f57600080fd5b5061022361021e366004612d48565b610630565b6040516101ca9190612db1565b34801561023c57600080fd5b5061025061024b366004612f17565b61063b565b005b34801561025e57600080fd5b5061025061026d366004612fc0565b610699565b34801561027e57600080fd5b50610250610778565b34801561029357600080fd5b506102a76102a2366004613048565b61078a565b6040516101ca91906130e6565b6102506102c23660046130f9565b6108b3565b3480156102d357600080fd5b506101c0610983565b3480156102e857600080fd5b506101f36102f7366004612fc0565b7f000000000000000000000000307e7a9713dbf6f19a2d2a2b670544f4791c4ec26001600160a01b0390811691161490565b34801561033557600080fd5b5061012f5460ff166101f3565b34801561034e57600080fd5b506101f361035d366004612fc0565b6001600160a01b0316600090815261025b602052604090205460ff1690565b34801561038857600080fd5b5061025061039736600461313c565b610a37565b3480156103a857600080fd5b50610250610a91565b3480156103bd57600080fd5b5061025c546101c0565b3480156103d357600080fd5b50610250610aa3565b3480156103e857600080fd5b506102506103f7366004613208565b610ab3565b34801561040857600080fd5b506101c5546040516001600160a01b0390911681526020016101ca565b34801561043157600080fd5b50610250610440366004613270565b610b50565b34801561045157600080fd5b506102506104603660046132e0565b610cd9565b34801561047157600080fd5b5061025061048036600461331c565b610ceb565b34801561049157600080fd5b506102506104a0366004613358565b610dae565b3480156104b157600080fd5b506102506104c036600461331c565b610ebe565b3480156104d157600080fd5b506101f36104e03660046133ce565b610fb4565b3480156104f157600080fd5b50610250610500366004613401565b611008565b34801561051157600080fd5b50610250610520366004612fc0565b61105f565b34801561053157600080fd5b50610250610540366004613465565b6110d5565b60006001600160a01b0383166105b55760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b50600081815260cb602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061061157506001600160e01b031982166303a24d0760e21b145b806105da57506301ffc9a760e01b6001600160e01b03198316146105da565b60606105da8261112a565b610643611209565b6001600160a01b0316856001600160a01b031614806106695750610669856104e0611209565b6106855760405162461bcd60e51b81526004016105ac90613498565b6106928585858585611218565b5050505050565b6001600160a01b037f000000000000000000000000d5409f013fef2ab009596fc7c2286c05dfdccecb1630036106e15760405162461bcd60e51b81526004016105ac906134e7565b7f000000000000000000000000d5409f013fef2ab009596fc7c2286c05dfdccecb6001600160a01b031661072a600080516020613bda833981519152546001600160a01b031690565b6001600160a01b0316146107505760405162461bcd60e51b81526004016105ac90613533565b610759816113d0565b60408051600080825260208201909252610775918391906113d8565b50565b610780611543565b6107886115bd565b565b606081518351146107ef5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105ac565b600083516001600160401b0381111561080a5761080a612dc4565b604051908082528060200260200182016040528015610833578160200160208202803683370190505b50905060005b84518110156108ab5761087e8582815181106108575761085761357f565b60200260200101518583815181106108715761087161357f565b6020026020010151610545565b8282815181106108905761089061357f565b60209081029190910101526108a4816135ab565b9050610839565b509392505050565b6001600160a01b037f000000000000000000000000d5409f013fef2ab009596fc7c2286c05dfdccecb1630036108fb5760405162461bcd60e51b81526004016105ac906134e7565b7f000000000000000000000000d5409f013fef2ab009596fc7c2286c05dfdccecb6001600160a01b0316610944600080516020613bda833981519152546001600160a01b031690565b6001600160a01b03161461096a5760405162461bcd60e51b81526004016105ac90613533565b610973826113d0565b61097f828260016113d8565b5050565b6000306001600160a01b037f000000000000000000000000d5409f013fef2ab009596fc7c2286c05dfdccecb1614610a235760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016105ac565b50600080516020613bda8339815191525b90565b610a3f611209565b6001600160a01b0316836001600160a01b03161480610a655750610a65836104e0611209565b610a815760405162461bcd60e51b81526004016105ac90613498565b610a8c838383611616565b505050565b610a99611543565b61078860006117be565b610aab611543565b610788611811565b610abb611850565b610ac6838383611897565b610af5610ad66020850185612fc0565b8460200135856040013560405180602001604052806000815250611b5b565b610b446020840135610b0a60608601866135c4565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611c8b92505050565b50506020013561025c55565b600054610100900460ff1615808015610b705750600054600160ff909116105b80610b8a5750303b158015610b8a575060005460ff166001145b610bed5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105ac565b6000805460ff191660011790558015610c10576000805461ff0019166101001790555b610c4d604051806060016040528060278152602001613bb360279139604051806040016040528060038152602001620312e360ec1b815250611ce8565b610c55611d19565b610c5e83611d48565b610c66611d78565b610c6e611da7565b610c76611dd6565b610c7e611d78565b610c86611dd6565b610c8f82610ebe565b8015610a8c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b61097f610ce4611209565b8383611dfd565b610cf3611543565b60005b815181101561097f576000828281518110610d1357610d1361357f565b60200260200101519050610d40816001600160a01b0316600090815261025b602052604090205460ff1690565b15610d9b576001600160a01b038116600081815261025b6020908152604091829020805460ff1916905590519182527ff8f9e1bebee7b0c58697594ecda657e7f23175d236f37eb4407d7a9eaa13bdaa910160405180910390a15b5080610da6816135ab565b915050610cf6565b610db6611850565b6001600160a01b038316610e325760405162461bcd60e51b815260206004820152603c60248201527f4e616e616b7573614e4654455243313135353a6c617a794d696e74416e64547260448201527f616e73666572207472616e73666572546f20697320696e76616c69640000000060648201526084016105ac565b610e3d848383611897565b610e6c610e4d6020860186612fc0565b8560200135866040013560405180602001604052806000815250611b5b565b610e816020850135610b0a60608701876135c4565b610eb1610e916020860186612fc0565b848660200135876040013560405180602001604052806000815250611edd565b5050506020013561025c55565b610ec6611543565b60005b815181101561097f576000828281518110610ee657610ee661357f565b6020026020010151905060006001600160a01b0316816001600160a01b031614158015610f1d57506000816001600160a01b03163b115b8015610f4357506001600160a01b038116600090815261025b602052604090205460ff16155b15610fa1576001600160a01b038116600081815261025b6020908152604091829020805460ff1916600117905590519182527fc8dfb5ab9ab6cf753862beaaf785f23636e0eab79a3542f13d4073588583f73d910160405180910390a15b5080610fac816135ab565b915050610ec9565b6001600160a01b038116600090815261025b602052604081205460ff168061100157506001600160a01b03808416600090815260cc602090815260408083209386168352929052205460ff165b9392505050565b611010611209565b6001600160a01b0316856001600160a01b031614806110365750611036856104e0611209565b6110525760405162461bcd60e51b81526004016105ac90613498565b6106928585858585611edd565b611067611543565b6001600160a01b0381166110cc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ac565b610775816117be565b6110dd611209565b6001600160a01b0316836001600160a01b031614806111035750611103836104e0611209565b61111f5760405162461bcd60e51b81526004016105ac90613498565b610a8c838383612024565b600081815260fe60205260408120805460609291906111489061360a565b80601f01602080910402602001604051908101604052809291908181526020018280546111749061360a565b80156111c15780601f10611196576101008083540402835291602001916111c1565b820191906000526020600020905b8154815290600101906020018083116111a457829003601f168201915b5050505050905060008151116111df576111da8361214b565b611001565b60fd816040516020016111f392919061363e565b6040516020818303038152906040529392505050565b60006112136121df565b905090565b81518351146112395760405162461bcd60e51b81526004016105ac906136c5565b6001600160a01b03841661125f5760405162461bcd60e51b81526004016105ac9061370d565b6000611269611209565b9050611279818787878787612223565b60005b84518110156113625760008582815181106112995761129961357f565b6020026020010151905060008583815181106112b7576112b761357f565b602090810291909101810151600084815260cb835260408082206001600160a01b038e1683529093529190912054909150818110156113085760405162461bcd60e51b81526004016105ac90613752565b600083815260cb602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061134790849061379c565b925050819055505050508061135b906135ab565b905061127c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516113b29291906137af565b60405180910390a46113c8818787878787612231565b505050505050565b610775611543565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561140b57610a8c8361238c565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611465575060408051601f3d908101601f19168201909252611462918101906137d4565b60015b6114c85760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016105ac565b600080516020613bda83398151915281146115375760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016105ac565b50610a8c838383612428565b61154b611209565b6001600160a01b03166115676101c5546001600160a01b031690565b6001600160a01b0316146107885760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ac565b6115c561244d565b61012f805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6115f9611209565b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b03831661163c5760405162461bcd60e51b81526004016105ac906137ed565b805182511461165d5760405162461bcd60e51b81526004016105ac906136c5565b6000611667611209565b905061168781856000868660405180602001604052806000815250612223565b60005b835181101561174f5760008482815181106116a7576116a761357f565b6020026020010151905060008483815181106116c5576116c561357f565b602090810291909101810151600084815260cb835260408082206001600160a01b038c1683529093529190912054909150818110156117165760405162461bcd60e51b81526004016105ac90613830565b600092835260cb602090815260408085206001600160a01b038b1686529091529092209103905580611747816135ab565b91505061168a565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516117a09291906137af565b60405180910390a46040805160208101909152600090525b50505050565b6101c580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611819611850565b61012f805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586115f9611209565b61012f5460ff16156107885760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016105ac565b82602001356000036119185760405162461bcd60e51b81526020600482015260506024820152600080516020613bfa83398151915260448201527f67756d656e7473206d696e74446174612e6e66744964206d757374206265206760648201526f726561746572207468616e207a65726f60801b608482015260a4016105ac565b826040013560000361199a5760405162461bcd60e51b81526020600482015260516024820152600080516020613bfa83398151915260448201527f67756d656e7473206d696e74446174612e616d6f756e74206d7573742062652060648201527067726561746572207468616e207a65726f60781b608482015260a4016105ac565b6119a760608401846135c4565b9050600003611a1a5760405162461bcd60e51b815260206004820152604460248201819052600080516020613bfa833981519152908201527f67756d656e7473206d696e74446174612e746f6b656e55524920697320696e76606482015263185b1a5960e21b608482015260a4016105ac565b6000611a2f6101c5546001600160a01b031690565b9050806001600160a01b0316611a43611209565b6001600160a01b0316146117b8576000611ae484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611ade9250611a9b9150899050612497565b611aa3612549565b6040805161190160f01b6020808301919091526022820193909352604280820194909452815180820390940184526062019052815191012090565b906125c4565b9050816001600160a01b0316816001600160a01b0316146106925760405162461bcd60e51b815260206004820152603b6024820152600080516020613bfa83398151915260448201527f67756d656e7473206e6f74207369676e6564206279204f776e6572000000000060648201526084016105ac565b6001600160a01b038416611bbb5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016105ac565b6000611bc5611209565b90506000611bd2856125e0565b90506000611bdf856125e0565b9050611bf083600089858589612223565b600086815260cb602090815260408083206001600160a01b038b16845290915281208054879290611c2290849061379c565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611c828360008989898961262b565b50505050505050565b600082815260fe60205260409020611ca382826138ba565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b611ccf84610630565b604051611cdc9190612db1565b60405180910390a25050565b600054610100900460ff16611d0f5760405162461bcd60e51b81526004016105ac90613979565b61097f82826126e6565b600054610100900460ff16611d405760405162461bcd60e51b81526004016105ac90613979565b610788612727565b600054610100900460ff16611d6f5760405162461bcd60e51b81526004016105ac90613979565b6107758161275e565b600054610100900460ff16611d9f5760405162461bcd60e51b81526004016105ac90613979565b61078861278e565b600054610100900460ff16611dce5760405162461bcd60e51b81526004016105ac90613979565b6107886127c2565b600054610100900460ff166107885760405162461bcd60e51b81526004016105ac90613979565b816001600160a01b0316836001600160a01b031603611e705760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016105ac565b6001600160a01b03838116600081815260cc6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038416611f035760405162461bcd60e51b81526004016105ac9061370d565b6000611f0d611209565b90506000611f1a856125e0565b90506000611f27856125e0565b9050611f37838989858589612223565b600086815260cb602090815260408083206001600160a01b038c16845290915290205485811015611f7a5760405162461bcd60e51b81526004016105ac90613752565b600087815260cb602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611fb990849061379c565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4612019848a8a8a8a8a61262b565b505050505050505050565b6001600160a01b03831661204a5760405162461bcd60e51b81526004016105ac906137ed565b6000612054611209565b90506000612061846125e0565b9050600061206e846125e0565b905061208e83876000858560405180602001604052806000815250612223565b600085815260cb602090815260408083206001600160a01b038a168452909152902054848110156120d15760405162461bcd60e51b81526004016105ac90613830565b600086815260cb602090815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4604080516020810190915260009052611c82565b606060cd805461215a9061360a565b80601f01602080910402602001604051908101604052809291908181526020018280546121869061360a565b80156121d35780601f106121a8576101008083540402835291602001916121d3565b820191906000526020600020905b8154815290600101906020018083116121b657829003601f168201915b50505050509050919050565b60007f000000000000000000000000307e7a9713dbf6f19a2d2a2b670544f4791c4ec26001600160a01b0316330361221e575060131936013560601c90565b503390565b6113c8868686868686612805565b6001600160a01b0384163b156113c85760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061227590899089908890889088906004016139c4565b6020604051808303816000875af19250505080156122b0575060408051601f3d908101601f191682019092526122ad91810190613a22565b60015b61235c576122bc613a3f565b806308c379a0036122f557506122d0613a5a565b806122db57506122f7565b8060405162461bcd60e51b81526004016105ac9190612db1565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105ac565b6001600160e01b0319811663bc197c8160e01b14611c825760405162461bcd60e51b81526004016105ac90613ae3565b6001600160a01b0381163b6123f95760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016105ac565b600080516020613bda83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6124318361286e565b60008251118061243e5750805b15610a8c576117b883836128ae565b61012f5460ff166107885760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016105ac565b60007fa4b99fa22379b81dc9fae56d21c8d840874068895b9a8b55a17affa15534d21a6124c76020840184612fc0565b602084013560408501356124de60608701876135c4565b6040516124ec929190613b2b565b60405190819003812061252c95949392916020019485526001600160a01b0393909316602085015260408401919091526060830152608082015260a00190565b604051602081830303815290604052805190602001209050919050565b60006112137f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f61257860655490565b6066546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b60008060006125d385856129a2565b915091506108ab816129e7565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061261a5761261a61357f565b602090810291909101015292915050565b6001600160a01b0384163b156113c85760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061266f9089908990889088908890600401613b3b565b6020604051808303816000875af19250505080156126aa575060408051601f3d908101601f191682019092526126a791810190613a22565b60015b6126b6576122bc613a3f565b6001600160e01b0319811663f23a6e6160e01b14611c825760405162461bcd60e51b81526004016105ac90613ae3565b600054610100900460ff1661270d5760405162461bcd60e51b81526004016105ac90613979565b815160209283012081519190920120606591909155606655565b600054610100900460ff1661274e5760405162461bcd60e51b81526004016105ac90613979565b610788612759611209565b6117be565b600054610100900460ff166127855760405162461bcd60e51b81526004016105ac90613979565b61077581612b9d565b600054610100900460ff166127b55760405162461bcd60e51b81526004016105ac90613979565b61012f805460ff19169055565b600054610100900460ff166127e95760405162461bcd60e51b81526004016105ac90613979565b60408051602081019091526000815260fd9061077590826138ba565b61012f5460ff16156113c85760405162461bcd60e51b815260206004820152602c60248201527f455243313135355061757361626c653a20746f6b656e207472616e736665722060448201526b1dda1a5b19481c185d5cd95960a21b60648201526084016105ac565b6128778161238c565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b6129165760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016105ac565b600080846001600160a01b0316846040516129319190613b80565b600060405180830381855af49150503d806000811461296c576040519150601f19603f3d011682016040523d82523d6000602084013e612971565b606091505b50915091506129998282604051806060016040528060278152602001613c1a60279139612ba9565b95945050505050565b60008082516041036129d85760208301516040840151606085015160001a6129cc87828585612be2565b945094505050506129e0565b506000905060025b9250929050565b60008160048111156129fb576129fb613b9c565b03612a035750565b6001816004811115612a1757612a17613b9c565b03612a645760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016105ac565b6002816004811115612a7857612a78613b9c565b03612ac55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016105ac565b6003816004811115612ad957612ad9613b9c565b03612b315760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016105ac565b6004816004811115612b4557612b45613b9c565b036107755760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016105ac565b60cd61097f82826138ba565b60608315612bb8575081611001565b825115612bc85782518084602001fd5b8160405162461bcd60e51b81526004016105ac9190612db1565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612c195750600090506003612cc6565b8460ff16601b14158015612c3157508460ff16601c14155b15612c425750600090506004612cc6565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612c96573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612cbf57600060019250925050612cc6565b9150600090505b94509492505050565b80356001600160a01b0381168114612ce657600080fd5b919050565b60008060408385031215612cfe57600080fd5b612d0783612ccf565b946020939093013593505050565b6001600160e01b03198116811461077557600080fd5b600060208284031215612d3d57600080fd5b813561100181612d15565b600060208284031215612d5a57600080fd5b5035919050565b60005b83811015612d7c578181015183820152602001612d64565b50506000910152565b60008151808452612d9d816020860160208601612d61565b601f01601f19169290920160200192915050565b6020815260006110016020830184612d85565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b0381118282101715612dff57612dff612dc4565b6040525050565b60006001600160401b03821115612e1f57612e1f612dc4565b5060051b60200190565b600082601f830112612e3a57600080fd5b81356020612e4782612e06565b604051612e548282612dda565b83815260059390931b8501820192828101915086841115612e7457600080fd5b8286015b84811015612e8f5780358352918301918301612e78565b509695505050505050565b60006001600160401b03831115612eb357612eb3612dc4565b604051612eca601f8501601f191660200182612dda565b809150838152848484011115612edf57600080fd5b83836020830137600060208583010152509392505050565b600082601f830112612f0857600080fd5b61100183833560208501612e9a565b600080600080600060a08688031215612f2f57600080fd5b612f3886612ccf565b9450612f4660208701612ccf565b935060408601356001600160401b0380821115612f6257600080fd5b612f6e89838a01612e29565b94506060880135915080821115612f8457600080fd5b612f9089838a01612e29565b93506080880135915080821115612fa657600080fd5b50612fb388828901612ef7565b9150509295509295909350565b600060208284031215612fd257600080fd5b61100182612ccf565b600082601f830112612fec57600080fd5b81356020612ff982612e06565b6040516130068282612dda565b83815260059390931b850182019282810191508684111561302657600080fd5b8286015b84811015612e8f5761303b81612ccf565b835291830191830161302a565b6000806040838503121561305b57600080fd5b82356001600160401b038082111561307257600080fd5b61307e86838701612fdb565b9350602085013591508082111561309457600080fd5b506130a185828601612e29565b9150509250929050565b600081518084526020808501945080840160005b838110156130db578151875295820195908201906001016130bf565b509495945050505050565b60208152600061100160208301846130ab565b6000806040838503121561310c57600080fd5b61311583612ccf565b915060208301356001600160401b0381111561313057600080fd5b6130a185828601612ef7565b60008060006060848603121561315157600080fd5b61315a84612ccf565b925060208401356001600160401b038082111561317657600080fd5b61318287838801612e29565b9350604086013591508082111561319857600080fd5b506131a586828701612e29565b9150509250925092565b6000608082840312156131c157600080fd5b50919050565b60008083601f8401126131d957600080fd5b5081356001600160401b038111156131f057600080fd5b6020830191508360208285010111156129e057600080fd5b60008060006040848603121561321d57600080fd5b83356001600160401b038082111561323457600080fd5b613240878388016131af565b9450602086013591508082111561325657600080fd5b50613263868287016131c7565b9497909650939450505050565b6000806040838503121561328357600080fd5b82356001600160401b038082111561329a57600080fd5b818501915085601f8301126132ae57600080fd5b6132bd86833560208501612e9a565b935060208501359150808211156132d357600080fd5b506130a185828601612fdb565b600080604083850312156132f357600080fd5b6132fc83612ccf565b91506020830135801515811461331157600080fd5b809150509250929050565b60006020828403121561332e57600080fd5b81356001600160401b0381111561334457600080fd5b61335084828501612fdb565b949350505050565b6000806000806060858703121561336e57600080fd5b84356001600160401b038082111561338557600080fd5b613391888389016131af565b955061339f60208801612ccf565b945060408701359150808211156133b557600080fd5b506133c2878288016131c7565b95989497509550505050565b600080604083850312156133e157600080fd5b6133ea83612ccf565b91506133f860208401612ccf565b90509250929050565b600080600080600060a0868803121561341957600080fd5b61342286612ccf565b945061343060208701612ccf565b9350604086013592506060860135915060808601356001600160401b0381111561345957600080fd5b612fb388828901612ef7565b60008060006060848603121561347a57600080fd5b61348384612ccf565b95602085013595506040909401359392505050565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016135bd576135bd613595565b5060010190565b6000808335601e198436030181126135db57600080fd5b8301803591506001600160401b038211156135f557600080fd5b6020019150368190038213156129e057600080fd5b600181811c9082168061361e57607f821691505b6020821081036131c157634e487b7160e01b600052602260045260246000fd5b600080845461364c8161360a565b600182811680156136645760018114613679576136a8565b60ff19841687528215158302870194506136a8565b8860005260208060002060005b8581101561369f5781548a820152908401908201613686565b50505082870194505b5050505083516136bc818360208801612d61565b01949350505050565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b808201808211156105da576105da613595565b6040815260006137c260408301856130ab565b828103602084015261299981856130ab565b6000602082840312156137e657600080fd5b5051919050565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b601f821115610a8c57600081815260208120601f850160051c8101602086101561389b5750805b601f850160051c820191505b818110156113c8578281556001016138a7565b81516001600160401b038111156138d3576138d3612dc4565b6138e7816138e1845461360a565b84613874565b602080601f83116001811461391c57600084156139045750858301515b600019600386901b1c1916600185901b1785556113c8565b600085815260208120601f198616915b8281101561394b5788860151825594840194600190910190840161392c565b50858210156139695787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b0386811682528516602082015260a0604082018190526000906139f0908301866130ab565b8281036060840152613a0281866130ab565b90508281036080840152613a168185612d85565b98975050505050505050565b600060208284031215613a3457600080fd5b815161100181612d15565b600060033d1115610a345760046000803e5060005160e01c90565b600060443d1015613a685790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715613a9757505050505090565b8285019150815181811115613aaf5750505050505090565b843d8701016020828501011115613ac95750505050505090565b613ad860208286010187612dda565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b8183823760009101908152919050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090613b7590830184612d85565b979650505050505050565b60008251613b92818460208701612d61565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfe5342494e4654204e616e616b757361204e46542045524331313535205570677261646561626c65360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc4e616e616b7573614e4654455243313135353a5f7665726966794d696e744172416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220fc95c70e8314dee67921b037986366f2b70aa039a8ec4ffd3d6075715f92599a64736f6c63430008130033