Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
NftTransferProxy
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.17;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/interfaces/IERC165Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol";
import {EIP712Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "../interfaces/INftTransferProxy.sol";
import "../interfaces/IUzuSharedCollection.sol";
import "../access/AdminPool.sol";
contract NftTransferProxy is
Initializable,
ERC165Upgradeable,
INftTransferProxy,
EIP712Upgradeable,
AdminPool,
UUPSUpgradeable
{
/**
* @dev To store the UZU Shared Collection Contract Address
*/
IUzuSharedCollection public uzuSharedCollectionAddress;
/**
* @dev constructor
*
* @param trustedForwarder address
*/
constructor(
address trustedForwarder
) ERC2771ContextUpgradeable(trustedForwarder) {}
/**
* @dev Initialize
*
* @param uzuSharedCollectionAddress_ address
*/
function __NftTransferProxy_init(
IUzuSharedCollection uzuSharedCollectionAddress_
) external initializer {
__ERC165_init();
__AdminPool_init();
__EIP712_init("NftTransferProxy", "1.0");
__UUPSUpgradeable_init();
setUzuSharedCollectionAddress(uzuSharedCollectionAddress_);
}
/**
* @dev See {UUPSUpgradeable._authorizeUpgrade()}
*
* @param newImplementation address
*
* Requirements:
* - onlyAdmin can call
*/
function _authorizeUpgrade(
address newImplementation
) internal virtual override onlyAdmin {}
/**
* @dev See {IERC165Upgradeable-supportsInterface}.
*
* @param interfaceId bytes4
*/
function supportsInterface(
bytes4 interfaceId
)
public
view
virtual
override(ERC165Upgradeable, IERC165Upgradeable)
returns (bool)
{
return
interfaceId == type(INftTransferProxy).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {INftTransferProxy-setUzuSharedCollectionAddress}
*/
function setUzuSharedCollectionAddress(
IUzuSharedCollection newAddress
) public virtual override onlyAdmin {
require(
IUzuSharedCollection(newAddress).supportsInterface(
type(IUzuSharedCollection).interfaceId
),
"NftTransferProxy: newAddress is not IUzuSharedCollection"
);
require(
uzuSharedCollectionAddress != newAddress,
"NftTransferProxy: existing same UzuSharedCollection"
);
uzuSharedCollectionAddress = IUzuSharedCollection(newAddress);
}
/**
* @dev See {INftTransferProxy-proxyNftTransfer}
*/
function proxyNftTransfer(
address from,
address to,
uint256 transferAmount,
uint256 nftId,
address collectionAddress,
Domain.NFTKind collectionType,
bytes calldata data,
bool isLazyMint,
Domain.MintData calldata lazyMintData,
bytes calldata lazyMintSign
) external virtual override onlyAdmin {
if (isLazyMint) {
uzuSharedCollectionAddress.lazyMintAndTransferFrom(
to,
transferAmount,
lazyMintData,
lazyMintSign
);
} else {
if (collectionType == Domain.NFTKind.ERC721) {
// ERC721
require(
transferAmount == 1,
"NftTransferProxy: ERC721 invalid nft amount"
);
IERC721(collectionAddress).safeTransferFrom(from, to, nftId, data);
} else if (collectionType == Domain.NFTKind.ERC1155) {
// ERC1155
IERC1155(collectionAddress).safeTransferFrom(
from,
to,
nftId,
transferAmount,
data
);
} else {
revert("NftTransferProxy: unsupported collection type");
}
}
}
}// 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);
}// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.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;
}// 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);
}// 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;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (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.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
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.
*
* 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.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* 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.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
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.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 the implementation's compatibility when performing 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;
}// 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;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
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;
}// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; // EIP-712 is Final as of 2022-08-11. This file is deprecated. import "./EIP712Upgradeable.sol";
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (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 // Deprecated in v4.8
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 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));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/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;
}// 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;
}// 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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library MathUpgradeable {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}// 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
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/MathUpgradeable.sol";
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = MathUpgradeable.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, MathUpgradeable.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts-upgradeable/metatx/ERC2771ContextUpgradeable.sol";
abstract contract AdminPool is ERC2771ContextUpgradeable {
event AdminAdded(address indexed adminAddress);
event AdminRemoved(address indexed adminAddress);
// Map of admin and their active state
mapping(address => bool) internal _admin;
function __AdminPool_init() internal onlyInitializing {
// At the time of init use deployer as an Admin
_addAdmin(_msgSender());
}
/**
* @dev Add new admin[s]
*
* @param _newAdminList address[]
*/
function addAdminBatch(
address[] calldata _newAdminList
) public virtual onlyAdmin {
for (uint256 idx = 0; idx < _newAdminList.length; idx++) {
_addAdmin(_newAdminList[idx]);
}
}
/**
* @dev Add new admin
*
* @param _newAdmin address
*/
function addAdmin(address _newAdmin) public virtual onlyAdmin {
_addAdmin(_newAdmin);
}
/**
* @dev [internal] Add new admin
*
* @param _newAdmin address
*/
function _addAdmin(address _newAdmin) internal virtual {
require(
_newAdmin != address(0),
"Admin:addAdmin newAdmin is the zero address"
);
_admin[_newAdmin] = true;
emit AdminAdded(_newAdmin);
}
/**
* @dev Removes an admin
*
* @param _adminToRemove address
*/
function removeAdmin(address _adminToRemove) public virtual onlyAdmin {
_removeAdmin(_adminToRemove);
}
/**
* @dev [internal] Removes an admin
*
* @param _adminToRemove address
*/
function _removeAdmin(address _adminToRemove) internal virtual {
require(
_admin[_adminToRemove],
"Admin:removeAdmin trying to remove non existing Admin"
);
delete _admin[_adminToRemove];
emit AdminRemoved(_adminToRemove);
}
/**
* @dev Check is an address is admin
*
* @param _addressToCheck address
*/
function isAdmin(address _addressToCheck) public view virtual returns (bool) {
return _admin[_addressToCheck];
}
/**
* @dev Throws if called by any account other than Admin.
*/
modifier onlyAdmin() {
require(_admin[_msgSender()], "Admin:onlyAdmin caller is not an Admin");
_;
}
}//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol";
import "./IUzuSharedCollection.sol";
import "../library/Domain.sol";
interface INftTransferProxy is IERC165Upgradeable {
/**
* @dev Change the UZU Shared Collection Address
* This contract must be added to UZUSharedCollection as Trusted Proxy.
* That allows this contract to do LazyMint and NFT Transfer.
*
* @param newAddress IUzuSharedCollection
*/
function setUzuSharedCollectionAddress(
IUzuSharedCollection newAddress
) external;
/**
* @dev Proxy the NFT Transfer transaction
*
* @param from address
* @param to address
* @param amount uint256
* @param nftId uint256
* @param collectionAddress address
* @param collectionType uint256
* @param data bytes
* @param isLazyMint bool
* @param lazyMintData bytes
* @param lazyMintSign bytes calldata
*/
function proxyNftTransfer(
address from,
address to,
uint256 amount,
uint256 nftId,
address collectionAddress,
Domain.NFTKind collectionType,
bytes calldata data,
bool isLazyMint,
Domain.MintData calldata lazyMintData,
bytes calldata lazyMintSign
) external;
}//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.17;
import "@openzeppelin/contracts-upgradeable/token/ERC1155/IERC1155Upgradeable.sol";
import "../interfaces/INftTransferProxy.sol";
import "../library/Domain.sol";
interface IUzuSharedCollection is IERC1155Upgradeable {
/**
* @dev Emitted when NFT transfer for anyone is approved by the NFT Creator.
*/
event NftTransferApprovedForAll(
uint256 indexed nftId,
address indexed caller // TODO: Not sure this event data is needed
);
/**
* @dev Emitted when new NftTransferProxy added
*/
event TrustedNftTransferProxyAdded(INftTransferProxy indexed operator);
/**
* @dev Emitted when a NftTransferProxy deleted
*/
event TrustedNftTransferProxyDeleted(INftTransferProxy indexed operator);
/**
* @dev If balance is enough, then transfer. If not, mint new NFT based on the data.
* @notice https://github.com/rarible/protocol-contracts/blob/master/tokens/contracts/erc-1155/ERC1155Lazy.sol#L37
*
* @param to address
* @param transferAmount uint256
* @param lazyMintData bytes
* @param lazyMintSign bytes calldata
*/
function lazyMintAndTransferFrom(
address to,
uint256 transferAmount,
Domain.MintData calldata lazyMintData,
bytes calldata lazyMintSign
) external;
/**
* @dev mint NFT. Register the NFT Creator.
*
* @param mintData Domain.MintData calldata
* @param sign bytes calldata
*/
function mint(
Domain.MintData calldata mintData,
bytes calldata sign
) external;
/**
* @dev NftCreator give permission to anyone to transfer the NFT
*
* @param nftId uint256
*/
function approveTransferForEveryoneByNftCreator(uint256 nftId) external;
/**
* @dev Transfer NFT for the first time by the approval of Creator
* The person who transfers the NFT must pay the gas fee for NFT transfer approval from NFT creators
*
* @param ot Domain.OwnershipTransfer calldata
* @param signature bytes calldata
*/
function approveByNftCreatorAndTransfer(
Domain.OwnershipTransfer calldata ot,
bytes calldata signature
) external;
/**
* @dev Check a nft is transferable for non creator
*
* By default creator could transfer nft but when a creator transfer nft to
* recever1 then recever1 else could not re-transfer to someone else.
*
* creator -> recever1 => OK
* recever1 -> recever2 => NG
*
* In order to make a nft transferable creator must allow first.
* See :
* {IUzuSharedCollection.approveTransferForEveryoneByNftCreator}
* {IUzuSharedCollection.approveByNftCreatorAndTransfer}
*
* @param nftId uint256
*/
function isNftTransferableForNonCreator(
uint256 nftId
) external returns (bool);
/**
* @dev Add Trusted Proxy
*
* @param operator INftTransferProxy
*/
function addTrustedNftTransferProxy(INftTransferProxy operator) external;
/**
* @dev Delete Trusted Proxy
*
* @param operator INftTransferProxy
*/
function deleteTrustedNftTransferProxy(INftTransferProxy operator) external;
}//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.17;
/**
* @dev Holds all struct and static functions
*/
library Domain {
enum NFTKind {
// ERC721-compatible Collection
ERC721,
// ERC1155-compatible Collections
ERC1155
}
// Curator Info
struct Curator {
address curatorAddress;
string curatorType;
}
// Because Solidity cannot deal with float value, we need to introduce decimals.
// ex) If the price is 123.45USD, the value of each variables should be as follows:
// - currencyType = CRYPTO
// - currencySymbol = USD
// - tokenAddress = 0x0
// - amount = 123450000000000000000
// - decimals = 18
struct Payment {
// Currency Type. If Fiat, tokenAddress field MUST be ignored.
string currencyType;
// Currency Symbol. To specify the currency.
string currencySymbol;
// If not 0, means ERC20 token address. If 0, means ETH.
address tokenAddress;
// Amount of payment
uint256 amount;
// Decimals of the amount.
uint256 decimals;
// USD price per Fiat/Token/ETH
uint256 rate;
}
struct Royalty {
// The type of recipient of the Royalty, like:
// - CREATOR
// - SPECIAL_CURATOR
// - RECOMMENDER
string recipientType;
// The recipient of the Royalty.
address recipientAddress;
// Rolayty percentage as a reference (using 2 decimals. That is, 10000 = 100%, 231 = 2.31%, 0 = 0%)
// *Important Note* This value is not used for calculation.
// All of payment details, including amount of rolayty, MUST be specified in Payment.
uint256 referenceRoyaltyFee;
// Royalty Payment Information
Payment payment;
}
// Order Body
struct Order {
/* Order-related Information */
// Order ID (Generated Off-chain), used as nonce
uint256 orderId;
// The time when the order is created (signed by UZU Admin) in Unix timestamp.
uint256 orderCreatedAt;
// The time when the order will expires in Unix timestamp.
uint256 orderExpiresAt;
/* NFT-related Information */
// The target collection address
address collectionAddress;
// The NFT Kind
NFTKind nftKind;
// The target NFT ID
uint256 nftId;
// The number of NFT amount. Must be 1 if the NFTKind = ERC721.
uint256 amount;
/* Basic Order Information */
// The price of this order (in USD multiplied by 10**decimals)
uint256 salePrice;
// The decimal of salePrice
uint256 salePriceDecimals;
// Address of Seller
address seller;
// Address where payment will be received, can be same as seller
address paymentReceiver;
// Address of Buyer
address buyer;
// Market Commission Percentage (using 2 decimals. That is, 10000 = 100%, 231 = 2.31%, 0 = 0%)
// *Important Note* This value is not used for calculation. Just for the information.
uint16 referenceMarketCommissionFee;
/* Buyer and Seller Fee */
Payment buyerPayment;
Payment sellerPayment;
// /* Management information of the order */
// OrderManagement orderManagement;
/* Royalty Information */
Royalty[] royalties;
// List of cruators
Curator[] cruators;
}
// Represents an un-minted NFT, which has not yet been recorded into the blockchain. A signed voucher can be redeemed for a real NFT using the redeem function.
struct MintData {
// Mint ID (Generated Off-chain), used as nonce
uint256 mintId;
// Address of the creator
address creator;
// The id of the token to be redeemed. Must be unique - if another token with this ID already exists, the redeem function will revert.
uint256 nftId;
// Amount of NFT needs to be minted
uint256 amount;
// The metadata URI to associate with this token.
string uri;
// Data to be passed for minting
bytes data;
// ERC2981 receiver
address royaltyReceiver;
// ERC2981 feeNumerator
uint96 royaltyFeeNumerator;
}
struct OwnershipTransfer {
uint256 nftId;
address to;
uint256 amount;
}
/**
* @dev Checks if the Currency Type is Crypto
*
* @param currencyType string
*/
function isCryptoCurrencyType(
string memory currencyType
) public pure returns (bool) {
return compareStrings(currencyType, "CRYPTO");
}
/**
* @dev Compares two strings
*
* @param a string first
* @param b string second
*/
function compareStrings(
string memory a,
string memory b
) public pure returns (bool) {
return (keccak256(abi.encodePacked((a))) ==
keccak256(abi.encodePacked((b))));
}
// ---- EIP712 ----
bytes32 internal constant PAYMENT_TYPEHASH =
keccak256(
"Payment(string currencyType,string currencySymbol,address tokenAddress,uint256 amount,uint256 decimals,uint256 rate)"
);
bytes32 internal constant ROYALTY_TYPEHASH =
keccak256(
"Royalty(string recipientType,address recipientAddress,uint256 referenceRoyaltyFee,Payment payment)Payment(string currencyType,string currencySymbol,address tokenAddress,uint256 amount,uint256 decimals,uint256 rate)"
);
bytes32 internal constant CURATOR_TYPEHASH =
keccak256("Curator(address curatorAddress,string curatorType)");
bytes32 internal constant ORDER_TYPEHASH =
keccak256(
"Order(uint256 orderId,uint256 orderCreatedAt,uint256 orderExpiresAt,address collectionAddress,uint8 nftKind,uint256 nftId,uint256 amount,uint256 salePrice,uint256 salePriceDecimals,address seller,address paymentReceiver,address buyer,uint16 referenceMarketCommissionFee,Payment buyerPayment,Payment sellerPayment,Royalty[] royalties,Curator[] cruators)Curator(address curatorAddress,string curatorType)Payment(string currencyType,string currencySymbol,address tokenAddress,uint256 amount,uint256 decimals,uint256 rate)Royalty(string recipientType,address recipientAddress,uint256 referenceRoyaltyFee,Payment payment)"
);
bytes32 internal constant MINT_DATA_TYPEHASH =
keccak256(
"MintData(uint256 mintId,address creator,uint256 nftId,uint256 amount,string uri,bytes data,address royaltyReceiver,uint96 royaltyFeeNumerator)"
);
bytes32 internal constant OWNERSHIP_TRASNFER_TYPEHASH =
keccak256("OwnershipTransfer(uint256 nftId,address to,uint256 amount)");
/**
* @dev Prepares keccak256 hash for Curator list
*
* @param curatorList Curator[] calldata
*/
function _hashCurator(
Curator[] calldata curatorList
) internal pure returns (bytes32) {
bytes32[] memory keccakData = new bytes32[](curatorList.length);
for (uint256 idx = 0; idx < curatorList.length; idx++) {
keccakData[idx] = _hashCurator(curatorList[idx]);
}
return keccak256(abi.encodePacked(keccakData));
}
/**
* @dev Prepares keccak256 hash for Curator
*
* @param curator Curator
*/
function _hashCurator(
Curator calldata curator
) internal pure returns (bytes32) {
return
keccak256(
abi.encode(
CURATOR_TYPEHASH,
curator.curatorAddress,
keccak256(bytes(curator.curatorType))
)
);
}
/**
* @dev Prepares keccak256 hash for Payment
*
* @param payment Payment
*/
function _hashPayment(
Payment calldata payment
) internal pure returns (bytes32) {
return
keccak256(
abi.encode(
PAYMENT_TYPEHASH,
keccak256(bytes(payment.currencyType)),
keccak256(bytes(payment.currencySymbol)),
payment.tokenAddress,
payment.amount,
payment.decimals,
payment.rate
)
);
}
/**
* @dev Prepares keccak256 hash for Royalty list
*
* @param royaltyList Royalty[]
*/
function _hashRoyalty(
Royalty[] calldata royaltyList
) internal pure returns (bytes32) {
bytes32[] memory keccakData = new bytes32[](royaltyList.length);
for (uint256 idx = 0; idx < royaltyList.length; idx++) {
keccakData[idx] = _hashRoyalty(royaltyList[idx]);
}
return keccak256(abi.encodePacked(keccakData));
}
/**
* @dev Prepares keccak256 hash for Royalty
*
* @param royalty Royalty
*/
function _hashRoyalty(
Royalty calldata royalty
) internal pure returns (bytes32) {
return
keccak256(
abi.encode(
ROYALTY_TYPEHASH,
keccak256(bytes(royalty.recipientType)),
royalty.recipientAddress,
royalty.referenceRoyaltyFee,
_hashPayment(royalty.payment)
)
);
}
/**
* @dev Prepares keccak256 hash for Order
*
* @param order Order
*/
function _hashOrder(Order calldata order) internal pure returns (bytes32) {
return
keccak256(
abi.encode(
ORDER_TYPEHASH,
order.orderId,
order.orderCreatedAt,
order.orderExpiresAt,
order.collectionAddress,
order.nftKind,
order.nftId,
order.amount,
order.salePrice,
order.salePriceDecimals,
order.seller,
order.paymentReceiver,
order.buyer,
order.referenceMarketCommissionFee,
_hashPayment(order.buyerPayment),
_hashPayment(order.sellerPayment),
_hashRoyalty(order.royalties),
_hashCurator(order.cruators)
)
);
}
/**
* @dev Prepares keccak256 hash for MintData
*
* @param mintData Domain.MintData
*/
function _hashMintData(
MintData calldata mintData
) internal pure returns (bytes32) {
return
keccak256(
abi.encode(
MINT_DATA_TYPEHASH,
mintData.mintId,
mintData.creator,
mintData.nftId,
mintData.amount,
keccak256(bytes(mintData.uri)),
keccak256(mintData.data),
mintData.royaltyReceiver,
mintData.royaltyFeeNumerator
)
);
}
/**
* @dev Prepares keccak256 hash for OwnershipTransfer
*
* @param ot OwnershipTransfer calldata
*/
function _hashOwnershipTranfer(
OwnershipTransfer calldata ot
) internal pure returns (bytes32) {
return
keccak256(
abi.encode(OWNERSHIP_TRASNFER_TYPEHASH, ot.nftId, ot.to, ot.amount)
);
}
}{
"optimizer": {
"enabled": true,
"runs": 1000
},
"viaIR": true,
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract ABI
API[{"inputs":[{"internalType":"address","name":"trustedForwarder","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"adminAddress","type":"address"}],"name":"AdminAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"adminAddress","type":"address"}],"name":"AdminRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[{"internalType":"contract IUzuSharedCollection","name":"uzuSharedCollectionAddress_","type":"address"}],"name":"__NftTransferProxy_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newAdmin","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_newAdminList","type":"address[]"}],"name":"addAdminBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addressToCheck","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"transferAmount","type":"uint256"},{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"address","name":"collectionAddress","type":"address"},{"internalType":"enum Domain.NFTKind","name":"collectionType","type":"uint8"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bool","name":"isLazyMint","type":"bool"},{"components":[{"internalType":"uint256","name":"mintId","type":"uint256"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"address","name":"royaltyReceiver","type":"address"},{"internalType":"uint96","name":"royaltyFeeNumerator","type":"uint96"}],"internalType":"struct Domain.MintData","name":"lazyMintData","type":"tuple"},{"internalType":"bytes","name":"lazyMintSign","type":"bytes"}],"name":"proxyNftTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_adminToRemove","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IUzuSharedCollection","name":"newAddress","type":"address"}],"name":"setUzuSharedCollectionAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"uzuSharedCollectionAddress","outputs":[{"internalType":"contract IUzuSharedCollection","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c03461008c57601f611ba238819003918201601f19168301916001600160401b038311848410176100915780849260209460405283398101031261008c57516001600160a01b038116810361008c576080523060a052604051611afa90816100a88239608051818181610c16015261190a015260a051818181610c5801528181610d9001526110e30152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146114fb575080631785f53c146113fc57806324d7806c146113bf5780633659cfe6146110bc5780634f1ef28614610d1257806352d1902d14610c3d578063572b6c0514610beb5780637048027514610ba157806386c92fe3146109e1578063907ecd30146109b9578063aba47579146108ed578063bcca91a0146104495763c3af096d146100b057600080fd5b346104465760208060031936011261044257600435906001600160a01b0380831680930361043e5783549060ff93848360081c161592838094610432575b801561041c575b156103b25760ff1981166001178755836103a1575b5061012385875460081c1661011e81611a00565b611a00565b6101ea8583610130611907565b61013981611947565b6101d8604051610148816115f7565b601081528981017f4e66745472616e7366657250726f78790000000000000000000000000000000081528c60405191610180836115f7565b600383528c8301917f312e3000000000000000000000000000000000000000000000000000000000008352549d8e60081c16936101bc85611a00565b6101c585611a00565b5190209151902090603355603455611a00565b16885260cb8652604088205416611896565b6040516301ffc9a760e01b8152632d9975f960e11b60048201528481602481855afa90811561039657879161035c575b50156102f25761013091818354918216146102885773ffffffffffffffffffffffffffffffffffffffff1916179055610251578280f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001916835560405160018152a138808280f35b6084856040519062461bcd60e51b82526004820152603360248201527f4e66745472616e7366657250726f78793a206578697374696e672073616d652060448201527f557a75536861726564436f6c6c656374696f6e000000000000000000000000006064820152fd5b6084846040519062461bcd60e51b82526004820152603860248201527f4e66745472616e7366657250726f78793a206e6577416464726573732069732060448201527f6e6f742049557a75536861726564436f6c6c656374696f6e00000000000000006064820152fd5b90508481813d831161038f575b6103738183611613565b8101031261038b5751801515810361038b573861021a565b8680fd5b503d610369565b6040513d89823e3d90fd5b61ffff19166101011786553861010a565b6084856040519062461bcd60e51b82526004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152fd5b50303b1580156100f557506001868216146100f5565b506001868216106100ee565b8380fd5b5080fd5b80fd5b5034610446576101403660031901126104465780610465611582565b602435906001600160a01b03821682036108e957608435906001600160a01b03821682036108e457600260a43510156108e45767ffffffffffffffff9060c435828111610762576104ba903690600401611651565b909260e435151560e4350361038b5780610104351161038b57610100610104353603600319011261038b576101243511610762576104fe3661012435600401611651565b9390946001600160a01b03610511611907565b16885260cb60205261052960ff60408a205416611896565b60e435156106ba57505050506001600160a01b036101305416803b156106b6576001600160a01b03604051947f3c98d87a00000000000000000000000000000000000000000000000000000000865216600485015260443560248501526080604485015261062061010435600401803560848701526001600160a01b036105b56024610104350161159d565b1660a4870152604461010435013560c4870152606461010435013560e487015261060d6105ff6105eb6084610104350184611a92565b6101006101048b01526101848a0191611a71565b9160a4610104350190611a92565b8783036083190161012489015290611a71565b6001600160a01b0361063760c4610104350161159d565b1661014486015260e4610104350135926bffffffffffffffffffffffff841680940361038b578561068281959389979388948496610164860152600319858403016064860152611a71565b03925af180156106ab57610697575b50505b80f35b6106a0906115b1565b610446578038610691565b6040513d84823e3d90fd5b8480fd5b929650935093915060a435156000146107d0576001604435036107665785946001600160a01b0382163b1561076257856001600160a01b0380969261074e839783956040519a8b998a9889967fb88d4fde0000000000000000000000000000000000000000000000000000000088521660048701521660248501526064356044850152608060648501526084840191611a71565b0393165af180156106ab5761069757505080f35b8580fd5b608460405162461bcd60e51b815260206004820152602b60248201527f4e66745472616e7366657250726f78793a2045524337323120696e76616c696460448201527f206e667420616d6f756e740000000000000000000000000000000000000000006064820152fd5b909193600160a4351460001461087a5785936001600160a01b0383163b156106b6576001600160a01b0380969261085e829488946040519a8b998a9889967ff242432a0000000000000000000000000000000000000000000000000000000088521660048701521660248501526064356044850152604435606485015260a0608485015260a4840191611a71565b0393165af180156106ab57610871575080f35b610694906115b1565b608460405162461bcd60e51b815260206004820152602d60248201527f4e66745472616e7366657250726f78793a20756e737570706f7274656420636f60448201527f6c6c656374696f6e2074797065000000000000000000000000000000000000006064820152fd5b505050fd5b5050fd5b50346104465760203660031901126104465760043567ffffffffffffffff8082116109b557366023830112156109b55781600401359081116109b557602491600590368484841b830101116106b6576001600160a01b03918261094e611907565b16865260cb60205261096660ff604088205416611896565b855b848110610973578680f35b8581831b8401013584811681036109b15761098d90611947565b600019811461099e57600101610968565b8587634e487b7160e01b81526011600452fd5b8780fd5b8280fd5b503461044657806003193601126104465760206001600160a01b036101305416604051908152f35b503461044657602080600319360112610442576004356001600160a01b0380821680920361043e5780610a12611907565b16845260cb8352610a2960ff604086205416611896565b6040516301ffc9a760e01b8152632d9975f960e11b60048201528381602481865afa908115610b96578591610b60575b5015610af6576101309282845492831614610a8c575073ffffffffffffffffffffffffffffffffffffffff191617905580f35b6084906040519062461bcd60e51b82526004820152603360248201527f4e66745472616e7366657250726f78793a206578697374696e672073616d652060448201527f557a75536861726564436f6c6c656374696f6e000000000000000000000000006064820152fd5b6084836040519062461bcd60e51b82526004820152603860248201527f4e66745472616e7366657250726f78793a206e6577416464726573732069732060448201527f6e6f742049557a75536861726564436f6c6c656374696f6e00000000000000006064820152fd5b90508381813d8311610b8f575b610b778183611613565b810103126106b6575180151581036106b65738610a59565b503d610b6d565b6040513d87823e3d90fd5b503461044657602036600319011261044657610694610bbe611582565b6001600160a01b03610bce611907565b16835260cb602052610be660ff604085205416611896565b611947565b5034610446576020366003190112610446576020610c07611582565b604051906001600160a01b03807f0000000000000000000000000000000000000000000000000000000000000000169116148152f35b50346104465780600319360112610446576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163003610ca85760206040517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b608460405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152fd5b50604036600319011261044657610d27611582565b90602491823567ffffffffffffffff81116109b557366023820112156109b557806004013590610d5682611635565b610d636040519182611613565b828152602092838201923688838301011161038b57818792898793018637830101526001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001690610dbd8230141561167f565b610dec7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc9282845416146116f0565b80610df5611907565b16875260cb8552610e0c60ff604089205416611896565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610e46575050505050610694919250611761565b8596949616906040516352d1902d60e01b81528781600481865afa86918161108d575b50610ed757608488602e8b6040519262461bcd60e51b845260048401528201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152fd5b97919293949695970361103857610eed87611761565b604051917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8780a2825115801590611030575b610f2f575b5050505050905080f35b863b15610fe15750509280948192610fcd9551915af43d15610fd9573d90610f5682611635565b91610f646040519384611613565b82523d858484013e5b7f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60405193610f9b856115db565b602785528401527f206661696c656400000000000000000000000000000000000000000000000000604084015261181b565b50803880808080610f25565b606090610f6d565b9060266084928662461bcd60e51b845260048401528201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152fd5b506001610f20565b8460296084926040519262461bcd60e51b845260048401528201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152fd5b9091508881813d83116110b5575b6110a58183611613565b8101031261038b57519038610e69565b503d61109b565b503461044657602080600319360112610442576110d7611582565b906001600160a01b03807f00000000000000000000000000000000000000000000000000000000000000001661110f8130141561167f565b61113e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc9183835416146116f0565b81611147611907565b16855260cb835261115e60ff604087205416611896565b604051908382019282841067ffffffffffffffff8511176113ab578360405286835260ff7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914354166000146111ba57505050505061069490611761565b8596949516906040516352d1902d60e01b81528681600481865afa86918161137c575b5061124c576084876040519062461bcd60e51b82526004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152fd5b959495036113265761125d86611761565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8680a281511580159061131f575b61129e575b50505050905080f35b853b156112cf575092809481926112c49551915af43d15610fd9573d90610f5682611635565b508038808080611295565b808462461bcd60e51b608493526004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152fd5b5084611290565b6084846040519062461bcd60e51b82526004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152fd5b9091508781813d83116113a4575b6113948183611613565b8101031261038b575190386111dd565b503d61138a565b602487634e487b7160e01b81526041600452fd5b50346104465760203660031901126104465760ff60406020926001600160a01b036113e8611582565b16815260cb84522054166040519015158152f35b503461044657602036600319011261044657611416611582565b6001600160a01b039081611428611907565b16835260cb60205261144060ff604085205416611896565b1680825260cb60205260ff604083205416156114915780825260cb60205260408220805460ff191690557fa3b62bc36326052d97ea62d63c3d60308ed4c3ea8ac079dd8499f1e9c4f80c0f8280a280f35b608460405162461bcd60e51b815260206004820152603560248201527f41646d696e3a72656d6f766541646d696e20747279696e6720746f2072656d6f60448201527f7665206e6f6e206578697374696e672041646d696e00000000000000000000006064820152fd5b905034610442576020366003190112610442576004357fffffffff0000000000000000000000000000000000000000000000000000000081168091036109b557602092507f3a03be43000000000000000000000000000000000000000000000000000000008114908115611571575b5015158152f35b6301ffc9a760e01b9150143861156a565b600435906001600160a01b038216820361159857565b600080fd5b35906001600160a01b038216820361159857565b67ffffffffffffffff81116115c557604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff8211176115c557604052565b6040810190811067ffffffffffffffff8211176115c557604052565b90601f8019910116810190811067ffffffffffffffff8211176115c557604052565b67ffffffffffffffff81116115c557601f01601f191660200190565b9181601f840112156115985782359167ffffffffffffffff8311611598576020838186019501011161159857565b1561168657565b608460405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152fd5b156116f757565b608460405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152fd5b803b156117b1576001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc911673ffffffffffffffffffffffffffffffffffffffff19825416179055565b608460405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b90919015611827575090565b8151156118375750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b82851061187d575050604492506000838284010152601f80199101168101030190fd5b848101820151868601604401529381019385935061185a565b1561189d57565b608460405162461bcd60e51b815260206004820152602660248201527f41646d696e3a6f6e6c7941646d696e2063616c6c6572206973206e6f7420616e60448201527f2041646d696e00000000000000000000000000000000000000000000000000006064820152fd5b337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316036119435736601319013560601c90565b3390565b6001600160a01b03168015611996578060005260cb6020526040600020600160ff198254161790557f44d6d25963f097ad14f29f06854a01f575648a1ef82f30e562ccd3889717e339600080a2565b608460405162461bcd60e51b815260206004820152602b60248201527f41646d696e3a61646441646d696e206e657741646d696e20697320746865207a60448201527f65726f20616464726573730000000000000000000000000000000000000000006064820152fd5b15611a0757565b608460405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152fd5b908060209392818452848401376000828201840152601f01601f1916010190565b9035601e198236030181121561159857016020813591019167ffffffffffffffff82116115985781360383136115985756fea2646970667358221220d10a9e9de25d762237624aa47076ee142d5e0315e8bc3e3e6b5fbb453059f49a64736f6c6343000811003300000000000000000000000091ac262afccd8ffb74f2211b6bfc108c3e1eb382
Deployed Bytecode
0x608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146114fb575080631785f53c146113fc57806324d7806c146113bf5780633659cfe6146110bc5780634f1ef28614610d1257806352d1902d14610c3d578063572b6c0514610beb5780637048027514610ba157806386c92fe3146109e1578063907ecd30146109b9578063aba47579146108ed578063bcca91a0146104495763c3af096d146100b057600080fd5b346104465760208060031936011261044257600435906001600160a01b0380831680930361043e5783549060ff93848360081c161592838094610432575b801561041c575b156103b25760ff1981166001178755836103a1575b5061012385875460081c1661011e81611a00565b611a00565b6101ea8583610130611907565b61013981611947565b6101d8604051610148816115f7565b601081528981017f4e66745472616e7366657250726f78790000000000000000000000000000000081528c60405191610180836115f7565b600383528c8301917f312e3000000000000000000000000000000000000000000000000000000000008352549d8e60081c16936101bc85611a00565b6101c585611a00565b5190209151902090603355603455611a00565b16885260cb8652604088205416611896565b6040516301ffc9a760e01b8152632d9975f960e11b60048201528481602481855afa90811561039657879161035c575b50156102f25761013091818354918216146102885773ffffffffffffffffffffffffffffffffffffffff1916179055610251578280f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989161ff001916835560405160018152a138808280f35b6084856040519062461bcd60e51b82526004820152603360248201527f4e66745472616e7366657250726f78793a206578697374696e672073616d652060448201527f557a75536861726564436f6c6c656374696f6e000000000000000000000000006064820152fd5b6084846040519062461bcd60e51b82526004820152603860248201527f4e66745472616e7366657250726f78793a206e6577416464726573732069732060448201527f6e6f742049557a75536861726564436f6c6c656374696f6e00000000000000006064820152fd5b90508481813d831161038f575b6103738183611613565b8101031261038b5751801515810361038b573861021a565b8680fd5b503d610369565b6040513d89823e3d90fd5b61ffff19166101011786553861010a565b6084856040519062461bcd60e51b82526004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152fd5b50303b1580156100f557506001868216146100f5565b506001868216106100ee565b8380fd5b5080fd5b80fd5b5034610446576101403660031901126104465780610465611582565b602435906001600160a01b03821682036108e957608435906001600160a01b03821682036108e457600260a43510156108e45767ffffffffffffffff9060c435828111610762576104ba903690600401611651565b909260e435151560e4350361038b5780610104351161038b57610100610104353603600319011261038b576101243511610762576104fe3661012435600401611651565b9390946001600160a01b03610511611907565b16885260cb60205261052960ff60408a205416611896565b60e435156106ba57505050506001600160a01b036101305416803b156106b6576001600160a01b03604051947f3c98d87a00000000000000000000000000000000000000000000000000000000865216600485015260443560248501526080604485015261062061010435600401803560848701526001600160a01b036105b56024610104350161159d565b1660a4870152604461010435013560c4870152606461010435013560e487015261060d6105ff6105eb6084610104350184611a92565b6101006101048b01526101848a0191611a71565b9160a4610104350190611a92565b8783036083190161012489015290611a71565b6001600160a01b0361063760c4610104350161159d565b1661014486015260e4610104350135926bffffffffffffffffffffffff841680940361038b578561068281959389979388948496610164860152600319858403016064860152611a71565b03925af180156106ab57610697575b50505b80f35b6106a0906115b1565b610446578038610691565b6040513d84823e3d90fd5b8480fd5b929650935093915060a435156000146107d0576001604435036107665785946001600160a01b0382163b1561076257856001600160a01b0380969261074e839783956040519a8b998a9889967fb88d4fde0000000000000000000000000000000000000000000000000000000088521660048701521660248501526064356044850152608060648501526084840191611a71565b0393165af180156106ab5761069757505080f35b8580fd5b608460405162461bcd60e51b815260206004820152602b60248201527f4e66745472616e7366657250726f78793a2045524337323120696e76616c696460448201527f206e667420616d6f756e740000000000000000000000000000000000000000006064820152fd5b909193600160a4351460001461087a5785936001600160a01b0383163b156106b6576001600160a01b0380969261085e829488946040519a8b998a9889967ff242432a0000000000000000000000000000000000000000000000000000000088521660048701521660248501526064356044850152604435606485015260a0608485015260a4840191611a71565b0393165af180156106ab57610871575080f35b610694906115b1565b608460405162461bcd60e51b815260206004820152602d60248201527f4e66745472616e7366657250726f78793a20756e737570706f7274656420636f60448201527f6c6c656374696f6e2074797065000000000000000000000000000000000000006064820152fd5b505050fd5b5050fd5b50346104465760203660031901126104465760043567ffffffffffffffff8082116109b557366023830112156109b55781600401359081116109b557602491600590368484841b830101116106b6576001600160a01b03918261094e611907565b16865260cb60205261096660ff604088205416611896565b855b848110610973578680f35b8581831b8401013584811681036109b15761098d90611947565b600019811461099e57600101610968565b8587634e487b7160e01b81526011600452fd5b8780fd5b8280fd5b503461044657806003193601126104465760206001600160a01b036101305416604051908152f35b503461044657602080600319360112610442576004356001600160a01b0380821680920361043e5780610a12611907565b16845260cb8352610a2960ff604086205416611896565b6040516301ffc9a760e01b8152632d9975f960e11b60048201528381602481865afa908115610b96578591610b60575b5015610af6576101309282845492831614610a8c575073ffffffffffffffffffffffffffffffffffffffff191617905580f35b6084906040519062461bcd60e51b82526004820152603360248201527f4e66745472616e7366657250726f78793a206578697374696e672073616d652060448201527f557a75536861726564436f6c6c656374696f6e000000000000000000000000006064820152fd5b6084836040519062461bcd60e51b82526004820152603860248201527f4e66745472616e7366657250726f78793a206e6577416464726573732069732060448201527f6e6f742049557a75536861726564436f6c6c656374696f6e00000000000000006064820152fd5b90508381813d8311610b8f575b610b778183611613565b810103126106b6575180151581036106b65738610a59565b503d610b6d565b6040513d87823e3d90fd5b503461044657602036600319011261044657610694610bbe611582565b6001600160a01b03610bce611907565b16835260cb602052610be660ff604085205416611896565b611947565b5034610446576020366003190112610446576020610c07611582565b604051906001600160a01b03807f00000000000000000000000091ac262afccd8ffb74f2211b6bfc108c3e1eb382169116148152f35b50346104465780600319360112610446576001600160a01b037f00000000000000000000000097b926c5a2f4b9462d8ff283f9045ffe0eb6a81d163003610ca85760206040517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b608460405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152fd5b50604036600319011261044657610d27611582565b90602491823567ffffffffffffffff81116109b557366023820112156109b557806004013590610d5682611635565b610d636040519182611613565b828152602092838201923688838301011161038b57818792898793018637830101526001600160a01b03807f00000000000000000000000097b926c5a2f4b9462d8ff283f9045ffe0eb6a81d1690610dbd8230141561167f565b610dec7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc9282845416146116f0565b80610df5611907565b16875260cb8552610e0c60ff604089205416611896565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615610e46575050505050610694919250611761565b8596949616906040516352d1902d60e01b81528781600481865afa86918161108d575b50610ed757608488602e8b6040519262461bcd60e51b845260048401528201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152fd5b97919293949695970361103857610eed87611761565b604051917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8780a2825115801590611030575b610f2f575b5050505050905080f35b863b15610fe15750509280948192610fcd9551915af43d15610fd9573d90610f5682611635565b91610f646040519384611613565b82523d858484013e5b7f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60405193610f9b856115db565b602785528401527f206661696c656400000000000000000000000000000000000000000000000000604084015261181b565b50803880808080610f25565b606090610f6d565b9060266084928662461bcd60e51b845260048401528201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152fd5b506001610f20565b8460296084926040519262461bcd60e51b845260048401528201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152fd5b9091508881813d83116110b5575b6110a58183611613565b8101031261038b57519038610e69565b503d61109b565b503461044657602080600319360112610442576110d7611582565b906001600160a01b03807f00000000000000000000000097b926c5a2f4b9462d8ff283f9045ffe0eb6a81d1661110f8130141561167f565b61113e7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc9183835416146116f0565b81611147611907565b16855260cb835261115e60ff604087205416611896565b604051908382019282841067ffffffffffffffff8511176113ab578360405286835260ff7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd914354166000146111ba57505050505061069490611761565b8596949516906040516352d1902d60e01b81528681600481865afa86918161137c575b5061124c576084876040519062461bcd60e51b82526004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152fd5b959495036113265761125d86611761565b604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8680a281511580159061131f575b61129e575b50505050905080f35b853b156112cf575092809481926112c49551915af43d15610fd9573d90610f5682611635565b508038808080611295565b808462461bcd60e51b608493526004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152fd5b5084611290565b6084846040519062461bcd60e51b82526004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152fd5b9091508781813d83116113a4575b6113948183611613565b8101031261038b575190386111dd565b503d61138a565b602487634e487b7160e01b81526041600452fd5b50346104465760203660031901126104465760ff60406020926001600160a01b036113e8611582565b16815260cb84522054166040519015158152f35b503461044657602036600319011261044657611416611582565b6001600160a01b039081611428611907565b16835260cb60205261144060ff604085205416611896565b1680825260cb60205260ff604083205416156114915780825260cb60205260408220805460ff191690557fa3b62bc36326052d97ea62d63c3d60308ed4c3ea8ac079dd8499f1e9c4f80c0f8280a280f35b608460405162461bcd60e51b815260206004820152603560248201527f41646d696e3a72656d6f766541646d696e20747279696e6720746f2072656d6f60448201527f7665206e6f6e206578697374696e672041646d696e00000000000000000000006064820152fd5b905034610442576020366003190112610442576004357fffffffff0000000000000000000000000000000000000000000000000000000081168091036109b557602092507f3a03be43000000000000000000000000000000000000000000000000000000008114908115611571575b5015158152f35b6301ffc9a760e01b9150143861156a565b600435906001600160a01b038216820361159857565b600080fd5b35906001600160a01b038216820361159857565b67ffffffffffffffff81116115c557604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff8211176115c557604052565b6040810190811067ffffffffffffffff8211176115c557604052565b90601f8019910116810190811067ffffffffffffffff8211176115c557604052565b67ffffffffffffffff81116115c557601f01601f191660200190565b9181601f840112156115985782359167ffffffffffffffff8311611598576020838186019501011161159857565b1561168657565b608460405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152fd5b156116f757565b608460405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152fd5b803b156117b1576001600160a01b037f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc911673ffffffffffffffffffffffffffffffffffffffff19825416179055565b608460405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b90919015611827575090565b8151156118375750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b82851061187d575050604492506000838284010152601f80199101168101030190fd5b848101820151868601604401529381019385935061185a565b1561189d57565b608460405162461bcd60e51b815260206004820152602660248201527f41646d696e3a6f6e6c7941646d696e2063616c6c6572206973206e6f7420616e60448201527f2041646d696e00000000000000000000000000000000000000000000000000006064820152fd5b337f00000000000000000000000091ac262afccd8ffb74f2211b6bfc108c3e1eb3826001600160a01b0316036119435736601319013560601c90565b3390565b6001600160a01b03168015611996578060005260cb6020526040600020600160ff198254161790557f44d6d25963f097ad14f29f06854a01f575648a1ef82f30e562ccd3889717e339600080a2565b608460405162461bcd60e51b815260206004820152602b60248201527f41646d696e3a61646441646d696e206e657741646d696e20697320746865207a60448201527f65726f20616464726573730000000000000000000000000000000000000000006064820152fd5b15611a0757565b608460405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152fd5b908060209392818452848401376000828201840152601f01601f1916010190565b9035601e198236030181121561159857016020813591019167ffffffffffffffff82116115985781360383136115985756fea2646970667358221220d10a9e9de25d762237624aa47076ee142d5e0315e8bc3e3e6b5fbb453059f49a64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000091ac262afccd8ffb74f2211b6bfc108c3e1eb382
-----Decoded View---------------
Arg [0] : trustedForwarder (address): 0x91AC262AfcCD8fFb74F2211b6BfC108c3e1eb382
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000091ac262afccd8ffb74f2211b6bfc108c3e1eb382
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.