Source Code
Overview
APE Balance
APE Value
$0.00Multichain Info
N/A
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
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:
GoblinnGoodies
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 2000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "../NPC1155CUpgradeable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
interface IGoblinnGoodies {
function mint(address to, uint256[] calldata tokenIds) external;
}
contract GoblinnGoodies is UUPSUpgradeable, NPC1155CUpgradeable {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address internal immutable GOBLINN_WELCOME_PACK_ADDRESS;
address internal _royaltyReceiver;
modifier onlyRoyaltyReceiver() {
require(
msg.sender == _royaltyReceiver,
"Only fee recipient can call this function"
);
_;
}
modifier onlyGoblinnWelcomePack() {
require(
msg.sender == GOBLINN_WELCOME_PACK_ADDRESS,
"Only Goblinn Welcome Pack can call this function"
);
_;
}
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(address goblinWelcomePackAddress) {
GOBLINN_WELCOME_PACK_ADDRESS = goblinWelcomePackAddress;
_disableInitializers();
}
function initialize(address royaltyReceiver_) public initializer {
__NPC1155CUpgradeable_init("https://thegoblinn.com/metadata/goodies/");
_royaltyReceiver = royaltyReceiver_;
}
function name() public pure returns (string memory) {
return "Goblinn Goodies";
}
function symbol() public pure returns (string memory) {
return "GOBGOOD";
}
function contractURI() public pure returns (string memory) {
return "https://www.thegoblinn.com/metadata/goodies/contract.json";
}
function uri(uint256 id) public view override returns (string memory) {
return string(abi.encodePacked(super.uri(0), id, ".json"));
}
// * MINT * //
function mint(
address to,
uint256[] calldata tokenIds
) public onlyGoblinnWelcomePack {
for (uint256 i = 0; i < tokenIds.length; i++) {
_mint(to, tokenIds[i], 1, "");
}
}
// * ADMIN * //
function setRoyaltyReceiver(
address royaltyReceiver_
) public onlyRoyaltyReceiver {
_royaltyReceiver = royaltyReceiver_;
}
// * ROYALTY * //
function royaltyInfo(
uint256,
uint256 salePrice
)
external
view
virtual
override
returns (address receiver, uint256 royaltyAmount)
{
return (_royaltyReceiver, salePrice / 10);
}
// * TRANSFER VALIDATION * //
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory tokenIds,
uint256[] memory amounts,
bytes memory data
) internal override {
if (operator != GOBLINN_WELCOME_PACK_ADDRESS) {
_preValidateTransfer(operator, from, to, tokenIds[0], amounts[0]);
}
super._beforeTokenTransfer(operator, from, to, tokenIds, amounts, data);
}
// * UPGRADE * //
function _authorizeUpgrade(
address newImplementation
) internal override onlyOwner {}
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ICreatorToken {
event TransferValidatorUpdated(address oldValidator, address newValidator);
function getTransferValidator() external view returns (address validator);
function setTransferValidator(address validator) external;
function getTransferValidationFunction() external view returns (bytes4 functionSignature, bool isViewFunction);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ICreatorTokenLegacy {
event TransferValidatorUpdated(address oldValidator, address newValidator);
function getTransferValidator() external view returns (address validator);
function setTransferValidator(address validator) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ITransferValidator {
function applyCollectionTransferPolicy(address caller, address from, address to) external view;
function validateTransfer(address caller, address from, address to) external view;
function validateTransfer(address caller, address from, address to, uint256 tokenId) external view;
function validateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount) external;
function beforeAuthorizedTransfer(address operator, address token, uint256 tokenId) external;
function afterAuthorizedTransfer(address token, uint256 tokenId) external;
function beforeAuthorizedTransfer(address operator, address token) external;
function afterAuthorizedTransfer(address token) external;
function beforeAuthorizedTransfer(address token, uint256 tokenId) external;
function beforeAuthorizedTransferWithAmount(address token, uint256 tokenId, uint256 amount) external;
function afterAuthorizedTransferWithAmount(address token, uint256 tokenId) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ITransferValidatorSetTokenType {
function setTokenTypeOfCollection(address collection, uint16 tokenType) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// 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 (last updated v4.8.3) (interfaces/IERC1967.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
*
* _Available since v4.9._
*/
interface IERC1967Upgradeable {
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Emitted when the beacon is changed.
*/
event BeaconUpgraded(address indexed beacon);
}// 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.8.3) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/IERC1967Upgradeable.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, IERC1967Upgradeable {
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 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 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 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.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "./IERC1155Upgradeable.sol";
import "./IERC1155ReceiverUpgradeable.sol";
import "./extensions/IERC1155MetadataURIUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC1155Upgradeable, IERC1155MetadataURIUpgradeable {
using AddressUpgradeable for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
function __ERC1155_init(string memory uri_) internal onlyInitializing {
__ERC1155_init_unchained(uri_);
}
function __ERC1155_init_unchained(string memory uri_) internal onlyInitializing {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
return
interfaceId == type(IERC1155Upgradeable).interfaceId ||
interfaceId == type(IERC1155MetadataURIUpgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: address zero is not a valid owner");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner or approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not token owner or approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `ids` and `amounts` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155ReceiverUpgradeable(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155ReceiverUpgradeable.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non-ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155ReceiverUpgradeable(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155ReceiverUpgradeable.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non-ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[47] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
import "../IERC1155Upgradeable.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURIUpgradeable is IERC1155Upgradeable {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165Upgradeable.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155ReceiverUpgradeable is IERC165Upgradeable {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// 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 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.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 v4.4.1 (interfaces/IERC1155.sol) pragma solidity ^0.8.0; import "../token/ERC1155/IERC1155.sol";
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/
interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}// 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 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
// 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 Math {
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.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
/**
* @dev String operations.
*/
library Strings {
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 = Math.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, Math.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
pragma solidity ^0.8.4;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@limitbreak/creator-token-standards/src/interfaces/ICreatorToken.sol";
import "@limitbreak/creator-token-standards/src/interfaces/ITransferValidator.sol";
import "@limitbreak/creator-token-standards/src/interfaces/ITransferValidatorSetTokenType.sol";
/**
* @title CreatorTokenBase
* @author Limit Break, Inc.
* @notice CreatorTokenBaseV3 is an abstract contract that provides basic functionality for managing token
* transfer policies through an implementation of ICreatorTokenTransferValidator/ICreatorTokenTransferValidatorV2/ICreatorTokenTransferValidatorV3.
* This contract is intended to be used as a base for creator-specific token contracts, enabling customizable transfer
* restrictions and security policies.
*
* <h4>Features:</h4>
* <ul>Ownable: This contract can have an owner who can set and update the transfer validator.</ul>
* <ul>TransferValidation: Implements the basic token transfer validation interface.</ul>
*
* <h4>Benefits:</h4>
* <ul>Provides a flexible and modular way to implement custom token transfer restrictions and security policies.</ul>
* <ul>Allows creators to enforce policies such as account and codehash blacklists, whitelists, and graylists.</ul>
* <ul>Can be easily integrated into other token contracts as a base contract.</ul>
*
* <h4>Intended Usage:</h4>
* <ul>Use as a base contract for creator token implementations that require advanced transfer restrictions and
* security policies.</ul>
* <ul>Set and update the ICreatorTokenTransferValidator implementation contract to enforce desired policies for the
* creator token.</ul>
*
* <h4>Compatibility:</h4>
* <ul>Backward and Forward Compatible - V1/V2/V3 Creator Token Base will work with V1/V2/V3 Transfer Validators.</ul>
*/
abstract contract CreatorTokenBaseUpgradeable is Initializable, ICreatorToken {
/// @dev Thrown when setting a transfer validator address that has no deployed code.
error CreatorTokenBase__InvalidTransferValidatorContract();
/// @dev The default transfer validator that will be used if no transfer validator has been set by the creator.
address public constant DEFAULT_TRANSFER_VALIDATOR =
address(0x721C002B0059009a671D00aD1700c9748146cd1B);
/// @dev Used to determine if the default transfer validator is applied.
/// @dev Set to true when the creator sets a transfer validator address.
bool private isValidatorInitialized;
/// @dev Address of the transfer validator to apply to transactions.
address private transferValidator;
function __CreatorTokenBaseUpgradeable_init() internal onlyInitializing {
_emitDefaultTransferValidator();
_registerTokenType(DEFAULT_TRANSFER_VALIDATOR);
}
/**
* @notice Sets the transfer validator for the token contract.
*
* @dev Throws when provided validator contract is not the zero address and does not have code.
* @dev Throws when the caller is not the contract owner.
*
* @dev <h4>Postconditions:</h4>
* 1. The transferValidator address is updated.
* 2. The `TransferValidatorUpdated` event is emitted.
*
* @param transferValidator_ The address of the transfer validator contract.
*/
function setTransferValidator(address transferValidator_) public {
_requireCallerIsContractOwner();
bool isValidTransferValidator = transferValidator_.code.length > 0;
if (transferValidator_ != address(0) && !isValidTransferValidator) {
revert CreatorTokenBase__InvalidTransferValidatorContract();
}
emit TransferValidatorUpdated(
address(getTransferValidator()),
transferValidator_
);
isValidatorInitialized = true;
transferValidator = transferValidator_;
if (transferValidator_ != address(0)) {
_registerTokenType(transferValidator_);
}
}
/**
* @notice Returns the transfer validator contract address for this token contract.
*/
function getTransferValidator()
public
view
override
returns (address validator)
{
validator = transferValidator;
if (validator == address(0)) {
if (!isValidatorInitialized) {
validator = DEFAULT_TRANSFER_VALIDATOR;
}
}
if (validator != address(0)) {
uint256 validatorCodeSize;
assembly {
validatorCodeSize := extcodesize(validator)
}
if (validatorCodeSize == 0) {
validator = address(0);
}
}
}
/**
* @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy.
* Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent
* and calling _validateBeforeTransfer so that checks can be properly applied during token transfers.
*
* @dev Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the
* transfer validator is expected to pre-validate the transfer.
*
* @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is
* set to a non-zero address.
*
* @param caller The address of the caller.
* @param from The address of the sender.
* @param to The address of the receiver.
* @param tokenId The token id being transferred.
*/
function _preValidateTransfer(
address caller,
address from,
address to,
uint256 tokenId
) internal virtual {
address validator = getTransferValidator();
if (validator != address(0)) {
if (msg.sender == validator) {
return;
}
ITransferValidator(validator).validateTransfer(
caller,
from,
to,
tokenId
);
}
}
/**
* @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy.
* Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent
* and calling _validateBeforeTransfer so that checks can be properly applied during token transfers.
*
* @dev Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the
* transfer validator is expected to pre-validate the transfer.
*
* @dev Used for ERC20 and ERC1155 token transfers which have an amount value to validate in the transfer validator.
* @dev The `tokenId` for ERC20 tokens should be set to `0`.
*
* @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is
* set to a non-zero address.
*
* @param caller The address of the caller.
* @param from The address of the sender.
* @param to The address of the receiver.
* @param tokenId The token id being transferred.
* @param amount The amount of token being transferred.
*/
function _preValidateTransfer(
address caller,
address from,
address to,
uint256 tokenId,
uint256 amount
) internal virtual {
address validator = getTransferValidator();
if (validator != address(0)) {
if (msg.sender == validator) {
return;
}
ITransferValidator(validator).validateTransfer(
caller,
from,
to,
tokenId,
amount
);
}
}
function _registerTokenType(address validator) internal {
if (validator != address(0)) {
uint256 validatorCodeSize;
assembly {
validatorCodeSize := extcodesize(validator)
}
if (validatorCodeSize > 0) {
try
ITransferValidatorSetTokenType(validator)
.setTokenTypeOfCollection(address(this), _tokenType())
{} catch {}
}
}
}
/**
* @dev Used during contract deployment for constructable and cloneable creator tokens
* @dev to emit the `TransferValidatorUpdated` event signaling the validator for the contract
* @dev is the default transfer validator.
*/
function _emitDefaultTransferValidator() internal {
emit TransferValidatorUpdated(address(0), DEFAULT_TRANSFER_VALIDATOR);
}
function _tokenType() internal pure virtual returns (uint16);
function _requireCallerIsContractOwner() internal view virtual;
uint256[48] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC1155/ERC1155Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "./limitbreak-upgradeable/CreatorTokenBaseUpgradeable.sol";
import "@limitbreak/creator-token-standards/src/interfaces/ICreatorToken.sol";
import "@limitbreak/creator-token-standards/src/interfaces/ICreatorTokenLegacy.sol";
import "@openzeppelin/contracts/interfaces/IERC1155.sol";
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
abstract contract NPC1155CUpgradeable is
OwnableUpgradeable,
ReentrancyGuardUpgradeable,
CreatorTokenBaseUpgradeable,
ERC1155Upgradeable
{
function __NPC1155CUpgradeable_init(string memory uri_) public initializer {
__Ownable_init();
__ReentrancyGuard_init();
__ERC1155_init(uri_);
__CreatorTokenBaseUpgradeable_init();
}
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC1155Upgradeable) returns (bool) {
return
interfaceId == type(IERC2981).interfaceId ||
interfaceId == type(ICreatorToken).interfaceId ||
interfaceId == type(ICreatorTokenLegacy).interfaceId ||
super.supportsInterface(interfaceId);
}
function royaltyInfo(
uint256 tokenId,
uint256 salePrice
) external view virtual returns (address receiver, uint256 royaltyAmount);
function _requireCallerIsContractOwner() internal view virtual override {
_checkOwner();
}
function _tokenType() internal pure override returns (uint16) {
return 1155;
}
function _preValidateTransfer(
address caller,
address from,
address to,
uint256 tokenId,
uint256 amount
) internal virtual override {
address validator = getTransferValidator();
if (validator != address(0)) {
if (msg.sender == validator) {
return;
}
ITransferValidator(validator).validateTransfer(
caller,
from,
to,
tokenId,
amount
);
}
}
function getTransferValidationFunction()
external
pure
override
returns (bytes4 functionSignature, bool isViewFunction)
{
return (
bytes4(
keccak256(
"validateTransfer(address,address,address,uint256,uint256)"
)
),
false
);
}
}{
"viaIR": true,
"optimizer": {
"enabled": true,
"runs": 2000,
"details": {
"yulDetails": {
"optimizerSteps": "u"
}
}
},
"debug": {
"revertStrings": "debug"
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"goblinWelcomePackAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"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":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","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":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DEFAULT_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"uri_","type":"string"}],"name":"__NPC1155CUpgradeable_init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTransferValidationFunction","outputs":[{"internalType":"bytes4","name":"functionSignature","type":"bytes4"},{"internalType":"bool","name":"isViewFunction","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"address","name":"validator","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"royaltyReceiver_","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"royaltyReceiver_","type":"address"}],"name":"setRoyaltyReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","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":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c06040523461004a57610019610014610191565b6101af565b60405161381f61034782396080518181816114550152611735015260a051818181611e070152612d00015261381f90f35b608461005560405190565b62461bcd60e51b815260206004820152602260248201527f45746865722073656e7420746f206e6f6e2d70617961626c652066756e63746960448201526137b760f11b6064820152fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b038211176100d657604052565b61009f565b906100ef6100e860405190565b92836100b5565b565b60846100fc60405190565b62461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f6044820152611c9d60f21b6064820152fd5b6001600160a01b031690565b90565b6001600160a01b0381160361016657565b600080fd5b905051906100ef82610155565b9060208282031261018c576101529161016b565b6100f1565b610152613b66803803806101a4816100db565b928339810190610178565b6101b76101c2565b60a0526100ef6102d7565b6100ef6100ef6100ef6100ef6100ef6100ef6100ef6100ef6100ef6100ef6100ef61020e565b61015290610146906001600160a01b031682565b610152906101e8565b610152906101fc565b61021730610205565b608052565b6101529060081c5b60ff1690565b610152905461021c565b1561023b57565b60405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608490fd5b61015290610224565b6101529054610290565b6102246101526101529260ff1690565b906102c36101526102d3926102a3565b825460ff191660ff919091161790565b9055565b6102f06102eb6102e7600061022a565b1590565b610234565b6102fa6000610299565b60ff9081161061030657565b61031260ff60006102b3565b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249861033c60405190565b60ff8152602090a156fe608060405260043610610e0b5760003560e01c8062fdd58e146101ab57806301463546146101a657806301ffc9a7146101a157806306fdde031461019c578063098144d4146101975780630d705df6146101925780630e89341c1461018d5780632a55205a146101885780632eb2c2d6146101835780633659cfe61461017e5780634e1273f4146101795780634f1ef2861461017457806352d1902d1461016f5780635f5c0ce71461016a578063715018a6146101655780638da5cb5b146101605780638dc251e31461015b57806395d89b4114610156578063a22cb46514610151578063a9fc664e1461014c578063c4d66de814610147578063de836ebd14610142578063e8a3d4851461013d578063e985e9c514610138578063f242432a146101335763f2fde38b03610e0b57610df3565b610dd7565b610d7a565b610d3c565b610d23565b610c2c565b610c14565b610bfb565b610ba8565b610b90565b610b75565b610b5d565b610b45565b610b04565b610af0565b610a92565b610962565b61092d565b6105d0565b610578565b610504565b6104e9565b6104c2565b610428565b6103b4565b610374565b60846101bb60405190565b62461bcd60e51b815260206004820152602260248201527f45746865722073656e7420746f206e6f6e2d70617961626c652066756e63746960448201527f6f6e0000000000000000000000000000000000000000000000000000000000006064820152fd5b608461022b60405190565b62461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f60448201527f72740000000000000000000000000000000000000000000000000000000000006064820152fd5b608461029b60405190565b62461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a20696e76616c6964207475706c65206f66667360448201527f65740000000000000000000000000000000000000000000000000000000000006064820152fd5b6001600160a01b031690565b90565b6001600160a01b0381165b0361032157565b600080fd5b905035906103338261030f565b565b8061031a565b9050359061033382610335565b919060408382031261036b5761030c9060206103648286610326565b940161033b565b610220565b9052565b346103a4576103a061039061038a366004610348565b90610f70565b6040519182918290815260200190565b0390f35b6101b0565b600091031261036b57565b346103a4576103c43660046103a9565b6103a073721c002b0059009a671d00ad1700c9748146cd1b5b604051918291826001600160a01b03909116815260200190565b6001600160e01b0319811661031a565b90503590610333826103f7565b9060208282031261036b5761030c91610407565b346103a4576103a061044361043e366004610414565b610fb7565b6040515b91829182901515815260200190565b60005b8381106104695750506000910152565b8181015183820152602001610459565b61049a6104a36020936104ad9361048e815190565b80835293849260200190565b95869101610456565b601f01601f191690565b0190565b602080825261030c92910190610479565b346103a4576104d23660046103a9565b6103a06104dd6110bc565b604051918291826104b1565b346103a4576104f93660046103a9565b6103a06103dd6110ef565b346103a4576105143660046103a9565b7f1854b241000000000000000000000000000000000000000000000000000000006000906103a061054460405190565b6001600160e01b0319909216825291151560208201529081906040820190565b9060208282031261036b5761030c9161033b565b346103a4576103a06104dd61058e366004610564565b6111f3565b919060408382031261036b5761030c906020610364828661033b565b6001600160a01b0390911681526040810192916103339160200152565b0152565b346103a4576105e96105e3366004610593565b90611283565b906103a06105f660405190565b928392836105af565b608461060a60405190565b62461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201527f72726179206f66667365740000000000000000000000000000000000000000006064820152fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff8211176106a757604052565b61066f565b906103336106b960405190565b9283610685565b67ffffffffffffffff81116106a75760208091020190565b60846106e360405190565b62461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201527f72726179207374726964650000000000000000000000000000000000000000006064820152fd5b9092919261075d610758826106c0565b6106ac565b938185526020808601920283019281841161079a57915b8383106107815750505050565b6020809161078f848661033b565b815201920191610774565b6106d8565b9080601f830112156107ba5781602061030c93359101610748565b6105ff565b60846107ca60405190565b62461bcd60e51b815260206004820152602760248201527f414249206465636f64696e673a20696e76616c6964206279746520617272617960448201527f206c656e677468000000000000000000000000000000000000000000000000006064820152fd5b67ffffffffffffffff81116106a757602090601f01601f19160190565b90826000939282370152565b909291926108686107588261082f565b93818552818301116108825761033391602085019061084c565b6107bf565b9080601f830112156107ba5781602061030c93359101610858565b91909160a08184031261036b576108b98382610326565b926108c78160208401610326565b92604083013567ffffffffffffffff811161092857826108e891850161079f565b92606081013567ffffffffffffffff8111610928578361090991830161079f565b92608082013567ffffffffffffffff81116109285761030c9201610887565b610290565b346103a4576109496109403660046108a2565b93929092611316565b604051005b9060208282031261036b5761030c91610326565b346103a45761094961097536600461094e565b611503565b9092919261098a610758826106c0565b938185526020808601920283019281841161079a57915b8383106109ae5750505050565b602080916109bc8486610326565b8152019201916109a1565b9080601f830112156107ba5781602061030c9335910161097a565b91909160408184031261036b57803567ffffffffffffffff81116109285783610a0c9183016109c7565b92602082013567ffffffffffffffff81116109285761030c920161079f565b90610a4b610a44610a3a845190565b8084529260200190565b9260200190565b9060005b818110610a5c5750505090565b909192610a79610a726001928651815260200190565b9460200190565b929101610a4f565b602080825261030c92910190610a2b565b346103a4576103a0610aae610aa83660046109e2565b906115d6565b60405191829182610a81565b91909160408184031261036b57610ad18382610326565b92602082013567ffffffffffffffff81116109285761030c9201610887565b610949610afe366004610aba565b9061169c565b346103a457610b143660046103a9565b6103a0610390611797565b9060208282031261036b57813567ffffffffffffffff81116109285761030c9201610887565b346103a457610949610b58366004610b1f565b6119d4565b346103a457610b6d3660046103a9565b6109496119fa565b346103a457610b853660046103a9565b6103a06103dd611a02565b346103a457610949610ba336600461094e565b611ad1565b346103a457610bb83660046103a9565b6103a06104dd611b15565b80151561031a565b9050359061033382610bc3565b919060408382031261036b5761030c906020610bf48286610326565b9401610bcb565b346103a457610949610c0e366004610bd8565b90611b1d565b346103a457610949610c2736600461094e565b611b6f565b346103a457610949610c3f36600461094e565b611d79565b6084610c4f60405190565b62461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201527f72726179206c656e6774680000000000000000000000000000000000000000006064820152fd5b909182601f830112156107ba5781359167ffffffffffffffff8311610ce457602001926020830284011161079a57565b610c44565b91909160408184031261036b57610d008382610326565b92602082013567ffffffffffffffff811161092857610d1f9201610cb4565b9091565b346103a457610949610d36366004610ce9565b91611eb3565b346103a457610d4c3660046103a9565b6103a06104dd611f1f565b919060408382031261036b5761030c906020610d738286610326565b9401610326565b346103a4576103a0610443610d90366004610d57565b90611f27565b91909160a08184031261036b57610dad8382610326565b92610dbb8160208401610326565b92610dc9826040850161033b565b92610909836060830161033b565b346103a457610949610dea366004610d96565b93929092611f48565b346103a457610949610e0636600461094e565b612006565b6084610e1660405190565b62461bcd60e51b815260206004820152603560248201527f436f6e747261637420646f6573206e6f7420686176652066616c6c6261636b2060448201527f6e6f7220726563656976652066756e6374696f6e7300000000000000000000006064820152fd5b61030061030c61030c9290565b61030c90610e7b565b15610e9857565b60405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e657200000000000000000000000000000000000000000000606482015280608481015b0390fd5b61030c61030c61030c9290565b90610f1f90610f08565b600052602052604060002090565b61030061030c61030c926001600160a01b031690565b61030c90610f2d565b61030c90610f43565b90610f1f90610f4c565b61030c9081565b61030c9054610f5f565b610fb290610fad61030c93610f83600090565b50610fa5610f946103006000610e88565b6001600160a01b0385161415610e91565b61015e610f15565b610f55565b610f66565b7f2a55205a000000000000000000000000000000000000000000000000000000006001600160e01b031982161490811561103b575b8115611007575b8115610ffd575090565b61030c915061200f565b6001600160e01b031981167fa07d229a00000000000000000000000000000000000000000000000000000000149150610ff3565b6001600160e01b031981167fad0d7f6c00000000000000000000000000000000000000000000000000000000149150610fec565b9061107c6107588361082f565b918252565b61108b600f61106f565b7f476f626c696e6e20476f6f646965730000000000000000000000000000000000602082015290565b61030c611081565b61030c6110b4565b61030c9060081c610300565b61030c90546110c4565b61030c905b60ff1690565b61030c90546110da565b6110f960fb6110d0565b90816111056000610e88565b906111216001600160a01b0383165b916001600160a01b031690565b14611163575b6001600160a01b0381166001600160a01b03841603611144575b50565b823b6111576111536000610f08565b9190565b1461115f5750565b9150565b61117461117060fb6110e5565b1590565b156111275773721c002b0059009a671d00ad1700c9748146cd1b9250611127565b6104ad6111ad926020926111a7815190565b94859290565b93849101610456565b916111c961107c61030c94602094611195565b017f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050190565b61122961030c61030c92611205606090565b506112186112136000610f08565b612184565b6040519384926020840192836111b6565b90810382520382610685565b61030c90610300565b61030c9054611235565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b811561127e570490565b611248565b509061030c61129361019061123e565b9261129e600a610f08565b90611274565b156112ab57565b60405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608490fd5b6103339493929190611346335b6001600160a01b0381166001600160a01b0384161490811561134b575b506112a4565b61233e565b611356915083611f27565b38611340565b1561136357565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608490fd5b156113d557565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608490fd5b610333906114b061145030610f4c565b61148f7f000000000000000000000000000000000000000000000000000000000000000091611488611114846001600160a01b031690565b141561135c565b6114aa61111461149d6124a1565b926001600160a01b031690565b146113ce565b6114dd565b369037565b906103336114d06114ca8461106f565b9361082f565b601f1901602084016114b5565b6000610333916114ec816124c0565b6114fd6114f883610f08565b6114ba565b90612601565b61033390611440565b1561151357565b60405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608490fd5b9061107c610758836106c0565b906103336114d061159b8461157e565b936106c0565b634e487b7160e01b600052603260045260246000fd5b906115c0825190565b8110156115d1576020809102010190565b6115a1565b906115f66115e2835190565b6115f061115361030c855190565b1461150c565b611606611601835190565b61158b565b916116116000610f08565b61161c61030c835190565b811015611670578061166561165861164761163a61166b95876115b7565b516001600160a01b031690565b61038a61165485896115b7565b5190565b61166283886115b7565b52565b60010190565b611611565b50505090565b906103339161168761145030610f4c565b61033391600191611697816124c0565b612601565b9061033391611676565b156116ad57565b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608490fd5b61030c9061176061172830610f4c565b61175a6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016611114565b146116a6565b61178e565b61030c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610f08565b5061030c611765565b61030c6000611718565b61030c9060081c6110df565b61030c90546117a1565b6110df61030c61030c9290565b156117cb57565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608490fd5b9060ff905b9181191691161790565b6110df61030c61030c9260ff1690565b9061186561030c61186c92611845565b8254611836565b9055565b9061ff009060081b61183b565b9061188d61030c61186c92151590565b8254611870565b610370906117b7565b6020810192916103339190611894565b6118f36118bd61117060006117ad565b918280611995575b8015611950575b6118d5906117c4565b826118ea6118e360016117b7565b6000611855565b61193f576119b3565b6118f957565b61190460008061187d565b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249861192e60405190565b8061193a60018261189d565b0390a1565b61194b6001600061187d565b6119b3565b5061196561117061196030610f4c565b61274a565b80156118cc57506118d561197960006110e5565b61198d61198660016117b7565b9160ff1690565b1490506118cc565b506119a060006110e5565b6119ad61198660016117b7565b106118c5565b6119cc906119bf6127eb565b6119c761280b565b61282d565b61033361286b565b610333906118ad565b6119e56128c3565b6103336103336119f56000610e88565b6128e0565b6103336119dd565b61030c609761123e565b15611a1357565b60405162461bcd60e51b815260206004820152602960248201527f4f6e6c792066656520726563697069656e742063616e2063616c6c207468697360448201527f2066756e6374696f6e00000000000000000000000000000000000000000000006064820152608490fd5b61033390611a9a611a9361030061019061123e565b3314611a0c565b611ac5565b906001600160a01b039061183b565b90611abe61030c61186c92610f4c565b8254611a9f565b61033390610190611aae565b61033390611a7e565b611ae4600761106f565b7f474f42474f4f4400000000000000000000000000000000000000000000000000602082015290565b61030c611ada565b61030c611b0d565b6103339190336129a6565b9061186561030c61186c92151590565b9074ffffffffffffffffffffffffffffffffffffffff009060081b61183b565b90611b6861030c61186c92610f4c565b8254611b38565b611b77612a1e565b6000813b611b8761115383610f08565b1190611b9561030082610e88565b6001600160a01b0384161415809281611c55575b50611c2d57507fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac82611bd96110ef565b611c03611be560405190565b928392836001600160a01b0391821681529116602082015260400190565b0390a1611c12600160fb611b28565b611c1d8260fb611b58565b611c245750565b61033390612a26565b7f32483afb000000000000000000000000000000000000000000000000000000008152600490fd5b15905038611ba9565b6118f3611c6e61117060006117ad565b918280611ce3575b8015611caa575b611c86906117c4565b82611c946118e360016117b7565b15611d6257611ca56001600061187d565b611d62565b50611cba61117061196030610f4c565b8015611c7d5750611c86611cce60006110e5565b611cdb61198660016117b7565b149050611c7d565b50611cee60006110e5565b611cfb61198660016117b7565b10611c76565b611d0b602861106f565b7f68747470733a2f2f746865676f626c696e6e2e636f6d2f6d657461646174612f60208201527f676f6f646965732f000000000000000000000000000000000000000000000000604082015290565b61030c611d01565b61033390611d71610b58611d5a565b610190611aae565b61033390611c5e565b15611d8957565b60405162461bcd60e51b815260206004820152603060248201527f4f6e6c7920476f626c696e6e2057656c636f6d65205061636b2063616e20636160448201527f6c6c20746869732066756e6374696f6e000000000000000000000000000000006064820152608490fd5b610333929190611e2e6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163314611d82565b611e5f565b91908110156115d1576020020190565b3561030c81610335565b61030c600061106f565b61030c611e4d565b929190611e6c6000610f08565b82811015611eac5780611665611e8e611e89611ea7948787611e33565b611e43565b611e986001610f08565b611ea0611e57565b9189612b8e565b611e6c565b5050509050565b906103339291611df4565b611ec8603961106f565b7f68747470733a2f2f7777772e746865676f626c696e6e2e636f6d2f6d6574616460208201527f6174612f676f6f646965732f636f6e74726163742e6a736f6e00000000000000604082015290565b61030c611ebe565b61030c611f17565b61030c91610fad611f4392611f3a600090565b5061015f610f55565b6110e5565b6103339493929190611f5933611323565b612c57565b61033390611f6a6128c3565b611fe1565b15611f7657565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608490fd5b610333906119f5611ff56103006000610e88565b6001600160a01b0383161415611f6f565b61033390611f5e565b7fd9b67a26000000000000000000000000000000000000000000000000000000006001600160e01b0319821614908115612058575b811561204e575090565b61030c9150612cc0565b6001600160e01b031981167f0e89341c00000000000000000000000000000000000000000000000000000000149150612044565b634e487b7160e01b600052602260045260246000fd5b90600160028304921680156120c2575b60208310146120bd57565b61208c565b91607f16916120b2565b805460009392916120e96120df836120a2565b8085529360200190565b916001811690811561213b575060011461210257505050565b6121159192939450600052602060002090565b916000925b8184106121275750500190565b80548484015260209093019260010161211a565b92949550505060ff1916825215156020020190565b9061030c916120cc565b906103336121749261216b60405190565b93848092612150565b0383610685565b61030c9061215a565b5061030c61016061217b565b1561219757565b60405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608490fd5b1561220957565b60405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608490fd5b1561227b57565b60405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608490fd5b906000199061183b565b9061230061030c61186c92610f08565b82546122e6565b9190820180921161231457565b61125e565b604080825261030c93919261233091840190610a2b565b916020818403910152610a2b565b93949291909261236361234f835190565b61235d61115361030c875190565b14612190565b6123856123736103006000610e88565b6001600160a01b0386165b1415612202565b3395612395818585888a8c612cf7565b61239f6000610f08565b6123aa61030c855190565b81101561243e5780611665886124336124248a610fad8b6123df611654896123d98f6124399d611654916115b7565b936115b7565b9561241f61015e9161241a61240f8a6123ff610fb285610fad8a8a610f15565b61240b82821015612274565b0390565b91610fad8686610f15565b6122f0565b610f15565b9161242e83610f66565b612307565b906122f0565b61239f565b50939095946103339561245081610f4c565b61245983610f4c565b61246285610f4c565b917f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb61248d60405190565b806124998b8b83612319565b0390a4612e8d565b61030c60006124b161030c611765565b0161123e565b506103336128c3565b610333906124b7565b61030c7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143610f08565b60846124fd60405190565b62461bcd60e51b815260206004820152602560248201527f54617267657420636f6e747261637420646f6573206e6f7420636f6e7461696e60448201527f20636f64650000000000000000000000000000000000000000000000000000006064820152fd5b9050519061033382610335565b9060208282031261036b5761030c91612562565b6040513d6000823e3d90fd5b1561259657565b60405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608490fd5b9190612619600061261361030c6124c9565b016110e5565b156126295750506103339061314f565b61263a61263584610f4c565b610f4c565b803b1561274557602061264c60405190565b7f52d1902d00000000000000000000000000000000000000000000000000000000815291829060049082905afa60009181612714575b506126f3575060405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608490fd5b9261270f6103339461270961115361030c611765565b1461258f565b6130a1565b61273791925060203d60201161273e575b61272f8183610685565b81019061256f565b9038612682565b503d612725565b6124f2565b3b6127586111536000610f08565b1190565b1561276357565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608490fd5b6127e06127db60006117ad565b61275c565b61033361033361318e565b6103336127ce565b6128006127db60006117ad565b6103336103336131c7565b6103336127f3565b610333906128246127db60006117ad565b610333906131e9565b61033390612813565b6128436127db60006117ad565b61033361284e6131f2565b61033373721c002b0059009a671d00ad1700c9748146cd1b612a26565b610333612836565b1561287a57565b60405162461bcd60e51b815280610f04600482016020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6103336128ce611a02565b6128da61111433610300565b14612873565b6129016128fb6128f0609761123e565b612635846097611aae565b91610f4c565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e061292c60405190565b80805b0390a3565b1561293b57565b60405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608490fd5b61292f612a14612a0e7f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31936129f56129e4876001600160a01b031690565b6001600160a01b0383161415612934565b61263587612a0988610fad8561015f610f55565b611b28565b93610f4c565b9361044760405190565b6103336128c3565b600090612a3561030083610e88565b6001600160a01b03821603612a49575b5050565b803b612a5761115384610f08565b11612a60575050565b612635612a6c91610f4c565b90612a7630610f4c565b612a7e613253565b833b1561274557612ac993839283612a9560405190565b809781958294612aa963fb2de5d760e01b90565b84526001600160a01b0316600484015261ffff1660248301526044820190565b03925af19182612adc575b505061033357565b81612afb92903d10612b02575b612af38183610685565b8101906103a9565b3880612ad4565b503d612ae9565b15612b1057565b60405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608490fd5b9081526040810192916103339160200152565b90610333939291612b9f6000610e88565b612bbd6001600160a01b0382166001600160a01b0384161415612b09565b33612bdd86612bcb8661325e565b612bd48861325e565b90868686612cf7565b612bfd612bf084610fad8761015e610f15565b6124338761242e83610f66565b612c0681610f4c565b612c0f83610f4c565b612c1885610f4c565b917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62612c4360405190565b80612c4f8b8b83612b7b565b0390a46132d9565b9061033394939291612c7e612c6f6103006000610e88565b6001600160a01b03841661237e565b33612c8c86612bcb8661325e565b612bfd612bf084610fad8761015e61241f612cb28c6123ff610fb28c610fad8888610f15565b61241a8a610fad8686610f15565b612cf37f01ffc9a7000000000000000000000000000000000000000000000000000000005b916001600160e01b03191690565b1490565b93929450612d2b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690565b6001600160a01b03851603612d42575b5050505050565b612d6d611654612d62611654612d7398612d5c6000610f08565b906115b7565b94612d5c6000610f08565b936133f0565b3880808080612d3b565b90505190610333826103f7565b9060208282031261036b5761030c91612d7d565b9390612de79061030c9694612dda612df595612dca60a08a019460008b01906001600160a01b03169052565b6001600160a01b03166020890152565b8682036040880152610a2b565b908482036060860152610a2b565b916080818403910152610479565b60009060033d11612e1057565b905060046000803e60005160e01c90565b60009060443d106103335760405160043d036004823e8051903d602483011167ffffffffffffffff831117612a455781810191825167ffffffffffffffff8111612e875760043d03830181602086010111612e875761030c939495506020010190610685565b50505050565b939491612e998161274a565b612ea6575b505050505050565b612635612eb291610f4c565b91823b1561274557602094612eff600092612ecc60405190565b988997889687957fbc197c8100000000000000000000000000000000000000000000000000000000875260048701612d9e565b03925af160009181613070575b50612fd757506001612f1c612e03565b6308c379a014612fa2575b612f37575b388080808080612e9e565b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608490fd5b612faa612e21565b80612fb55750612f27565b610f0490612fc260405190565b91829162461bcd60e51b8352600483016104b1565b6130007fbc197c8100000000000000000000000000000000000000000000000000000000612ce5565b14612f2c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608490fd5b61309391925060203d60201161309a575b61308b8183610685565b810190612d8a565b9038612f0c565b503d613081565b916130ab836134bb565b81516130ba6111536000610f08565b119081156130d5575b506130cc575050565b611141916135ea565b9050386130c3565b156130e457565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608490fd5b6103339061316461315f8261274a565b6130dd565b600061317161030c611765565b01611aae565b6131846127db60006117ad565b61033380336128e0565b610333613177565b6131a36127db60006117ad565b6103336131b5565b61030c6001610f08565b6103336131c06131ab565b60c96122f0565b610333613196565b610333906131e06127db60006117ad565b610333906137b3565b610333906131cf565b7fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac61321d6000610e88565b73721c002b0059009a671d00ad1700c9748146cd1b9061193a611be560405190565b61324c61030c61030c9290565b61ffff1690565b61030c61048361323f565b61030c61326e6116016001610f08565b9161166261327c6000610f08565b846115b7565b91936132c561030c96946132be6132cc94976132ae60a088019960008901906001600160a01b03169052565b6001600160a01b03166020870152565b6040850152565b6060830152565b6080818403910152610479565b9394916132e58161274a565b6132f157505050505050565b6126356132fd91610f4c565b91823b156127455760209461334a60009261331760405190565b988997889687957ff23a6e6100000000000000000000000000000000000000000000000000000000875260048701613282565b03925af160009181613390575b5061336757506001612f1c612e03565b6130007ff23a6e6100000000000000000000000000000000000000000000000000000000612ce5565b6133aa91925060203d60201161309a5761308b8183610685565b9038613357565b90959492610333946132c56105cc926133e06080966132ae60a088019c60008901906001600160a01b03169052565b6001600160a01b03166040850152565b9293906133fb6110ef565b6134086103006000610e88565b6001600160a01b0382160361341f57505050505050565b6001600160a01b0381163314612e9e5761263561343b91610f4c565b91823b1561274557600094613487869261345460405190565b988997889687957f1854b241000000000000000000000000000000000000000000000000000000008752600487016133b1565b03925af180156134b6576134a0575b8080808080612e9e565b6134b0906000612af38183610685565b38613496565b612583565b6134c8906126358161314f565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b6134f260405190565b600090a2565b156134ff57565b60405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608490fd5b3d15613584576135793d61106f565b903d6000602084013e565b606090565b613593602761106f565b7f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201527f206661696c656400000000000000000000000000000000000000000000000000604082015290565b61030c613589565b600061030c9281926135fa606090565b5061360c6136078261274a565b6134f8565b602082519201905af461361d61356a565b6136256135e2565b916137bf565b9190600861183b910291613640600019841b90565b921b90565b919061365661030c61186c93610f08565b90835461362b565b61033391600091613645565b818110613675575050565b80613683600060019361365e565b0161366a565b9190601f811161369857505050565b6136aa61033393600052602060002090565b906020601f8401819004830193106136cc575b6020601f90910104019061366a565b90915081906136bd565b906136df815190565b9067ffffffffffffffff82116106a757613703826136fd85546120a2565b85613689565b602090601f831160011461373e5761186c929160009183613733575b5050600019600883021c1916906002021790565b01519050388061371f565b601f1983169161375385600052602060002090565b9260005b81811061379157509160029391856001969410613778575b50505002019055565b01516000196008601f8516021c1916905538808061376f565b91936020600181928787015181550195019201613757565b90610333916136d6565b610333906101606137a9565b909190156137cb575090565b81516137da6111536000610f08565b1115612fb55750805190602001fdfea26469706673582212209e3be986a6d7e67824d167f694881c520a09ffeb4c225c0768b731ffa7fbcf2f64736f6c634300081c00330000000000000000000000008b05241dc25a9f64dcf2dde4f68b4c31ea1d2c9f
Deployed Bytecode
0x608060405260043610610e0b5760003560e01c8062fdd58e146101ab57806301463546146101a657806301ffc9a7146101a157806306fdde031461019c578063098144d4146101975780630d705df6146101925780630e89341c1461018d5780632a55205a146101885780632eb2c2d6146101835780633659cfe61461017e5780634e1273f4146101795780634f1ef2861461017457806352d1902d1461016f5780635f5c0ce71461016a578063715018a6146101655780638da5cb5b146101605780638dc251e31461015b57806395d89b4114610156578063a22cb46514610151578063a9fc664e1461014c578063c4d66de814610147578063de836ebd14610142578063e8a3d4851461013d578063e985e9c514610138578063f242432a146101335763f2fde38b03610e0b57610df3565b610dd7565b610d7a565b610d3c565b610d23565b610c2c565b610c14565b610bfb565b610ba8565b610b90565b610b75565b610b5d565b610b45565b610b04565b610af0565b610a92565b610962565b61092d565b6105d0565b610578565b610504565b6104e9565b6104c2565b610428565b6103b4565b610374565b60846101bb60405190565b62461bcd60e51b815260206004820152602260248201527f45746865722073656e7420746f206e6f6e2d70617961626c652066756e63746960448201527f6f6e0000000000000000000000000000000000000000000000000000000000006064820152fd5b608461022b60405190565b62461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a207475706c65206461746120746f6f2073686f60448201527f72740000000000000000000000000000000000000000000000000000000000006064820152fd5b608461029b60405190565b62461bcd60e51b815260206004820152602260248201527f414249206465636f64696e673a20696e76616c6964207475706c65206f66667360448201527f65740000000000000000000000000000000000000000000000000000000000006064820152fd5b6001600160a01b031690565b90565b6001600160a01b0381165b0361032157565b600080fd5b905035906103338261030f565b565b8061031a565b9050359061033382610335565b919060408382031261036b5761030c9060206103648286610326565b940161033b565b610220565b9052565b346103a4576103a061039061038a366004610348565b90610f70565b6040519182918290815260200190565b0390f35b6101b0565b600091031261036b57565b346103a4576103c43660046103a9565b6103a073721c002b0059009a671d00ad1700c9748146cd1b5b604051918291826001600160a01b03909116815260200190565b6001600160e01b0319811661031a565b90503590610333826103f7565b9060208282031261036b5761030c91610407565b346103a4576103a061044361043e366004610414565b610fb7565b6040515b91829182901515815260200190565b60005b8381106104695750506000910152565b8181015183820152602001610459565b61049a6104a36020936104ad9361048e815190565b80835293849260200190565b95869101610456565b601f01601f191690565b0190565b602080825261030c92910190610479565b346103a4576104d23660046103a9565b6103a06104dd6110bc565b604051918291826104b1565b346103a4576104f93660046103a9565b6103a06103dd6110ef565b346103a4576105143660046103a9565b7f1854b241000000000000000000000000000000000000000000000000000000006000906103a061054460405190565b6001600160e01b0319909216825291151560208201529081906040820190565b9060208282031261036b5761030c9161033b565b346103a4576103a06104dd61058e366004610564565b6111f3565b919060408382031261036b5761030c906020610364828661033b565b6001600160a01b0390911681526040810192916103339160200152565b0152565b346103a4576105e96105e3366004610593565b90611283565b906103a06105f660405190565b928392836105af565b608461060a60405190565b62461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201527f72726179206f66667365740000000000000000000000000000000000000000006064820152fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff8211176106a757604052565b61066f565b906103336106b960405190565b9283610685565b67ffffffffffffffff81116106a75760208091020190565b60846106e360405190565b62461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201527f72726179207374726964650000000000000000000000000000000000000000006064820152fd5b9092919261075d610758826106c0565b6106ac565b938185526020808601920283019281841161079a57915b8383106107815750505050565b6020809161078f848661033b565b815201920191610774565b6106d8565b9080601f830112156107ba5781602061030c93359101610748565b6105ff565b60846107ca60405190565b62461bcd60e51b815260206004820152602760248201527f414249206465636f64696e673a20696e76616c6964206279746520617272617960448201527f206c656e677468000000000000000000000000000000000000000000000000006064820152fd5b67ffffffffffffffff81116106a757602090601f01601f19160190565b90826000939282370152565b909291926108686107588261082f565b93818552818301116108825761033391602085019061084c565b6107bf565b9080601f830112156107ba5781602061030c93359101610858565b91909160a08184031261036b576108b98382610326565b926108c78160208401610326565b92604083013567ffffffffffffffff811161092857826108e891850161079f565b92606081013567ffffffffffffffff8111610928578361090991830161079f565b92608082013567ffffffffffffffff81116109285761030c9201610887565b610290565b346103a4576109496109403660046108a2565b93929092611316565b604051005b9060208282031261036b5761030c91610326565b346103a45761094961097536600461094e565b611503565b9092919261098a610758826106c0565b938185526020808601920283019281841161079a57915b8383106109ae5750505050565b602080916109bc8486610326565b8152019201916109a1565b9080601f830112156107ba5781602061030c9335910161097a565b91909160408184031261036b57803567ffffffffffffffff81116109285783610a0c9183016109c7565b92602082013567ffffffffffffffff81116109285761030c920161079f565b90610a4b610a44610a3a845190565b8084529260200190565b9260200190565b9060005b818110610a5c5750505090565b909192610a79610a726001928651815260200190565b9460200190565b929101610a4f565b602080825261030c92910190610a2b565b346103a4576103a0610aae610aa83660046109e2565b906115d6565b60405191829182610a81565b91909160408184031261036b57610ad18382610326565b92602082013567ffffffffffffffff81116109285761030c9201610887565b610949610afe366004610aba565b9061169c565b346103a457610b143660046103a9565b6103a0610390611797565b9060208282031261036b57813567ffffffffffffffff81116109285761030c9201610887565b346103a457610949610b58366004610b1f565b6119d4565b346103a457610b6d3660046103a9565b6109496119fa565b346103a457610b853660046103a9565b6103a06103dd611a02565b346103a457610949610ba336600461094e565b611ad1565b346103a457610bb83660046103a9565b6103a06104dd611b15565b80151561031a565b9050359061033382610bc3565b919060408382031261036b5761030c906020610bf48286610326565b9401610bcb565b346103a457610949610c0e366004610bd8565b90611b1d565b346103a457610949610c2736600461094e565b611b6f565b346103a457610949610c3f36600461094e565b611d79565b6084610c4f60405190565b62461bcd60e51b815260206004820152602b60248201527f414249206465636f64696e673a20696e76616c69642063616c6c64617461206160448201527f72726179206c656e6774680000000000000000000000000000000000000000006064820152fd5b909182601f830112156107ba5781359167ffffffffffffffff8311610ce457602001926020830284011161079a57565b610c44565b91909160408184031261036b57610d008382610326565b92602082013567ffffffffffffffff811161092857610d1f9201610cb4565b9091565b346103a457610949610d36366004610ce9565b91611eb3565b346103a457610d4c3660046103a9565b6103a06104dd611f1f565b919060408382031261036b5761030c906020610d738286610326565b9401610326565b346103a4576103a0610443610d90366004610d57565b90611f27565b91909160a08184031261036b57610dad8382610326565b92610dbb8160208401610326565b92610dc9826040850161033b565b92610909836060830161033b565b346103a457610949610dea366004610d96565b93929092611f48565b346103a457610949610e0636600461094e565b612006565b6084610e1660405190565b62461bcd60e51b815260206004820152603560248201527f436f6e747261637420646f6573206e6f7420686176652066616c6c6261636b2060448201527f6e6f7220726563656976652066756e6374696f6e7300000000000000000000006064820152fd5b61030061030c61030c9290565b61030c90610e7b565b15610e9857565b60405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201527f616c6964206f776e657200000000000000000000000000000000000000000000606482015280608481015b0390fd5b61030c61030c61030c9290565b90610f1f90610f08565b600052602052604060002090565b61030061030c61030c926001600160a01b031690565b61030c90610f2d565b61030c90610f43565b90610f1f90610f4c565b61030c9081565b61030c9054610f5f565b610fb290610fad61030c93610f83600090565b50610fa5610f946103006000610e88565b6001600160a01b0385161415610e91565b61015e610f15565b610f55565b610f66565b7f2a55205a000000000000000000000000000000000000000000000000000000006001600160e01b031982161490811561103b575b8115611007575b8115610ffd575090565b61030c915061200f565b6001600160e01b031981167fa07d229a00000000000000000000000000000000000000000000000000000000149150610ff3565b6001600160e01b031981167fad0d7f6c00000000000000000000000000000000000000000000000000000000149150610fec565b9061107c6107588361082f565b918252565b61108b600f61106f565b7f476f626c696e6e20476f6f646965730000000000000000000000000000000000602082015290565b61030c611081565b61030c6110b4565b61030c9060081c610300565b61030c90546110c4565b61030c905b60ff1690565b61030c90546110da565b6110f960fb6110d0565b90816111056000610e88565b906111216001600160a01b0383165b916001600160a01b031690565b14611163575b6001600160a01b0381166001600160a01b03841603611144575b50565b823b6111576111536000610f08565b9190565b1461115f5750565b9150565b61117461117060fb6110e5565b1590565b156111275773721c002b0059009a671d00ad1700c9748146cd1b9250611127565b6104ad6111ad926020926111a7815190565b94859290565b93849101610456565b916111c961107c61030c94602094611195565b017f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050190565b61122961030c61030c92611205606090565b506112186112136000610f08565b612184565b6040519384926020840192836111b6565b90810382520382610685565b61030c90610300565b61030c9054611235565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b811561127e570490565b611248565b509061030c61129361019061123e565b9261129e600a610f08565b90611274565b156112ab57565b60405162461bcd60e51b815260206004820152602e60248201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60448201527f6572206f7220617070726f7665640000000000000000000000000000000000006064820152608490fd5b6103339493929190611346335b6001600160a01b0381166001600160a01b0384161490811561134b575b506112a4565b61233e565b611356915083611f27565b38611340565b1561136357565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608490fd5b156113d557565b60405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608490fd5b610333906114b061145030610f4c565b61148f7f00000000000000000000000089d232e37027e9941a0bed366c16f82097ea475391611488611114846001600160a01b031690565b141561135c565b6114aa61111461149d6124a1565b926001600160a01b031690565b146113ce565b6114dd565b369037565b906103336114d06114ca8461106f565b9361082f565b601f1901602084016114b5565b6000610333916114ec816124c0565b6114fd6114f883610f08565b6114ba565b90612601565b61033390611440565b1561151357565b60405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608490fd5b9061107c610758836106c0565b906103336114d061159b8461157e565b936106c0565b634e487b7160e01b600052603260045260246000fd5b906115c0825190565b8110156115d1576020809102010190565b6115a1565b906115f66115e2835190565b6115f061115361030c855190565b1461150c565b611606611601835190565b61158b565b916116116000610f08565b61161c61030c835190565b811015611670578061166561165861164761163a61166b95876115b7565b516001600160a01b031690565b61038a61165485896115b7565b5190565b61166283886115b7565b52565b60010190565b611611565b50505090565b906103339161168761145030610f4c565b61033391600191611697816124c0565b612601565b9061033391611676565b156116ad57565b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608490fd5b61030c9061176061172830610f4c565b61175a6001600160a01b037f00000000000000000000000089d232e37027e9941a0bed366c16f82097ea475316611114565b146116a6565b61178e565b61030c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610f08565b5061030c611765565b61030c6000611718565b61030c9060081c6110df565b61030c90546117a1565b6110df61030c61030c9290565b156117cb57565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608490fd5b9060ff905b9181191691161790565b6110df61030c61030c9260ff1690565b9061186561030c61186c92611845565b8254611836565b9055565b9061ff009060081b61183b565b9061188d61030c61186c92151590565b8254611870565b610370906117b7565b6020810192916103339190611894565b6118f36118bd61117060006117ad565b918280611995575b8015611950575b6118d5906117c4565b826118ea6118e360016117b7565b6000611855565b61193f576119b3565b6118f957565b61190460008061187d565b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249861192e60405190565b8061193a60018261189d565b0390a1565b61194b6001600061187d565b6119b3565b5061196561117061196030610f4c565b61274a565b80156118cc57506118d561197960006110e5565b61198d61198660016117b7565b9160ff1690565b1490506118cc565b506119a060006110e5565b6119ad61198660016117b7565b106118c5565b6119cc906119bf6127eb565b6119c761280b565b61282d565b61033361286b565b610333906118ad565b6119e56128c3565b6103336103336119f56000610e88565b6128e0565b6103336119dd565b61030c609761123e565b15611a1357565b60405162461bcd60e51b815260206004820152602960248201527f4f6e6c792066656520726563697069656e742063616e2063616c6c207468697360448201527f2066756e6374696f6e00000000000000000000000000000000000000000000006064820152608490fd5b61033390611a9a611a9361030061019061123e565b3314611a0c565b611ac5565b906001600160a01b039061183b565b90611abe61030c61186c92610f4c565b8254611a9f565b61033390610190611aae565b61033390611a7e565b611ae4600761106f565b7f474f42474f4f4400000000000000000000000000000000000000000000000000602082015290565b61030c611ada565b61030c611b0d565b6103339190336129a6565b9061186561030c61186c92151590565b9074ffffffffffffffffffffffffffffffffffffffff009060081b61183b565b90611b6861030c61186c92610f4c565b8254611b38565b611b77612a1e565b6000813b611b8761115383610f08565b1190611b9561030082610e88565b6001600160a01b0384161415809281611c55575b50611c2d57507fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac82611bd96110ef565b611c03611be560405190565b928392836001600160a01b0391821681529116602082015260400190565b0390a1611c12600160fb611b28565b611c1d8260fb611b58565b611c245750565b61033390612a26565b7f32483afb000000000000000000000000000000000000000000000000000000008152600490fd5b15905038611ba9565b6118f3611c6e61117060006117ad565b918280611ce3575b8015611caa575b611c86906117c4565b82611c946118e360016117b7565b15611d6257611ca56001600061187d565b611d62565b50611cba61117061196030610f4c565b8015611c7d5750611c86611cce60006110e5565b611cdb61198660016117b7565b149050611c7d565b50611cee60006110e5565b611cfb61198660016117b7565b10611c76565b611d0b602861106f565b7f68747470733a2f2f746865676f626c696e6e2e636f6d2f6d657461646174612f60208201527f676f6f646965732f000000000000000000000000000000000000000000000000604082015290565b61030c611d01565b61033390611d71610b58611d5a565b610190611aae565b61033390611c5e565b15611d8957565b60405162461bcd60e51b815260206004820152603060248201527f4f6e6c7920476f626c696e6e2057656c636f6d65205061636b2063616e20636160448201527f6c6c20746869732066756e6374696f6e000000000000000000000000000000006064820152608490fd5b610333929190611e2e6001600160a01b037f0000000000000000000000008b05241dc25a9f64dcf2dde4f68b4c31ea1d2c9f163314611d82565b611e5f565b91908110156115d1576020020190565b3561030c81610335565b61030c600061106f565b61030c611e4d565b929190611e6c6000610f08565b82811015611eac5780611665611e8e611e89611ea7948787611e33565b611e43565b611e986001610f08565b611ea0611e57565b9189612b8e565b611e6c565b5050509050565b906103339291611df4565b611ec8603961106f565b7f68747470733a2f2f7777772e746865676f626c696e6e2e636f6d2f6d6574616460208201527f6174612f676f6f646965732f636f6e74726163742e6a736f6e00000000000000604082015290565b61030c611ebe565b61030c611f17565b61030c91610fad611f4392611f3a600090565b5061015f610f55565b6110e5565b6103339493929190611f5933611323565b612c57565b61033390611f6a6128c3565b611fe1565b15611f7657565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608490fd5b610333906119f5611ff56103006000610e88565b6001600160a01b0383161415611f6f565b61033390611f5e565b7fd9b67a26000000000000000000000000000000000000000000000000000000006001600160e01b0319821614908115612058575b811561204e575090565b61030c9150612cc0565b6001600160e01b031981167f0e89341c00000000000000000000000000000000000000000000000000000000149150612044565b634e487b7160e01b600052602260045260246000fd5b90600160028304921680156120c2575b60208310146120bd57565b61208c565b91607f16916120b2565b805460009392916120e96120df836120a2565b8085529360200190565b916001811690811561213b575060011461210257505050565b6121159192939450600052602060002090565b916000925b8184106121275750500190565b80548484015260209093019260010161211a565b92949550505060ff1916825215156020020190565b9061030c916120cc565b906103336121749261216b60405190565b93848092612150565b0383610685565b61030c9061215a565b5061030c61016061217b565b1561219757565b60405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608490fd5b1561220957565b60405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608490fd5b1561227b57565b60405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608490fd5b906000199061183b565b9061230061030c61186c92610f08565b82546122e6565b9190820180921161231457565b61125e565b604080825261030c93919261233091840190610a2b565b916020818403910152610a2b565b93949291909261236361234f835190565b61235d61115361030c875190565b14612190565b6123856123736103006000610e88565b6001600160a01b0386165b1415612202565b3395612395818585888a8c612cf7565b61239f6000610f08565b6123aa61030c855190565b81101561243e5780611665886124336124248a610fad8b6123df611654896123d98f6124399d611654916115b7565b936115b7565b9561241f61015e9161241a61240f8a6123ff610fb285610fad8a8a610f15565b61240b82821015612274565b0390565b91610fad8686610f15565b6122f0565b610f15565b9161242e83610f66565b612307565b906122f0565b61239f565b50939095946103339561245081610f4c565b61245983610f4c565b61246285610f4c565b917f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb61248d60405190565b806124998b8b83612319565b0390a4612e8d565b61030c60006124b161030c611765565b0161123e565b506103336128c3565b610333906124b7565b61030c7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143610f08565b60846124fd60405190565b62461bcd60e51b815260206004820152602560248201527f54617267657420636f6e747261637420646f6573206e6f7420636f6e7461696e60448201527f20636f64650000000000000000000000000000000000000000000000000000006064820152fd5b9050519061033382610335565b9060208282031261036b5761030c91612562565b6040513d6000823e3d90fd5b1561259657565b60405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608490fd5b9190612619600061261361030c6124c9565b016110e5565b156126295750506103339061314f565b61263a61263584610f4c565b610f4c565b803b1561274557602061264c60405190565b7f52d1902d00000000000000000000000000000000000000000000000000000000815291829060049082905afa60009181612714575b506126f3575060405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608490fd5b9261270f6103339461270961115361030c611765565b1461258f565b6130a1565b61273791925060203d60201161273e575b61272f8183610685565b81019061256f565b9038612682565b503d612725565b6124f2565b3b6127586111536000610f08565b1190565b1561276357565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608490fd5b6127e06127db60006117ad565b61275c565b61033361033361318e565b6103336127ce565b6128006127db60006117ad565b6103336103336131c7565b6103336127f3565b610333906128246127db60006117ad565b610333906131e9565b61033390612813565b6128436127db60006117ad565b61033361284e6131f2565b61033373721c002b0059009a671d00ad1700c9748146cd1b612a26565b610333612836565b1561287a57565b60405162461bcd60e51b815280610f04600482016020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6103336128ce611a02565b6128da61111433610300565b14612873565b6129016128fb6128f0609761123e565b612635846097611aae565b91610f4c565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e061292c60405190565b80805b0390a3565b1561293b57565b60405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608490fd5b61292f612a14612a0e7f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31936129f56129e4876001600160a01b031690565b6001600160a01b0383161415612934565b61263587612a0988610fad8561015f610f55565b611b28565b93610f4c565b9361044760405190565b6103336128c3565b600090612a3561030083610e88565b6001600160a01b03821603612a49575b5050565b803b612a5761115384610f08565b11612a60575050565b612635612a6c91610f4c565b90612a7630610f4c565b612a7e613253565b833b1561274557612ac993839283612a9560405190565b809781958294612aa963fb2de5d760e01b90565b84526001600160a01b0316600484015261ffff1660248301526044820190565b03925af19182612adc575b505061033357565b81612afb92903d10612b02575b612af38183610685565b8101906103a9565b3880612ad4565b503d612ae9565b15612b1057565b60405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608490fd5b9081526040810192916103339160200152565b90610333939291612b9f6000610e88565b612bbd6001600160a01b0382166001600160a01b0384161415612b09565b33612bdd86612bcb8661325e565b612bd48861325e565b90868686612cf7565b612bfd612bf084610fad8761015e610f15565b6124338761242e83610f66565b612c0681610f4c565b612c0f83610f4c565b612c1885610f4c565b917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62612c4360405190565b80612c4f8b8b83612b7b565b0390a46132d9565b9061033394939291612c7e612c6f6103006000610e88565b6001600160a01b03841661237e565b33612c8c86612bcb8661325e565b612bfd612bf084610fad8761015e61241f612cb28c6123ff610fb28c610fad8888610f15565b61241a8a610fad8686610f15565b612cf37f01ffc9a7000000000000000000000000000000000000000000000000000000005b916001600160e01b03191690565b1490565b93929450612d2b7f0000000000000000000000008b05241dc25a9f64dcf2dde4f68b4c31ea1d2c9f6001600160a01b031690565b6001600160a01b03851603612d42575b5050505050565b612d6d611654612d62611654612d7398612d5c6000610f08565b906115b7565b94612d5c6000610f08565b936133f0565b3880808080612d3b565b90505190610333826103f7565b9060208282031261036b5761030c91612d7d565b9390612de79061030c9694612dda612df595612dca60a08a019460008b01906001600160a01b03169052565b6001600160a01b03166020890152565b8682036040880152610a2b565b908482036060860152610a2b565b916080818403910152610479565b60009060033d11612e1057565b905060046000803e60005160e01c90565b60009060443d106103335760405160043d036004823e8051903d602483011167ffffffffffffffff831117612a455781810191825167ffffffffffffffff8111612e875760043d03830181602086010111612e875761030c939495506020010190610685565b50505050565b939491612e998161274a565b612ea6575b505050505050565b612635612eb291610f4c565b91823b1561274557602094612eff600092612ecc60405190565b988997889687957fbc197c8100000000000000000000000000000000000000000000000000000000875260048701612d9e565b03925af160009181613070575b50612fd757506001612f1c612e03565b6308c379a014612fa2575b612f37575b388080808080612e9e565b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608490fd5b612faa612e21565b80612fb55750612f27565b610f0490612fc260405190565b91829162461bcd60e51b8352600483016104b1565b6130007fbc197c8100000000000000000000000000000000000000000000000000000000612ce5565b14612f2c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608490fd5b61309391925060203d60201161309a575b61308b8183610685565b810190612d8a565b9038612f0c565b503d613081565b916130ab836134bb565b81516130ba6111536000610f08565b119081156130d5575b506130cc575050565b611141916135ea565b9050386130c3565b156130e457565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608490fd5b6103339061316461315f8261274a565b6130dd565b600061317161030c611765565b01611aae565b6131846127db60006117ad565b61033380336128e0565b610333613177565b6131a36127db60006117ad565b6103336131b5565b61030c6001610f08565b6103336131c06131ab565b60c96122f0565b610333613196565b610333906131e06127db60006117ad565b610333906137b3565b610333906131cf565b7fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac61321d6000610e88565b73721c002b0059009a671d00ad1700c9748146cd1b9061193a611be560405190565b61324c61030c61030c9290565b61ffff1690565b61030c61048361323f565b61030c61326e6116016001610f08565b9161166261327c6000610f08565b846115b7565b91936132c561030c96946132be6132cc94976132ae60a088019960008901906001600160a01b03169052565b6001600160a01b03166020870152565b6040850152565b6060830152565b6080818403910152610479565b9394916132e58161274a565b6132f157505050505050565b6126356132fd91610f4c565b91823b156127455760209461334a60009261331760405190565b988997889687957ff23a6e6100000000000000000000000000000000000000000000000000000000875260048701613282565b03925af160009181613390575b5061336757506001612f1c612e03565b6130007ff23a6e6100000000000000000000000000000000000000000000000000000000612ce5565b6133aa91925060203d60201161309a5761308b8183610685565b9038613357565b90959492610333946132c56105cc926133e06080966132ae60a088019c60008901906001600160a01b03169052565b6001600160a01b03166040850152565b9293906133fb6110ef565b6134086103006000610e88565b6001600160a01b0382160361341f57505050505050565b6001600160a01b0381163314612e9e5761263561343b91610f4c565b91823b1561274557600094613487869261345460405190565b988997889687957f1854b241000000000000000000000000000000000000000000000000000000008752600487016133b1565b03925af180156134b6576134a0575b8080808080612e9e565b6134b0906000612af38183610685565b38613496565b612583565b6134c8906126358161314f565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b6134f260405190565b600090a2565b156134ff57565b60405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608490fd5b3d15613584576135793d61106f565b903d6000602084013e565b606090565b613593602761106f565b7f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201527f206661696c656400000000000000000000000000000000000000000000000000604082015290565b61030c613589565b600061030c9281926135fa606090565b5061360c6136078261274a565b6134f8565b602082519201905af461361d61356a565b6136256135e2565b916137bf565b9190600861183b910291613640600019841b90565b921b90565b919061365661030c61186c93610f08565b90835461362b565b61033391600091613645565b818110613675575050565b80613683600060019361365e565b0161366a565b9190601f811161369857505050565b6136aa61033393600052602060002090565b906020601f8401819004830193106136cc575b6020601f90910104019061366a565b90915081906136bd565b906136df815190565b9067ffffffffffffffff82116106a757613703826136fd85546120a2565b85613689565b602090601f831160011461373e5761186c929160009183613733575b5050600019600883021c1916906002021790565b01519050388061371f565b601f1983169161375385600052602060002090565b9260005b81811061379157509160029391856001969410613778575b50505002019055565b01516000196008601f8516021c1916905538808061376f565b91936020600181928787015181550195019201613757565b90610333916136d6565b610333906101606137a9565b909190156137cb575090565b81516137da6111536000610f08565b1115612fb55750805190602001fdfea26469706673582212209e3be986a6d7e67824d167f694881c520a09ffeb4c225c0768b731ffa7fbcf2f64736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008b05241dc25a9f64dcf2dde4f68b4c31ea1d2c9f
-----Decoded View---------------
Arg [0] : goblinWelcomePackAddress (address): 0x8B05241Dc25a9F64DcF2DdE4f68B4C31EA1d2C9F
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000008b05241dc25a9f64dcf2dde4f68b4c31ea1d2c9f
Loading...
Loading
Loading...
Loading
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.