Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
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:
TablelandTables
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 9999999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.10 <0.9.0;
import {ERC721AUpgradeable} from "erc721a-upgradeable/contracts/ERC721AUpgradeable.sol";
import {ERC721AQueryableUpgradeable} from "erc721a-upgradeable/contracts/extensions/ERC721AQueryableUpgradeable.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {ITablelandTables} from "./interfaces/ITablelandTables.sol";
import {ITablelandController} from "./interfaces/ITablelandController.sol";
import {TablelandPolicy} from "./TablelandPolicy.sol";
/**
* @dev Implementation of {ITablelandTables}.
*/
contract TablelandTables is
ITablelandTables,
ERC721AUpgradeable,
ERC721AQueryableUpgradeable,
OwnableUpgradeable,
PausableUpgradeable,
ReentrancyGuardUpgradeable,
UUPSUpgradeable
{
// A URI used to reference off-chain table metadata.
string internal _baseURIString;
// A mapping of table ids to table controller addresses.
mapping(uint256 => address) internal _controllers;
// A mapping of table controller addresses to lock status.
mapping(uint256 => bool) internal _locks;
// The maximum size allowed for a query.
uint256 internal constant QUERY_MAX_SIZE = 35001;
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(
string memory baseURI
) public initializerERC721A initializer {
__ERC721A_init("Tableland Tables", "TABLE");
__ERC721AQueryable_init();
__Ownable_init();
__Pausable_init();
__ReentrancyGuard_init();
__UUPSUpgradeable_init();
_baseURIString = baseURI;
}
/**
* @custom:deprecated
* This function is deprecated, please use `create`.
*/
function createTable(
address owner,
string calldata statement
) external payable whenNotPaused returns (uint256) {
return _create(owner, statement);
}
/**
* @dev See {ITablelandTables-create}.
*/
function create(
address owner,
string calldata statement
) external payable override whenNotPaused returns (uint256) {
return _create(owner, statement);
}
/**
* @dev See {ITablelandTables-create}.
*/
function create(
address owner,
string[] calldata statements
) external payable override whenNotPaused returns (uint256[] memory) {
uint256 statementsLength = statements.length;
if (statementsLength < 1) revert Unauthorized();
uint256[] memory tableIds = new uint256[](statementsLength);
for (uint256 i; i < statementsLength; ) {
tableIds[i] = _create(owner, statements[i]);
unchecked {
++i;
}
}
return tableIds;
}
/**
* @custom:depreciated See {ITablelandTables-runSQL}.
* This function is deprecated, please use `mutate`.
*/
function runSQL(
address caller,
uint256 tableId,
string calldata statement
) external payable whenNotPaused nonReentrant {
_mutate(caller, tableId, statement);
}
/**
* @dev See {ITablelandTables-mutate}.
*/
function mutate(
address caller,
uint256 tableId,
string calldata statement
) external payable override whenNotPaused nonReentrant {
_mutate(caller, tableId, statement);
}
/**
* @dev See {ITablelandTables-mutate}.
*/
function mutate(
address caller,
ITablelandTables.Statement[] calldata statements
) external payable override whenNotPaused nonReentrant {
uint256 statementsLength = statements.length;
for (uint256 i; i < statementsLength; ) {
_mutate(caller, statements[i].tableId, statements[i].statement);
unchecked {
++i;
}
}
}
function _create(
address owner,
string calldata statement
) private returns (uint256 tableId) {
tableId = _nextTokenId();
_safeMint(owner, 1);
emit CreateTable(owner, tableId, statement);
return tableId;
}
function _mutate(
address caller,
uint256 tableId,
string calldata statement
) private {
if (!_exists(tableId) || caller != _msgSenderERC721A())
revert Unauthorized();
uint256 querySize = bytes(statement).length;
if (querySize >= QUERY_MAX_SIZE)
revert MaxQuerySizeExceeded(querySize, QUERY_MAX_SIZE);
emit RunSQL(
caller,
ownerOf(tableId) == caller,
tableId,
statement,
_getPolicy(caller, tableId)
);
}
/**
* @dev Returns an {TablelandPolicy} for `caller` and `tableId`.
*
* An allow-all policy is returned if the table's controller does not exist.
*
* Requirements:
*
* - if the controller is an EOA, caller must be controller
* - if the controller is a contract address, it must implement {ITablelandController}
*/
function _getPolicy(
address caller,
uint256 tableId
) private returns (TablelandPolicy memory) {
address controller = _controllers[tableId];
if (_isContract(controller)) {
// Try {ITablelandController.getPolicy(address, uint256)}.
try
ITablelandController(controller).getPolicy{value: msg.value}(
caller,
tableId
)
returns (TablelandPolicy memory policy) {
return policy;
} catch Error(string memory reason) {
// Controller reverted/required with a reason string. Bubble up the error.
revert(reason);
} catch (bytes memory err) {
// We are here for one of two reasons:
// 1. The controller does not implement {ITablelandController.getPolicy(address, uint256)}.
// 2. The controller reverted w/o a reason string, e.g, a custom error, revert(), or require(condition).
// We can't differentiate between reverting/requiring w/o a reason string and not implemented.
// When a controller reverts/requires w/o a reason string it will be treated as not implemented,
// i.e., we will try to call {ITablelandController.getPolicy(address)}.
// Controller reverted with a custom error. Bubble it up.
if (err.length > 0) {
// solhint-disable-next-line no-inline-assembly
assembly {
revert(add(32, err), mload(err))
}
}
}
// If the controller reverted w/o a reason string, the following _could_ result in the caller
// seeing a different error.
// Try {ITablelandController.getPolicy(address)}.
return
ITablelandController(controller).getPolicy{value: msg.value}(
caller
);
}
if (!(controller == address(0) || controller == caller))
revert Unauthorized();
return
TablelandPolicy({
allowInsert: true,
allowUpdate: true,
allowDelete: true,
whereClause: "",
withCheck: "",
updatableColumns: new string[](0)
});
}
/**
* @dev Returns whether or not `account` is a contract address.
*/
function _isContract(address account) private view returns (bool) {
return account.code.length > 0;
}
/**
* @dev See {ITablelandTables-setController}.
*/
function setController(
address caller,
uint256 tableId,
address controller
) external override whenNotPaused {
if (
caller != ownerOf(tableId) ||
caller != _msgSenderERC721A() ||
_locks[tableId]
) revert Unauthorized();
_controllers[tableId] = controller;
emit SetController(tableId, controller);
}
/**
* @dev See {ITablelandTables-getController}.
*/
function getController(
uint256 tableId
) external view override returns (address) {
return _controllers[tableId];
}
/**
* @dev See {ITablelandTables-lockController}.
*/
function lockController(
address caller,
uint256 tableId
) external override whenNotPaused {
if (
caller != ownerOf(tableId) ||
caller != _msgSenderERC721A() ||
_locks[tableId]
) revert Unauthorized();
_locks[tableId] = true;
}
/**
* @dev See {ITablelandTables-setBaseURI}.
*/
function setBaseURI(string memory baseURI) external override onlyOwner {
_baseURIString = baseURI;
}
/**
* @dev See {ERC721AUpgradeable-_baseURI}.
*/
function _baseURI() internal view override returns (string memory) {
return _baseURIString;
}
/**
* @dev See {ITablelandTables-pause}.
*/
function pause() external override onlyOwner {
_pause();
}
/**
* @dev See {ITablelandTables-unpause}.
*/
function unpause() external override onlyOwner {
_unpause();
}
/**
* @dev See {ERC721AUpgradeable-_startTokenId}.
*/
function _startTokenId() internal pure override returns (uint256) {
return 1;
}
/**
* @dev See {ERC721AUpgradeable-_afterTokenTransfers}.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal override {
super._afterTokenTransfers(from, to, startTokenId, quantity);
// quantity is only > 1 after bulk minting when from == address(0)
if (from != address(0)) emit TransferTable(from, to, startTokenId);
}
/**
* @dev See {UUPSUpgradeable-_authorizeUpgrade}.
*/
function _authorizeUpgrade(address) internal view override onlyOwner {} // solhint-disable no-empty-blocks
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../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. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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.9.0) (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.8.3._
*/
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.9.0) (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 {Initializable} from "../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._
*/
abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {
// 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;
function __ERC1967Upgrade_init() internal onlyInitializing {
}
function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
}
/**
* @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) {
AddressUpgradeable.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) {
AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* 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.9.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import {Initializable} from "./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 {
/// @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");
_;
}
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/**
* @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.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeTo(address newImplementation) public 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.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data, true);
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal override onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract PausableUpgradeable is Initializable, ContextUpgradeable {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../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 Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _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.9.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
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [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://consensys.net/diligence/blog/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.8.0/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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(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 (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
/**
* @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.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
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:
* ```solidity
* 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`, `uint256`._
* _Available since v4.9 for `string`, `bytes`._
*/
library StorageSlotUpgradeable {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes 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
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.10 <0.9.0;
import {TablelandPolicy} from "../TablelandPolicy.sol";
/**
* @dev Interface of a TablelandController compliant contract.
*
* This interface can be implemented to enabled advanced access control for a table.
* Call {ITablelandTables-setController} with the address of your implementation.
*
* See {test/TestTablelandController} for an example of token-gating table write-access.
*/
interface ITablelandController {
/**
* @dev Returns a {TablelandPolicy} struct defining how a table can be accessed by `caller`.
*/
function getPolicy(
address caller,
uint256 tableId
) external payable returns (TablelandPolicy memory);
/**
* @notice DEPRECATED. Use {ITablelandController.getPolicy(address, uint256)} instead.
*/
function getPolicy(
address caller
) external payable returns (TablelandPolicy memory);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.10 <0.9.0;
import {TablelandPolicy} from "../TablelandPolicy.sol";
/**
* @dev Interface of a TablelandTables compliant contract.
*/
interface ITablelandTables {
/**
* The caller is not authorized.
*/
error Unauthorized();
/**
* RunSQL was called with a query length greater than maximum allowed.
*/
error MaxQuerySizeExceeded(uint256 querySize, uint256 maxQuerySize);
/**
* @dev Emitted when `owner` creates a new table.
*
* owner - the to-be owner of the table
* tableId - the table id of the new table
* statement - the SQL statement used to create the table
*/
event CreateTable(address owner, uint256 tableId, string statement);
/**
* @dev Emitted when a table is transferred from `from` to `to`.
*
* Not emmitted when a table is created.
* Also emitted after a table has been burned.
*
* from - the address that transfered the table
* to - the address that received the table
* tableId - the table id that was transferred
*/
event TransferTable(address from, address to, uint256 tableId);
/**
* @dev Emitted when `caller` runs a SQL statement.
*
* caller - the address that is running the SQL statement
* isOwner - whether or not the caller is the table owner
* tableId - the id of the target table
* statement - the SQL statement to run
* policy - an object describing how `caller` can interact with the table (see {TablelandPolicy})
*/
event RunSQL(
address caller,
bool isOwner,
uint256 tableId,
string statement,
TablelandPolicy policy
);
/**
* @dev Emitted when a table's controller is set.
*
* tableId - the id of the target table
* controller - the address of the controller (EOA or contract)
*/
event SetController(uint256 tableId, address controller);
/**
* @dev Struct containing parameters needed to run a mutating sql statement
*
* tableId - the id of the target table
* statement - the SQL statement to run
* - the statement type can be any of INSERT, UPDATE, DELETE, GRANT, REVOKE
*
*/
struct Statement {
uint256 tableId;
string statement;
}
/**
* @dev Creates a new table owned by `owner` using `statement` and returns its `tableId`.
*
* owner - the to-be owner of the new table
* statement - the SQL statement used to create the table
* - the statement type must be CREATE
*
* Requirements:
*
* - contract must be unpaused
*/
function create(
address owner,
string memory statement
) external payable returns (uint256);
/**
* @dev Creates multiple new tables owned by `owner` using `statements` and returns array of `tableId`s.
*
* owner - the to-be owner of the new table
* statements - the SQL statements used to create the tables
* - each statement type must be CREATE
*
* Requirements:
*
* - contract must be unpaused
*/
function create(
address owner,
string[] calldata statements
) external payable returns (uint256[] memory);
/**
* @dev Runs a mutating SQL statement for `caller` using `statement`.
*
* caller - the address that is running the SQL statement
* tableId - the id of the target table
* statement - the SQL statement to run
* - the statement type can be any of INSERT, UPDATE, DELETE, GRANT, REVOKE
*
* Requirements:
*
* - contract must be unpaused
* - `msg.sender` must be `caller`
* - `tableId` must exist and be the table being mutated
* - `caller` must be authorized by the table controller
* - `statement` must be less than or equal to 35000 bytes
*/
function mutate(
address caller,
uint256 tableId,
string calldata statement
) external payable;
/**
* @dev Runs an array of mutating SQL statements for `caller`
*
* caller - the address that is running the SQL statement
* statements - an array of structs containing the id of the target table and coresponding statement
* - the statement type can be any of INSERT, UPDATE, DELETE, GRANT, REVOKE
*
* Requirements:
*
* - contract must be unpaused
* - `msg.sender` must be `caller`
* - `tableId` must be the table being muated in each struct's statement
* - `caller` must be authorized by the table controller if the statement is mutating
* - each struct inside `statements` must have a `tableId` that corresponds to table being mutated
* - each struct inside `statements` must have a `statement` that is less than or equal to 35000 bytes after normalization
*/
function mutate(
address caller,
ITablelandTables.Statement[] calldata statements
) external payable;
/**
* @dev Sets the controller for a table. Controller can be an EOA or contract address.
*
* When a table is created, it's controller is set to the zero address, which means that the
* contract will not enforce write access control. In this situation, validators will not accept
* transactions from non-owners unless explicitly granted access with "GRANT" SQL statements.
*
* When a controller address is set for a table, validators assume write access control is
* handled at the contract level, and will accept all transactions.
*
* You can unset a controller address for a table by setting it back to the zero address.
* This will cause validators to revert back to honoring owner and GRANT/REVOKE based write access control.
*
* caller - the address that is setting the controller
* tableId - the id of the target table
* controller - the address of the controller (EOA or contract)
*
* Requirements:
*
* - contract must be unpaused
* - `msg.sender` must be `caller` and owner of `tableId`
* - `tableId` must exist
* - `tableId` controller must not be locked
*/
function setController(
address caller,
uint256 tableId,
address controller
) external;
/**
* @dev Returns the controller for a table.
*
* tableId - the id of the target table
*/
function getController(uint256 tableId) external returns (address);
/**
* @dev Locks the controller for a table _forever_. Controller can be an EOA or contract address.
*
* Although not very useful, it is possible to lock a table controller that is set to the zero address.
*
* caller - the address that is locking the controller
* tableId - the id of the target table
*
* Requirements:
*
* - contract must be unpaused
* - `msg.sender` must be `caller` and owner of `tableId`
* - `tableId` must exist
* - `tableId` controller must not be locked
*/
function lockController(address caller, uint256 tableId) external;
/**
* @dev Sets the contract base URI.
*
* baseURI - the new base URI
*
* Requirements:
*
* - `msg.sender` must be contract owner
*/
function setBaseURI(string memory baseURI) external;
/**
* @dev Pauses the contract.
*
* Requirements:
*
* - `msg.sender` must be contract owner
* - contract must be unpaused
*/
function pause() external;
/**
* @dev Unpauses the contract.
*
* Requirements:
*
* - `msg.sender` must be contract owner
* - contract must be paused
*/
function unpause() external;
}// SPDX-License-Identifier: MIT
pragma solidity >=0.8.10 <0.9.0;
/**
* @dev Object defining how a table can be accessed.
*/
struct TablelandPolicy {
// Whether or not the table should allow SQL INSERT statements.
bool allowInsert;
// Whether or not the table should allow SQL UPDATE statements.
bool allowUpdate;
// Whether or not the table should allow SQL DELETE statements.
bool allowDelete;
// A conditional clause used with SQL UPDATE and DELETE statements.
// For example, a value of "foo > 0" will concatenate all SQL UPDATE
// and/or DELETE statements with "WHERE foo > 0".
// This can be useful for limiting how a table can be modified.
// Use {Policies-joinClauses} to include more than one condition.
string whereClause;
// A conditional clause used with SQL INSERT statements.
// For example, a value of "foo > 0" will concatenate all SQL INSERT
// statements with a check on the incoming data, i.e., "CHECK (foo > 0)".
// This can be useful for limiting how table data ban be added.
// Use {Policies-joinClauses} to include more than one condition.
string withCheck;
// A list of SQL column names that can be updated.
string[] updatableColumns;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev This is a base contract to aid in writing upgradeable diamond facet 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.
*
* 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.
*/
import {ERC721A__InitializableStorage} from './ERC721A__InitializableStorage.sol';
abstract contract ERC721A__Initializable {
using ERC721A__InitializableStorage for ERC721A__InitializableStorage.Layout;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializerERC721A() {
// If the contract is initializing we ignore whether _initialized is set in order to support multiple
// inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
// contract may have been reentered.
require(
ERC721A__InitializableStorage.layout()._initializing
? _isConstructor()
: !ERC721A__InitializableStorage.layout()._initialized,
'ERC721A__Initializable: contract is already initialized'
);
bool isTopLevelCall = !ERC721A__InitializableStorage.layout()._initializing;
if (isTopLevelCall) {
ERC721A__InitializableStorage.layout()._initializing = true;
ERC721A__InitializableStorage.layout()._initialized = true;
}
_;
if (isTopLevelCall) {
ERC721A__InitializableStorage.layout()._initializing = false;
}
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} modifier, directly or indirectly.
*/
modifier onlyInitializingERC721A() {
require(
ERC721A__InitializableStorage.layout()._initializing,
'ERC721A__Initializable: contract is not initializing'
);
_;
}
/// @dev Returns true if and only if the function is running in the constructor
function _isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly {
cs := extcodesize(self)
}
return cs == 0;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev This is a base storage for the initialization function for upgradeable diamond facet contracts
**/
library ERC721A__InitializableStorage {
struct Layout {
/*
* Indicates that the contract has been initialized.
*/
bool _initialized;
/*
* Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.initializable.facet');
function layout() internal pure returns (Layout storage l) {
bytes32 slot = STORAGE_SLOT;
assembly {
l.slot := slot
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library ERC721AStorage {
// Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
struct TokenApprovalRef {
address value;
}
struct Layout {
// =============================================================
// STORAGE
// =============================================================
// The next token ID to be minted.
uint256 _currentIndex;
// The number of tokens burned.
uint256 _burnCounter;
// Token name
string _name;
// Token symbol
string _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned.
// See {_packedOwnershipOf} implementation for details.
//
// Bits Layout:
// - [0..159] `addr`
// - [160..223] `startTimestamp`
// - [224] `burned`
// - [225] `nextInitialized`
// - [232..255] `extraData`
mapping(uint256 => uint256) _packedOwnerships;
// Mapping owner address to address data.
//
// Bits Layout:
// - [0..63] `balance`
// - [64..127] `numberMinted`
// - [128..191] `numberBurned`
// - [192..255] `aux`
mapping(address => uint256) _packedAddressData;
// Mapping from token ID to approved address.
mapping(uint256 => ERC721AStorage.TokenApprovalRef) _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) _operatorApprovals;
}
bytes32 internal constant STORAGE_SLOT = keccak256('ERC721A.contracts.storage.ERC721A');
function layout() internal pure returns (Layout storage l) {
bytes32 slot = STORAGE_SLOT;
assembly {
l.slot := slot
}
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import './IERC721AUpgradeable.sol';
import {ERC721AStorage} from './ERC721AStorage.sol';
import './ERC721A__Initializable.sol';
/**
* @dev Interface of ERC721 token receiver.
*/
interface ERC721A__IERC721ReceiverUpgradeable {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @title ERC721A
*
* @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
* Non-Fungible Token Standard, including the Metadata extension.
* Optimized for lower gas during batch mints.
*
* Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
* starting from `_startTokenId()`.
*
* Assumptions:
*
* - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
* - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
*/
contract ERC721AUpgradeable is ERC721A__Initializable, IERC721AUpgradeable {
using ERC721AStorage for ERC721AStorage.Layout;
// =============================================================
// CONSTANTS
// =============================================================
// Mask of an entry in packed address data.
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
// The bit position of `numberMinted` in packed address data.
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
// The bit position of `numberBurned` in packed address data.
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
// The bit position of `aux` in packed address data.
uint256 private constant _BITPOS_AUX = 192;
// Mask of all 256 bits in packed address data except the 64 bits for `aux`.
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
// The bit position of `startTimestamp` in packed ownership.
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
// The bit mask of the `burned` bit in packed ownership.
uint256 private constant _BITMASK_BURNED = 1 << 224;
// The bit position of the `nextInitialized` bit in packed ownership.
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
// The bit mask of the `nextInitialized` bit in packed ownership.
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
// The bit position of `extraData` in packed ownership.
uint256 private constant _BITPOS_EXTRA_DATA = 232;
// Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
// The mask of the lower 160 bits for addresses.
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
// The maximum `quantity` that can be minted with {_mintERC2309}.
// This limit is to prevent overflows on the address data entries.
// For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
// is required to cause an overflow, which is unrealistic.
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
// The `Transfer` event signature is given by:
// `keccak256(bytes("Transfer(address,address,uint256)"))`.
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
// =============================================================
// CONSTRUCTOR
// =============================================================
function __ERC721A_init(string memory name_, string memory symbol_) internal onlyInitializingERC721A {
__ERC721A_init_unchained(name_, symbol_);
}
function __ERC721A_init_unchained(string memory name_, string memory symbol_) internal onlyInitializingERC721A {
ERC721AStorage.layout()._name = name_;
ERC721AStorage.layout()._symbol = symbol_;
ERC721AStorage.layout()._currentIndex = _startTokenId();
}
// =============================================================
// TOKEN COUNTING OPERATIONS
// =============================================================
/**
* @dev Returns the starting token ID.
* To change the starting token ID, please override this function.
*/
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev Returns the next token ID to be minted.
*/
function _nextTokenId() internal view virtual returns (uint256) {
return ERC721AStorage.layout()._currentIndex;
}
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() public view virtual override returns (uint256) {
// Counter underflow is impossible as _burnCounter cannot be incremented
// more than `_currentIndex - _startTokenId()` times.
unchecked {
return ERC721AStorage.layout()._currentIndex - ERC721AStorage.layout()._burnCounter - _startTokenId();
}
}
/**
* @dev Returns the total amount of tokens minted in the contract.
*/
function _totalMinted() internal view virtual returns (uint256) {
// Counter underflow is impossible as `_currentIndex` does not decrement,
// and it is initialized to `_startTokenId()`.
unchecked {
return ERC721AStorage.layout()._currentIndex - _startTokenId();
}
}
/**
* @dev Returns the total number of tokens burned.
*/
function _totalBurned() internal view virtual returns (uint256) {
return ERC721AStorage.layout()._burnCounter;
}
// =============================================================
// ADDRESS DATA OPERATIONS
// =============================================================
/**
* @dev Returns the number of tokens in `owner`'s account.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return ERC721AStorage.layout()._packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens minted by `owner`.
*/
function _numberMinted(address owner) internal view returns (uint256) {
return
(ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens burned by or on behalf of `owner`.
*/
function _numberBurned(address owner) internal view returns (uint256) {
return
(ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
*/
function _getAux(address owner) internal view returns (uint64) {
return uint64(ERC721AStorage.layout()._packedAddressData[owner] >> _BITPOS_AUX);
}
/**
* Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
* If there are multiple variables, please pack them into a uint64.
*/
function _setAux(address owner, uint64 aux) internal virtual {
uint256 packed = ERC721AStorage.layout()._packedAddressData[owner];
uint256 auxCasted;
// Cast `aux` with assembly to avoid redundant masking.
assembly {
auxCasted := aux
}
packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
ERC721AStorage.layout()._packedAddressData[owner] = packed;
}
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
// The interface IDs are constants representing the first 4 bytes
// of the XOR of all function selectors in the interface.
// See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
// (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
return
interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
}
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @dev Returns the token collection name.
*/
function name() public view virtual override returns (string memory) {
return ERC721AStorage.layout()._name;
}
/**
* @dev Returns the token collection symbol.
*/
function symbol() public view virtual override returns (string memory) {
return ERC721AStorage.layout()._symbol;
}
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return '';
}
// =============================================================
// OWNERSHIPS OPERATIONS
// =============================================================
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
/**
* @dev Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around over time.
*/
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
/**
* @dev Returns the unpacked `TokenOwnership` struct at `index`.
*/
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(ERC721AStorage.layout()._packedOwnerships[index]);
}
/**
* @dev Initializes the ownership slot minted at `index` for efficiency purposes.
*/
function _initializeOwnershipAt(uint256 index) internal virtual {
if (ERC721AStorage.layout()._packedOwnerships[index] == 0) {
ERC721AStorage.layout()._packedOwnerships[index] = _packedOwnershipOf(index);
}
}
/**
* Returns the packed ownership data of `tokenId`.
*/
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {
if (_startTokenId() <= tokenId) {
packed = ERC721AStorage.layout()._packedOwnerships[tokenId];
// If not burned.
if (packed & _BITMASK_BURNED == 0) {
// If the data at the starting slot does not exist, start the scan.
if (packed == 0) {
if (tokenId >= ERC721AStorage.layout()._currentIndex) revert OwnerQueryForNonexistentToken();
// Invariant:
// There will always be an initialized ownership slot
// (i.e. `ownership.addr != address(0) && ownership.burned == false`)
// before an unintialized ownership slot
// (i.e. `ownership.addr == address(0) && ownership.burned == false`)
// Hence, `tokenId` will not underflow.
//
// We can directly compare the packed value.
// If the address is zero, packed will be zero.
for (;;) {
unchecked {
packed = ERC721AStorage.layout()._packedOwnerships[--tokenId];
}
if (packed == 0) continue;
return packed;
}
}
// Otherwise, the data exists and is not burned. We can skip the scan.
// This is possible because we have already achieved the target condition.
// This saves 2143 gas on transfers of initialized tokens.
return packed;
}
}
revert OwnerQueryForNonexistentToken();
}
/**
* @dev Returns the unpacked `TokenOwnership` struct from `packed`.
*/
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
ownership.addr = address(uint160(packed));
ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
ownership.burned = packed & _BITMASK_BURNED != 0;
ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
}
/**
* @dev Packs ownership data into a single uint256.
*/
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
// Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
owner := and(owner, _BITMASK_ADDRESS)
// `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
/**
* @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
*/
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
// For branchless setting of the `nextInitialized` flag.
assembly {
// `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
}
}
// =============================================================
// APPROVAL OPERATIONS
// =============================================================
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
*/
function approve(address to, uint256 tokenId) public payable virtual override {
_approve(to, tokenId, true);
}
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return ERC721AStorage.layout()._tokenApprovals[tokenId].value;
}
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom}
* for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
ERC721AStorage.layout()._operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
}
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return ERC721AStorage.layout()._operatorApprovals[owner][operator];
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted. See {_mint}.
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return
_startTokenId() <= tokenId &&
tokenId < ERC721AStorage.layout()._currentIndex && // If within bounds,
ERC721AStorage.layout()._packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
}
/**
* @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
*/
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
assembly {
// Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
owner := and(owner, _BITMASK_ADDRESS)
// Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
msgSender := and(msgSender, _BITMASK_ADDRESS)
// `msgSender == owner || msgSender == approvedAddress`.
result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
}
}
/**
* @dev Returns the storage slot and value for the approved address of `tokenId`.
*/
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
ERC721AStorage.TokenApprovalRef storage tokenApproval = ERC721AStorage.layout()._tokenApprovals[tokenId];
// The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
assembly {
approvedAddressSlot := tokenApproval.slot
approvedAddress := sload(approvedAddressSlot)
}
}
// =============================================================
// TRANSFER OPERATIONS
// =============================================================
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token
* by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner.
assembly {
if approvedAddress {
// This is equivalent to `delete _tokenApprovals[tokenId]`.
sstore(approvedAddressSlot, 0)
}
}
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
unchecked {
// We can directly increment and decrement the balances.
--ERC721AStorage.layout()._packedAddressData[from]; // Updates: `balance -= 1`.
++ERC721AStorage.layout()._packedAddressData[to]; // Updates: `balance += 1`.
// Updates:
// - `address` to the next owner.
// - `startTimestamp` to the timestamp of transfering.
// - `burned` to `false`.
// - `nextInitialized` to `true`.
ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData(
to,
_BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
);
// If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
// If the next slot's address is zero and not burned (i.e. packed value is zero).
if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) {
// If the next slot is within bounds.
if (nextTokenId != ERC721AStorage.layout()._currentIndex) {
// Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
safeTransferFrom(from, to, tokenId, '');
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token
* by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public payable virtual override {
transferFrom(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
/**
* @dev Hook that is called before a set of serially-ordered token IDs
* are about to be transferred. This includes minting.
* And also called before burning one token.
*
* `startTokenId` - the first token ID to be transferred.
* `quantity` - the amount to be transferred.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, `tokenId` will be burned by `from`.
* - `from` and `to` are never both zero.
*/
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Hook that is called after a set of serially-ordered token IDs
* have been transferred. This includes minting.
* And also called after one token has been burned.
*
* `startTokenId` - the first token ID to be transferred.
* `quantity` - the amount to be transferred.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
* transferred to `to`.
* - When `from` is zero, `tokenId` has been minted for `to`.
* - When `to` is zero, `tokenId` has been burned by `from`.
* - `from` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
*
* `from` - Previous owner of the given token ID.
* `to` - Target address that will receive the token.
* `tokenId` - Token ID to be transferred.
* `_data` - Optional data to send along with the call.
*
* Returns whether the call correctly returned the expected magic value.
*/
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
try
ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data)
returns (bytes4 retval) {
return retval == ERC721A__IERC721ReceiverUpgradeable(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
// =============================================================
// MINT OPERATIONS
// =============================================================
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event for each mint.
*/
function _mint(address to, uint256 quantity) internal virtual {
uint256 startTokenId = ERC721AStorage.layout()._currentIndex;
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are incredibly unrealistic.
// `balance` and `numberMinted` have a maximum limit of 2**64.
// `tokenId` has a maximum limit of 2**256.
unchecked {
// Updates:
// - `balance += quantity`.
// - `numberMinted += quantity`.
//
// We can directly add to the `balance` and `numberMinted`.
ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `quantity == 1`.
ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
uint256 toMasked;
uint256 end = startTokenId + quantity;
// Use assembly to loop and emit the `Transfer` event for gas savings.
// The duplicated `log4` removes an extra check and reduces stack juggling.
// The assembly, together with the surrounding Solidity code, have been
// delicately arranged to nudge the compiler into producing optimized opcodes.
assembly {
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
toMasked := and(to, _BITMASK_ADDRESS)
// Emit the `Transfer` event.
log4(
0, // Start of data (0, since no data).
0, // End of data (0, since no data).
_TRANSFER_EVENT_SIGNATURE, // Signature.
0, // `address(0)`.
toMasked, // `to`.
startTokenId // `tokenId`.
)
// The `iszero(eq(,))` check ensures that large values of `quantity`
// that overflows uint256 will make the loop run out of gas.
// The compiler will optimize the `iszero` away for performance.
for {
let tokenId := add(startTokenId, 1)
} iszero(eq(tokenId, end)) {
tokenId := add(tokenId, 1)
} {
// Emit the `Transfer` event. Similar to above.
log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
}
}
if (toMasked == 0) revert MintToZeroAddress();
ERC721AStorage.layout()._currentIndex = end;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* This function is intended for efficient minting only during contract creation.
*
* It emits only one {ConsecutiveTransfer} as defined in
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
* instead of a sequence of {Transfer} event(s).
*
* Calling this function outside of contract creation WILL make your contract
* non-compliant with the ERC721 standard.
* For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
* {ConsecutiveTransfer} event is only permissible during contract creation.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {ConsecutiveTransfer} event.
*/
function _mintERC2309(address to, uint256 quantity) internal virtual {
uint256 startTokenId = ERC721AStorage.layout()._currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are unrealistic due to the above check for `quantity` to be below the limit.
unchecked {
// Updates:
// - `balance += quantity`.
// - `numberMinted += quantity`.
//
// We can directly add to the `balance` and `numberMinted`.
ERC721AStorage.layout()._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `quantity == 1`.
ERC721AStorage.layout()._packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);
ERC721AStorage.layout()._currentIndex = startTokenId + quantity;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Safely mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
* - `quantity` must be greater than 0.
*
* See {_mint}.
*
* Emits a {Transfer} event for each mint.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
_mint(to, quantity);
unchecked {
if (to.code.length != 0) {
uint256 end = ERC721AStorage.layout()._currentIndex;
uint256 index = end - quantity;
do {
if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
} while (index < end);
// Reentrancy protection.
if (ERC721AStorage.layout()._currentIndex != end) revert();
}
}
}
/**
* @dev Equivalent to `_safeMint(to, quantity, '')`.
*/
function _safeMint(address to, uint256 quantity) internal virtual {
_safeMint(to, quantity, '');
}
// =============================================================
// APPROVAL OPERATIONS
// =============================================================
/**
* @dev Equivalent to `_approve(to, tokenId, false)`.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_approve(to, tokenId, false);
}
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the
* zero address clears previous approvals.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function _approve(
address to,
uint256 tokenId,
bool approvalCheck
) internal virtual {
address owner = ownerOf(tokenId);
if (approvalCheck)
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
ERC721AStorage.layout()._tokenApprovals[tokenId].value = to;
emit Approval(owner, to, tokenId);
}
// =============================================================
// BURN OPERATIONS
// =============================================================
/**
* @dev Equivalent to `_burn(tokenId, false)`.
*/
function _burn(uint256 tokenId) internal virtual {
_burn(tokenId, false);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
address from = address(uint160(prevOwnershipPacked));
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (approvalCheck) {
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
}
_beforeTokenTransfers(from, address(0), tokenId, 1);
// Clear approvals from the previous owner.
assembly {
if approvedAddress {
// This is equivalent to `delete _tokenApprovals[tokenId]`.
sstore(approvedAddressSlot, 0)
}
}
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
unchecked {
// Updates:
// - `balance -= 1`.
// - `numberBurned += 1`.
//
// We can directly decrement the balance, and increment the number burned.
// This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
ERC721AStorage.layout()._packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;
// Updates:
// - `address` to the last owner.
// - `startTimestamp` to the timestamp of burning.
// - `burned` to `true`.
// - `nextInitialized` to `true`.
ERC721AStorage.layout()._packedOwnerships[tokenId] = _packOwnershipData(
from,
(_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
);
// If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
// If the next slot's address is zero and not burned (i.e. packed value is zero).
if (ERC721AStorage.layout()._packedOwnerships[nextTokenId] == 0) {
// If the next slot is within bounds.
if (nextTokenId != ERC721AStorage.layout()._currentIndex) {
// Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
ERC721AStorage.layout()._packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, address(0), tokenId);
_afterTokenTransfers(from, address(0), tokenId, 1);
// Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
unchecked {
ERC721AStorage.layout()._burnCounter++;
}
}
// =============================================================
// EXTRA DATA OPERATIONS
// =============================================================
/**
* @dev Directly sets the extra data for the ownership data `index`.
*/
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
uint256 packed = ERC721AStorage.layout()._packedOwnerships[index];
if (packed == 0) revert OwnershipNotInitializedForExtraData();
uint256 extraDataCasted;
// Cast `extraData` with assembly to avoid redundant masking.
assembly {
extraDataCasted := extraData
}
packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
ERC721AStorage.layout()._packedOwnerships[index] = packed;
}
/**
* @dev Called during each token transfer to set the 24bit `extraData` field.
* Intended to be overridden by the cosumer contract.
*
* `previousExtraData` - the value of `extraData` before transfer.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, `tokenId` will be burned by `from`.
* - `from` and `to` are never both zero.
*/
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual returns (uint24) {}
/**
* @dev Returns the next extra data for the packed ownership data.
* The returned result is shifted into position.
*/
function _nextExtraData(
address from,
address to,
uint256 prevOwnershipPacked
) private view returns (uint256) {
uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
}
// =============================================================
// OTHER OPERATIONS
// =============================================================
/**
* @dev Returns the message sender (defaults to `msg.sender`).
*
* If you are writing GSN compatible contracts, you need to override this function.
*/
function _msgSenderERC721A() internal view virtual returns (address) {
return msg.sender;
}
/**
* @dev Converts a uint256 to its ASCII string decimal representation.
*/
function _toString(uint256 value) internal pure virtual returns (string memory str) {
assembly {
// The maximum value of a uint256 contains 78 digits (1 byte per digit), but
// we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
// We will need 1 word for the trailing zeros padding, 1 word for the length,
// and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
let m := add(mload(0x40), 0xa0)
// Update the free memory pointer to allocate.
mstore(0x40, m)
// Assign the `str` to the end.
str := sub(m, 0x20)
// Zeroize the slot after the string.
mstore(str, 0)
// Cache the end of the memory to calculate the length later.
let end := str
// We write the string from rightmost digit to leftmost digit.
// The following is essentially a do-while loop that also handles the zero case.
// prettier-ignore
for { let temp := value } 1 {} {
str := sub(str, 1)
// Write the character to the pointer.
// The ASCII index of the '0' character is 48.
mstore8(str, add(48, mod(temp, 10)))
// Keep dividing `temp` until zero.
temp := div(temp, 10)
// prettier-ignore
if iszero(temp) { break }
}
let length := sub(end, str)
// Move the pointer 32 bytes leftwards to make room for the length.
str := sub(str, 0x20)
// Store the length.
mstore(str, length)
}
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import './IERC721AQueryableUpgradeable.sol';
import '../ERC721AUpgradeable.sol';
import '../ERC721A__Initializable.sol';
/**
* @title ERC721AQueryable.
*
* @dev ERC721A subclass with convenience query functions.
*/
abstract contract ERC721AQueryableUpgradeable is
ERC721A__Initializable,
ERC721AUpgradeable,
IERC721AQueryableUpgradeable
{
function __ERC721AQueryable_init() internal onlyInitializingERC721A {
__ERC721AQueryable_init_unchained();
}
function __ERC721AQueryable_init_unchained() internal onlyInitializingERC721A {}
/**
* @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
*
* If the `tokenId` is out of bounds:
*
* - `addr = address(0)`
* - `startTimestamp = 0`
* - `burned = false`
* - `extraData = 0`
*
* If the `tokenId` is burned:
*
* - `addr = <Address of owner before token was burned>`
* - `startTimestamp = <Timestamp when token was burned>`
* - `burned = true`
* - `extraData = <Extra data when token was burned>`
*
* Otherwise:
*
* - `addr = <Address of owner>`
* - `startTimestamp = <Timestamp of start of ownership>`
* - `burned = false`
* - `extraData = <Extra data at start of ownership>`
*/
function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) {
TokenOwnership memory ownership;
if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) {
return ownership;
}
ownership = _ownershipAt(tokenId);
if (ownership.burned) {
return ownership;
}
return _ownershipOf(tokenId);
}
/**
* @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
* See {ERC721AQueryable-explicitOwnershipOf}
*/
function explicitOwnershipsOf(uint256[] calldata tokenIds)
external
view
virtual
override
returns (TokenOwnership[] memory)
{
unchecked {
uint256 tokenIdsLength = tokenIds.length;
TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);
for (uint256 i; i != tokenIdsLength; ++i) {
ownerships[i] = explicitOwnershipOf(tokenIds[i]);
}
return ownerships;
}
}
/**
* @dev Returns an array of token IDs owned by `owner`,
* in the range [`start`, `stop`)
* (i.e. `start <= tokenId < stop`).
*
* This function allows for tokens to be queried if the collection
* grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
*
* Requirements:
*
* - `start < stop`
*/
function tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) external view virtual override returns (uint256[] memory) {
unchecked {
if (start >= stop) revert InvalidQueryRange();
uint256 tokenIdsIdx;
uint256 stopLimit = _nextTokenId();
// Set `start = max(start, _startTokenId())`.
if (start < _startTokenId()) {
start = _startTokenId();
}
// Set `stop = min(stop, stopLimit)`.
if (stop > stopLimit) {
stop = stopLimit;
}
uint256 tokenIdsMaxLength = balanceOf(owner);
// Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
// to cater for cases where `balanceOf(owner)` is too big.
if (start < stop) {
uint256 rangeLength = stop - start;
if (rangeLength < tokenIdsMaxLength) {
tokenIdsMaxLength = rangeLength;
}
} else {
tokenIdsMaxLength = 0;
}
uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);
if (tokenIdsMaxLength == 0) {
return tokenIds;
}
// We need to call `explicitOwnershipOf(start)`,
// because the slot at `start` may not be initialized.
TokenOwnership memory ownership = explicitOwnershipOf(start);
address currOwnershipAddr;
// If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`.
// `ownership.address` will not be zero, as `start` is clamped to the valid token ID range.
if (!ownership.burned) {
currOwnershipAddr = ownership.addr;
}
for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) {
ownership = _ownershipAt(i);
if (ownership.burned) {
continue;
}
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
tokenIds[tokenIdsIdx++] = i;
}
}
// Downsize the array to fit.
assembly {
mstore(tokenIds, tokenIdsIdx)
}
return tokenIds;
}
}
/**
* @dev Returns an array of token IDs owned by `owner`.
*
* This function scans the ownership mapping and is O(`totalSupply`) in complexity.
* It is meant to be called off-chain.
*
* See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
* multiple smaller scans if the collection is large enough to cause
* an out-of-gas error (10K collections should be fine).
*/
function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {
unchecked {
uint256 tokenIdsIdx;
address currOwnershipAddr;
uint256 tokenIdsLength = balanceOf(owner);
uint256[] memory tokenIds = new uint256[](tokenIdsLength);
TokenOwnership memory ownership;
for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
ownership = _ownershipAt(i);
if (ownership.burned) {
continue;
}
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
tokenIds[tokenIdsIdx++] = i;
}
}
return tokenIds;
}
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import '../IERC721AUpgradeable.sol';
/**
* @dev Interface of ERC721AQueryable.
*/
interface IERC721AQueryableUpgradeable is IERC721AUpgradeable {
/**
* Invalid query range (`start` >= `stop`).
*/
error InvalidQueryRange();
/**
* @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
*
* If the `tokenId` is out of bounds:
*
* - `addr = address(0)`
* - `startTimestamp = 0`
* - `burned = false`
* - `extraData = 0`
*
* If the `tokenId` is burned:
*
* - `addr = <Address of owner before token was burned>`
* - `startTimestamp = <Timestamp when token was burned>`
* - `burned = true`
* - `extraData = <Extra data when token was burned>`
*
* Otherwise:
*
* - `addr = <Address of owner>`
* - `startTimestamp = <Timestamp of start of ownership>`
* - `burned = false`
* - `extraData = <Extra data at start of ownership>`
*/
function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);
/**
* @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
* See {ERC721AQueryable-explicitOwnershipOf}
*/
function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);
/**
* @dev Returns an array of token IDs owned by `owner`,
* in the range [`start`, `stop`)
* (i.e. `start <= tokenId < stop`).
*
* This function allows for tokens to be queried if the collection
* grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
*
* Requirements:
*
* - `start < stop`
*/
function tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) external view returns (uint256[] memory);
/**
* @dev Returns an array of token IDs owned by `owner`.
*
* This function scans the ownership mapping and is O(`totalSupply`) in complexity.
* It is meant to be called off-chain.
*
* See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
* multiple smaller scans if the collection is large enough to cause
* an out-of-gas error (10K collections should be fine).
*/
function tokensOfOwner(address owner) external view returns (uint256[] memory);
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of ERC721A.
*/
interface IERC721AUpgradeable {
/**
* The caller must own the token or be an approved operator.
*/
error ApprovalCallerNotOwnerNorApproved();
/**
* The token does not exist.
*/
error ApprovalQueryForNonexistentToken();
/**
* Cannot query the balance for the zero address.
*/
error BalanceQueryForZeroAddress();
/**
* Cannot mint to the zero address.
*/
error MintToZeroAddress();
/**
* The quantity of tokens minted must be more than zero.
*/
error MintZeroQuantity();
/**
* The token does not exist.
*/
error OwnerQueryForNonexistentToken();
/**
* The caller must own the token or be an approved operator.
*/
error TransferCallerNotOwnerNorApproved();
/**
* The token must be owned by `from`.
*/
error TransferFromIncorrectOwner();
/**
* Cannot safely transfer to a contract that does not implement the
* ERC721Receiver interface.
*/
error TransferToNonERC721ReceiverImplementer();
/**
* Cannot transfer to the zero address.
*/
error TransferToZeroAddress();
/**
* The token does not exist.
*/
error URIQueryForNonexistentToken();
/**
* The `quantity` minted with ERC2309 exceeds the safety limit.
*/
error MintERC2309QuantityExceedsLimit();
/**
* The `extraData` cannot be set on an unintialized ownership slot.
*/
error OwnershipNotInitializedForExtraData();
// =============================================================
// STRUCTS
// =============================================================
struct TokenOwnership {
// The address of the owner.
address addr;
// Stores the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
// Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
uint24 extraData;
}
// =============================================================
// TOKEN COUNTERS
// =============================================================
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() external view returns (uint256);
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
// =============================================================
// IERC721
// =============================================================
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables
* (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in `owner`'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`,
* checking first that contract recipients are aware of the ERC721 protocol
* to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move
* this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external payable;
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom}
* whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token
* by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external payable;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the
* zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external payable;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom}
* for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
// =============================================================
// IERC2309
// =============================================================
/**
* @dev Emitted when tokens in `fromTokenId` to `toTokenId`
* (inclusive) is transferred from `from` to `to`, as defined in the
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
*
* See {_mintERC2309} for more details.
*/
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}{
"optimizer": {
"enabled": true,
"runs": 9999999
},
"metadata": {
"bytecodeHash": "none"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[{"internalType":"uint256","name":"querySize","type":"uint256"},{"internalType":"uint256","name":"maxQuerySize","type":"uint256"}],"name":"MaxQuerySizeExceeded","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"Unauthorized","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":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","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":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"tableId","type":"uint256"},{"indexed":false,"internalType":"string","name":"statement","type":"string"}],"name":"CreateTable","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"bool","name":"isOwner","type":"bool"},{"indexed":false,"internalType":"uint256","name":"tableId","type":"uint256"},{"indexed":false,"internalType":"string","name":"statement","type":"string"},{"components":[{"internalType":"bool","name":"allowInsert","type":"bool"},{"internalType":"bool","name":"allowUpdate","type":"bool"},{"internalType":"bool","name":"allowDelete","type":"bool"},{"internalType":"string","name":"whereClause","type":"string"},{"internalType":"string","name":"withCheck","type":"string"},{"internalType":"string[]","name":"updatableColumns","type":"string[]"}],"indexed":false,"internalType":"struct TablelandPolicy","name":"policy","type":"tuple"}],"name":"RunSQL","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tableId","type":"uint256"},{"indexed":false,"internalType":"address","name":"controller","type":"address"}],"name":"SetController","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"tableId","type":"uint256"}],"name":"TransferTable","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"string[]","name":"statements","type":"string[]"}],"name":"create","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"string","name":"statement","type":"string"}],"name":"create","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"string","name":"statement","type":"string"}],"name":"createTable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721AUpgradeable.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tableId","type":"uint256"}],"name":"getController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint256","name":"tableId","type":"uint256"}],"name":"lockController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint256","name":"tableId","type":"uint256"},{"internalType":"string","name":"statement","type":"string"}],"name":"mutate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"components":[{"internalType":"uint256","name":"tableId","type":"uint256"},{"internalType":"string","name":"statement","type":"string"}],"internalType":"struct ITablelandTables.Statement[]","name":"statements","type":"tuple[]"}],"name":"mutate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"address","name":"caller","type":"address"},{"internalType":"uint256","name":"tableId","type":"uint256"},{"internalType":"string","name":"statement","type":"string"}],"name":"runSQL","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint256","name":"tableId","type":"uint256"},{"internalType":"address","name":"controller","type":"address"}],"name":"setController","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":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","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"}]Contract Creation Code
60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e7565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6080516150946200011f60003960008181610e7701528181610f2c015281816110fe015281816111ae01526112f301526150946000f3fe6080604052600436106102855760003560e01c80636352211e11610153578063a15ab08d116100cb578063c87b56dd1161007f578063eaf5d04e11610064578063eaf5d04e14610411578063f2fde38b14610762578063f62d18881461078257600080fd5b8063c87b56dd146106cd578063e985e9c5146106ed57600080fd5b8063abf69aa3116100b0578063abf69aa31461067a578063b88d4fde1461068d578063c23dc68f146106a057600080fd5b8063a15ab08d14610424578063a22cb4651461065a57600080fd5b80638462151c116101225780638da5cb5b116101075780638da5cb5b146105fa57806395d89b411461062557806399a2557a1461063a57600080fd5b80638462151c146105ba5780638bb0ab97146105da57600080fd5b80636352211e1461055057806370a0823114610570578063715018a6146105905780638456cb59146105a557600080fd5b80633a9151b01161020157806355f804b3116101b55780635bbb21771161019a5780635bbb2177146104eb5780635c975abb1461051857806361a23d0f1461053057600080fd5b806355f804b31461048757806358edaa9c146104a757600080fd5b806342842e0e116101e657806342842e0e1461044c5780634f1ef2861461045f57806352d1902d1461047257600080fd5b80633a9151b0146104245780633f4ba83a1461043757600080fd5b8063095ea7b31161025857806323b872dd1161023d57806323b872dd146103de5780633659cfe6146103f1578063377af0da1461041157600080fd5b8063095ea7b31461034857806318160ddd1461035b57600080fd5b806301ffc9a71461028a57806305295681146102bf57806306fdde03146102e1578063081812fc14610303575b600080fd5b34801561029657600080fd5b506102aa6102a5366004614170565b6107a2565b60405190151581526020015b60405180910390f35b3480156102cb57600080fd5b506102df6102da3660046141b1565b610887565b005b3480156102ed57600080fd5b506102f6610974565b6040516102b69190614249565b34801561030f57600080fd5b5061032361031e36600461425c565b610a28565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102b6565b6102df6103563660046141b1565b610ab1565b34801561036757600080fd5b507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c41547f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4054037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015b6040519081526020016102b6565b6102df6103ec366004614275565b610ac1565b3480156103fd57600080fd5b506102df61040c3660046142b1565b610e60565b6102df61041f366004614315565b61106a565b6103d061043236600461436f565b611096565b34801561044357600080fd5b506102df6110b5565b6102df61045a366004614275565b6110c7565b6102df61046d366004614511565b6110e7565b34801561047e57600080fd5b506103d06112d9565b34801561049357600080fd5b506102df6104a236600461455f565b6113c6565b3480156104b357600080fd5b506103236104c236600461425c565b600090815261012e602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b3480156104f757600080fd5b5061050b6105063660046145ed565b6113db565b6040516102b6919061462f565b34801561052457600080fd5b5060655460ff166102aa565b61054361053e3660046146b9565b6114c5565b6040516102b691906146ff565b34801561055c57600080fd5b5061032361056b36600461425c565b6115b9565b34801561057c57600080fd5b506103d061058b3660046142b1565b6115c4565b34801561059c57600080fd5b506102df611665565b3480156105b157600080fd5b506102df611677565b3480156105c657600080fd5b506105436105d53660046142b1565b611687565b3480156105e657600080fd5b506102df6105f5366004614737565b6117b2565b34801561060657600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff16610323565b34801561063157600080fd5b506102f66118f1565b34801561064657600080fd5b50610543610655366004614773565b611922565b34801561066657600080fd5b506102df6106753660046147b4565b611b07565b6102df6106883660046146b9565b611bbd565b6102df61069b3660046147eb565b611c4d565b3480156106ac57600080fd5b506106c06106bb36600461425c565b611cb7565b6040516102b69190614853565b3480156106d957600080fd5b506102f66106e836600461425c565b611d5e565b3480156106f957600080fd5b506102aa6107083660046148a5565b73ffffffffffffffffffffffffffffffffffffffff91821660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c476020908152604080832093909416825291909152205460ff1690565b34801561076e57600080fd5b506102df61077d3660046142b1565b611dfa565b34801561078e57600080fd5b506102df61079d36600461455f565b611eae565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316148061083557507f80ac58cd000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b8061088157507f5b5e139f000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b61088f612297565b610898816115b9565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415806108e8575073ffffffffffffffffffffffffffffffffffffffff82163314155b806109025750600081815261012f602052604090205460ff165b15610939576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600090815261012f6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550565b60607f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4060020180546109a5906148d8565b80601f01602080910402602001604051908101604052809291908181526020018280546109d1906148d8565b8015610a1e5780601f106109f357610100808354040283529160200191610a1e565b820191906000526020600020905b815481529060010190602001808311610a0157829003601f168201915b5050505050905090565b6000610a3382612304565b610a69576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5060009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c46602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b610abd82826001612390565b5050565b6000610acc826124ea565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610b33576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c466020526040902080543380821473ffffffffffffffffffffffffffffffffffffffff881690911417610c0e5773ffffffffffffffffffffffffffffffffffffffff861660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c476020908152604080832033845290915290205460ff16610c0e576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516610c5b576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8015610c6657600082555b73ffffffffffffffffffffffffffffffffffffffff86811660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055918716808252919020805460010190554260a01b177c02000000000000000000000000000000000000000000000000000000001760008581527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4460205260408120919091557c020000000000000000000000000000000000000000000000000000000084169003610df0576001840160008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4460205260408120549003610dee577f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40548114610dee5760008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602052604090208490555b505b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610e58868686600161263b565b505050505050565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163003610f2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084015b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610f9f7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614611042576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610f21565b61104b816126b5565b60408051600080825260208201909252611067918391906126bd565b50565b611072612297565b61107a6128bc565b6110868484848461292f565b6110906001609755565b50505050565b60006110a0612297565b6110ab848484612a66565b90505b9392505050565b6110bd612ae1565b6110c5612b62565b565b6110e283838360405180602001604052806000815250611c4d565b505050565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001630036111ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610f21565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166112217f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16146112c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610f21565b6112cd826126b5565b610abd828260016126bd565b60003073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146113a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610f21565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b90565b6113ce612ae1565b61012d610abd8282614971565b60608160008167ffffffffffffffff8111156113f9576113f96143c2565b60405190808252806020026020018201604052801561146957816020015b6040805160808101825260008082526020808301829052928201819052606082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816114175790505b50905060005b8281146114bc5761149786868381811061148b5761148b614a8b565b90506020020135611cb7565b8282815181106114a9576114a9614a8b565b602090810291909101015260010161146f565b50949350505050565b60606114cf612297565b81600181101561150b576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff811115611526576115266143c2565b60405190808252806020026020018201604052801561154f578160200160208202803683370190505b50905060005b828110156115af5761158a8787878481811061157357611573614a8b565b90506020028101906115859190614aba565b612a66565b82828151811061159c5761159c614a8b565b6020908102919091010152600101611555565b5095945050505050565b6000610881826124ea565b600073ffffffffffffffffffffffffffffffffffffffff8216611613576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45602052604090205467ffffffffffffffff1690565b61166d612ae1565b6110c56000612bdf565b61167f612ae1565b6110c5612c56565b60606000806000611697856115c4565b905060008167ffffffffffffffff8111156116b4576116b46143c2565b6040519080825280602002602001820160405280156116dd578160200160208202803683370190505b5060408051608081018252600080825260208201819052918101829052606081019190915290915060015b8386146117a65761171881612cb1565b9150816040015161179e57815173ffffffffffffffffffffffffffffffffffffffff161561174557815194505b8773ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff160361179e578083878060010198508151811061179157611791614a8b565b6020026020010181815250505b600101611708565b50909695505050505050565b6117ba612297565b6117c3826115b9565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580611813575073ffffffffffffffffffffffffffffffffffffffff83163314155b8061182d5750600082815261012f602052604090205460ff165b15611864576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815261012e602090815260409182902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85169081179091558251858152918201527f64d442926514e7c17643406b529155919979582e13eee1dfe07cbd088ef2033e910160405180910390a1505050565b60607f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4060030180546109a5906148d8565b606081831061195d576040517f32c1995a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806119887f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405490565b9050600185101561199857600194505b808411156119a4578093505b60006119af876115c4565b9050848610156119ce57858503818110156119c8578091505b506119d2565b5060005b60008167ffffffffffffffff8111156119ed576119ed6143c2565b604051908082528060200260200182016040528015611a16578160200160208202803683370190505b50905081600003611a2c5793506110ae92505050565b6000611a3788611cb7565b905060008160400151611a48575080515b885b888114158015611a5a5750848714155b15611af657611a6881612cb1565b92508260400151611aee57825173ffffffffffffffffffffffffffffffffffffffff1615611a9557825191505b8a73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611aee5780848880600101995081518110611ae157611ae1614a8b565b6020026020010181815250505b600101611a4a565b505050928352509095945050505050565b3360008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c476020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611bc5612297565b611bcd6128bc565b8060005b81811015611c4157611c3985858584818110611bef57611bef614a8b565b9050602002810190611c019190614b1f565b35868685818110611c1457611c14614a8b565b9050602002810190611c269190614b1f565b611c34906020810190614aba565b61292f565b600101611bd1565b50506110e26001609755565b611c58848484610ac1565b73ffffffffffffffffffffffffffffffffffffffff83163b1561109057611c8184848484612d7a565b611090576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160808101825260008082526020820181905291810182905260608101919091526040805160808101825260008082526020820181905291810182905260608101919091526001831080611d2f57507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40548310155b15611d3a5792915050565b611d4383612cb1565b9050806040015115611d555792915050565b6110ae83612ef4565b6060611d6982612304565b611d9f576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611da9612f92565b90508051600003611dc957604051806020016040528060008152506110ae565b80611dd384612fa2565b604051602001611de4929190614b5d565b6040516020818303038152906040529392505050565b611e02612ae1565b73ffffffffffffffffffffffffffffffffffffffff8116611ea5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610f21565b61106781612bdf565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff16611f07577fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f5460ff1615611f0b565b303b155b611f97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610f21565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff16158015612014577fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b600054610100900460ff16158080156120345750600054600160ff909116105b8061204e5750303b15801561204e575060005460ff166001145b6120da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610f21565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561213857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6121ac6040518060400160405280601081526020017f5461626c656c616e64205461626c6573000000000000000000000000000000008152506040518060400160405280600581526020017f5441424c45000000000000000000000000000000000000000000000000000000815250613004565b6121b46130c4565b6121bc613182565b6121c4613221565b6121cc6132c0565b6121d461335f565b61012d6121e18482614971565b50801561224557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015610abd5750507fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60655460ff16156110c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610f21565b60008160011115801561233757507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405482105b801561088157505060009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4460205260409020547c0100000000000000000000000000000000000000000000000000000000161590565b600061239b836115b9565b90508115612449573373ffffffffffffffffffffffffffffffffffffffff8216146124495773ffffffffffffffffffffffffffffffffffffffff811660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c476020908152604080832033845290915290205460ff16612449576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c46602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b600081600111612609575060008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c446020526040812054907c0100000000000000000000000000000000000000000000000000000000821690036126095780600003612604577f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405482106125ac576040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602052604090205480156125ac575b919050565b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff841615611090576040805173ffffffffffffffffffffffffffffffffffffffff8087168252851660208201529081018390527f16d5b5d582da969cea3131e89ffbd67ee6b1ebbe2576c7a97e9b852fce946a7f9060600160405180910390a150505050565b611067612ae1565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156126f0576110e2836133f6565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612775575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261277291810190614b8c565b60015b612801576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608401610f21565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146128b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608401610f21565b506110e2838383613500565b600260975403612928576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610f21565b6002609755565b61293883612304565b158061295a575073ffffffffffffffffffffffffffffffffffffffff84163314155b15612991576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806188b981106129d8576040517f287d9057000000000000000000000000000000000000000000000000000000008152600481018290526188b96024820152604401610f21565b7f6de956d2cb2e161f8c91c6ae7b286358c7458d5ad5e26ea2d55330fbe282839c858673ffffffffffffffffffffffffffffffffffffffff16612a1a876115b9565b73ffffffffffffffffffffffffffffffffffffffff1614868686612a3e8b8b613525565b604051612a5096959493929190614bee565b60405180910390a15050505050565b6001609755565b6000612a907f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405490565b9050612a9d8460016138a3565b7ffe0c067afc4fe17adcf4cfa139aabad6dc30dd86dfe39fb2b858961637156cdd84828585604051612ad29493929190614d0e565b60405180910390a19392505050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146110c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610f21565b612b6a6138bd565b606580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612c5e612297565b606580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612bb53390565b6040805160808101825260008082526020820181905291810182905260608101919091526108817f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40600084815260049190910160205260409020546040805160808101825273ffffffffffffffffffffffffffffffffffffffff8316815260a083901c67ffffffffffffffff1660208201527c0100000000000000000000000000000000000000000000000000000000831615159181019190915260e89190911c606082015290565b6040517f150b7a0200000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290612dd5903390899088908890600401614d44565b6020604051808303816000875af1925050508015612e2e575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252612e2b91810190614d83565b60015b612ea5573d808015612e5c576040519150601f19603f3d011682016040523d82523d6000602084013e612e61565b606091505b508051600003612e9d576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a02000000000000000000000000000000000000000000000000000000001490505b949350505050565b604080516080810182526000808252602082018190529181018290526060810191909152610881612f24836124ea565b6040805160808101825273ffffffffffffffffffffffffffffffffffffffff8316815260a083901c67ffffffffffffffff1660208201527c0100000000000000000000000000000000000000000000000000000000831615159181019190915260e89190911c606082015290565b606061012d80546109a5906148d8565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480612fbc57508190037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909101908152919050565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff166130ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f206973206e6f7420696e697469616c697a696e670000000000000000000000006064820152608401610f21565b610abd8282613929565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff1661317a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f206973206e6f7420696e697469616c697a696e670000000000000000000000006064820152608401610f21565b6110c5613a5f565b600054610100900460ff16613219576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b6110c5613b15565b600054610100900460ff166132b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b6110c5613bb5565b600054610100900460ff16613357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b6110c5613c76565b600054610100900460ff166110c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b73ffffffffffffffffffffffffffffffffffffffff81163b61349a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610f21565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61350983613d0d565b6000825111806135165750805b156110e2576110908383613d5a565b6040805160c0810182526000808252602082018190529181019190915260608082018190526080820181905260a0820152600082815261012e602052604090205473ffffffffffffffffffffffffffffffffffffffff16803b156137a6576040517f66df322e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590528216906366df322e90349060440160006040518083038185885af19350505050801561363957506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526136369190810190614ea3565b60015b6136df57613645614f8b565b806308c379a0036136985750613659614fa6565b80613664575061369a565b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f219190614249565b505b3d8080156136c4576040519150601f19603f3d011682016040523d82523d6000602084013e6136c9565b606091505b508051156136d957805181602001fd5b506136e8565b91506108819050565b6040517f3791dc6a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152821690633791dc6a90349060240160006040518083038185885af1158015613757573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261379e9190810190614ea3565b915050610881565b73ffffffffffffffffffffffffffffffffffffffff811615806137f457508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b61382a576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160c081018252600180825260208083018290528284019190915282518082018452600080825260608401919091528351808301855281815260808401528351818152918201909352909160a083019190613898565b60608152602001906001900390816138835790505b509052949350505050565b610abd828260405180602001604052806000815250613d7f565b60655460ff166110c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610f21565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff166139df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f206973206e6f7420696e697469616c697a696e670000000000000000000000006064820152608401610f21565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c42613a0a8382614971565b507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c43613a368282614971565b5060017f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40555050565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff166110c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f206973206e6f7420696e697469616c697a696e670000000000000000000000006064820152608401610f21565b600054610100900460ff16613bac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b6110c533612bdf565b600054610100900460ff16613c4c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b606580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600054610100900460ff16612a5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b613d16816133f6565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606110ae838360405180606001604052806027815260200161506160279139613e50565b613d898383613ed5565b73ffffffffffffffffffffffffffffffffffffffff83163b156110e2577f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40548281035b613ddf6000868380600101945086612d7a565b613e15576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818110613dcc57817f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405414613e4957600080fd5b5050505050565b60606000808573ffffffffffffffffffffffffffffffffffffffff1685604051613e7a919061504e565b600060405180830381855af49150503d8060008114613eb5576040519150601f19603f3d011682016040523d82523d6000602084013e613eba565b606091505b5091509150613ecb86838387614097565b9695505050505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40546000829003613f32576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831660008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c456020908152604080832080546801000000000000000188020190558483527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b81811461402c57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101613ff4565b5081600003614067576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4055506110e2600084838561263b565b6060831561412d5782516000036141265773ffffffffffffffffffffffffffffffffffffffff85163b614126576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610f21565b5081612eec565b612eec83838151156136645781518083602001fd5b7fffffffff000000000000000000000000000000000000000000000000000000008116811461106757600080fd5b60006020828403121561418257600080fd5b81356110ae81614142565b803573ffffffffffffffffffffffffffffffffffffffff8116811461260457600080fd5b600080604083850312156141c457600080fd5b6141cd8361418d565b946020939093013593505050565b60005b838110156141f65781810151838201526020016141de565b50506000910152565b600081518084526142178160208601602086016141db565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006110ae60208301846141ff565b60006020828403121561426e57600080fd5b5035919050565b60008060006060848603121561428a57600080fd5b6142938461418d565b92506142a16020850161418d565b9150604084013590509250925092565b6000602082840312156142c357600080fd5b6110ae8261418d565b60008083601f8401126142de57600080fd5b50813567ffffffffffffffff8111156142f657600080fd5b60208301915083602082850101111561430e57600080fd5b9250929050565b6000806000806060858703121561432b57600080fd5b6143348561418d565b935060208501359250604085013567ffffffffffffffff81111561435757600080fd5b614363878288016142cc565b95989497509550505050565b60008060006040848603121561438457600080fd5b61438d8461418d565b9250602084013567ffffffffffffffff8111156143a957600080fd5b6143b5868287016142cc565b9497909650939450505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116810181811067ffffffffffffffff82111715614435576144356143c2565b6040525050565b60405160c0810167ffffffffffffffff8111828210171561445f5761445f6143c2565b60405290565b600067ffffffffffffffff82111561447f5761447f6143c2565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60006144b683614465565b6040516144c382826143f1565b8092508481528585850111156144d857600080fd5b8484602083013760006020868301015250509392505050565b600082601f83011261450257600080fd5b6110ae838335602085016144ab565b6000806040838503121561452457600080fd5b61452d8361418d565b9150602083013567ffffffffffffffff81111561454957600080fd5b614555858286016144f1565b9150509250929050565b60006020828403121561457157600080fd5b813567ffffffffffffffff81111561458857600080fd5b8201601f8101841361459957600080fd5b612eec848235602084016144ab565b60008083601f8401126145ba57600080fd5b50813567ffffffffffffffff8111156145d257600080fd5b6020830191508360208260051b850101111561430e57600080fd5b6000806020838503121561460057600080fd5b823567ffffffffffffffff81111561461757600080fd5b614623858286016145a8565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b818110156117a6576146a683855173ffffffffffffffffffffffffffffffffffffffff815116825267ffffffffffffffff602082015116602083015260408101511515604083015262ffffff60608201511660608301525050565b928401926080929092019160010161464b565b6000806000604084860312156146ce57600080fd5b6146d78461418d565b9250602084013567ffffffffffffffff8111156146f357600080fd5b6143b5868287016145a8565b6020808252825182820181905260009190848201906040850190845b818110156117a65783518352928401929184019160010161471b565b60008060006060848603121561474c57600080fd5b6147558461418d565b92506020840135915061476a6040850161418d565b90509250925092565b60008060006060848603121561478857600080fd5b6147918461418d565b95602085013595506040909401359392505050565b801515811461106757600080fd5b600080604083850312156147c757600080fd5b6147d08361418d565b915060208301356147e0816147a6565b809150509250929050565b6000806000806080858703121561480157600080fd5b61480a8561418d565b93506148186020860161418d565b925060408501359150606085013567ffffffffffffffff81111561483b57600080fd5b614847878288016144f1565b91505092959194509250565b815173ffffffffffffffffffffffffffffffffffffffff16815260208083015167ffffffffffffffff169082015260408083015115159082015260608083015162ffffff169082015260808101610881565b600080604083850312156148b857600080fd5b6148c18361418d565b91506148cf6020840161418d565b90509250929050565b600181811c908216806148ec57607f821691505b602082108103614925577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f8211156110e257600081815260208120601f850160051c810160208610156149525750805b601f850160051c820191505b81811015610e585782815560010161495e565b815167ffffffffffffffff81111561498b5761498b6143c2565b61499f8161499984546148d8565b8461492b565b602080601f8311600181146149f257600084156149bc5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610e58565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015614a3f57888601518255948401946001909101908401614a20565b5085821015614a7b57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614aef57600080fd5b83018035915067ffffffffffffffff821115614b0a57600080fd5b60200191503681900382131561430e57600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112614b5357600080fd5b9190910192915050565b60008351614b6f8184602088016141db565b835190830190614b838183602088016141db565b01949350505050565b600060208284031215614b9e57600080fd5b5051919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff87168152600060208715158184015286604084015260a06060840152614c2d60a084018688614ba5565b838103608085015284511515815281850151151582820152604085015115156040820152606085015160c06060830152614c6a60c08301826141ff565b905060808601518282036080840152614c8382826141ff565b91505060a086015182820360a084015281925080518083528483019350848160051b840101858301925060005b82811015614cfc577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0858303018652614cea8285516141ff565b95870195938701939150600101614cb0565b509d9c50505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff85168152836020820152606060408201526000613ecb606083018486614ba5565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152613ecb60808301846141ff565b600060208284031215614d9557600080fd5b81516110ae81614142565b8051612604816147a6565b600082601f830112614dbc57600080fd5b8151614dc781614465565b604051614dd482826143f1565b828152856020848701011115614de957600080fd5b614dfa8360208301602088016141db565b95945050505050565b600082601f830112614e1457600080fd5b8151602067ffffffffffffffff80831115614e3157614e316143c2565b8260051b604051614e44848301826143f1565b93845285810183019383810188861115614e5d57600080fd5b84880192505b85831015614e9757825184811115614e7b5760008081fd5b614e898a87838c0101614dab565b825250918401918401614e63565b50979650505050505050565b600060208284031215614eb557600080fd5b815167ffffffffffffffff80821115614ecd57600080fd5b9083019060c08286031215614ee157600080fd5b614ee961443c565b614ef283614da0565b8152614f0060208401614da0565b6020820152614f1160408401614da0565b6040820152606083015182811115614f2857600080fd5b614f3487828601614dab565b606083015250608083015182811115614f4c57600080fd5b614f5887828601614dab565b60808301525060a083015182811115614f7057600080fd5b614f7c87828601614e03565b60a08301525095945050505050565b600060033d11156113c35760046000803e5060005160e01c90565b600060443d1015614fb45790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff816024840111818411171561500257505050505090565b828501915081518181111561501a5750505050505090565b843d87010160208285010111156150345750505050505090565b615043602082860101876143f1565b509095945050505050565b60008251614b538184602087016141db56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000813000a
Deployed Bytecode
0x6080604052600436106102855760003560e01c80636352211e11610153578063a15ab08d116100cb578063c87b56dd1161007f578063eaf5d04e11610064578063eaf5d04e14610411578063f2fde38b14610762578063f62d18881461078257600080fd5b8063c87b56dd146106cd578063e985e9c5146106ed57600080fd5b8063abf69aa3116100b0578063abf69aa31461067a578063b88d4fde1461068d578063c23dc68f146106a057600080fd5b8063a15ab08d14610424578063a22cb4651461065a57600080fd5b80638462151c116101225780638da5cb5b116101075780638da5cb5b146105fa57806395d89b411461062557806399a2557a1461063a57600080fd5b80638462151c146105ba5780638bb0ab97146105da57600080fd5b80636352211e1461055057806370a0823114610570578063715018a6146105905780638456cb59146105a557600080fd5b80633a9151b01161020157806355f804b3116101b55780635bbb21771161019a5780635bbb2177146104eb5780635c975abb1461051857806361a23d0f1461053057600080fd5b806355f804b31461048757806358edaa9c146104a757600080fd5b806342842e0e116101e657806342842e0e1461044c5780634f1ef2861461045f57806352d1902d1461047257600080fd5b80633a9151b0146104245780633f4ba83a1461043757600080fd5b8063095ea7b31161025857806323b872dd1161023d57806323b872dd146103de5780633659cfe6146103f1578063377af0da1461041157600080fd5b8063095ea7b31461034857806318160ddd1461035b57600080fd5b806301ffc9a71461028a57806305295681146102bf57806306fdde03146102e1578063081812fc14610303575b600080fd5b34801561029657600080fd5b506102aa6102a5366004614170565b6107a2565b60405190151581526020015b60405180910390f35b3480156102cb57600080fd5b506102df6102da3660046141b1565b610887565b005b3480156102ed57600080fd5b506102f6610974565b6040516102b69190614249565b34801561030f57600080fd5b5061032361031e36600461425c565b610a28565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016102b6565b6102df6103563660046141b1565b610ab1565b34801561036757600080fd5b507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c41547f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4054037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015b6040519081526020016102b6565b6102df6103ec366004614275565b610ac1565b3480156103fd57600080fd5b506102df61040c3660046142b1565b610e60565b6102df61041f366004614315565b61106a565b6103d061043236600461436f565b611096565b34801561044357600080fd5b506102df6110b5565b6102df61045a366004614275565b6110c7565b6102df61046d366004614511565b6110e7565b34801561047e57600080fd5b506103d06112d9565b34801561049357600080fd5b506102df6104a236600461455f565b6113c6565b3480156104b357600080fd5b506103236104c236600461425c565b600090815261012e602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b3480156104f757600080fd5b5061050b6105063660046145ed565b6113db565b6040516102b6919061462f565b34801561052457600080fd5b5060655460ff166102aa565b61054361053e3660046146b9565b6114c5565b6040516102b691906146ff565b34801561055c57600080fd5b5061032361056b36600461425c565b6115b9565b34801561057c57600080fd5b506103d061058b3660046142b1565b6115c4565b34801561059c57600080fd5b506102df611665565b3480156105b157600080fd5b506102df611677565b3480156105c657600080fd5b506105436105d53660046142b1565b611687565b3480156105e657600080fd5b506102df6105f5366004614737565b6117b2565b34801561060657600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff16610323565b34801561063157600080fd5b506102f66118f1565b34801561064657600080fd5b50610543610655366004614773565b611922565b34801561066657600080fd5b506102df6106753660046147b4565b611b07565b6102df6106883660046146b9565b611bbd565b6102df61069b3660046147eb565b611c4d565b3480156106ac57600080fd5b506106c06106bb36600461425c565b611cb7565b6040516102b69190614853565b3480156106d957600080fd5b506102f66106e836600461425c565b611d5e565b3480156106f957600080fd5b506102aa6107083660046148a5565b73ffffffffffffffffffffffffffffffffffffffff91821660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c476020908152604080832093909416825291909152205460ff1690565b34801561076e57600080fd5b506102df61077d3660046142b1565b611dfa565b34801561078e57600080fd5b506102df61079d36600461455f565b611eae565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316148061083557507f80ac58cd000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b8061088157507f5b5e139f000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b61088f612297565b610898816115b9565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415806108e8575073ffffffffffffffffffffffffffffffffffffffff82163314155b806109025750600081815261012f602052604090205460ff165b15610939576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600090815261012f6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905550565b60607f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4060020180546109a5906148d8565b80601f01602080910402602001604051908101604052809291908181526020018280546109d1906148d8565b8015610a1e5780601f106109f357610100808354040283529160200191610a1e565b820191906000526020600020905b815481529060010190602001808311610a0157829003601f168201915b5050505050905090565b6000610a3382612304565b610a69576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5060009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c46602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b610abd82826001612390565b5050565b6000610acc826124ea565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610b33576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c466020526040902080543380821473ffffffffffffffffffffffffffffffffffffffff881690911417610c0e5773ffffffffffffffffffffffffffffffffffffffff861660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c476020908152604080832033845290915290205460ff16610c0e576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516610c5b576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8015610c6657600082555b73ffffffffffffffffffffffffffffffffffffffff86811660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055918716808252919020805460010190554260a01b177c02000000000000000000000000000000000000000000000000000000001760008581527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4460205260408120919091557c020000000000000000000000000000000000000000000000000000000084169003610df0576001840160008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4460205260408120549003610dee577f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40548114610dee5760008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602052604090208490555b505b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610e58868686600161263b565b505050505050565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f3a896bf78ce6a4ef15f9a5b326f657b4221af07163003610f2a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c000000000000000000000000000000000000000060648201526084015b60405180910390fd5b7f000000000000000000000000f3a896bf78ce6a4ef15f9a5b326f657b4221af0773ffffffffffffffffffffffffffffffffffffffff16610f9f7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614611042576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610f21565b61104b816126b5565b60408051600080825260208201909252611067918391906126bd565b50565b611072612297565b61107a6128bc565b6110868484848461292f565b6110906001609755565b50505050565b60006110a0612297565b6110ab848484612a66565b90505b9392505050565b6110bd612ae1565b6110c5612b62565b565b6110e283838360405180602001604052806000815250611c4d565b505050565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f3a896bf78ce6a4ef15f9a5b326f657b4221af071630036111ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610f21565b7f000000000000000000000000f3a896bf78ce6a4ef15f9a5b326f657b4221af0773ffffffffffffffffffffffffffffffffffffffff166112217f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16146112c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610f21565b6112cd826126b5565b610abd828260016126bd565b60003073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000f3a896bf78ce6a4ef15f9a5b326f657b4221af0716146113a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610f21565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b90565b6113ce612ae1565b61012d610abd8282614971565b60608160008167ffffffffffffffff8111156113f9576113f96143c2565b60405190808252806020026020018201604052801561146957816020015b6040805160808101825260008082526020808301829052928201819052606082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816114175790505b50905060005b8281146114bc5761149786868381811061148b5761148b614a8b565b90506020020135611cb7565b8282815181106114a9576114a9614a8b565b602090810291909101015260010161146f565b50949350505050565b60606114cf612297565b81600181101561150b576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff811115611526576115266143c2565b60405190808252806020026020018201604052801561154f578160200160208202803683370190505b50905060005b828110156115af5761158a8787878481811061157357611573614a8b565b90506020028101906115859190614aba565b612a66565b82828151811061159c5761159c614a8b565b6020908102919091010152600101611555565b5095945050505050565b6000610881826124ea565b600073ffffffffffffffffffffffffffffffffffffffff8216611613576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff1660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c45602052604090205467ffffffffffffffff1690565b61166d612ae1565b6110c56000612bdf565b61167f612ae1565b6110c5612c56565b60606000806000611697856115c4565b905060008167ffffffffffffffff8111156116b4576116b46143c2565b6040519080825280602002602001820160405280156116dd578160200160208202803683370190505b5060408051608081018252600080825260208201819052918101829052606081019190915290915060015b8386146117a65761171881612cb1565b9150816040015161179e57815173ffffffffffffffffffffffffffffffffffffffff161561174557815194505b8773ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff160361179e578083878060010198508151811061179157611791614a8b565b6020026020010181815250505b600101611708565b50909695505050505050565b6117ba612297565b6117c3826115b9565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580611813575073ffffffffffffffffffffffffffffffffffffffff83163314155b8061182d5750600082815261012f602052604090205460ff165b15611864576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815261012e602090815260409182902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85169081179091558251858152918201527f64d442926514e7c17643406b529155919979582e13eee1dfe07cbd088ef2033e910160405180910390a1505050565b60607f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4060030180546109a5906148d8565b606081831061195d576040517f32c1995a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806119887f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405490565b9050600185101561199857600194505b808411156119a4578093505b60006119af876115c4565b9050848610156119ce57858503818110156119c8578091505b506119d2565b5060005b60008167ffffffffffffffff8111156119ed576119ed6143c2565b604051908082528060200260200182016040528015611a16578160200160208202803683370190505b50905081600003611a2c5793506110ae92505050565b6000611a3788611cb7565b905060008160400151611a48575080515b885b888114158015611a5a5750848714155b15611af657611a6881612cb1565b92508260400151611aee57825173ffffffffffffffffffffffffffffffffffffffff1615611a9557825191505b8a73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611aee5780848880600101995081518110611ae157611ae1614a8b565b6020026020010181815250505b600101611a4a565b505050928352509095945050505050565b3360008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c476020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b611bc5612297565b611bcd6128bc565b8060005b81811015611c4157611c3985858584818110611bef57611bef614a8b565b9050602002810190611c019190614b1f565b35868685818110611c1457611c14614a8b565b9050602002810190611c269190614b1f565b611c34906020810190614aba565b61292f565b600101611bd1565b50506110e26001609755565b611c58848484610ac1565b73ffffffffffffffffffffffffffffffffffffffff83163b1561109057611c8184848484612d7a565b611090576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160808101825260008082526020820181905291810182905260608101919091526040805160808101825260008082526020820181905291810182905260608101919091526001831080611d2f57507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40548310155b15611d3a5792915050565b611d4383612cb1565b9050806040015115611d555792915050565b6110ae83612ef4565b6060611d6982612304565b611d9f576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611da9612f92565b90508051600003611dc957604051806020016040528060008152506110ae565b80611dd384612fa2565b604051602001611de4929190614b5d565b6040516020818303038152906040529392505050565b611e02612ae1565b73ffffffffffffffffffffffffffffffffffffffff8116611ea5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610f21565b61106781612bdf565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff16611f07577fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f5460ff1615611f0b565b303b155b611f97576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f20697320616c726561647920696e697469616c697a65640000000000000000006064820152608401610f21565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff16158015612014577fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b600054610100900460ff16158080156120345750600054600160ff909116105b8061204e5750303b15801561204e575060005460ff166001145b6120da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610f21565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561213857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6121ac6040518060400160405280601081526020017f5461626c656c616e64205461626c6573000000000000000000000000000000008152506040518060400160405280600581526020017f5441424c45000000000000000000000000000000000000000000000000000000815250613004565b6121b46130c4565b6121bc613182565b6121c4613221565b6121cc6132c0565b6121d461335f565b61012d6121e18482614971565b50801561224557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b508015610abd5750507fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055565b60655460ff16156110c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610f21565b60008160011115801561233757507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405482105b801561088157505060009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4460205260409020547c0100000000000000000000000000000000000000000000000000000000161590565b600061239b836115b9565b90508115612449573373ffffffffffffffffffffffffffffffffffffffff8216146124495773ffffffffffffffffffffffffffffffffffffffff811660009081527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c476020908152604080832033845290915290205460ff16612449576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c46602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff88811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b600081600111612609575060008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c446020526040812054907c0100000000000000000000000000000000000000000000000000000000821690036126095780600003612604577f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405482106125ac576040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c44602052604090205480156125ac575b919050565b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff841615611090576040805173ffffffffffffffffffffffffffffffffffffffff8087168252851660208201529081018390527f16d5b5d582da969cea3131e89ffbd67ee6b1ebbe2576c7a97e9b852fce946a7f9060600160405180910390a150505050565b611067612ae1565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156126f0576110e2836133f6565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015612775575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261277291810190614b8c565b60015b612801576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608401610f21565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146128b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608401610f21565b506110e2838383613500565b600260975403612928576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610f21565b6002609755565b61293883612304565b158061295a575073ffffffffffffffffffffffffffffffffffffffff84163314155b15612991576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806188b981106129d8576040517f287d9057000000000000000000000000000000000000000000000000000000008152600481018290526188b96024820152604401610f21565b7f6de956d2cb2e161f8c91c6ae7b286358c7458d5ad5e26ea2d55330fbe282839c858673ffffffffffffffffffffffffffffffffffffffff16612a1a876115b9565b73ffffffffffffffffffffffffffffffffffffffff1614868686612a3e8b8b613525565b604051612a5096959493929190614bee565b60405180910390a15050505050565b6001609755565b6000612a907f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405490565b9050612a9d8460016138a3565b7ffe0c067afc4fe17adcf4cfa139aabad6dc30dd86dfe39fb2b858961637156cdd84828585604051612ad29493929190614d0e565b60405180910390a19392505050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146110c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610f21565b612b6a6138bd565b606580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612c5e612297565b606580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612bb53390565b6040805160808101825260008082526020820181905291810182905260608101919091526108817f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40600084815260049190910160205260409020546040805160808101825273ffffffffffffffffffffffffffffffffffffffff8316815260a083901c67ffffffffffffffff1660208201527c0100000000000000000000000000000000000000000000000000000000831615159181019190915260e89190911c606082015290565b6040517f150b7a0200000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290612dd5903390899088908890600401614d44565b6020604051808303816000875af1925050508015612e2e575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252612e2b91810190614d83565b60015b612ea5573d808015612e5c576040519150601f19603f3d011682016040523d82523d6000602084013e612e61565b606091505b508051600003612e9d576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a02000000000000000000000000000000000000000000000000000000001490505b949350505050565b604080516080810182526000808252602082018190529181018290526060810191909152610881612f24836124ea565b6040805160808101825273ffffffffffffffffffffffffffffffffffffffff8316815260a083901c67ffffffffffffffff1660208201527c0100000000000000000000000000000000000000000000000000000000831615159181019190915260e89190911c606082015290565b606061012d80546109a5906148d8565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a900480612fbc57508190037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909101908152919050565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff166130ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f206973206e6f7420696e697469616c697a696e670000000000000000000000006064820152608401610f21565b610abd8282613929565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff1661317a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f206973206e6f7420696e697469616c697a696e670000000000000000000000006064820152608401610f21565b6110c5613a5f565b600054610100900460ff16613219576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b6110c5613b15565b600054610100900460ff166132b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b6110c5613bb5565b600054610100900460ff16613357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b6110c5613c76565b600054610100900460ff166110c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b73ffffffffffffffffffffffffffffffffffffffff81163b61349a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610f21565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61350983613d0d565b6000825111806135165750805b156110e2576110908383613d5a565b6040805160c0810182526000808252602082018190529181019190915260608082018190526080820181905260a0820152600082815261012e602052604090205473ffffffffffffffffffffffffffffffffffffffff16803b156137a6576040517f66df322e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152602482018590528216906366df322e90349060440160006040518083038185885af19350505050801561363957506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526136369190810190614ea3565b60015b6136df57613645614f8b565b806308c379a0036136985750613659614fa6565b80613664575061369a565b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f219190614249565b505b3d8080156136c4576040519150601f19603f3d011682016040523d82523d6000602084013e6136c9565b606091505b508051156136d957805181602001fd5b506136e8565b91506108819050565b6040517f3791dc6a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152821690633791dc6a90349060240160006040518083038185885af1158015613757573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261379e9190810190614ea3565b915050610881565b73ffffffffffffffffffffffffffffffffffffffff811615806137f457508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b61382a576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160c081018252600180825260208083018290528284019190915282518082018452600080825260608401919091528351808301855281815260808401528351818152918201909352909160a083019190613898565b60608152602001906001900390816138835790505b509052949350505050565b610abd828260405180602001604052806000815250613d7f565b60655460ff166110c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610f21565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff166139df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f206973206e6f7420696e697469616c697a696e670000000000000000000000006064820152608401610f21565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c42613a0a8382614971565b507f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c43613a368282614971565b5060017f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40555050565b7fee151c8401928dc223602bb187aff91b9a56c7cae5476ef1b3287b085a16c85f54610100900460ff166110c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f455243373231415f5f496e697469616c697a61626c653a20636f6e747261637460448201527f206973206e6f7420696e697469616c697a696e670000000000000000000000006064820152608401610f21565b600054610100900460ff16613bac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b6110c533612bdf565b600054610100900460ff16613c4c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b606580547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600054610100900460ff16612a5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f21565b613d16816133f6565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606110ae838360405180606001604052806027815260200161506160279139613e50565b613d898383613ed5565b73ffffffffffffffffffffffffffffffffffffffff83163b156110e2577f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40548281035b613ddf6000868380600101945086612d7a565b613e15576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818110613dcc57817f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c405414613e4957600080fd5b5050505050565b60606000808573ffffffffffffffffffffffffffffffffffffffff1685604051613e7a919061504e565b600060405180830381855af49150503d8060008114613eb5576040519150601f19603f3d011682016040523d82523d6000602084013e613eba565b606091505b5091509150613ecb86838387614097565b9695505050505050565b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40546000829003613f32576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831660008181527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c456020908152604080832080546801000000000000000188020190558483527f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b81811461402c57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101613ff4565b5081600003614067576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c4055506110e2600084838561263b565b6060831561412d5782516000036141265773ffffffffffffffffffffffffffffffffffffffff85163b614126576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610f21565b5081612eec565b612eec83838151156136645781518083602001fd5b7fffffffff000000000000000000000000000000000000000000000000000000008116811461106757600080fd5b60006020828403121561418257600080fd5b81356110ae81614142565b803573ffffffffffffffffffffffffffffffffffffffff8116811461260457600080fd5b600080604083850312156141c457600080fd5b6141cd8361418d565b946020939093013593505050565b60005b838110156141f65781810151838201526020016141de565b50506000910152565b600081518084526142178160208601602086016141db565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815260006110ae60208301846141ff565b60006020828403121561426e57600080fd5b5035919050565b60008060006060848603121561428a57600080fd5b6142938461418d565b92506142a16020850161418d565b9150604084013590509250925092565b6000602082840312156142c357600080fd5b6110ae8261418d565b60008083601f8401126142de57600080fd5b50813567ffffffffffffffff8111156142f657600080fd5b60208301915083602082850101111561430e57600080fd5b9250929050565b6000806000806060858703121561432b57600080fd5b6143348561418d565b935060208501359250604085013567ffffffffffffffff81111561435757600080fd5b614363878288016142cc565b95989497509550505050565b60008060006040848603121561438457600080fd5b61438d8461418d565b9250602084013567ffffffffffffffff8111156143a957600080fd5b6143b5868287016142cc565b9497909650939450505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116810181811067ffffffffffffffff82111715614435576144356143c2565b6040525050565b60405160c0810167ffffffffffffffff8111828210171561445f5761445f6143c2565b60405290565b600067ffffffffffffffff82111561447f5761447f6143c2565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b60006144b683614465565b6040516144c382826143f1565b8092508481528585850111156144d857600080fd5b8484602083013760006020868301015250509392505050565b600082601f83011261450257600080fd5b6110ae838335602085016144ab565b6000806040838503121561452457600080fd5b61452d8361418d565b9150602083013567ffffffffffffffff81111561454957600080fd5b614555858286016144f1565b9150509250929050565b60006020828403121561457157600080fd5b813567ffffffffffffffff81111561458857600080fd5b8201601f8101841361459957600080fd5b612eec848235602084016144ab565b60008083601f8401126145ba57600080fd5b50813567ffffffffffffffff8111156145d257600080fd5b6020830191508360208260051b850101111561430e57600080fd5b6000806020838503121561460057600080fd5b823567ffffffffffffffff81111561461757600080fd5b614623858286016145a8565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b818110156117a6576146a683855173ffffffffffffffffffffffffffffffffffffffff815116825267ffffffffffffffff602082015116602083015260408101511515604083015262ffffff60608201511660608301525050565b928401926080929092019160010161464b565b6000806000604084860312156146ce57600080fd5b6146d78461418d565b9250602084013567ffffffffffffffff8111156146f357600080fd5b6143b5868287016145a8565b6020808252825182820181905260009190848201906040850190845b818110156117a65783518352928401929184019160010161471b565b60008060006060848603121561474c57600080fd5b6147558461418d565b92506020840135915061476a6040850161418d565b90509250925092565b60008060006060848603121561478857600080fd5b6147918461418d565b95602085013595506040909401359392505050565b801515811461106757600080fd5b600080604083850312156147c757600080fd5b6147d08361418d565b915060208301356147e0816147a6565b809150509250929050565b6000806000806080858703121561480157600080fd5b61480a8561418d565b93506148186020860161418d565b925060408501359150606085013567ffffffffffffffff81111561483b57600080fd5b614847878288016144f1565b91505092959194509250565b815173ffffffffffffffffffffffffffffffffffffffff16815260208083015167ffffffffffffffff169082015260408083015115159082015260608083015162ffffff169082015260808101610881565b600080604083850312156148b857600080fd5b6148c18361418d565b91506148cf6020840161418d565b90509250929050565b600181811c908216806148ec57607f821691505b602082108103614925577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f8211156110e257600081815260208120601f850160051c810160208610156149525750805b601f850160051c820191505b81811015610e585782815560010161495e565b815167ffffffffffffffff81111561498b5761498b6143c2565b61499f8161499984546148d8565b8461492b565b602080601f8311600181146149f257600084156149bc5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555610e58565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015614a3f57888601518255948401946001909101908401614a20565b5085821015614a7b57878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112614aef57600080fd5b83018035915067ffffffffffffffff821115614b0a57600080fd5b60200191503681900382131561430e57600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112614b5357600080fd5b9190910192915050565b60008351614b6f8184602088016141db565b835190830190614b838183602088016141db565b01949350505050565b600060208284031215614b9e57600080fd5b5051919050565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b73ffffffffffffffffffffffffffffffffffffffff87168152600060208715158184015286604084015260a06060840152614c2d60a084018688614ba5565b838103608085015284511515815281850151151582820152604085015115156040820152606085015160c06060830152614c6a60c08301826141ff565b905060808601518282036080840152614c8382826141ff565b91505060a086015182820360a084015281925080518083528483019350848160051b840101858301925060005b82811015614cfc577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0858303018652614cea8285516141ff565b95870195938701939150600101614cb0565b509d9c50505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff85168152836020820152606060408201526000613ecb606083018486614ba5565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152613ecb60808301846141ff565b600060208284031215614d9557600080fd5b81516110ae81614142565b8051612604816147a6565b600082601f830112614dbc57600080fd5b8151614dc781614465565b604051614dd482826143f1565b828152856020848701011115614de957600080fd5b614dfa8360208301602088016141db565b95945050505050565b600082601f830112614e1457600080fd5b8151602067ffffffffffffffff80831115614e3157614e316143c2565b8260051b604051614e44848301826143f1565b93845285810183019383810188861115614e5d57600080fd5b84880192505b85831015614e9757825184811115614e7b5760008081fd5b614e898a87838c0101614dab565b825250918401918401614e63565b50979650505050505050565b600060208284031215614eb557600080fd5b815167ffffffffffffffff80821115614ecd57600080fd5b9083019060c08286031215614ee157600080fd5b614ee961443c565b614ef283614da0565b8152614f0060208401614da0565b6020820152614f1160408401614da0565b6040820152606083015182811115614f2857600080fd5b614f3487828601614dab565b606083015250608083015182811115614f4c57600080fd5b614f5887828601614dab565b60808301525060a083015182811115614f7057600080fd5b614f7c87828601614e03565b60a08301525095945050505050565b600060033d11156113c35760046000803e5060005160e01c90565b600060443d1015614fb45790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff816024840111818411171561500257505050505090565b828501915081518181111561501a5750505050505090565b843d87010160208285010111156150345750505050505090565b615043602082860101876143f1565b509095945050505050565b60008251614b538184602087016141db56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000813000a
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.