Source Code
Overview
ETH Balance
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 23439660 | 136 days ago | 0 ETH | ||||
| 23439660 | 136 days ago | 0 ETH | ||||
| 23439660 | 136 days ago | 0 ETH | ||||
| 23439660 | 136 days ago | 0 ETH | ||||
| 23352112 | 138 days ago | 0 ETH | ||||
| 23352112 | 138 days ago | 0 ETH | ||||
| 23352112 | 138 days ago | 0 ETH | ||||
| 23352112 | 138 days ago | 0 ETH | ||||
| 22191191 | 166 days ago | 0 ETH | ||||
| 22191191 | 166 days ago | 0 ETH | ||||
| 22191191 | 166 days ago | 0 ETH | ||||
| 22191191 | 166 days ago | 0 ETH | ||||
| 21678000 | 178 days ago | 0 ETH | ||||
| 21678000 | 178 days ago | 0 ETH | ||||
| 21678000 | 178 days ago | 0 ETH | ||||
| 21678000 | 178 days ago | 0 ETH | ||||
| 18364812 | 281 days ago | 0 ETH | ||||
| 18364812 | 281 days ago | 0 ETH | ||||
| 18364812 | 281 days ago | 0 ETH | ||||
| 18364812 | 281 days ago | 0 ETH | ||||
| 18364628 | 281 days ago | 0 ETH | ||||
| 18364628 | 281 days ago | 0 ETH | ||||
| 18364628 | 281 days ago | 0 ETH | ||||
| 18364628 | 281 days ago | 0 ETH | ||||
| 18364211 | 281 days ago | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ReceiptNFT
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 1 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import {ReceiptData} from "./lib/Structs.sol";
contract ReceiptNFT is ERC721Upgradeable, UUPSUpgradeable, OwnableUpgradeable {
using Strings for uint256;
uint256 private _receiptsCounter;
mapping(uint256 => ReceiptData) public receipts;
mapping(address => bool) public managers;
string public uri;
bool public dynamicURI;
modifier onlyManager() {
if (managers[msg.sender] == false) revert NotManager();
_;
}
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
// lock implementation
_disableInitializers();
}
function initialize(bytes memory initializeData) external initializer {
__Ownable_init();
__UUPSUpgradeable_init();
__ERC721_init("Proof Of Deposit", "CLIP-V1-POD");
// decode initialize data
(address strategyRouter, address batch, string memory link, bool isDynamic) = abi.decode(
initializeData,
(address, address, string, bool)
);
setBaseURI(link, isDynamic);
managers[strategyRouter] = true;
managers[batch] = true;
// transer ownership and set proxi admin to address that deployed this contract from Create2Deployer
transferOwnership(tx.origin);
}
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
function setAmount(uint256 receiptId, uint256 amount) external onlyManager {
if (!_exists(receiptId)) revert NonExistingToken();
if (receipts[receiptId].tokenAmountUniform < amount) revert ReceiptAmountCanOnlyDecrease();
receipts[receiptId].tokenAmountUniform = amount;
emit SetAmount(receiptId, amount);
}
function mint(uint256 cycleId, uint256 amount, address token, address wallet) external onlyManager {
uint256 _receiptId = _receiptsCounter;
receipts[_receiptId] = ReceiptData({cycleId: cycleId, token: token, tokenAmountUniform: amount});
_mint(wallet, _receiptId);
_receiptsCounter++;
}
function burn(uint256 receiptId) external onlyManager {
if (!_exists(receiptId)) revert NonExistingToken();
_burn(receiptId);
delete receipts[receiptId];
}
/// @notice Get receipt data recorded in NFT.
function getReceipt(uint256 receiptId) external view returns (ReceiptData memory) {
if (_exists(receiptId) == false) revert NonExistingToken();
return receipts[receiptId];
}
/**
* @dev Returns an array of token IDs owned by `owner`,
* in the range [`start`, `stop`].
*
* This function allows for tokens to be queried if the collection
* grows too big for a single call of {ReceiptNFT-getTokensOfOwner}.
*
* Requirements:
*
* - `start <= receiptId < stop`
*/
function getTokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) public view returns (uint256[] memory receiptIds) {
unchecked {
if (start >= stop) revert InvalidQueryRange();
uint256 receiptIdsIdx;
uint256 stopLimit = _receiptsCounter;
// Set `stop = min(stop, stopLimit)`.
if (stop > stopLimit) {
// At this point `start` could be greater than `stop`.
stop = stopLimit;
}
uint256 receiptIdsMaxLength = balanceOf(owner);
// Set `receiptIdsMaxLength = min(balanceOf(owner), stop - start)`,
// to cater for cases where `balanceOf(owner)` is too big.
if (start < stop) {
uint256 rangeLength = stop - start;
if (rangeLength < receiptIdsMaxLength) {
receiptIdsMaxLength = rangeLength;
}
} else {
receiptIdsMaxLength = 0;
}
receiptIds = new uint256[](receiptIdsMaxLength);
if (receiptIdsMaxLength == 0) {
return receiptIds;
}
// We want to scan tokens in range [start <= receiptId < stop].
// And if whole range is owned by user or when receiptIdsMaxLength is less than range,
// then we also want to exit loop when array is full.
uint256 receiptId = start;
while (receiptId != stop && receiptIdsIdx != receiptIdsMaxLength) {
if (_exists(receiptId) && ownerOf(receiptId) == owner) {
receiptIds[receiptIdsIdx++] = receiptId;
}
receiptId++;
}
// If after scan we haven't filled array, then downsize the array to fit.
assembly {
mstore(receiptIds, receiptIdsIdx)
}
return receiptIds;
}
}
/**
* @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 {ReceiptNFT-getTokensOfOwnerIn} for splitting the scan into
* multiple smaller scans if the collection is large enough to cause
* an out-of-gas error.
*/
function getTokensOfOwner(address owner) public view returns (uint256[] memory receiptIds) {
uint256 balance = balanceOf(owner);
receiptIds = new uint256[](balance);
uint256 receiptId;
while (balance > 0) {
if (_exists(receiptId) && ownerOf(receiptId) == owner) {
receiptIds[--balance] = receiptId;
}
receiptId++;
}
}
function tokenURI(uint256 receiptId) public view virtual override returns (string memory) {
if (!_exists(receiptId)) revert NonExistingToken();
return dynamicURI != true ? uri : string(abi.encodePacked(uri, receiptId.toString()));
}
function setBaseURI(string memory link, bool dynamic) public onlyOwner {
uri = link;
dynamicURI = dynamic;
emit BaseURISet(link, dynamic);
}
function getReceiptsCounter() external view returns (uint256) {
return _receiptsCounter;
}
/* ERRORS */
error NonExistingToken();
error ReceiptAmountCanOnlyDecrease();
error NotManager();
/// Invalid query range (`start` >= `stop`).
error InvalidQueryRange();
/* EVENTS */
event SetAmount(uint256 indexed receiptId, uint256 amount);
event BaseURISet(string newBaseURI, bool isDynamicURI);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. 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 "../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 {
function __ERC1967Upgrade_init() internal onlyInitializing {
}
function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
}
// This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation address.
*/
function _getImplementation() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Perform implementation upgrade
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Perform implementation upgrade with additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {
_upgradeTo(newImplementation);
if (data.length > 0 || forceCall) {
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.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*
* _Available since v4.1._
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address private immutable __self = address(this);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
require(address(this) != __self, "Function must be called through delegatecall");
require(_getImplementation() == __self, "Function must be called through active proxy");
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
_;
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @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.9.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
using AddressUpgradeable for address;
using StringsUpgradeable for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC721_init_unchained(name_, symbol_);
}
function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
return
interfaceId == type(IERC721Upgradeable).interfaceId ||
interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: address zero is not a valid owner");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _ownerOf(tokenId);
require(owner != address(0), "ERC721: invalid token ID");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
_requireMinted(tokenId);
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @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, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721Upgradeable.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not token owner or approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
_requireMinted(tokenId);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved");
_safeTransfer(from, to, tokenId, data);
}
/**
* @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.
*
* `data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
*/
function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
return _owners[tokenId];
}
/**
* @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 (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _ownerOf(tokenId) != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
address owner = ERC721Upgradeable.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId, 1);
// Check that tokenId was not minted by `_beforeTokenTransfer` hook
require(!_exists(tokenId), "ERC721: token already minted");
unchecked {
// Will not overflow unless all 2**256 token ids are minted to the same owner.
// Given that tokens are minted one by one, it is impossible in practice that
// this ever happens. Might change if we allow batch minting.
// The ERC fails to describe this case.
_balances[to] += 1;
}
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId, 1);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
* This is an internal function that does not check if the sender is authorized to operate on the token.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721Upgradeable.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId, 1);
// Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
owner = ERC721Upgradeable.ownerOf(tokenId);
// Clear approvals
delete _tokenApprovals[tokenId];
unchecked {
// Cannot overflow, as that would require more tokens to be burned/transferred
// out than the owner initially received through minting and transferring in.
_balances[owner] -= 1;
}
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId, 1);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(address from, address to, uint256 tokenId) internal virtual {
require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId, 1);
// Check that tokenId was not transferred by `_beforeTokenTransfer` hook
require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
// Clear approvals from the previous owner
delete _tokenApprovals[tokenId];
unchecked {
// `_balances[from]` cannot overflow for the same reason as described in `_burn`:
// `from`'s balance is the number of token held, which is at least one before the current
// transfer.
// `_balances[to]` could overflow in the conditions described in `_mint`. That would require
// all 2**256 token ids to be minted, which in practice is impossible.
_balances[from] -= 1;
_balances[to] += 1;
}
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId, 1);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Reverts if the `tokenId` has not been minted yet.
*/
function _requireMinted(uint256 tokenId) internal view virtual {
require(_exists(tokenId), "ERC721: invalid token ID");
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
* used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
* - When `from` is zero, the tokens will be minted for `to`.
* - When `to` is zero, ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}
/**
* @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
* used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
* - When `from` is zero, the tokens were minted for `to`.
* - When `to` is zero, ``from``'s tokens were burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {}
/**
* @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
*
* WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant
* being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such
* that `ownerOf(tokenId)` is `a`.
*/
// solhint-disable-next-line func-name-mixedcase
function __unsafe_increaseBalance(address account, uint256 amount) internal {
_balances[account] += amount;
}
/**
* @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[44] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721Upgradeable.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
/**
* @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);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721ReceiverUpgradeable {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165Upgradeable.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721Upgradeable is IERC165Upgradeable {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (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 v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library MathUpgradeable {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMathUpgradeable {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// 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
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/MathUpgradeable.sol";
import "./math/SignedMathUpgradeable.sol";
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = MathUpgradeable.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, MathUpgradeable.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
struct TokenPrice {
uint256 price;
uint8 priceDecimals;
address token;
}
struct StrategyInfo {
address strategyAddress;
address depositToken;
uint256 depositTokenInSupportedTokensIndex;
uint256 weight;
}
struct IdleStrategyInfo {
address strategyAddress;
address depositToken;
}
struct ReceiptData {
uint256 cycleId;
uint256 tokenAmountUniform; // in token
address token;
}
struct Cycle {
// block.timestamp at which cycle started
uint256 startAt;
// batch USD value before deposited into strategies
uint256 totalDepositedInUsd;
// USD value received by strategies after all swaps necessary to ape into strategies
uint256 receivedByStrategiesInUsd;
// Protocol TVL after compound idle strategy and actual deposit to strategies
uint256 strategiesBalanceWithCompoundAndBatchDepositsInUsd;
// price per share in USD
uint256 pricePerShare;
// tokens price at time of the deposit to strategies
mapping(address => uint256) prices;
}{
"viaIR": true,
"optimizer": {
"enabled": true,
"runs": 1,
"details": {
"peephole": true,
"yulDetails": {
"stackAllocation": true,
"optimizerSteps": "dhfoD[xarrscLMcCTU]uljmul"
}
}
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"NonExistingToken","type":"error"},{"inputs":[],"name":"NotManager","type":"error"},{"inputs":[],"name":"ReceiptAmountCanOnlyDecrease","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":false,"internalType":"string","name":"newBaseURI","type":"string"},{"indexed":false,"internalType":"bool","name":"isDynamicURI","type":"bool"}],"name":"BaseURISet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"receiptId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SetAmount","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":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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"receiptId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dynamicURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"receiptId","type":"uint256"}],"name":"getReceipt","outputs":[{"components":[{"internalType":"uint256","name":"cycleId","type":"uint256"},{"internalType":"uint256","name":"tokenAmountUniform","type":"uint256"},{"internalType":"address","name":"token","type":"address"}],"internalType":"struct ReceiptData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReceiptsCounter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"getTokensOfOwner","outputs":[{"internalType":"uint256[]","name":"receiptIds","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":"getTokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"receiptIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"initializeData","type":"bytes"}],"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":"","type":"address"}],"name":"managers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"cycleId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"wallet","type":"address"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","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":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"receipts","outputs":[{"internalType":"uint256","name":"cycleId","type":"uint256"},{"internalType":"uint256","name":"tokenAmountUniform","type":"uint256"},{"internalType":"address","name":"token","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","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":"nonpayable","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"receiptId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"link","type":"string"},{"internalType":"bool","name":"dynamic","type":"bool"}],"name":"setBaseURI","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":"receiptId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60a06040523462000034576200001462000039565b604051612fe69081620001f98239608051818181610ef001526110140152f35b600080fd5b620000436200004f565b6200004d6200017e565b565b6200004d62000094565b6200006f9062000072906001600160a01b031682565b90565b6001600160a01b031690565b6200006f9062000059565b6200006f906200007e565b6200009f3062000089565b608052565b6200006f9060081c5b60ff1690565b6200006f9054620000a4565b60208082526027908201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604082015266616c697a696e6760c81b606082015260800190565b156200010e57565b60405162461bcd60e51b8152806200012960048201620000bf565b0390fd5b6200006f90620000ad565b6200006f90546200012d565b620000ad6200006f6200006f9260ff1690565b906200016b6200006f6200017a9262000144565b825460ff191660ff9091161790565b9055565b6200019c62000196620001926000620000b3565b1590565b62000106565b620001a8600062000138565b60ff90811603620001b557565b620001c360ff600062000157565b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498620001ee60405190565b60ff8152602090a156fe6080604052600436101561001257600080fd5b60003560e01c806301ffc9a71461021257806306fdde031461020d578063081812fc14610208578063095ea7b3146102035780630f7ee1ec146101fe578063137bc427146101f957806323b872dd146101f45780633659cfe6146101ef57806342842e0e146101ea57806342966c68146101e5578063439fab91146101e05780634f1ef286146101db57806352d1902d146101d65780635734b968146101d15780635de6dc55146101cc5780636352211e146101c757806370a08231146101c2578063715018a6146101bd5780638da5cb5b146101b857806395d89b41146101b3578063a22cb465146101ae578063a5f5a7f1146101a9578063b63e6ac3146101a4578063b64b21ca1461019f578063b88d4fde1461019a578063c6a023e914610195578063c87b56dd14610190578063e985e9c51461018b578063eac989f814610186578063ebde463c14610181578063f2fde38b1461017c5763fdff9b4d0361023457610c68565b610c0a565b610bef565b610bd4565b610a94565b610a5d565b610a44565b610a0c565b6109a4565b61094f565b6108f8565b6108b6565b610863565b610848565b610830565b610815565b6107fa565b6107d3565b610750565b6106e8565b6106d4565b610687565b610587565b61056e565b610556565b610529565b6104e5565b610494565b6103df565b61037f565b61030c565b610263565b6001600160e01b03191690565b61022d81610217565b0361023457565b600080fd5b9050359061024682610224565b565b906020828203126102345761025c91610239565b90565b9052565b346102345761029161027e610279366004610248565b6113e1565b6040515b91829182901515815260200190565b0390f35b600091031261023457565b60005b8381106102b35750506000910152565b81810151838201526020016102a3565b6102e46102ed6020936102f7936102d8815190565b80835293849260200190565b958691016102a0565b601f01601f191690565b0190565b90602061025c9281815201906102c3565b346102345761031c366004610295565b610291610327611540565b604051918291826102fb565b8061022d565b9050359061024682610333565b906020828203126102345761025c91610339565b6001600160a01b031690565b61025f9061035a565b6020810192916102469190610366565b346102345761029161039a610395366004610346565b61167b565b6040519182918261036f565b61022d8161035a565b90503590610246826103a6565b9190604083820312610234578060206103d861025c93866103af565b9401610339565b34610234576103f86103f23660046103bc565b9061161c565b604051005b61025c61025c61025c9290565b90610414906103fd565b600052602052604060002090565b61025c9081565b61025c9054610422565b61025c905461035a565b6104499061012e61040a565b61045281610429565b9161025c600261046460018501610429565b9301610433565b60409061048d61024694969593966104868360608101999052565b6020830152565b0190610366565b34610234576102916104af6104aa366004610346565b61043d565b6040519193919384938461046b565b61025c9160031b1c5b60ff1690565b9061025c91546104be565b61025c60006101316104cd565b34610234576104f5366004610295565b61029161027e6104d8565b90916060828403126102345761025c61051984846103af565b9360406103d882602087016103af565b34610234576103f861053c366004610500565b91611716565b906020828203126102345761025c916103af565b34610234576103f8610569366004610542565b6110bf565b34610234576103f8610581366004610500565b91611745565b34610234576103f861059a366004610346565b61283e565b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b038211176105d657604052565b61059f565b906102466105e860405190565b92836105b5565b6001600160401b0381116105d657602090601f01601f19160190565b90826000939282370152565b9092919261062c610627826105ef565b6105db565b9182948284528282011161023457602061024693019061060b565b9080601f830112156102345781602061025c93359101610617565b906020828203126102345781356001600160401b0381116102345761025c9201610647565b34610234576103f861069a366004610662565b6121e3565b919091604081840312610234576106b683826103af565b9260208201356001600160401b0381116102345761025c9201610647565b6103f86106e236600461069f565b906113d7565b34610234576106f8366004610295565b610291610703610f51565b6040515b9182918290815260200190565b608081830312610234576107288282610339565b9261025c6107398460208501610339565b93606061074982604087016103af565b94016103af565b34610234576103f8610763366004610714565b929190916126b3565b9061078c61078561077b845190565b8084529260200190565b9260200190565b9060005b81811061079d5750505090565b9091926107ba6107b36001928651815260200190565b9460200190565b929101610790565b90602061025c92818152019061076c565b34610234576102916107ee6107e9366004610542565b612b04565b604051918291826107c2565b346102345761029161039a610810366004610346565b61150e565b346102345761029161070361082b366004610542565b611494565b3461023457610840366004610295565b6103f8610cc5565b3461023457610858366004610295565b61029161039a610c83565b3461023457610873366004610295565b61029161032761154a565b80151561022d565b905035906102468261087e565b9190604083820312610234578060206108af61025c93866103af565b9401610886565b34610234576103f86108c9366004610893565b90611692565b90916060828403126102345761025c6108e884846103af565b9360406103d88260208701610339565b34610234576102916107ee61090e3660046108cf565b916129cf565b90604080610246936109268482519052565b61093560208201516020860152565b0151910190610366565b6060810192916102469190610914565b346102345761029161096a610965366004610346565b61292a565b6040519182918261093f565b9190604083820312610234578235906001600160401b0382116102345760206108af8261025c948701610647565b34610234576103f86109b7366004610976565b90612f7b565b90608082820312610234576109d281836103af565b926109e082602085016103af565b926109ee8360408301610339565b9260608201356001600160401b0381116102345761025c9201610647565b34610234576103f8610a1f3660046109bd565b92919091611755565b9190604083820312610234578060206103d861025c9386610339565b34610234576103f8610a57366004610a28565b9061257d565b3461023457610291610327610a73366004610346565b612c47565b91906040838203126102345780602061074961025c93866103af565b346102345761029161027e610aaa366004610a78565b9061169d565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b600181811c929116828115610afd575b506020831014610af857565b610ac6565b607f16925038610aec565b80546000939291610b25610b1b83610adc565b8085529360200190565b9160018116908115610b775750600114610b3e57505050565b610b519192939450600052602060002090565b916000925b818410610b635750500190565b805484840152602090930192600101610b56565b60ff19168352505090151560051b019150565b9061025c91610b08565b90610246610ba160405190565b80610bad818096610b8a565b03906105b5565b90610bc25761025c90610b94565b610ab0565b61025c6000610130610bb4565b3461023457610be4366004610295565b610291610327610bc7565b3461023457610bff366004610295565b610291610703612f85565b34610234576103f8610c1d366004610542565b610dd9565b61025c9061035a906001600160a01b031682565b61025c90610c22565b61025c90610c36565b9061041490610c3f565b6000610c6361025c9261012f610c48565b6104cd565b346102345761029161027e610c7e366004610542565b610c52565b61025c60fb610433565b610c95610d21565b610246610cb3565b61035a61025c61025c9290565b61025c90610c9d565b610246610cc06000610caa565b610e12565b610246610c8d565b15610cd457565b60405162461bcd60e51b815280610d1d600482016020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b0390fd5b610246610d2c610c83565b610d43610d3d3361035a565b61035a565b9161035a565b14610ccd565b61024690610d55610d21565b610db5565b15610d6157565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b61024690610cc0610dc9610d386000610caa565b610dd28361035a565b1415610d5a565b61024690610d49565b90610df261025c610e0e92610c3f565b82546001600160a01b0319166001600160a01b03919091161790565b9055565b610e38610e32610e2260fb610433565b610e2d8460fb610de2565b610c3f565b91610c3f565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0610e6360405190565b80805b0390a3565b15610e7257565b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608490fd5b61025c90610f1a610ee830610c3f565b610f14610d3d7f000000000000000000000000000000000000000000000000000000000000000061035a565b14610e6b565b610f48565b61025c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6103fd565b5061025c610f1f565b61025c6000610ed8565b15610f6257565b60405162461bcd60e51b815260206004820152602c6024820152600080516020612f9183398151915260448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b15610fb157565b60405162461bcd60e51b815260206004820152602c6024820152600080516020612f9183398151915260448201526b6163746976652070726f787960a01b6064820152608490fd5b6102469061105861104061104761100f30610c3f565b6110387f000000000000000000000000000000000000000000000000000000000000000061035a565b92839161035a565b1415610f5b565b611052610d386110c8565b14610faa565b611099565b9061106a610627836105ef565b918252565b369037565b906102466110818361105d565b60208194611091601f19916105ef565b01910161106f565b6000610246916110a881612498565b6110b96110b4836103fd565b611074565b90611196565b61024690610ff9565b61025c6110d661025c610f1f565b610433565b61025c7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91436103fd565b61025c906104c7565b61025c9054611104565b9050519061024682610333565b906020828203126102345761025c91611117565b1561113f57565b60405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b91906111ab6111a661025c6110db565b61110d565b156111bb57505061024690611308565b6111c7610e2d84610c3f565b60206111d260405190565b6352d1902d60e01b815291829060049082905afa60009181611276575b50611251575060405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b926112716102469461126b61126761025c610f1f565b9190565b14611138565b61132d565b61129891925060203d811161129f575b61129081836105b5565b810190611124565b90386111ef565b503d611286565b156112ad57565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b6102469061131d61131882611d12565b6112a6565b61132861025c610f1f565b610de2565b916113378361136c565b815161134661126760006103fd565b11908115611364575b50611358575050565b61136191611d6f565b50565b90503861134f565b61137990610e2d81611308565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b6113a360405190565b80805b0390a2565b90610246916113c261104061104761100f30610c3f565b610246916001916113d281612498565b611196565b90610246916113ab565b6113f16380ac58cd60e01b610217565b906113fb81610217565b91821491821561141b575b508115611411575090565b61025c9150611e61565b90915061142e635b5e139f60e01b610217565b149038611406565b1561143d57565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608490fd5b6114c261025c916114bb6114ab610d386000610caa565b6114b48361035a565b1415611436565b6068610c48565b610429565b156114ce57565b60405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606490fd5b611517906117f5565b61025c611527610d386000610caa565b6115308361035a565b14156114c7565b61025c90610b94565b61025c6065611537565b61025c6066611537565b1561155b57565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b156115b157565b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b906102469161166561162d8361150e565b6116368161035a565b61164a816116438661035a565b1415611554565b33906116558261035a565b1491821561166a575b50506115aa565b611a6c565b611674925061169d565b388061165e565b6110d661025c9161168b81611b89565b606961040a565b610246919033611b20565b61025c916116af6111a692606a610c48565b610c48565b156116bb57565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b61024692919061172e6117298433611803565b6116b4565b611966565b61025c600061105d565b61025c611733565b90916102469261175361173d565b925b610246939291906117696117298433611803565b6117d6565b1561177557565b6040515b62461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608490fd5b9161024693916117f0936117eb838383611966565b611c2f565b61176e565b6110d661025c91606761040a565b61180c8261150e565b916118168361035a565b916118208161035a565b92831493841561184b575b5050821561183857505090565b611847919250610d389061167b565b1490565b61185692945061169d565b91388061182b565b1561186557565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b156118bf57565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b9060031b6119296001600160a01b03821b5b9384921b90565b169119161790565b919061194261025c610e0e93610c3f565b908354611910565b61024691600091611931565b9061025c61025c610e0e926103fd565b611a35611a2f611a3b92949394611a2061198e6119946119858861150e565b6110388561035a565b1461185e565b6119b46119a4610d386000610caa565b6119ad8a61035a565b14156118b8565b6119ce6119c160016103fd565b9161198e610d388a61150e565b6119e360006119de89606961040a565b61194a565b611a086119f1846068610c48565b611a02836119fe83610429565b0390565b90611956565b611a02611a16896068610c48565b916102f783610429565b610e2d8661132887606761040a565b93610c3f565b916103fd565b917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611a6660405190565b600090a4565b90611a7c8261132883606961040a565b611a8e611a35611a2f610e2d8461150e565b917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925611a6660405190565b15611ac057565b60405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606490fd5b90611b1161025c610e0e92151590565b825460ff191660ff9091161790565b610e66611b7f611a2f7f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3193611b67611b578761035a565b611b608361035a565b1415611ab9565b610e2d87611b7a886116af85606a610c48565b611b01565b9361028260405190565b611b9561024691611b9a565b6114c7565b611ba3906117f5565b611bb3610d3d610d386000610caa565b141590565b9050519061024682610224565b906020828203126102345761025c91611bb8565b9061025c9493611bfc608094611bf285611c0395610366565b6020850190610366565b6040830152565b81606082015201906102c3565b3d15611c2a57611c1f3d61105d565b903d6000602084013e565b606090565b600094939291611c3e81611d12565b15611d085790611c53610e2d60209493610c3f565b90600033611c7d611c6360405190565b97889687958694630a85bd0160e11b865260048601611bd9565b03925af160009181611cd8575b50611cbc5750611c98611c10565b8051611ca761126760006103fd565b03611cb457604051611779565b805190602001fd5b909150611847611cd2630a85bd0160e11b610217565b91610217565b611cfa91925060203d8111611d01575b611cf281836105b5565b810190611bc5565b9038611c8a565b503d611ce8565b5060019450505050565b3b611d2061126760006103fd565b1190565b611d2e602761105d565b7f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c6020820152660819985a5b195960ca1b604082015290565b61025c611d24565b61025c91611d7b611d67565b9160008061025c9493602081519101845af4611d95611c10565b91611de7565b15611da257565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b91929015611e1957508151611dff61126760006103fd565b14611e08575090565b611e1461025c91611d12565b611d9b565b8290611e23825190565b611e3061126760006103fd565b1115611e3f5750805190602001fd5b610d1d90611e4c60405190565b62461bcd60e51b8152918291600483016102fb565b611847611cd26301ffc9a760e01b610217565b61025c9060081c6104c7565b61025c9054611e74565b6104c761025c61025c9290565b15611e9e57565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b6104c761025c61025c9260ff1690565b90611b1161025c610e0e92611efa565b90611f2a61025c610e0e92151590565b825461ff00191660089190911b61ff00161790565b61025f90611e8a565b6020810192916102469190611f3f565b611fa2611f6c611f686000611e80565b1590565b918280612044575b8015611fff575b611f8490611e97565b82611f99611f926001611e8a565b6000611f0a565b611fee57612167565b611fa857565b611fb3600080611f1a565b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498611fdd60405190565b80611fe9600182611f48565b0390a1565b611ffa60016000611f1a565b612167565b50612014611f6861200f30610c3f565b611d12565b8015611f7b5750611f84612028600061110d565b61203c6120356001611e8a565b9160ff1690565b149050611f7b565b5061204f600061110d565b61205c6120356001611e8a565b10611f74565b61206c601061105d565b6f141c9bdbd98813d98811195c1bdcda5d60821b602082015290565b61025c612062565b61209a600b61105d565b6a10d312540b558c4b5413d160aa1b602082015290565b61025c612090565b90505190610246826103a6565b909291926120d6610627826105ef565b918294828452828201116102345760206102469301906102a0565b9080601f8301121561023457815161025c926020016120c6565b905051906102468261087e565b6080818303126102345761212c82826120b9565b9261213a83602084016120b9565b604083015190936001600160401b0382116102345760606121608261025c9487016120f1565b940161210b565b6001611b7a6121cc6121d283611b7a611a2f6121d26121c16121da9961218b612269565b61219361229f565b6121ac61219e612088565b6121a66120b1565b906122c3565b6020806121b7835190565b8301019101612118565b929891949098610c3f565b96612f7b565b61012f610c48565b61024632610dd9565b61024690611f58565b156121f357565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b61225e6122596000611e80565b6121ec565b61024661024661228a565b61024661224c565b61227e6122596000611e80565b61024661024633610e12565b610246612271565b6102466122596000611e80565b610246612292565b90610246916122b96122596000611e80565b9061024691612485565b90610246916122a7565b90610246916122df6122596000611e80565b61246f565b9060031b611929600019821b611922565b919061230661025c610e0e936103fd565b9083546122e4565b610246916000916122f5565b818110612325575050565b80612333600060019361230e565b0161231a565b9190601f811161234857505050565b61235a61024693600052602060002090565b906020601f840160051c8301931061237a575b601f0160051c019061231a565b909150819061236d565b9060001960039190911b1c191690565b8161239e91612384565b9060011b1790565b81519192916001600160401b0381116105d6576123cd816123c78454610adc565b84612339565b6020601f82116001146123fc578190610e0e9394956000926123f1575b5050612394565b0151905038806123ea565b601f1982169461241184600052602060002090565b9160005b87811061244d575083600195969710612433575b505050811b019055565b612443910151601f841690612384565b9055388080612429565b90926020600181928686015181550194019101612415565b90610246916123a6565b9061247e610246926065612465565b6066612465565b90610246916122cd565b50610246610d21565b6102469061248f565b906124b16111a63361012f610c48565b6124bd60005b91151590565b146124cb57610246916124dd565b60405163607e454560e11b8152600490fd5b6124e9611f6882611b9a565b61256b5761250460016124fe8361012e61040a565b01610429565b8211612559576113a661254f8261254a8560016125447f6a1a1ff90ae3fd5b978159d028ceb33c54751ea49f6a1d7e64ddfc954aa9785e9761012e61040a565b01611956565b6103fd565b9261070760405190565b6040516322daed7d60e21b8152600490fd5b6040516323a3f85f60e21b8152600490fd5b90610246916124a1565b9291906125996111a63361012f610c48565b6125a360006124b7565b146124cb5761024693612643565b61025c60606105db565b9061025f9061035a565b61025c905161035a565b60026126086040610246946125eb6125e5825190565b86611956565b6126026125f9602083015190565b60018701611956565b016125c5565b9101610de2565b90610246916125cf565b634e487b7160e01b600052601160045260246000fd5b600019811461263e5760010190565b612619565b6126909061267f61269595939461267661265e61012d610429565b9661266f61266a6125b1565b958652565b6020850152565b604083016125bb565b61268b8461012e61040a565b61260f565b61275a565b6102466126ab6126a661012d610429565b61262f565b61012d611956565b90610246939291612587565b156126c657565b60405162461bcd60e51b815280610d1d600482016020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b1561271657565b60405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606490fd5b90611a3b611a35611a2f61276e6000610caa565b61278a61277a8261035a565b6127838861035a565b14156126bf565b61279e612799611f6887611b9a565b61270f565b611a206127ab60016103fd565b611a08612799611f6889611b9a565b6127c96111a63361012f610c48565b6127d360006124b7565b146124cb576102469061280f565b60026000916127f0838261230e565b6127fd836001830161230e565b0155565b90610bc257610246906127e1565b61281b611f6882611b9a565b61256b5760006128398261283161024694612847565b61012e61040a565b612801565b610246906127ba565b6128508161150e565b5061285b6000610caa565b90611a3b611a35611a2f61286f60016103fd565b6128a461287b8661150e565b9161288c60006119de89606961040a565b611a0261289a846068610c48565b916119fe83610429565b610e2d60006119de87606761040a565b6128bc6125b1565b90816000808252602082015260406000910152565b61025c6128b4565b906102466128e56125b1565b604061291a600283966128fe6128fa82610429565b8652565b61291461290d60018301610429565b6020870152565b01610433565b91016125bb565b61025c906128d9565b6129326128d1565b5061293c81611b9a565b61294660006124b7565b1461256b5761295a61025c9161012e61040a565b612921565b6001600160401b0381116105d65760051b60200190565b9061106a6106278361295f565b9061024661299083612976565b60208194611091601f199161295f565b634e487b7160e01b600052603260045260246000fd5b80518210156129ca5760209160051b010190565b6129a0565b9092908291849383851015612ae5576000936129ec61012d610429565b908110612add575b506129fe83611494565b908681809710600014612acb579003818110612ac3575b505b612a2081612983565b9586612a33612a2f60006103fd565b9390565b928314612ab857505b8581141580612aae575b15612aa45780612a58612a6892611b9a565b80612a88575b612a6d5760010190565b612a3c565b612a8281612a7f60018901988b6129b6565b52565b60010190565b50612a928161150e565b612a9e610d3d8761035a565b14612a5e565b5050918452509050565b5081851415612a46565b955050509350505090565b905038612a15565b505050612ad860006103fd565b612a17565b9050386129f4565b604051631960ccad60e11b8152600490fd5b801561263e576000190190565b90612b0e82611494565b91612b1883612983565b9081600093612b2760006103fd565b945b85871115612b9257612b3a81611b9a565b80612b76575b612b53575b612b4e9061262f565b612b29565b95612b60612b4e91612af7565b96612b6f81612a7f8a896129b6565b9050612b45565b50612b808161150e565b612b8c610d3d8661035a565b14612b40565b50935093505050565b80546000939291612bae612a2f83610adc565b9160018116908115612bff5750600114612bc757505050565b612bda9192939450600052602060002090565b6000905b838210612beb5750500190565b600181602092548486015201910190612bde565b60ff191683525050811515909102019150565b6102f7612c2a92602092612c24815190565b94859290565b938491016102a0565b612c419061025c9392612b9b565b90612c12565b612c53611f6882611b9a565b61256b57612c6261013161110d565b612c6c60016124b7565b14612c7d575061025c610130611537565b612ca161025c612c8f61025c93612cdb565b60405192839161013060208401612c33565b03601f1981018352826105b5565b6000190190565b634e487b7160e01b600052601260045260246000fd5b8115612cd6570490565b612cb6565b612cf1612ce782612d65565b6102f760016103fd565b906020612cfd83611074565b9283010190612d0c600a6103fd565b90612d4582612d24612d1e60006103fd565b95612caf565b926f181899199a1a9b1b9c1cb0b131b232b360811b600a82061a8453612ccc565b91838314612d5e579190612d45908390612d2490612caf565b5050505090565b612d6f60006103fd565b9081612d9072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b6103fd565b80831015612ed5575b50612db290506904ee2d6d415b85acef8160201b6103fd565b80821015612eb6575b50612dcc662386f26fc100006103fd565b80821015612e97575b50612de36305f5e1006103fd565b80821015612e78575b50612df86127106103fd565b80821015612e59575b50612e0c60646103fd565b80821015612e3a575b50612e23611267600a6103fd565b1015612e2c5790565b61025c906102f760016103fd565b612e4790612e5292612ccc565b916102f760026103fd565b9038612e15565b612e6690612e7192612ccc565b916102f760046103fd565b9038612e01565b612e8590612e9092612ccc565b916102f760086103fd565b9038612dec565b612ea490612eaf92612ccc565b916102f760106103fd565b9038612dd5565b612ec390612ece92612ccc565b916102f760206103fd565b9038612dbb565b612ee4919350612eef92612ccc565b916102f760406103fd565b903880612d99565b9061024691612f04610d21565b612f2b565b92916020612f22610246936040875260408701906102c3565b94019015159052565b907faa5eeeb94aadf22bfd5c06901d46a8a72fb610b2b7a2331f3e6f6f59f8aec85d91612f5a81610130612465565b612f6682610131611b01565b611fe9612f7260405190565b92839283612f09565b9061024691612ef7565b61025c61012d61042956fe46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820a2646970667358221220e3ad2fe51c294bd75eb521040fc8796575e27beb9b1794671c70f8e3ecc0092864736f6c63430008140033
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c806301ffc9a71461021257806306fdde031461020d578063081812fc14610208578063095ea7b3146102035780630f7ee1ec146101fe578063137bc427146101f957806323b872dd146101f45780633659cfe6146101ef57806342842e0e146101ea57806342966c68146101e5578063439fab91146101e05780634f1ef286146101db57806352d1902d146101d65780635734b968146101d15780635de6dc55146101cc5780636352211e146101c757806370a08231146101c2578063715018a6146101bd5780638da5cb5b146101b857806395d89b41146101b3578063a22cb465146101ae578063a5f5a7f1146101a9578063b63e6ac3146101a4578063b64b21ca1461019f578063b88d4fde1461019a578063c6a023e914610195578063c87b56dd14610190578063e985e9c51461018b578063eac989f814610186578063ebde463c14610181578063f2fde38b1461017c5763fdff9b4d0361023457610c68565b610c0a565b610bef565b610bd4565b610a94565b610a5d565b610a44565b610a0c565b6109a4565b61094f565b6108f8565b6108b6565b610863565b610848565b610830565b610815565b6107fa565b6107d3565b610750565b6106e8565b6106d4565b610687565b610587565b61056e565b610556565b610529565b6104e5565b610494565b6103df565b61037f565b61030c565b610263565b6001600160e01b03191690565b61022d81610217565b0361023457565b600080fd5b9050359061024682610224565b565b906020828203126102345761025c91610239565b90565b9052565b346102345761029161027e610279366004610248565b6113e1565b6040515b91829182901515815260200190565b0390f35b600091031261023457565b60005b8381106102b35750506000910152565b81810151838201526020016102a3565b6102e46102ed6020936102f7936102d8815190565b80835293849260200190565b958691016102a0565b601f01601f191690565b0190565b90602061025c9281815201906102c3565b346102345761031c366004610295565b610291610327611540565b604051918291826102fb565b8061022d565b9050359061024682610333565b906020828203126102345761025c91610339565b6001600160a01b031690565b61025f9061035a565b6020810192916102469190610366565b346102345761029161039a610395366004610346565b61167b565b6040519182918261036f565b61022d8161035a565b90503590610246826103a6565b9190604083820312610234578060206103d861025c93866103af565b9401610339565b34610234576103f86103f23660046103bc565b9061161c565b604051005b61025c61025c61025c9290565b90610414906103fd565b600052602052604060002090565b61025c9081565b61025c9054610422565b61025c905461035a565b6104499061012e61040a565b61045281610429565b9161025c600261046460018501610429565b9301610433565b60409061048d61024694969593966104868360608101999052565b6020830152565b0190610366565b34610234576102916104af6104aa366004610346565b61043d565b6040519193919384938461046b565b61025c9160031b1c5b60ff1690565b9061025c91546104be565b61025c60006101316104cd565b34610234576104f5366004610295565b61029161027e6104d8565b90916060828403126102345761025c61051984846103af565b9360406103d882602087016103af565b34610234576103f861053c366004610500565b91611716565b906020828203126102345761025c916103af565b34610234576103f8610569366004610542565b6110bf565b34610234576103f8610581366004610500565b91611745565b34610234576103f861059a366004610346565b61283e565b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b038211176105d657604052565b61059f565b906102466105e860405190565b92836105b5565b6001600160401b0381116105d657602090601f01601f19160190565b90826000939282370152565b9092919261062c610627826105ef565b6105db565b9182948284528282011161023457602061024693019061060b565b9080601f830112156102345781602061025c93359101610617565b906020828203126102345781356001600160401b0381116102345761025c9201610647565b34610234576103f861069a366004610662565b6121e3565b919091604081840312610234576106b683826103af565b9260208201356001600160401b0381116102345761025c9201610647565b6103f86106e236600461069f565b906113d7565b34610234576106f8366004610295565b610291610703610f51565b6040515b9182918290815260200190565b608081830312610234576107288282610339565b9261025c6107398460208501610339565b93606061074982604087016103af565b94016103af565b34610234576103f8610763366004610714565b929190916126b3565b9061078c61078561077b845190565b8084529260200190565b9260200190565b9060005b81811061079d5750505090565b9091926107ba6107b36001928651815260200190565b9460200190565b929101610790565b90602061025c92818152019061076c565b34610234576102916107ee6107e9366004610542565b612b04565b604051918291826107c2565b346102345761029161039a610810366004610346565b61150e565b346102345761029161070361082b366004610542565b611494565b3461023457610840366004610295565b6103f8610cc5565b3461023457610858366004610295565b61029161039a610c83565b3461023457610873366004610295565b61029161032761154a565b80151561022d565b905035906102468261087e565b9190604083820312610234578060206108af61025c93866103af565b9401610886565b34610234576103f86108c9366004610893565b90611692565b90916060828403126102345761025c6108e884846103af565b9360406103d88260208701610339565b34610234576102916107ee61090e3660046108cf565b916129cf565b90604080610246936109268482519052565b61093560208201516020860152565b0151910190610366565b6060810192916102469190610914565b346102345761029161096a610965366004610346565b61292a565b6040519182918261093f565b9190604083820312610234578235906001600160401b0382116102345760206108af8261025c948701610647565b34610234576103f86109b7366004610976565b90612f7b565b90608082820312610234576109d281836103af565b926109e082602085016103af565b926109ee8360408301610339565b9260608201356001600160401b0381116102345761025c9201610647565b34610234576103f8610a1f3660046109bd565b92919091611755565b9190604083820312610234578060206103d861025c9386610339565b34610234576103f8610a57366004610a28565b9061257d565b3461023457610291610327610a73366004610346565b612c47565b91906040838203126102345780602061074961025c93866103af565b346102345761029161027e610aaa366004610a78565b9061169d565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b600181811c929116828115610afd575b506020831014610af857565b610ac6565b607f16925038610aec565b80546000939291610b25610b1b83610adc565b8085529360200190565b9160018116908115610b775750600114610b3e57505050565b610b519192939450600052602060002090565b916000925b818410610b635750500190565b805484840152602090930192600101610b56565b60ff19168352505090151560051b019150565b9061025c91610b08565b90610246610ba160405190565b80610bad818096610b8a565b03906105b5565b90610bc25761025c90610b94565b610ab0565b61025c6000610130610bb4565b3461023457610be4366004610295565b610291610327610bc7565b3461023457610bff366004610295565b610291610703612f85565b34610234576103f8610c1d366004610542565b610dd9565b61025c9061035a906001600160a01b031682565b61025c90610c22565b61025c90610c36565b9061041490610c3f565b6000610c6361025c9261012f610c48565b6104cd565b346102345761029161027e610c7e366004610542565b610c52565b61025c60fb610433565b610c95610d21565b610246610cb3565b61035a61025c61025c9290565b61025c90610c9d565b610246610cc06000610caa565b610e12565b610246610c8d565b15610cd457565b60405162461bcd60e51b815280610d1d600482016020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b0390fd5b610246610d2c610c83565b610d43610d3d3361035a565b61035a565b9161035a565b14610ccd565b61024690610d55610d21565b610db5565b15610d6157565b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b61024690610cc0610dc9610d386000610caa565b610dd28361035a565b1415610d5a565b61024690610d49565b90610df261025c610e0e92610c3f565b82546001600160a01b0319166001600160a01b03919091161790565b9055565b610e38610e32610e2260fb610433565b610e2d8460fb610de2565b610c3f565b91610c3f565b907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0610e6360405190565b80805b0390a3565b15610e7257565b60405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c6044820152771b1959081d1a1c9bdd59da0819195b1959d85d1958d85b1b60421b6064820152608490fd5b61025c90610f1a610ee830610c3f565b610f14610d3d7f00000000000000000000000047238069baccaa027f3783e67681c57c284ef2c161035a565b14610e6b565b610f48565b61025c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6103fd565b5061025c610f1f565b61025c6000610ed8565b15610f6257565b60405162461bcd60e51b815260206004820152602c6024820152600080516020612f9183398151915260448201526b19195b1959d85d1958d85b1b60a21b6064820152608490fd5b15610fb157565b60405162461bcd60e51b815260206004820152602c6024820152600080516020612f9183398151915260448201526b6163746976652070726f787960a01b6064820152608490fd5b6102469061105861104061104761100f30610c3f565b6110387f00000000000000000000000047238069baccaa027f3783e67681c57c284ef2c161035a565b92839161035a565b1415610f5b565b611052610d386110c8565b14610faa565b611099565b9061106a610627836105ef565b918252565b369037565b906102466110818361105d565b60208194611091601f19916105ef565b01910161106f565b6000610246916110a881612498565b6110b96110b4836103fd565b611074565b90611196565b61024690610ff9565b61025c6110d661025c610f1f565b610433565b61025c7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91436103fd565b61025c906104c7565b61025c9054611104565b9050519061024682610333565b906020828203126102345761025c91611117565b1561113f57565b60405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608490fd5b91906111ab6111a661025c6110db565b61110d565b156111bb57505061024690611308565b6111c7610e2d84610c3f565b60206111d260405190565b6352d1902d60e01b815291829060049082905afa60009181611276575b50611251575060405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608490fd5b926112716102469461126b61126761025c610f1f565b9190565b14611138565b61132d565b61129891925060203d811161129f575b61129081836105b5565b810190611124565b90386111ef565b503d611286565b156112ad57565b60405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608490fd5b6102469061131d61131882611d12565b6112a6565b61132861025c610f1f565b610de2565b916113378361136c565b815161134661126760006103fd565b11908115611364575b50611358575050565b61136191611d6f565b50565b90503861134f565b61137990610e2d81611308565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b6113a360405190565b80805b0390a2565b90610246916113c261104061104761100f30610c3f565b610246916001916113d281612498565b611196565b90610246916113ab565b6113f16380ac58cd60e01b610217565b906113fb81610217565b91821491821561141b575b508115611411575090565b61025c9150611e61565b90915061142e635b5e139f60e01b610217565b149038611406565b1561143d57565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608490fd5b6114c261025c916114bb6114ab610d386000610caa565b6114b48361035a565b1415611436565b6068610c48565b610429565b156114ce57565b60405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606490fd5b611517906117f5565b61025c611527610d386000610caa565b6115308361035a565b14156114c7565b61025c90610b94565b61025c6065611537565b61025c6066611537565b1561155b57565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b156115b157565b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b906102469161166561162d8361150e565b6116368161035a565b61164a816116438661035a565b1415611554565b33906116558261035a565b1491821561166a575b50506115aa565b611a6c565b611674925061169d565b388061165e565b6110d661025c9161168b81611b89565b606961040a565b610246919033611b20565b61025c916116af6111a692606a610c48565b610c48565b156116bb57565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b61024692919061172e6117298433611803565b6116b4565b611966565b61025c600061105d565b61025c611733565b90916102469261175361173d565b925b610246939291906117696117298433611803565b6117d6565b1561177557565b6040515b62461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608490fd5b9161024693916117f0936117eb838383611966565b611c2f565b61176e565b6110d661025c91606761040a565b61180c8261150e565b916118168361035a565b916118208161035a565b92831493841561184b575b5050821561183857505090565b611847919250610d389061167b565b1490565b61185692945061169d565b91388061182b565b1561186557565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b156118bf57565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b9060031b6119296001600160a01b03821b5b9384921b90565b169119161790565b919061194261025c610e0e93610c3f565b908354611910565b61024691600091611931565b9061025c61025c610e0e926103fd565b611a35611a2f611a3b92949394611a2061198e6119946119858861150e565b6110388561035a565b1461185e565b6119b46119a4610d386000610caa565b6119ad8a61035a565b14156118b8565b6119ce6119c160016103fd565b9161198e610d388a61150e565b6119e360006119de89606961040a565b61194a565b611a086119f1846068610c48565b611a02836119fe83610429565b0390565b90611956565b611a02611a16896068610c48565b916102f783610429565b610e2d8661132887606761040a565b93610c3f565b916103fd565b917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef611a6660405190565b600090a4565b90611a7c8261132883606961040a565b611a8e611a35611a2f610e2d8461150e565b917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925611a6660405190565b15611ac057565b60405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606490fd5b90611b1161025c610e0e92151590565b825460ff191660ff9091161790565b610e66611b7f611a2f7f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3193611b67611b578761035a565b611b608361035a565b1415611ab9565b610e2d87611b7a886116af85606a610c48565b611b01565b9361028260405190565b611b9561024691611b9a565b6114c7565b611ba3906117f5565b611bb3610d3d610d386000610caa565b141590565b9050519061024682610224565b906020828203126102345761025c91611bb8565b9061025c9493611bfc608094611bf285611c0395610366565b6020850190610366565b6040830152565b81606082015201906102c3565b3d15611c2a57611c1f3d61105d565b903d6000602084013e565b606090565b600094939291611c3e81611d12565b15611d085790611c53610e2d60209493610c3f565b90600033611c7d611c6360405190565b97889687958694630a85bd0160e11b865260048601611bd9565b03925af160009181611cd8575b50611cbc5750611c98611c10565b8051611ca761126760006103fd565b03611cb457604051611779565b805190602001fd5b909150611847611cd2630a85bd0160e11b610217565b91610217565b611cfa91925060203d8111611d01575b611cf281836105b5565b810190611bc5565b9038611c8a565b503d611ce8565b5060019450505050565b3b611d2061126760006103fd565b1190565b611d2e602761105d565b7f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c6020820152660819985a5b195960ca1b604082015290565b61025c611d24565b61025c91611d7b611d67565b9160008061025c9493602081519101845af4611d95611c10565b91611de7565b15611da257565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b91929015611e1957508151611dff61126760006103fd565b14611e08575090565b611e1461025c91611d12565b611d9b565b8290611e23825190565b611e3061126760006103fd565b1115611e3f5750805190602001fd5b610d1d90611e4c60405190565b62461bcd60e51b8152918291600483016102fb565b611847611cd26301ffc9a760e01b610217565b61025c9060081c6104c7565b61025c9054611e74565b6104c761025c61025c9290565b15611e9e57565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b6104c761025c61025c9260ff1690565b90611b1161025c610e0e92611efa565b90611f2a61025c610e0e92151590565b825461ff00191660089190911b61ff00161790565b61025f90611e8a565b6020810192916102469190611f3f565b611fa2611f6c611f686000611e80565b1590565b918280612044575b8015611fff575b611f8490611e97565b82611f99611f926001611e8a565b6000611f0a565b611fee57612167565b611fa857565b611fb3600080611f1a565b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498611fdd60405190565b80611fe9600182611f48565b0390a1565b611ffa60016000611f1a565b612167565b50612014611f6861200f30610c3f565b611d12565b8015611f7b5750611f84612028600061110d565b61203c6120356001611e8a565b9160ff1690565b149050611f7b565b5061204f600061110d565b61205c6120356001611e8a565b10611f74565b61206c601061105d565b6f141c9bdbd98813d98811195c1bdcda5d60821b602082015290565b61025c612062565b61209a600b61105d565b6a10d312540b558c4b5413d160aa1b602082015290565b61025c612090565b90505190610246826103a6565b909291926120d6610627826105ef565b918294828452828201116102345760206102469301906102a0565b9080601f8301121561023457815161025c926020016120c6565b905051906102468261087e565b6080818303126102345761212c82826120b9565b9261213a83602084016120b9565b604083015190936001600160401b0382116102345760606121608261025c9487016120f1565b940161210b565b6001611b7a6121cc6121d283611b7a611a2f6121d26121c16121da9961218b612269565b61219361229f565b6121ac61219e612088565b6121a66120b1565b906122c3565b6020806121b7835190565b8301019101612118565b929891949098610c3f565b96612f7b565b61012f610c48565b61024632610dd9565b61024690611f58565b156121f357565b60405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b61225e6122596000611e80565b6121ec565b61024661024661228a565b61024661224c565b61227e6122596000611e80565b61024661024633610e12565b610246612271565b6102466122596000611e80565b610246612292565b90610246916122b96122596000611e80565b9061024691612485565b90610246916122a7565b90610246916122df6122596000611e80565b61246f565b9060031b611929600019821b611922565b919061230661025c610e0e936103fd565b9083546122e4565b610246916000916122f5565b818110612325575050565b80612333600060019361230e565b0161231a565b9190601f811161234857505050565b61235a61024693600052602060002090565b906020601f840160051c8301931061237a575b601f0160051c019061231a565b909150819061236d565b9060001960039190911b1c191690565b8161239e91612384565b9060011b1790565b81519192916001600160401b0381116105d6576123cd816123c78454610adc565b84612339565b6020601f82116001146123fc578190610e0e9394956000926123f1575b5050612394565b0151905038806123ea565b601f1982169461241184600052602060002090565b9160005b87811061244d575083600195969710612433575b505050811b019055565b612443910151601f841690612384565b9055388080612429565b90926020600181928686015181550194019101612415565b90610246916123a6565b9061247e610246926065612465565b6066612465565b90610246916122cd565b50610246610d21565b6102469061248f565b906124b16111a63361012f610c48565b6124bd60005b91151590565b146124cb57610246916124dd565b60405163607e454560e11b8152600490fd5b6124e9611f6882611b9a565b61256b5761250460016124fe8361012e61040a565b01610429565b8211612559576113a661254f8261254a8560016125447f6a1a1ff90ae3fd5b978159d028ceb33c54751ea49f6a1d7e64ddfc954aa9785e9761012e61040a565b01611956565b6103fd565b9261070760405190565b6040516322daed7d60e21b8152600490fd5b6040516323a3f85f60e21b8152600490fd5b90610246916124a1565b9291906125996111a63361012f610c48565b6125a360006124b7565b146124cb5761024693612643565b61025c60606105db565b9061025f9061035a565b61025c905161035a565b60026126086040610246946125eb6125e5825190565b86611956565b6126026125f9602083015190565b60018701611956565b016125c5565b9101610de2565b90610246916125cf565b634e487b7160e01b600052601160045260246000fd5b600019811461263e5760010190565b612619565b6126909061267f61269595939461267661265e61012d610429565b9661266f61266a6125b1565b958652565b6020850152565b604083016125bb565b61268b8461012e61040a565b61260f565b61275a565b6102466126ab6126a661012d610429565b61262f565b61012d611956565b90610246939291612587565b156126c657565b60405162461bcd60e51b815280610d1d600482016020808252818101527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604082015260600190565b1561271657565b60405162461bcd60e51b815260206004820152601c60248201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b6044820152606490fd5b90611a3b611a35611a2f61276e6000610caa565b61278a61277a8261035a565b6127838861035a565b14156126bf565b61279e612799611f6887611b9a565b61270f565b611a206127ab60016103fd565b611a08612799611f6889611b9a565b6127c96111a63361012f610c48565b6127d360006124b7565b146124cb576102469061280f565b60026000916127f0838261230e565b6127fd836001830161230e565b0155565b90610bc257610246906127e1565b61281b611f6882611b9a565b61256b5760006128398261283161024694612847565b61012e61040a565b612801565b610246906127ba565b6128508161150e565b5061285b6000610caa565b90611a3b611a35611a2f61286f60016103fd565b6128a461287b8661150e565b9161288c60006119de89606961040a565b611a0261289a846068610c48565b916119fe83610429565b610e2d60006119de87606761040a565b6128bc6125b1565b90816000808252602082015260406000910152565b61025c6128b4565b906102466128e56125b1565b604061291a600283966128fe6128fa82610429565b8652565b61291461290d60018301610429565b6020870152565b01610433565b91016125bb565b61025c906128d9565b6129326128d1565b5061293c81611b9a565b61294660006124b7565b1461256b5761295a61025c9161012e61040a565b612921565b6001600160401b0381116105d65760051b60200190565b9061106a6106278361295f565b9061024661299083612976565b60208194611091601f199161295f565b634e487b7160e01b600052603260045260246000fd5b80518210156129ca5760209160051b010190565b6129a0565b9092908291849383851015612ae5576000936129ec61012d610429565b908110612add575b506129fe83611494565b908681809710600014612acb579003818110612ac3575b505b612a2081612983565b9586612a33612a2f60006103fd565b9390565b928314612ab857505b8581141580612aae575b15612aa45780612a58612a6892611b9a565b80612a88575b612a6d5760010190565b612a3c565b612a8281612a7f60018901988b6129b6565b52565b60010190565b50612a928161150e565b612a9e610d3d8761035a565b14612a5e565b5050918452509050565b5081851415612a46565b955050509350505090565b905038612a15565b505050612ad860006103fd565b612a17565b9050386129f4565b604051631960ccad60e11b8152600490fd5b801561263e576000190190565b90612b0e82611494565b91612b1883612983565b9081600093612b2760006103fd565b945b85871115612b9257612b3a81611b9a565b80612b76575b612b53575b612b4e9061262f565b612b29565b95612b60612b4e91612af7565b96612b6f81612a7f8a896129b6565b9050612b45565b50612b808161150e565b612b8c610d3d8661035a565b14612b40565b50935093505050565b80546000939291612bae612a2f83610adc565b9160018116908115612bff5750600114612bc757505050565b612bda9192939450600052602060002090565b6000905b838210612beb5750500190565b600181602092548486015201910190612bde565b60ff191683525050811515909102019150565b6102f7612c2a92602092612c24815190565b94859290565b938491016102a0565b612c419061025c9392612b9b565b90612c12565b612c53611f6882611b9a565b61256b57612c6261013161110d565b612c6c60016124b7565b14612c7d575061025c610130611537565b612ca161025c612c8f61025c93612cdb565b60405192839161013060208401612c33565b03601f1981018352826105b5565b6000190190565b634e487b7160e01b600052601260045260246000fd5b8115612cd6570490565b612cb6565b612cf1612ce782612d65565b6102f760016103fd565b906020612cfd83611074565b9283010190612d0c600a6103fd565b90612d4582612d24612d1e60006103fd565b95612caf565b926f181899199a1a9b1b9c1cb0b131b232b360811b600a82061a8453612ccc565b91838314612d5e579190612d45908390612d2490612caf565b5050505090565b612d6f60006103fd565b9081612d9072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b6103fd565b80831015612ed5575b50612db290506904ee2d6d415b85acef8160201b6103fd565b80821015612eb6575b50612dcc662386f26fc100006103fd565b80821015612e97575b50612de36305f5e1006103fd565b80821015612e78575b50612df86127106103fd565b80821015612e59575b50612e0c60646103fd565b80821015612e3a575b50612e23611267600a6103fd565b1015612e2c5790565b61025c906102f760016103fd565b612e4790612e5292612ccc565b916102f760026103fd565b9038612e15565b612e6690612e7192612ccc565b916102f760046103fd565b9038612e01565b612e8590612e9092612ccc565b916102f760086103fd565b9038612dec565b612ea490612eaf92612ccc565b916102f760106103fd565b9038612dd5565b612ec390612ece92612ccc565b916102f760206103fd565b9038612dbb565b612ee4919350612eef92612ccc565b916102f760406103fd565b903880612d99565b9061024691612f04610d21565b612f2b565b92916020612f22610246936040875260408701906102c3565b94019015159052565b907faa5eeeb94aadf22bfd5c06901d46a8a72fb610b2b7a2331f3e6f6f59f8aec85d91612f5a81610130612465565b612f6682610131611b01565b611fe9612f7260405190565b92839283612f09565b9061024691612ef7565b61025c61012d61042956fe46756e6374696f6e206d7573742062652063616c6c6564207468726f75676820a2646970667358221220e3ad2fe51c294bd75eb521040fc8796575e27beb9b1794671c70f8e3ecc0092864736f6c63430008140033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
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.