Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 9 from a total of 9 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Mint With ETH | 21694527 | 426 days ago | IN | 0.0134255 ETH | 0.00288601 | ||||
| Pay For Generati... | 21694517 | 426 days ago | IN | 0.00026831 ETH | 0.00065353 | ||||
| Mint With ETH | 21694484 | 426 days ago | IN | 0.00895097 ETH | 0.00300895 | ||||
| Mint With ETH | 21586615 | 441 days ago | IN | 0.00895097 ETH | 0.000815 | ||||
| Mint With ETH | 21581797 | 441 days ago | IN | 0.0134255 ETH | 0.00152314 | ||||
| Pay For Generati... | 21581784 | 441 days ago | IN | 0.00026831 ETH | 0.00071267 | ||||
| Mint With ETH | 21581762 | 441 days ago | IN | 0.00895097 ETH | 0.00257657 | ||||
| Set NFT Image Mi... | 21509774 | 452 days ago | IN | 0 ETH | 0.00012721 | ||||
| Set NFT Video Mi... | 21509770 | 452 days ago | IN | 0 ETH | 0.00013743 |
Latest 7 internal transactions
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 21694527 | 426 days ago | 0.0134255 ETH | ||||
| Transfer | 21694517 | 426 days ago | 0.00026831 ETH | ||||
| Transfer | 21694484 | 426 days ago | 0.00895097 ETH | ||||
| Transfer | 21586615 | 441 days ago | 0.00895097 ETH | ||||
| Transfer | 21581797 | 441 days ago | 0.0134255 ETH | ||||
| Transfer | 21581784 | 441 days ago | 0.00026831 ETH | ||||
| Transfer | 21581762 | 441 days ago | 0.00895097 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Mintify_AI_Collection
Compiler Version
v0.8.22+commit.4fc1097e
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
/// @title Mintify ERC721A Smart Contract
/// @notice Serves as a fungible token
/// @dev Inherits the ERC721A implentation
contract Mintify_AI_Collection is Ownable, ERC721A {
using Strings for uint256;
using SafeERC20 for IERC20;
address private signer;
address public token;
address public MintTreasury;
address public GenerationTreasury;
bool public contractPaused;
uint256 public generationFee;
uint256 public NFTImageMintPrice;
uint256 public NFTVideoMintPrice;
mapping(string => bool) public processedNonces;
mapping(uint256 => string) private _tokenURIs;
event Withdraw(uint256 amount, address indexed addr);
constructor(
address _token,
address _signer,
address _owner,
address _mintTreasury,
address _generationTreasury,
uint256 _NFTImageMintPrice,
uint256 _NFTVideoMintPrice,
uint256 _generationFee
) ERC721A("Mintify AI Collection", "MNFT") Ownable(_owner) {
token = _token;
MintTreasury = _mintTreasury;
GenerationTreasury=_generationTreasury;
signer = _signer;
NFTImageMintPrice = _NFTImageMintPrice;
NFTVideoMintPrice = _NFTVideoMintPrice;
generationFee = _generationFee;
transferOwnership(_owner);
}
modifier whenNotPausedAndValidSupply(
address _user,
bool _checkPrice,
uint256 _tokenAmount
) {
require(!contractPaused, "Sale Paused!");
if (_checkPrice) {
require(
IERC20(token).balanceOf(_user) >= _tokenAmount,
"Not enough token sent, check price"
);
}
_;
}
function mintWithToken(
address _to,
string memory _uri,
bytes memory _signature,
string memory _message,
uint256 _tokenAmount
) external whenNotPausedAndValidSupply(msg.sender, true, _tokenAmount) {
require(
isMessageValid(_signature, _message, _tokenAmount),
"signature invalid"
);
require(processedNonces[_message] == false, "invalid nonce");
processedNonces[_message] = true;
IERC20(token).safeTransferFrom(
msg.sender,
MintTreasury,
_tokenAmount
);
uint256 startTokenId = _nextTokenId();
_safeMint(_to, 1);
_tokenURIs[startTokenId] = _uri;
}
function mintWithETH(
address _to,
string memory _uri,
bool isImage
) external payable whenNotPausedAndValidSupply(msg.sender, false, 0) {
uint256 mintPrice;
if (isImage) {
mintPrice = NFTImageMintPrice;
} else {
mintPrice = NFTVideoMintPrice;
}
require(msg.value >= mintPrice, "Insufficient Fees sent for minting");
(bool success, ) = MintTreasury.call{value: msg.value}("");
require(success, "ETH transfer to treasury failed");
uint256 startTokenId = _nextTokenId();
_safeMint(_to, 1);
_tokenURIs[startTokenId] = _uri;
}
function payForGeneration() external payable {
require(msg.value >= generationFee, "Insufficient fee");
(bool success, ) = GenerationTreasury.call{value: msg.value}("");
require(success, "Fee transfer failed");
}
function pauseContract() external onlyOwner {
contractPaused = true;
}
function unpauseContract() external onlyOwner {
contractPaused = false;
}
function setMintTreasuryWallet(address _newMintTreasury)
external
onlyOwner
{
require(
_newMintTreasury != address(0),
"Invalid mint treasury wallet address"
);
MintTreasury = _newMintTreasury;
}
function setGenerationTreasuryWallet(address _newGenerationTreasury)
external
onlyOwner
{
require(
_newGenerationTreasury != address(0),
"Invalid generation treasury wallet address"
);
GenerationTreasury = _newGenerationTreasury;
}
function updatesignerWallet(address _signer) external onlyOwner {
require(_signer != address(0), "Invalid wallet address");
signer = _signer;
}
function updateToken(address _token) external onlyOwner {
require(_token != address(0), "Invalid _token address");
token = _token;
}
function setNFTImageMintPrice(uint256 _imagePrice) external onlyOwner {
require(_imagePrice > 0, "Image mint price must be greater than zero");
NFTImageMintPrice = _imagePrice;
}
function setNFTVideoMintPrice(uint256 _videoPrice) external onlyOwner {
require(_videoPrice > 0, "Video mint price must be greater than zero");
NFTVideoMintPrice = _videoPrice;
}
function withdraw() external payable onlyOwner {
uint256 amount = address(this).balance;
(bool success, ) = msg.sender.call{value: amount}("");
require(success, "Withdraw failed.");
emit Withdraw(amount, msg.sender);
}
function setGenerationFee(uint256 _fee) external onlyOwner {
require(_fee > 0, "Fee must be greater than zero");
generationFee = _fee;
}
function tokenURI(uint256 tokenId)
public
view
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory tokenUri = _tokenURIs[tokenId];
require(bytes(tokenUri).length > 0, "Token URI not set");
return tokenUri;
}
function _startTokenId() internal view virtual override returns (uint256) {
return 1;
}
function walletOfOwner(address owner)
public
view
returns (uint256[] memory)
{
unchecked {
uint256 tokenIdsIdx;
address currOwnershipAddr;
uint256 tokenIdsLength = balanceOf(owner);
uint256[] memory tokenIds = new uint256[](tokenIdsLength);
TokenOwnership memory ownership;
for (
uint256 i = _startTokenId();
tokenIdsIdx != tokenIdsLength;
++i
) {
ownership = _ownershipAt(i);
if (ownership.burned) {
continue;
}
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
tokenIds[tokenIdsIdx++] = i;
}
}
return tokenIds;
}
}
function isMessageValid(
bytes memory _signature,
string memory _message,
uint256 _tokenAmount
) public view returns (bool) {
bytes32 messageHash = getMessageHash(_message, _tokenAmount);
bytes32 ethSignedMessageHash = getEthSignedMessageHash(messageHash);
return recoverSigner(ethSignedMessageHash, _signature) == signer;
}
function getMessageHash(string memory _message, uint256 _tokenAmount)
public
pure
returns (bytes32)
{
return keccak256(abi.encodePacked(_message, _tokenAmount));
}
function getEthSignedMessageHash(bytes32 _messageHash)
public
pure
returns (bytes32)
{
return
keccak256(
abi.encodePacked(
"\x19Ethereum Signed Message:\n32",
_messageHash
)
);
}
function recoverSigner(
bytes32 _ethSignedMessageHash,
bytes memory _signature
) public pure returns (address) {
(bytes32 r, bytes32 s, uint8 v) = splitSignature(_signature);
return ecrecover(_ethSignedMessageHash, v, r, s);
}
function splitSignature(bytes memory sig)
public
pure
returns (
bytes32 r,
bytes32 s,
uint8 v
)
{
require(sig.length == 65, "invalid signature length");
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
import {Address} from "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import './IERC721A.sol';
/**
* @dev Interface of ERC721 token receiver.
*/
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @title ERC721A
*
* @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
* Non-Fungible Token Standard, including the Metadata extension.
* Optimized for lower gas during batch mints.
*
* Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
* starting from `_startTokenId()`.
*
* The `_sequentialUpTo()` function can be overriden to enable spot mints
* (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`.
*
* Assumptions:
*
* - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
* - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
*/
contract ERC721A is IERC721A {
// Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
struct TokenApprovalRef {
address value;
}
// =============================================================
// CONSTANTS
// =============================================================
// Mask of an entry in packed address data.
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
// The bit position of `numberMinted` in packed address data.
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
// The bit position of `numberBurned` in packed address data.
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
// The bit position of `aux` in packed address data.
uint256 private constant _BITPOS_AUX = 192;
// Mask of all 256 bits in packed address data except the 64 bits for `aux`.
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
// The bit position of `startTimestamp` in packed ownership.
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
// The bit mask of the `burned` bit in packed ownership.
uint256 private constant _BITMASK_BURNED = 1 << 224;
// The bit position of the `nextInitialized` bit in packed ownership.
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
// The bit mask of the `nextInitialized` bit in packed ownership.
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
// The bit position of `extraData` in packed ownership.
uint256 private constant _BITPOS_EXTRA_DATA = 232;
// Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
// The mask of the lower 160 bits for addresses.
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
// The maximum `quantity` that can be minted with {_mintERC2309}.
// This limit is to prevent overflows on the address data entries.
// For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
// is required to cause an overflow, which is unrealistic.
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
// The `Transfer` event signature is given by:
// `keccak256(bytes("Transfer(address,address,uint256)"))`.
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
// =============================================================
// STORAGE
// =============================================================
// The next token ID to be minted.
uint256 private _currentIndex;
// The number of tokens burned.
uint256 private _burnCounter;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned.
// See {_packedOwnershipOf} implementation for details.
//
// Bits Layout:
// - [0..159] `addr`
// - [160..223] `startTimestamp`
// - [224] `burned`
// - [225] `nextInitialized`
// - [232..255] `extraData`
mapping(uint256 => uint256) private _packedOwnerships;
// Mapping owner address to address data.
//
// Bits Layout:
// - [0..63] `balance`
// - [64..127] `numberMinted`
// - [128..191] `numberBurned`
// - [192..255] `aux`
mapping(address => uint256) private _packedAddressData;
// Mapping from token ID to approved address.
mapping(uint256 => TokenApprovalRef) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// The amount of tokens minted above `_sequentialUpTo()`.
// We call these spot mints (i.e. non-sequential mints).
uint256 private _spotMinted;
// =============================================================
// CONSTRUCTOR
// =============================================================
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector);
}
// =============================================================
// TOKEN COUNTING OPERATIONS
// =============================================================
/**
* @dev Returns the starting token ID for sequential mints.
*
* Override this function to change the starting token ID for sequential mints.
*
* Note: The value returned must never change after any tokens have been minted.
*/
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev Returns the maximum token ID (inclusive) for sequential mints.
*
* Override this function to return a value less than 2**256 - 1,
* but greater than `_startTokenId()`, to enable spot (non-sequential) mints.
*
* Note: The value returned must never change after any tokens have been minted.
*/
function _sequentialUpTo() internal view virtual returns (uint256) {
return type(uint256).max;
}
/**
* @dev Returns the next token ID to be minted.
*/
function _nextTokenId() internal view virtual returns (uint256) {
return _currentIndex;
}
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() public view virtual override returns (uint256 result) {
// Counter underflow is impossible as `_burnCounter` cannot be incremented
// more than `_currentIndex + _spotMinted - _startTokenId()` times.
unchecked {
// With spot minting, the intermediate `result` can be temporarily negative,
// and the computation must be unchecked.
result = _currentIndex - _burnCounter - _startTokenId();
if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;
}
}
/**
* @dev Returns the total amount of tokens minted in the contract.
*/
function _totalMinted() internal view virtual returns (uint256 result) {
// Counter underflow is impossible as `_currentIndex` does not decrement,
// and it is initialized to `_startTokenId()`.
unchecked {
result = _currentIndex - _startTokenId();
if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;
}
}
/**
* @dev Returns the total number of tokens burned.
*/
function _totalBurned() internal view virtual returns (uint256) {
return _burnCounter;
}
/**
* @dev Returns the total number of tokens that are spot-minted.
*/
function _totalSpotMinted() internal view virtual returns (uint256) {
return _spotMinted;
}
// =============================================================
// ADDRESS DATA OPERATIONS
// =============================================================
/**
* @dev Returns the number of tokens in `owner`'s account.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector);
return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens minted by `owner`.
*/
function _numberMinted(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens burned by or on behalf of `owner`.
*/
function _numberBurned(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
*/
function _getAux(address owner) internal view returns (uint64) {
return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
}
/**
* Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
* If there are multiple variables, please pack them into a uint64.
*/
function _setAux(address owner, uint64 aux) internal virtual {
uint256 packed = _packedAddressData[owner];
uint256 auxCasted;
// Cast `aux` with assembly to avoid redundant masking.
assembly {
auxCasted := aux
}
packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
_packedAddressData[owner] = packed;
}
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
// The interface IDs are constants representing the first 4 bytes
// of the XOR of all function selectors in the interface.
// See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
// (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
return
interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
}
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @dev Returns the token collection name.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the token collection symbol.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector);
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return '';
}
// =============================================================
// OWNERSHIPS OPERATIONS
// =============================================================
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
/**
* @dev Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around over time.
*/
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
/**
* @dev Returns the unpacked `TokenOwnership` struct at `index`.
*/
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
/**
* @dev Returns whether the ownership slot at `index` is initialized.
* An uninitialized slot does not necessarily mean that the slot has no owner.
*/
function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) {
return _packedOwnerships[index] != 0;
}
/**
* @dev Initializes the ownership slot minted at `index` for efficiency purposes.
*/
function _initializeOwnershipAt(uint256 index) internal virtual {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
/**
* @dev Returns the packed ownership data of `tokenId`.
*/
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {
if (_startTokenId() <= tokenId) {
packed = _packedOwnerships[tokenId];
if (tokenId > _sequentialUpTo()) {
if (_packedOwnershipExists(packed)) return packed;
_revert(OwnerQueryForNonexistentToken.selector);
}
// If the data at the starting slot does not exist, start the scan.
if (packed == 0) {
if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector);
// Invariant:
// There will always be an initialized ownership slot
// (i.e. `ownership.addr != address(0) && ownership.burned == false`)
// before an unintialized ownership slot
// (i.e. `ownership.addr == address(0) && ownership.burned == false`)
// Hence, `tokenId` will not underflow.
//
// We can directly compare the packed value.
// If the address is zero, packed will be zero.
for (;;) {
unchecked {
packed = _packedOwnerships[--tokenId];
}
if (packed == 0) continue;
if (packed & _BITMASK_BURNED == 0) return packed;
// Otherwise, the token is burned, and we must revert.
// This handles the case of batch burned tokens, where only the burned bit
// of the starting slot is set, and remaining slots are left uninitialized.
_revert(OwnerQueryForNonexistentToken.selector);
}
}
// Otherwise, the data exists and we can skip the scan.
// This is possible because we have already achieved the target condition.
// This saves 2143 gas on transfers of initialized tokens.
// If the token is not burned, return `packed`. Otherwise, revert.
if (packed & _BITMASK_BURNED == 0) return packed;
}
_revert(OwnerQueryForNonexistentToken.selector);
}
/**
* @dev Returns the unpacked `TokenOwnership` struct from `packed`.
*/
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
ownership.addr = address(uint160(packed));
ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
ownership.burned = packed & _BITMASK_BURNED != 0;
ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
}
/**
* @dev Packs ownership data into a single uint256.
*/
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
// Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
owner := and(owner, _BITMASK_ADDRESS)
// `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
/**
* @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
*/
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
// For branchless setting of the `nextInitialized` flag.
assembly {
// `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
}
}
// =============================================================
// APPROVAL OPERATIONS
// =============================================================
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
*/
function approve(address to, uint256 tokenId) public payable virtual override {
_approve(to, tokenId, true);
}
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector);
return _tokenApprovals[tokenId].value;
}
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom}
* for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
}
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted. See {_mint}.
*/
function _exists(uint256 tokenId) internal view virtual returns (bool result) {
if (_startTokenId() <= tokenId) {
if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]);
if (tokenId < _currentIndex) {
uint256 packed;
while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId;
result = packed & _BITMASK_BURNED == 0;
}
}
}
/**
* @dev Returns whether `packed` represents a token that exists.
*/
function _packedOwnershipExists(uint256 packed) private pure returns (bool result) {
assembly {
// The following is equivalent to `owner != address(0) && burned == false`.
// Symbolically tested.
result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_BURNED))
}
}
/**
* @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
*/
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
assembly {
// Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
owner := and(owner, _BITMASK_ADDRESS)
// Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
msgSender := and(msgSender, _BITMASK_ADDRESS)
// `msgSender == owner || msgSender == approvedAddress`.
result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
}
}
/**
* @dev Returns the storage slot and value for the approved address of `tokenId`.
*/
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
// The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
assembly {
approvedAddressSlot := tokenApproval.slot
approvedAddress := sload(approvedAddressSlot)
}
}
// =============================================================
// TRANSFER OPERATIONS
// =============================================================
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token
* by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
// Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.
from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));
if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector);
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner.
assembly {
if approvedAddress {
// This is equivalent to `delete _tokenApprovals[tokenId]`.
sstore(approvedAddressSlot, 0)
}
}
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
unchecked {
// We can directly increment and decrement the balances.
--_packedAddressData[from]; // Updates: `balance -= 1`.
++_packedAddressData[to]; // Updates: `balance += 1`.
// Updates:
// - `address` to the next owner.
// - `startTimestamp` to the timestamp of transfering.
// - `burned` to `false`.
// - `nextInitialized` to `true`.
_packedOwnerships[tokenId] = _packOwnershipData(
to,
_BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
);
// If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
// If the next slot's address is zero and not burned (i.e. packed value is zero).
if (_packedOwnerships[nextTokenId] == 0) {
// If the next slot is within bounds.
if (nextTokenId != _currentIndex) {
// Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
assembly {
// Emit the `Transfer` event.
log4(
0, // Start of data (0, since no data).
0, // End of data (0, since no data).
_TRANSFER_EVENT_SIGNATURE, // Signature.
from, // `from`.
toMasked, // `to`.
tokenId // `tokenId`.
)
}
if (toMasked == 0) _revert(TransferToZeroAddress.selector);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
safeTransferFrom(from, to, tokenId, '');
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token
* by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public payable virtual override {
transferFrom(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
_revert(TransferToNonERC721ReceiverImplementer.selector);
}
}
/**
* @dev Hook that is called before a set of serially-ordered token IDs
* are about to be transferred. This includes minting.
* And also called before burning one token.
*
* `startTokenId` - the first token ID to be transferred.
* `quantity` - the amount to be transferred.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, `tokenId` will be burned by `from`.
* - `from` and `to` are never both zero.
*/
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Hook that is called after a set of serially-ordered token IDs
* have been transferred. This includes minting.
* And also called after one token has been burned.
*
* `startTokenId` - the first token ID to be transferred.
* `quantity` - the amount to be transferred.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
* transferred to `to`.
* - When `from` is zero, `tokenId` has been minted for `to`.
* - When `to` is zero, `tokenId` has been burned by `from`.
* - `from` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
*
* `from` - Previous owner of the given token ID.
* `to` - Target address that will receive the token.
* `tokenId` - Token ID to be transferred.
* `_data` - Optional data to send along with the call.
*
* Returns whether the call correctly returned the expected magic value.
*/
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
bytes4 retval
) {
return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
_revert(TransferToNonERC721ReceiverImplementer.selector);
}
assembly {
revert(add(32, reason), mload(reason))
}
}
}
// =============================================================
// MINT OPERATIONS
// =============================================================
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event for each mint.
*/
function _mint(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (quantity == 0) _revert(MintZeroQuantity.selector);
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are incredibly unrealistic.
// `balance` and `numberMinted` have a maximum limit of 2**64.
// `tokenId` has a maximum limit of 2**256.
unchecked {
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `quantity == 1`.
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
// Updates:
// - `balance += quantity`.
// - `numberMinted += quantity`.
//
// We can directly add to the `balance` and `numberMinted`.
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
if (toMasked == 0) _revert(MintToZeroAddress.selector);
uint256 end = startTokenId + quantity;
uint256 tokenId = startTokenId;
if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);
do {
assembly {
// Emit the `Transfer` event.
log4(
0, // Start of data (0, since no data).
0, // End of data (0, since no data).
_TRANSFER_EVENT_SIGNATURE, // Signature.
0, // `address(0)`.
toMasked, // `to`.
tokenId // `tokenId`.
)
}
// The `!=` check ensures that large values of `quantity`
// that overflows uint256 will make the loop run out of gas.
} while (++tokenId != end);
_currentIndex = end;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* This function is intended for efficient minting only during contract creation.
*
* It emits only one {ConsecutiveTransfer} as defined in
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
* instead of a sequence of {Transfer} event(s).
*
* Calling this function outside of contract creation WILL make your contract
* non-compliant with the ERC721 standard.
* For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
* {ConsecutiveTransfer} event is only permissible during contract creation.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {ConsecutiveTransfer} event.
*/
function _mintERC2309(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (to == address(0)) _revert(MintToZeroAddress.selector);
if (quantity == 0) _revert(MintZeroQuantity.selector);
if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector);
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are unrealistic due to the above check for `quantity` to be below the limit.
unchecked {
// Updates:
// - `balance += quantity`.
// - `numberMinted += quantity`.
//
// We can directly add to the `balance` and `numberMinted`.
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `quantity == 1`.
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);
emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);
_currentIndex = startTokenId + quantity;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Safely mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
* - `quantity` must be greater than 0.
*
* See {_mint}.
*
* Emits a {Transfer} event for each mint.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
_mint(to, quantity);
unchecked {
if (to.code.length != 0) {
uint256 end = _currentIndex;
uint256 index = end - quantity;
do {
if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
_revert(TransferToNonERC721ReceiverImplementer.selector);
}
} while (index < end);
// This prevents reentrancy to `_safeMint`.
// It does not prevent reentrancy to `_safeMintSpot`.
if (_currentIndex != end) revert();
}
}
}
/**
* @dev Equivalent to `_safeMint(to, quantity, '')`.
*/
function _safeMint(address to, uint256 quantity) internal virtual {
_safeMint(to, quantity, '');
}
/**
* @dev Mints a single token at `tokenId`.
*
* Note: A spot-minted `tokenId` that has been burned can be re-minted again.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` must be greater than `_sequentialUpTo()`.
* - `tokenId` must not exist.
*
* Emits a {Transfer} event for each mint.
*/
function _mintSpot(address to, uint256 tokenId) internal virtual {
if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector);
uint256 prevOwnershipPacked = _packedOwnerships[tokenId];
if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector);
_beforeTokenTransfers(address(0), to, tokenId, 1);
// Overflows are incredibly unrealistic.
// The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1.
// `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1.
unchecked {
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `true` (as `quantity == 1`).
_packedOwnerships[tokenId] = _packOwnershipData(
to,
_nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked)
);
// Updates:
// - `balance += 1`.
// - `numberMinted += 1`.
//
// We can directly add to the `balance` and `numberMinted`.
_packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1;
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
if (toMasked == 0) _revert(MintToZeroAddress.selector);
assembly {
// Emit the `Transfer` event.
log4(
0, // Start of data (0, since no data).
0, // End of data (0, since no data).
_TRANSFER_EVENT_SIGNATURE, // Signature.
0, // `address(0)`.
toMasked, // `to`.
tokenId // `tokenId`.
)
}
++_spotMinted;
}
_afterTokenTransfers(address(0), to, tokenId, 1);
}
/**
* @dev Safely mints a single token at `tokenId`.
*
* Note: A spot-minted `tokenId` that has been burned can be re-minted again.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}.
* - `tokenId` must be greater than `_sequentialUpTo()`.
* - `tokenId` must not exist.
*
* See {_mintSpot}.
*
* Emits a {Transfer} event.
*/
function _safeMintSpot(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mintSpot(to, tokenId);
unchecked {
if (to.code.length != 0) {
uint256 currentSpotMinted = _spotMinted;
if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) {
_revert(TransferToNonERC721ReceiverImplementer.selector);
}
// This prevents reentrancy to `_safeMintSpot`.
// It does not prevent reentrancy to `_safeMint`.
if (_spotMinted != currentSpotMinted) revert();
}
}
}
/**
* @dev Equivalent to `_safeMintSpot(to, tokenId, '')`.
*/
function _safeMintSpot(address to, uint256 tokenId) internal virtual {
_safeMintSpot(to, tokenId, '');
}
// =============================================================
// APPROVAL OPERATIONS
// =============================================================
/**
* @dev Equivalent to `_approve(to, tokenId, false)`.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_approve(to, tokenId, false);
}
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the
* zero address clears previous approvals.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function _approve(
address to,
uint256 tokenId,
bool approvalCheck
) internal virtual {
address owner = ownerOf(tokenId);
if (approvalCheck && _msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
_revert(ApprovalCallerNotOwnerNorApproved.selector);
}
_tokenApprovals[tokenId].value = to;
emit Approval(owner, to, tokenId);
}
// =============================================================
// BURN OPERATIONS
// =============================================================
/**
* @dev Equivalent to `_burn(tokenId, false)`.
*/
function _burn(uint256 tokenId) internal virtual {
_burn(tokenId, false);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
address from = address(uint160(prevOwnershipPacked));
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (approvalCheck) {
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);
}
_beforeTokenTransfers(from, address(0), tokenId, 1);
// Clear approvals from the previous owner.
assembly {
if approvedAddress {
// This is equivalent to `delete _tokenApprovals[tokenId]`.
sstore(approvedAddressSlot, 0)
}
}
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
unchecked {
// Updates:
// - `balance -= 1`.
// - `numberBurned += 1`.
//
// We can directly decrement the balance, and increment the number burned.
// This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
_packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;
// Updates:
// - `address` to the last owner.
// - `startTimestamp` to the timestamp of burning.
// - `burned` to `true`.
// - `nextInitialized` to `true`.
_packedOwnerships[tokenId] = _packOwnershipData(
from,
(_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
);
// If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
// If the next slot's address is zero and not burned (i.e. packed value is zero).
if (_packedOwnerships[nextTokenId] == 0) {
// If the next slot is within bounds.
if (nextTokenId != _currentIndex) {
// Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, address(0), tokenId);
_afterTokenTransfers(from, address(0), tokenId, 1);
// Overflow not possible, as `_burnCounter` cannot be exceed `_currentIndex + _spotMinted` times.
unchecked {
_burnCounter++;
}
}
// =============================================================
// EXTRA DATA OPERATIONS
// =============================================================
/**
* @dev Directly sets the extra data for the ownership data `index`.
*/
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
uint256 packed = _packedOwnerships[index];
if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector);
uint256 extraDataCasted;
// Cast `extraData` with assembly to avoid redundant masking.
assembly {
extraDataCasted := extraData
}
packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
_packedOwnerships[index] = packed;
}
/**
* @dev Called during each token transfer to set the 24bit `extraData` field.
* Intended to be overridden by the cosumer contract.
*
* `previousExtraData` - the value of `extraData` before transfer.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, `tokenId` will be burned by `from`.
* - `from` and `to` are never both zero.
*/
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual returns (uint24) {}
/**
* @dev Returns the next extra data for the packed ownership data.
* The returned result is shifted into position.
*/
function _nextExtraData(
address from,
address to,
uint256 prevOwnershipPacked
) private view returns (uint256) {
uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
}
// =============================================================
// OTHER OPERATIONS
// =============================================================
/**
* @dev Returns the message sender (defaults to `msg.sender`).
*
* If you are writing GSN compatible contracts, you need to override this function.
*/
function _msgSenderERC721A() internal view virtual returns (address) {
return msg.sender;
}
/**
* @dev Converts a uint256 to its ASCII string decimal representation.
*/
function _toString(uint256 value) internal pure virtual returns (string memory str) {
assembly {
// The maximum value of a uint256 contains 78 digits (1 byte per digit), but
// we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
// We will need 1 word for the trailing zeros padding, 1 word for the length,
// and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
let m := add(mload(0x40), 0xa0)
// Update the free memory pointer to allocate.
mstore(0x40, m)
// Assign the `str` to the end.
str := sub(m, 0x20)
// Zeroize the slot after the string.
mstore(str, 0)
// Cache the end of the memory to calculate the length later.
let end := str
// We write the string from rightmost digit to leftmost digit.
// The following is essentially a do-while loop that also handles the zero case.
// prettier-ignore
for { let temp := value } 1 {} {
str := sub(str, 1)
// Write the character to the pointer.
// The ASCII index of the '0' character is 48.
mstore8(str, add(48, mod(temp, 10)))
// Keep dividing `temp` until zero.
temp := div(temp, 10)
// prettier-ignore
if iszero(temp) { break }
}
let length := sub(end, str)
// Move the pointer 32 bytes leftwards to make room for the length.
str := sub(str, 0x20)
// Store the length.
mstore(str, length)
}
}
/**
* @dev For more efficient reverts.
*/
function _revert(bytes4 errorSelector) internal pure {
assembly {
mstore(0x00, errorSelector)
revert(0x00, 0x04)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.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.
*
* The initial owner is set to the address provided by the deployer. 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 Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @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;
assembly ("memory-safe") {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly ("memory-safe") {
mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.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, 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) {
uint256 localValue = value;
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = HEX_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal
* representation, according to EIP-55.
*/
function toChecksumHexString(address addr) internal pure returns (string memory) {
bytes memory buffer = bytes(toHexString(addr));
// hash the hex part of buffer (skip length + 2 bytes, length 40)
uint256 hashValue;
assembly ("memory-safe") {
hashValue := shr(96, keccak256(add(buffer, 0x22), 40))
}
for (uint256 i = 41; i > 1; --i) {
// possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)
if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {
// case shift by xoring with 0x20
buffer[i] ^= 0x20;
}
hashValue >>= 4;
}
return string(buffer);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of ERC721A.
*/
interface IERC721A {
/**
* The caller must own the token or be an approved operator.
*/
error ApprovalCallerNotOwnerNorApproved();
/**
* The token does not exist.
*/
error ApprovalQueryForNonexistentToken();
/**
* Cannot query the balance for the zero address.
*/
error BalanceQueryForZeroAddress();
/**
* Cannot mint to the zero address.
*/
error MintToZeroAddress();
/**
* The quantity of tokens minted must be more than zero.
*/
error MintZeroQuantity();
/**
* The token does not exist.
*/
error OwnerQueryForNonexistentToken();
/**
* The caller must own the token or be an approved operator.
*/
error TransferCallerNotOwnerNorApproved();
/**
* The token must be owned by `from`.
*/
error TransferFromIncorrectOwner();
/**
* Cannot safely transfer to a contract that does not implement the
* ERC721Receiver interface.
*/
error TransferToNonERC721ReceiverImplementer();
/**
* Cannot transfer to the zero address.
*/
error TransferToZeroAddress();
/**
* The token does not exist.
*/
error URIQueryForNonexistentToken();
/**
* The `quantity` minted with ERC2309 exceeds the safety limit.
*/
error MintERC2309QuantityExceedsLimit();
/**
* The `extraData` cannot be set on an unintialized ownership slot.
*/
error OwnershipNotInitializedForExtraData();
/**
* `_sequentialUpTo()` must be greater than `_startTokenId()`.
*/
error SequentialUpToTooSmall();
/**
* The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`.
*/
error SequentialMintExceedsLimit();
/**
* Spot minting requires a `tokenId` greater than `_sequentialUpTo()`.
*/
error SpotMintTokenIdTooSmall();
/**
* Cannot mint over a token that already exists.
*/
error TokenAlreadyExists();
/**
* The feature is not compatible with spot mints.
*/
error NotCompatibleWithSpotMints();
// =============================================================
// STRUCTS
// =============================================================
struct TokenOwnership {
// The address of the owner.
address addr;
// Stores the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
// Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
uint24 extraData;
}
// =============================================================
// TOKEN COUNTERS
// =============================================================
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() external view returns (uint256);
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
// =============================================================
// IERC721
// =============================================================
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables
* (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in `owner`'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`,
* checking first that contract recipients are aware of the ERC721 protocol
* to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move
* this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external payable;
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom}
* whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token
* by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external payable;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the
* zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external payable;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom}
* for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
// =============================================================
// IERC2309
// =============================================================
/**
* @dev Emitted when tokens in `fromTokenId` to `toTokenId`
* (inclusive) is transferred from `from` to `to`, as defined in the
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
*
* See {_mintERC2309} for more details.
*/
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
import {SafeCast} from "./SafeCast.sol";
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {
unchecked {
// branchless ternary works because:
// b ^ (a ^ b) == a
// b ^ 0 == b
return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));
}
}
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return ternary(a > b, a, b);
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return ternary(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 {
// Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson.
// Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,
// taking advantage of the most significant (or "sign" bit) in two's complement representation.
// This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,
// the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).
int256 mask = n >> 255;
// A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.
return uint256((n + mask) ^ mask);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
import {Panic} from "../Panic.sol";
import {SafeCast} from "./SafeCast.sol";
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an success flag (no overflow).
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a success flag (no division by zero).
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {
unchecked {
// branchless ternary works because:
// b ^ (a ^ b) == a
// b ^ 0 == b
return b ^ ((a ^ b) * SafeCast.toUint(condition));
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(a > b, a, b);
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(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 towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
Panic.panic(Panic.DIVISION_BY_ZERO);
}
// The following calculation ensures accurate ceiling division without overflow.
// Since a is non-zero, (a - 1) / b will not overflow.
// The largest possible result occurs when (a - 1) / b is type(uint256).max,
// but the largest value we can obtain is type(uint256).max - 1, which happens
// when a = type(uint256).max and b = 1.
unchecked {
return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);
}
}
/**
* @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
*
* 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²⁵⁶ and mod 2²⁵⁶ - 1, then use
// the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2²⁵⁶ + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
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²⁵⁶. Also prevents denominator == 0.
if (denominator <= prod1) {
Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_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.
uint256 twos = denominator & (0 - denominator);
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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such
// that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv ≡ 1 mod 2⁴.
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⁸
inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶
inverse *= 2 - denominator * inverse; // inverse mod 2³²
inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴
inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸
inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶
// 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²⁵⁶. Since the preconditions guarantee that the outcome is
// less than 2²⁵⁶, 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;
}
}
/**
* @dev 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) {
return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);
}
/**
* @dev Calculate the modular multiplicative inverse of a number in Z/nZ.
*
* If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.
* If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.
*
* If the input value is not inversible, 0 is returned.
*
* NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the
* inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.
*/
function invMod(uint256 a, uint256 n) internal pure returns (uint256) {
unchecked {
if (n == 0) return 0;
// The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)
// Used to compute integers x and y such that: ax + ny = gcd(a, n).
// When the gcd is 1, then the inverse of a modulo n exists and it's x.
// ax + ny = 1
// ax = 1 + (-y)n
// ax ≡ 1 (mod n) # x is the inverse of a modulo n
// If the remainder is 0 the gcd is n right away.
uint256 remainder = a % n;
uint256 gcd = n;
// Therefore the initial coefficients are:
// ax + ny = gcd(a, n) = n
// 0a + 1n = n
int256 x = 0;
int256 y = 1;
while (remainder != 0) {
uint256 quotient = gcd / remainder;
(gcd, remainder) = (
// The old remainder is the next gcd to try.
remainder,
// Compute the next remainder.
// Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd
// where gcd is at most n (capped to type(uint256).max)
gcd - remainder * quotient
);
(x, y) = (
// Increment the coefficient of a.
y,
// Decrement the coefficient of n.
// Can overflow, but the result is casted to uint256 so that the
// next value of y is "wrapped around" to a value between 0 and n - 1.
x - y * int256(quotient)
);
}
if (gcd != 1) return 0; // No inverse exists.
return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.
}
}
/**
* @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.
*
* From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is
* prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that
* `a**(p-2)` is the modular multiplicative inverse of a in Fp.
*
* NOTE: this function does NOT check that `p` is a prime greater than `2`.
*/
function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {
unchecked {
return Math.modExp(a, p - 2, p);
}
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)
*
* Requirements:
* - modulus can't be zero
* - underlying staticcall to precompile must succeed
*
* IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make
* sure the chain you're using it on supports the precompiled contract for modular exponentiation
* at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,
* the underlying function will succeed given the lack of a revert, but the result may be incorrectly
* interpreted as 0.
*/
function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {
(bool success, uint256 result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).
* It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying
* to operate modulo 0 or if the underlying precompile reverted.
*
* IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain
* you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in
* https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack
* of a revert, but the result may be incorrectly interpreted as 0.
*/
function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {
if (m == 0) return (false, 0);
assembly ("memory-safe") {
let ptr := mload(0x40)
// | Offset | Content | Content (Hex) |
// |-----------|------------|--------------------------------------------------------------------|
// | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x60:0x7f | value of b | 0x<.............................................................b> |
// | 0x80:0x9f | value of e | 0x<.............................................................e> |
// | 0xa0:0xbf | value of m | 0x<.............................................................m> |
mstore(ptr, 0x20)
mstore(add(ptr, 0x20), 0x20)
mstore(add(ptr, 0x40), 0x20)
mstore(add(ptr, 0x60), b)
mstore(add(ptr, 0x80), e)
mstore(add(ptr, 0xa0), m)
// Given the result < m, it's guaranteed to fit in 32 bytes,
// so we can use the memory scratch space located at offset 0.
success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)
result := mload(0x00)
}
}
/**
* @dev Variant of {modExp} that supports inputs of arbitrary length.
*/
function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {
(bool success, bytes memory result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Variant of {tryModExp} that supports inputs of arbitrary length.
*/
function tryModExp(
bytes memory b,
bytes memory e,
bytes memory m
) internal view returns (bool success, bytes memory result) {
if (_zeroBytes(m)) return (false, new bytes(0));
uint256 mLen = m.length;
// Encode call args in result and move the free memory pointer
result = abi.encodePacked(b.length, e.length, mLen, b, e, m);
assembly ("memory-safe") {
let dataPtr := add(result, 0x20)
// Write result on top of args to avoid allocating extra memory.
success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)
// Overwrite the length.
// result.length > returndatasize() is guaranteed because returndatasize() == m.length
mstore(result, mLen)
// Set the memory pointer after the returned data.
mstore(0x40, add(dataPtr, mLen))
}
}
/**
* @dev Returns whether the provided byte array is zero.
*/
function _zeroBytes(bytes memory byteArray) private pure returns (bool) {
for (uint256 i = 0; i < byteArray.length; ++i) {
if (byteArray[i] != 0) {
return false;
}
}
return true;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* This method is based on Newton's method for computing square roots; the algorithm is restricted to only
* using integer operations.
*/
function sqrt(uint256 a) internal pure returns (uint256) {
unchecked {
// Take care of easy edge cases when a == 0 or a == 1
if (a <= 1) {
return a;
}
// In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a
// sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between
// the current value as `ε_n = | x_n - sqrt(a) |`.
//
// For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root
// of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is
// bigger than any uint256.
//
// By noticing that
// `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`
// we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar
// to the msb function.
uint256 aa = a;
uint256 xn = 1;
if (aa >= (1 << 128)) {
aa >>= 128;
xn <<= 64;
}
if (aa >= (1 << 64)) {
aa >>= 64;
xn <<= 32;
}
if (aa >= (1 << 32)) {
aa >>= 32;
xn <<= 16;
}
if (aa >= (1 << 16)) {
aa >>= 16;
xn <<= 8;
}
if (aa >= (1 << 8)) {
aa >>= 8;
xn <<= 4;
}
if (aa >= (1 << 4)) {
aa >>= 4;
xn <<= 2;
}
if (aa >= (1 << 2)) {
xn <<= 1;
}
// We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).
//
// We can refine our estimation by noticing that the middle of that interval minimizes the error.
// If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).
// This is going to be our x_0 (and ε_0)
xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)
// From here, Newton's method give us:
// x_{n+1} = (x_n + a / x_n) / 2
//
// One should note that:
// x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a
// = ((x_n² + a) / (2 * x_n))² - a
// = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a
// = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)
// = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)
// = (x_n² - a)² / (2 * x_n)²
// = ((x_n² - a) / (2 * x_n))²
// ≥ 0
// Which proves that for all n ≥ 1, sqrt(a) ≤ x_n
//
// This gives us the proof of quadratic convergence of the sequence:
// ε_{n+1} = | x_{n+1} - sqrt(a) |
// = | (x_n + a / x_n) / 2 - sqrt(a) |
// = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |
// = | (x_n - sqrt(a))² / (2 * x_n) |
// = | ε_n² / (2 * x_n) |
// = ε_n² / | (2 * x_n) |
//
// For the first iteration, we have a special case where x_0 is known:
// ε_1 = ε_0² / | (2 * x_0) |
// ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))
// ≤ 2**(2*e-4) / (3 * 2**(e-1))
// ≤ 2**(e-3) / 3
// ≤ 2**(e-3-log2(3))
// ≤ 2**(e-4.5)
//
// For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:
// ε_{n+1} = ε_n² / | (2 * x_n) |
// ≤ (2**(e-k))² / (2 * 2**(e-1))
// ≤ 2**(2*e-2*k) / 2**e
// ≤ 2**(e-2*k)
xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above
xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5
xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9
xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18
xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36
xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72
// Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision
// ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either
// sqrt(a) or sqrt(a) + 1.
return xn - SafeCast.toUint(xn > a / xn);
}
}
/**
* @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
uint256 exp;
unchecked {
exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);
value >>= exp;
result += exp;
exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);
value >>= exp;
result += exp;
exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);
value >>= exp;
result += exp;
exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);
value >>= exp;
result += exp;
exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);
value >>= exp;
result += exp;
exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);
value >>= exp;
result += exp;
exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);
value >>= exp;
result += exp;
result += SafeCast.toUint(value > 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* 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;
uint256 isGt;
unchecked {
isGt = SafeCast.toUint(value > (1 << 128) - 1);
value >>= isGt * 128;
result += isGt * 16;
isGt = SafeCast.toUint(value > (1 << 64) - 1);
value >>= isGt * 64;
result += isGt * 8;
isGt = SafeCast.toUint(value > (1 << 32) - 1);
value >>= isGt * 32;
result += isGt * 4;
isGt = SafeCast.toUint(value > (1 << 16) - 1);
value >>= isGt * 16;
result += isGt * 2;
result += SafeCast.toUint(value > (1 << 8) - 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)
pragma solidity ^0.8.20;
import {Errors} from "./Errors.sol";
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert Errors.FailedCall();
}
}
/**
* @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 or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {Errors.FailedCall} error.
*
* 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.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @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`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
* of an unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {Errors.FailedCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
*/
function _revert(bytes memory returndata) 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
assembly ("memory-safe") {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert Errors.FailedCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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 Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.
pragma solidity ^0.8.20;
/**
* @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeCast {
/**
* @dev Value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);
/**
* @dev An int value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedIntToUint(int256 value);
/**
* @dev Value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);
/**
* @dev An uint value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedUintToInt(uint256 value);
/**
* @dev Returns the downcasted uint248 from uint256, reverting on
* overflow (when the input is greater than largest uint248).
*
* Counterpart to Solidity's `uint248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toUint248(uint256 value) internal pure returns (uint248) {
if (value > type(uint248).max) {
revert SafeCastOverflowedUintDowncast(248, value);
}
return uint248(value);
}
/**
* @dev Returns the downcasted uint240 from uint256, reverting on
* overflow (when the input is greater than largest uint240).
*
* Counterpart to Solidity's `uint240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toUint240(uint256 value) internal pure returns (uint240) {
if (value > type(uint240).max) {
revert SafeCastOverflowedUintDowncast(240, value);
}
return uint240(value);
}
/**
* @dev Returns the downcasted uint232 from uint256, reverting on
* overflow (when the input is greater than largest uint232).
*
* Counterpart to Solidity's `uint232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toUint232(uint256 value) internal pure returns (uint232) {
if (value > type(uint232).max) {
revert SafeCastOverflowedUintDowncast(232, value);
}
return uint232(value);
}
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toUint224(uint256 value) internal pure returns (uint224) {
if (value > type(uint224).max) {
revert SafeCastOverflowedUintDowncast(224, value);
}
return uint224(value);
}
/**
* @dev Returns the downcasted uint216 from uint256, reverting on
* overflow (when the input is greater than largest uint216).
*
* Counterpart to Solidity's `uint216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toUint216(uint256 value) internal pure returns (uint216) {
if (value > type(uint216).max) {
revert SafeCastOverflowedUintDowncast(216, value);
}
return uint216(value);
}
/**
* @dev Returns the downcasted uint208 from uint256, reverting on
* overflow (when the input is greater than largest uint208).
*
* Counterpart to Solidity's `uint208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toUint208(uint256 value) internal pure returns (uint208) {
if (value > type(uint208).max) {
revert SafeCastOverflowedUintDowncast(208, value);
}
return uint208(value);
}
/**
* @dev Returns the downcasted uint200 from uint256, reverting on
* overflow (when the input is greater than largest uint200).
*
* Counterpart to Solidity's `uint200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toUint200(uint256 value) internal pure returns (uint200) {
if (value > type(uint200).max) {
revert SafeCastOverflowedUintDowncast(200, value);
}
return uint200(value);
}
/**
* @dev Returns the downcasted uint192 from uint256, reverting on
* overflow (when the input is greater than largest uint192).
*
* Counterpart to Solidity's `uint192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toUint192(uint256 value) internal pure returns (uint192) {
if (value > type(uint192).max) {
revert SafeCastOverflowedUintDowncast(192, value);
}
return uint192(value);
}
/**
* @dev Returns the downcasted uint184 from uint256, reverting on
* overflow (when the input is greater than largest uint184).
*
* Counterpart to Solidity's `uint184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toUint184(uint256 value) internal pure returns (uint184) {
if (value > type(uint184).max) {
revert SafeCastOverflowedUintDowncast(184, value);
}
return uint184(value);
}
/**
* @dev Returns the downcasted uint176 from uint256, reverting on
* overflow (when the input is greater than largest uint176).
*
* Counterpart to Solidity's `uint176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toUint176(uint256 value) internal pure returns (uint176) {
if (value > type(uint176).max) {
revert SafeCastOverflowedUintDowncast(176, value);
}
return uint176(value);
}
/**
* @dev Returns the downcasted uint168 from uint256, reverting on
* overflow (when the input is greater than largest uint168).
*
* Counterpart to Solidity's `uint168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toUint168(uint256 value) internal pure returns (uint168) {
if (value > type(uint168).max) {
revert SafeCastOverflowedUintDowncast(168, value);
}
return uint168(value);
}
/**
* @dev Returns the downcasted uint160 from uint256, reverting on
* overflow (when the input is greater than largest uint160).
*
* Counterpart to Solidity's `uint160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toUint160(uint256 value) internal pure returns (uint160) {
if (value > type(uint160).max) {
revert SafeCastOverflowedUintDowncast(160, value);
}
return uint160(value);
}
/**
* @dev Returns the downcasted uint152 from uint256, reverting on
* overflow (when the input is greater than largest uint152).
*
* Counterpart to Solidity's `uint152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toUint152(uint256 value) internal pure returns (uint152) {
if (value > type(uint152).max) {
revert SafeCastOverflowedUintDowncast(152, value);
}
return uint152(value);
}
/**
* @dev Returns the downcasted uint144 from uint256, reverting on
* overflow (when the input is greater than largest uint144).
*
* Counterpart to Solidity's `uint144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toUint144(uint256 value) internal pure returns (uint144) {
if (value > type(uint144).max) {
revert SafeCastOverflowedUintDowncast(144, value);
}
return uint144(value);
}
/**
* @dev Returns the downcasted uint136 from uint256, reverting on
* overflow (when the input is greater than largest uint136).
*
* Counterpart to Solidity's `uint136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toUint136(uint256 value) internal pure returns (uint136) {
if (value > type(uint136).max) {
revert SafeCastOverflowedUintDowncast(136, value);
}
return uint136(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
if (value > type(uint128).max) {
revert SafeCastOverflowedUintDowncast(128, value);
}
return uint128(value);
}
/**
* @dev Returns the downcasted uint120 from uint256, reverting on
* overflow (when the input is greater than largest uint120).
*
* Counterpart to Solidity's `uint120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toUint120(uint256 value) internal pure returns (uint120) {
if (value > type(uint120).max) {
revert SafeCastOverflowedUintDowncast(120, value);
}
return uint120(value);
}
/**
* @dev Returns the downcasted uint112 from uint256, reverting on
* overflow (when the input is greater than largest uint112).
*
* Counterpart to Solidity's `uint112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toUint112(uint256 value) internal pure returns (uint112) {
if (value > type(uint112).max) {
revert SafeCastOverflowedUintDowncast(112, value);
}
return uint112(value);
}
/**
* @dev Returns the downcasted uint104 from uint256, reverting on
* overflow (when the input is greater than largest uint104).
*
* Counterpart to Solidity's `uint104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toUint104(uint256 value) internal pure returns (uint104) {
if (value > type(uint104).max) {
revert SafeCastOverflowedUintDowncast(104, value);
}
return uint104(value);
}
/**
* @dev Returns the downcasted uint96 from uint256, reverting on
* overflow (when the input is greater than largest uint96).
*
* Counterpart to Solidity's `uint96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toUint96(uint256 value) internal pure returns (uint96) {
if (value > type(uint96).max) {
revert SafeCastOverflowedUintDowncast(96, value);
}
return uint96(value);
}
/**
* @dev Returns the downcasted uint88 from uint256, reverting on
* overflow (when the input is greater than largest uint88).
*
* Counterpart to Solidity's `uint88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toUint88(uint256 value) internal pure returns (uint88) {
if (value > type(uint88).max) {
revert SafeCastOverflowedUintDowncast(88, value);
}
return uint88(value);
}
/**
* @dev Returns the downcasted uint80 from uint256, reverting on
* overflow (when the input is greater than largest uint80).
*
* Counterpart to Solidity's `uint80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toUint80(uint256 value) internal pure returns (uint80) {
if (value > type(uint80).max) {
revert SafeCastOverflowedUintDowncast(80, value);
}
return uint80(value);
}
/**
* @dev Returns the downcasted uint72 from uint256, reverting on
* overflow (when the input is greater than largest uint72).
*
* Counterpart to Solidity's `uint72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toUint72(uint256 value) internal pure returns (uint72) {
if (value > type(uint72).max) {
revert SafeCastOverflowedUintDowncast(72, value);
}
return uint72(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
if (value > type(uint64).max) {
revert SafeCastOverflowedUintDowncast(64, value);
}
return uint64(value);
}
/**
* @dev Returns the downcasted uint56 from uint256, reverting on
* overflow (when the input is greater than largest uint56).
*
* Counterpart to Solidity's `uint56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toUint56(uint256 value) internal pure returns (uint56) {
if (value > type(uint56).max) {
revert SafeCastOverflowedUintDowncast(56, value);
}
return uint56(value);
}
/**
* @dev Returns the downcasted uint48 from uint256, reverting on
* overflow (when the input is greater than largest uint48).
*
* Counterpart to Solidity's `uint48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toUint48(uint256 value) internal pure returns (uint48) {
if (value > type(uint48).max) {
revert SafeCastOverflowedUintDowncast(48, value);
}
return uint48(value);
}
/**
* @dev Returns the downcasted uint40 from uint256, reverting on
* overflow (when the input is greater than largest uint40).
*
* Counterpart to Solidity's `uint40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toUint40(uint256 value) internal pure returns (uint40) {
if (value > type(uint40).max) {
revert SafeCastOverflowedUintDowncast(40, value);
}
return uint40(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
if (value > type(uint32).max) {
revert SafeCastOverflowedUintDowncast(32, value);
}
return uint32(value);
}
/**
* @dev Returns the downcasted uint24 from uint256, reverting on
* overflow (when the input is greater than largest uint24).
*
* Counterpart to Solidity's `uint24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toUint24(uint256 value) internal pure returns (uint24) {
if (value > type(uint24).max) {
revert SafeCastOverflowedUintDowncast(24, value);
}
return uint24(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
if (value > type(uint16).max) {
revert SafeCastOverflowedUintDowncast(16, value);
}
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toUint8(uint256 value) internal pure returns (uint8) {
if (value > type(uint8).max) {
revert SafeCastOverflowedUintDowncast(8, value);
}
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
if (value < 0) {
revert SafeCastOverflowedIntToUint(value);
}
return uint256(value);
}
/**
* @dev Returns the downcasted int248 from int256, reverting on
* overflow (when the input is less than smallest int248 or
* greater than largest int248).
*
* Counterpart to Solidity's `int248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toInt248(int256 value) internal pure returns (int248 downcasted) {
downcasted = int248(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(248, value);
}
}
/**
* @dev Returns the downcasted int240 from int256, reverting on
* overflow (when the input is less than smallest int240 or
* greater than largest int240).
*
* Counterpart to Solidity's `int240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toInt240(int256 value) internal pure returns (int240 downcasted) {
downcasted = int240(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(240, value);
}
}
/**
* @dev Returns the downcasted int232 from int256, reverting on
* overflow (when the input is less than smallest int232 or
* greater than largest int232).
*
* Counterpart to Solidity's `int232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toInt232(int256 value) internal pure returns (int232 downcasted) {
downcasted = int232(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(232, value);
}
}
/**
* @dev Returns the downcasted int224 from int256, reverting on
* overflow (when the input is less than smallest int224 or
* greater than largest int224).
*
* Counterpart to Solidity's `int224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toInt224(int256 value) internal pure returns (int224 downcasted) {
downcasted = int224(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(224, value);
}
}
/**
* @dev Returns the downcasted int216 from int256, reverting on
* overflow (when the input is less than smallest int216 or
* greater than largest int216).
*
* Counterpart to Solidity's `int216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toInt216(int256 value) internal pure returns (int216 downcasted) {
downcasted = int216(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(216, value);
}
}
/**
* @dev Returns the downcasted int208 from int256, reverting on
* overflow (when the input is less than smallest int208 or
* greater than largest int208).
*
* Counterpart to Solidity's `int208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toInt208(int256 value) internal pure returns (int208 downcasted) {
downcasted = int208(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(208, value);
}
}
/**
* @dev Returns the downcasted int200 from int256, reverting on
* overflow (when the input is less than smallest int200 or
* greater than largest int200).
*
* Counterpart to Solidity's `int200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toInt200(int256 value) internal pure returns (int200 downcasted) {
downcasted = int200(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(200, value);
}
}
/**
* @dev Returns the downcasted int192 from int256, reverting on
* overflow (when the input is less than smallest int192 or
* greater than largest int192).
*
* Counterpart to Solidity's `int192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toInt192(int256 value) internal pure returns (int192 downcasted) {
downcasted = int192(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(192, value);
}
}
/**
* @dev Returns the downcasted int184 from int256, reverting on
* overflow (when the input is less than smallest int184 or
* greater than largest int184).
*
* Counterpart to Solidity's `int184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toInt184(int256 value) internal pure returns (int184 downcasted) {
downcasted = int184(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(184, value);
}
}
/**
* @dev Returns the downcasted int176 from int256, reverting on
* overflow (when the input is less than smallest int176 or
* greater than largest int176).
*
* Counterpart to Solidity's `int176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toInt176(int256 value) internal pure returns (int176 downcasted) {
downcasted = int176(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(176, value);
}
}
/**
* @dev Returns the downcasted int168 from int256, reverting on
* overflow (when the input is less than smallest int168 or
* greater than largest int168).
*
* Counterpart to Solidity's `int168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toInt168(int256 value) internal pure returns (int168 downcasted) {
downcasted = int168(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(168, value);
}
}
/**
* @dev Returns the downcasted int160 from int256, reverting on
* overflow (when the input is less than smallest int160 or
* greater than largest int160).
*
* Counterpart to Solidity's `int160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toInt160(int256 value) internal pure returns (int160 downcasted) {
downcasted = int160(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(160, value);
}
}
/**
* @dev Returns the downcasted int152 from int256, reverting on
* overflow (when the input is less than smallest int152 or
* greater than largest int152).
*
* Counterpart to Solidity's `int152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toInt152(int256 value) internal pure returns (int152 downcasted) {
downcasted = int152(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(152, value);
}
}
/**
* @dev Returns the downcasted int144 from int256, reverting on
* overflow (when the input is less than smallest int144 or
* greater than largest int144).
*
* Counterpart to Solidity's `int144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toInt144(int256 value) internal pure returns (int144 downcasted) {
downcasted = int144(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(144, value);
}
}
/**
* @dev Returns the downcasted int136 from int256, reverting on
* overflow (when the input is less than smallest int136 or
* greater than largest int136).
*
* Counterpart to Solidity's `int136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toInt136(int256 value) internal pure returns (int136 downcasted) {
downcasted = int136(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(136, value);
}
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toInt128(int256 value) internal pure returns (int128 downcasted) {
downcasted = int128(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(128, value);
}
}
/**
* @dev Returns the downcasted int120 from int256, reverting on
* overflow (when the input is less than smallest int120 or
* greater than largest int120).
*
* Counterpart to Solidity's `int120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toInt120(int256 value) internal pure returns (int120 downcasted) {
downcasted = int120(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(120, value);
}
}
/**
* @dev Returns the downcasted int112 from int256, reverting on
* overflow (when the input is less than smallest int112 or
* greater than largest int112).
*
* Counterpart to Solidity's `int112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toInt112(int256 value) internal pure returns (int112 downcasted) {
downcasted = int112(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(112, value);
}
}
/**
* @dev Returns the downcasted int104 from int256, reverting on
* overflow (when the input is less than smallest int104 or
* greater than largest int104).
*
* Counterpart to Solidity's `int104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toInt104(int256 value) internal pure returns (int104 downcasted) {
downcasted = int104(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(104, value);
}
}
/**
* @dev Returns the downcasted int96 from int256, reverting on
* overflow (when the input is less than smallest int96 or
* greater than largest int96).
*
* Counterpart to Solidity's `int96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toInt96(int256 value) internal pure returns (int96 downcasted) {
downcasted = int96(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(96, value);
}
}
/**
* @dev Returns the downcasted int88 from int256, reverting on
* overflow (when the input is less than smallest int88 or
* greater than largest int88).
*
* Counterpart to Solidity's `int88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toInt88(int256 value) internal pure returns (int88 downcasted) {
downcasted = int88(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(88, value);
}
}
/**
* @dev Returns the downcasted int80 from int256, reverting on
* overflow (when the input is less than smallest int80 or
* greater than largest int80).
*
* Counterpart to Solidity's `int80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toInt80(int256 value) internal pure returns (int80 downcasted) {
downcasted = int80(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(80, value);
}
}
/**
* @dev Returns the downcasted int72 from int256, reverting on
* overflow (when the input is less than smallest int72 or
* greater than largest int72).
*
* Counterpart to Solidity's `int72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toInt72(int256 value) internal pure returns (int72 downcasted) {
downcasted = int72(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(72, value);
}
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toInt64(int256 value) internal pure returns (int64 downcasted) {
downcasted = int64(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(64, value);
}
}
/**
* @dev Returns the downcasted int56 from int256, reverting on
* overflow (when the input is less than smallest int56 or
* greater than largest int56).
*
* Counterpart to Solidity's `int56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toInt56(int256 value) internal pure returns (int56 downcasted) {
downcasted = int56(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(56, value);
}
}
/**
* @dev Returns the downcasted int48 from int256, reverting on
* overflow (when the input is less than smallest int48 or
* greater than largest int48).
*
* Counterpart to Solidity's `int48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toInt48(int256 value) internal pure returns (int48 downcasted) {
downcasted = int48(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(48, value);
}
}
/**
* @dev Returns the downcasted int40 from int256, reverting on
* overflow (when the input is less than smallest int40 or
* greater than largest int40).
*
* Counterpart to Solidity's `int40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toInt40(int256 value) internal pure returns (int40 downcasted) {
downcasted = int40(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(40, value);
}
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toInt32(int256 value) internal pure returns (int32 downcasted) {
downcasted = int32(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(32, value);
}
}
/**
* @dev Returns the downcasted int24 from int256, reverting on
* overflow (when the input is less than smallest int24 or
* greater than largest int24).
*
* Counterpart to Solidity's `int24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toInt24(int256 value) internal pure returns (int24 downcasted) {
downcasted = int24(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(24, value);
}
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toInt16(int256 value) internal pure returns (int16 downcasted) {
downcasted = int16(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(16, value);
}
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toInt8(int256 value) internal pure returns (int8 downcasted) {
downcasted = int8(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(8, value);
}
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
// Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
if (value > uint256(type(int256).max)) {
revert SafeCastOverflowedUintToInt(value);
}
return int256(value);
}
/**
* @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.
*/
function toUint(bool b) internal pure returns (uint256 u) {
assembly ("memory-safe") {
u := iszero(iszero(b))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)
pragma solidity ^0.8.20;
/**
* @dev Helper library for emitting standardized panic codes.
*
* ```solidity
* contract Example {
* using Panic for uint256;
*
* // Use any of the declared internal constants
* function foo() { Panic.GENERIC.panic(); }
*
* // Alternatively
* function foo() { Panic.panic(Panic.GENERIC); }
* }
* ```
*
* Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].
*
* _Available since v5.1._
*/
// slither-disable-next-line unused-state
library Panic {
/// @dev generic / unspecified error
uint256 internal constant GENERIC = 0x00;
/// @dev used by the assert() builtin
uint256 internal constant ASSERT = 0x01;
/// @dev arithmetic underflow or overflow
uint256 internal constant UNDER_OVERFLOW = 0x11;
/// @dev division or modulo by zero
uint256 internal constant DIVISION_BY_ZERO = 0x12;
/// @dev enum conversion error
uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;
/// @dev invalid encoding in storage
uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;
/// @dev empty array pop
uint256 internal constant EMPTY_ARRAY_POP = 0x31;
/// @dev array out of bounds access
uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;
/// @dev resource error (too large allocation or too large array)
uint256 internal constant RESOURCE_ERROR = 0x41;
/// @dev calling invalid internal function
uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;
/// @dev Reverts with a panic code. Recommended to use with
/// the internal constants with predefined codes.
function panic(uint256 code) internal pure {
assembly ("memory-safe") {
mstore(0x00, 0x4e487b71)
mstore(0x20, code)
revert(0x1c, 0x24)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of common custom errors used in multiple contracts
*
* IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
* It is recommended to avoid relying on the error API for critical functionality.
*
* _Available since v5.1._
*/
library Errors {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedCall();
/**
* @dev The deployment failed.
*/
error FailedDeployment();
/**
* @dev A necessary precompile is missing.
*/
error MissingPrecompile(address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC 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);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"remappings": [],
"evmVersion": "paris"
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_signer","type":"address"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_mintTreasury","type":"address"},{"internalType":"address","name":"_generationTreasury","type":"address"},{"internalType":"uint256","name":"_NFTImageMintPrice","type":"uint256"},{"internalType":"uint256","name":"_NFTVideoMintPrice","type":"uint256"},{"internalType":"uint256","name":"_generationFee","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotCompatibleWithSpotMints","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"SequentialMintExceedsLimit","type":"error"},{"inputs":[],"name":"SequentialUpToTooSmall","type":"error"},{"inputs":[],"name":"SpotMintTokenIdTooSmall","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"addr","type":"address"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"GenerationTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MintTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NFTImageMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NFTVideoMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"generationFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"bytes32","name":"_messageHash","type":"bytes32"}],"name":"getEthSignedMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"string","name":"_message","type":"string"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"getMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","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":"bytes","name":"_signature","type":"bytes"},{"internalType":"string","name":"_message","type":"string"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"isMessageValid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"bool","name":"isImage","type":"bool"}],"name":"mintWithETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"string","name":"_message","type":"string"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"mintWithToken","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":"pauseContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"payForGeneration","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"processedNonces","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_ethSignedMessageHash","type":"bytes32"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"recoverSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setGenerationFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newGenerationTreasury","type":"address"}],"name":"setGenerationTreasuryWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMintTreasury","type":"address"}],"name":"setMintTreasuryWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_imagePrice","type":"uint256"}],"name":"setNFTImageMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_videoPrice","type":"uint256"}],"name":"setNFTVideoMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"splitSignature","outputs":[{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"stateMutability":"pure","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":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpauseContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"updateToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"updatesignerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"walletOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"payable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b5060405162002aed38038062002aed833981016040819052620000349162000239565b604080518082018252601581527f4d696e7469667920414920436f6c6c656374696f6e0000000000000000000000602080830191909152825180840190935260048352631353919560e21b9083015290876001600160a01b038116620000b557604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620000c08162000157565b506003620000cf83826200036d565b506004620000de82826200036d565b50506001805550600b80546001600160a01b03199081166001600160a01b038b811691909117909255600c80548216888416179055600d80548216878416179055600a8054909116918916919091179055600f8390556010829055600e8190556200014986620001a7565b505050505050505062000439565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001b1620001eb565b6001600160a01b038116620001dd57604051631e4fbdf760e01b815260006004820152602401620000ac565b620001e88162000157565b50565b6000546001600160a01b031633146200021a5760405163118cdaa760e01b8152336004820152602401620000ac565b565b80516001600160a01b03811681146200023457600080fd5b919050565b600080600080600080600080610100898b0312156200025757600080fd5b62000262896200021c565b97506200027260208a016200021c565b96506200028260408a016200021c565b95506200029260608a016200021c565b9450620002a260808a016200021c565b935060a0890151925060c0890151915060e089015190509295985092959890939650565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620002f157607f821691505b6020821081036200031257634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000368576000816000526020600020601f850160051c81016020861015620003435750805b601f850160051c820191505b8181101562000364578281556001016200034f565b5050505b505050565b81516001600160401b03811115620003895762000389620002c6565b620003a1816200039a8454620002dc565b8462000318565b602080601f831160018114620003d95760008415620003c05750858301515b600019600386901b1c1916600185901b17855562000364565b600085815260208120601f198616915b828110156200040a57888601518255948401946001909101908401620003e9565b5085821015620004295787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6126a480620004496000396000f3fe6080604052600436106102675760003560e01c8063715018a611610144578063a7bb5803116100b6578063ccb915961161007a578063ccb91596146106d8578063d4aa691614610713578063e985e9c514610733578063f2fde38b1461077c578063fa5408011461079c578063fc0c546a146107bc57600080fd5b8063a7bb580314610632578063b33712c514610670578063b88d4fde14610685578063c87b56dd14610698578063c9e720dc146106b857600080fd5b80638da5cb5b116101085780638da5cb5b146105a45780638ddb3636146105c257806395d89b41146105ca57806397aba7f9146105df578063a22cb465146105ff578063a68996fd1461061f57600080fd5b8063715018a61461050e5780637801a4ff146105235780637ad3def2146105435780637d32daea146105635780638a67456a1461058357600080fd5b806328f1a0e0116101dd578063438b6300116101a1578063438b630014610456578063439766ce146104835780635509d40814610498578063622e8ea3146104ae5780636352211e146104ce57806370a08231146104ee57600080fd5b806328f1a0e0146103e557806338a131cd146104055780633ccfd60b1461041b578063419bfcfc1461042357806342842e0e1461044357600080fd5b80630cf6e1dd1161022f5780630cf6e1dd14610334578063160d806e1461035457806318160ddd1461037457806321171b411461039257806322e7b464146103b257806323b872dd146103d257600080fd5b806301ffc9a71461026c5780630566f18a146102a157806306fdde03146102c5578063081812fc146102e7578063095ea7b31461031f575b600080fd5b34801561027857600080fd5b5061028c610287366004611ee1565b6107dc565b60405190151581526020015b60405180910390f35b3480156102ad57600080fd5b506102b7600e5481565b604051908152602001610298565b3480156102d157600080fd5b506102da61082e565b6040516102989190611f55565b3480156102f357600080fd5b50610307610302366004611f68565b6108c0565b6040516001600160a01b039091168152602001610298565b61033261032d366004611f98565b6108fb565b005b34801561034057600080fd5b5061033261034f366004611fc2565b61090b565b34801561036057600080fd5b5061033261036f366004611fc2565b610989565b34801561038057600080fd5b506102b7600254600154036000190190565b34801561039e57600080fd5b506103326103ad366004611fc2565b610a15565b3480156103be57600080fd5b5061028c6103cd366004612080565b610aa8565b6103326103e03660046120ed565b610aef565b3480156103f157600080fd5b50610332610400366004611f68565b610c54565b34801561041157600080fd5b506102b760105481565b610332610cb1565b34801561042f57600080fd5b5061033261043e366004612129565b610d7f565b6103326104513660046120ed565b610f99565b34801561046257600080fd5b50610476610471366004611fc2565b610fb9565b60405161029891906121ca565b34801561048f57600080fd5b506103326110c2565b3480156104a457600080fd5b506102b7600f5481565b3480156104ba57600080fd5b506103326104c9366004611f68565b6110df565b3480156104da57600080fd5b506103076104e9366004611f68565b61114f565b3480156104fa57600080fd5b506102b7610509366004611fc2565b61115a565b34801561051a57600080fd5b506103326111a0565b34801561052f57600080fd5b50600c54610307906001600160a01b031681565b34801561054f57600080fd5b5061033261055e366004611fc2565b6111b4565b34801561056f57600080fd5b5061033261057e366004611f68565b61122d565b34801561058f57600080fd5b50600d5461028c90600160a01b900460ff1681565b3480156105b057600080fd5b506000546001600160a01b0316610307565b61033261129d565b3480156105d657600080fd5b506102da61137e565b3480156105eb57600080fd5b506103076105fa366004612202565b61138d565b34801561060b57600080fd5b5061033261061a366004612259565b61140c565b61033261062d36600461228c565b611478565b34801561063e57600080fd5b5061065261064d3660046122ea565b61166e565b60408051938452602084019290925260ff1690820152606001610298565b34801561067c57600080fd5b506103326116e2565b61033261069336600461231f565b6116f9565b3480156106a457600080fd5b506102da6106b3366004611f68565b61173a565b3480156106c457600080fd5b50600d54610307906001600160a01b031681565b3480156106e457600080fd5b5061028c6106f33660046122ea565b805160208183018101805160118252928201919093012091525460ff1681565b34801561071f57600080fd5b506102b761072e366004612387565b611887565b34801561073f57600080fd5b5061028c61074e3660046123cc565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b34801561078857600080fd5b50610332610797366004611fc2565b6118ba565b3480156107a857600080fd5b506102b76107b7366004611f68565b6118f5565b3480156107c857600080fd5b50600b54610307906001600160a01b031681565b60006301ffc9a760e01b6001600160e01b03198316148061080d57506380ac58cd60e01b6001600160e01b03198316145b806108285750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606003805461083d906123f6565b80601f0160208091040260200160405190810160405280929190818152602001828054610869906123f6565b80156108b65780601f1061088b576101008083540402835291602001916108b6565b820191906000526020600020905b81548152906001019060200180831161089957829003601f168201915b5050505050905090565b60006108cb82611948565b6108df576108df6333d1c03960e21b611996565b506000908152600760205260409020546001600160a01b031690565b610907828260016119a0565b5050565b610913611a43565b6001600160a01b0381166109675760405162461bcd60e51b8152602060048201526016602482015275496e76616c69642077616c6c6574206164647265737360501b60448201526064015b60405180910390fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b610991611a43565b6001600160a01b0381166109f35760405162461bcd60e51b8152602060048201526024808201527f496e76616c6964206d696e742074726561737572792077616c6c6574206164646044820152637265737360e01b606482015260840161095e565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b610a1d611a43565b6001600160a01b038116610a865760405162461bcd60e51b815260206004820152602a60248201527f496e76616c69642067656e65726174696f6e2074726561737572792077616c6c6044820152696574206164647265737360b01b606482015260840161095e565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b600080610ab58484611887565b90506000610ac2826118f5565b600a549091506001600160a01b0316610adb828861138d565b6001600160a01b0316149695505050505050565b6000610afa82611a70565b6001600160a01b039485169490915081168414610b2057610b2062a1148160e81b611996565b60008281526007602052604090208054338082146001600160a01b03881690911417610b6457610b50863361074e565b610b6457610b64632ce44b5f60e11b611996565b8015610b6f57600082555b6001600160a01b038681166000908152600660205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260056020526040812091909155600160e11b84169003610c0157600184016000818152600560205260408120549003610bff576001548114610bff5760008181526005602052604090208490555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003610c4b57610c4b633a954ecd60e21b611996565b50505050505050565b610c5c611a43565b60008111610cac5760405162461bcd60e51b815260206004820152601d60248201527f466565206d7573742062652067726561746572207468616e207a65726f000000604482015260640161095e565b600e55565b610cb9611a43565b6040514790600090339083908381818185875af1925050503d8060008114610cfd576040519150601f19603f3d011682016040523d82523d6000602084013e610d02565b606091505b5050905080610d465760405162461bcd60e51b815260206004820152601060248201526f2bb4ba34323930bb903330b4b632b21760811b604482015260640161095e565b60405182815233907f8353ffcac0876ad14e226d9783c04540bfebf13871e868157d2a391cad98e9189060200160405180910390a25050565b33600182600d60149054906101000a900460ff1615610dcf5760405162461bcd60e51b815260206004820152600c60248201526b53616c65205061757365642160a01b604482015260640161095e565b8115610e6157600b546040516370a0823160e01b81526001600160a01b038581166004830152839216906370a0823190602401602060405180830381865afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e439190612430565b1015610e615760405162461bcd60e51b815260040161095e90612449565b610e6c868686610aa8565b610eac5760405162461bcd60e51b81526020600482015260116024820152701cda59db985d1d5c99481a5b9d985b1a59607a1b604482015260640161095e565b601185604051610ebc919061248b565b9081526040519081900360200190205460ff1615610f0c5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c6964206e6f6e636560981b604482015260640161095e565b6001601186604051610f1e919061248b565b908152604051908190036020019020805491151560ff19909216919091179055600c54600b54610f5d916001600160a01b039182169133911687611b11565b6000610f6860015490565b9050610f75896001611b6b565b6000818152601260205260409020610f8d89826124f7565b50505050505050505050565b610fb4838383604051806020016040528060008152506116f9565b505050565b60606000806000610fc98561115a565b905060008167ffffffffffffffff811115610fe657610fe6611fdd565b60405190808252806020026020018201604052801561100f578160200160208202803683370190505b50905061103c60408051608081018252600080825260208201819052918101829052606081019190915290565b60015b8386146110b65761104f81611b85565b915081604001516110ae5781516001600160a01b03161561106f57815194505b876001600160a01b0316856001600160a01b0316036110ae57808387806001019850815181106110a1576110a16125b7565b6020026020010181815250505b60010161103f565b50909695505050505050565b6110ca611a43565b600d805460ff60a01b1916600160a01b179055565b6110e7611a43565b6000811161114a5760405162461bcd60e51b815260206004820152602a60248201527f566964656f206d696e74207072696365206d7573742062652067726561746572604482015269207468616e207a65726f60b01b606482015260840161095e565b601055565b600061082882611a70565b60006001600160a01b03821661117a5761117a6323d3ad8160e21b611996565b506001600160a01b031660009081526006602052604090205467ffffffffffffffff1690565b6111a8611a43565b6111b26000611c04565b565b6111bc611a43565b6001600160a01b03811661120b5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964205f746f6b656e206164647265737360501b604482015260640161095e565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b611235611a43565b600081116112985760405162461bcd60e51b815260206004820152602a60248201527f496d616765206d696e74207072696365206d7573742062652067726561746572604482015269207468616e207a65726f60b01b606482015260840161095e565b600f55565b600e543410156112e25760405162461bcd60e51b815260206004820152601060248201526f496e73756666696369656e742066656560801b604482015260640161095e565b600d546040516000916001600160a01b03169034908381818185875af1925050503d806000811461132f576040519150601f19603f3d011682016040523d82523d6000602084013e611334565b606091505b505090508061137b5760405162461bcd60e51b8152602060048201526013602482015272119959481d1c985b9cd9995c8819985a5b1959606a1b604482015260640161095e565b50565b60606004805461083d906123f6565b60008060008061139c8561166e565b6040805160008152602081018083528b905260ff8316918101919091526060810184905260808101839052929550909350915060019060a0016020604051602081039080840390855afa1580156113f7573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b33600080600d60149054906101000a900460ff16156114c85760405162461bcd60e51b815260206004820152600c60248201526b53616c65205061757365642160a01b604482015260640161095e565b811561155a57600b546040516370a0823160e01b81526001600160a01b038581166004830152839216906370a0823190602401602060405180830381865afa158015611518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061153c9190612430565b101561155a5760405162461bcd60e51b815260040161095e90612449565b6000841561156b5750600f54611570565b506010545b803410156115cb5760405162461bcd60e51b815260206004820152602260248201527f496e73756666696369656e7420466565732073656e7420666f72206d696e74696044820152616e6760f01b606482015260840161095e565b600c546040516000916001600160a01b03169034908381818185875af1925050503d8060008114611618576040519150601f19603f3d011682016040523d82523d6000602084013e61161d565b606091505b5050905080610f5d5760405162461bcd60e51b815260206004820152601f60248201527f455448207472616e7366657220746f207472656173757279206661696c656400604482015260640161095e565b600080600083516041146116c45760405162461bcd60e51b815260206004820152601860248201527f696e76616c6964207369676e6174757265206c656e6774680000000000000000604482015260640161095e565b50505060208101516040820151606090920151909260009190911a90565b6116ea611a43565b600d805460ff60a01b19169055565b611704848484610aef565b6001600160a01b0383163b156117345761172084848484611c54565b611734576117346368d2bf6b60e11b611996565b50505050565b606061174582611948565b6117a95760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161095e565b600082815260126020526040812080546117c2906123f6565b80601f01602080910402602001604051908101604052809291908181526020018280546117ee906123f6565b801561183b5780601f106118105761010080835404028352916020019161183b565b820191906000526020600020905b81548152906001019060200180831161181e57829003601f168201915b5050505050905060008151116108285760405162461bcd60e51b8152602060048201526011602482015270151bdad95b88155492481b9bdd081cd95d607a1b604482015260640161095e565b6000828260405160200161189c9291906125cd565b60405160208183030381529060405280519060200120905092915050565b6118c2611a43565b6001600160a01b0381166118ec57604051631e4fbdf760e01b81526000600482015260240161095e565b61137b81611c04565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b600081600111611991576001548210156119915760005b506000828152600560205260408120549081900361198757611980836125ef565b925061195f565b600160e01b161590505b919050565b8060005260046000fd5b60006119ab8361114f565b90508180156119c35750336001600160a01b03821614155b156119e6576119d2813361074e565b6119e6576119e66367d9dca160e11b611996565b60008381526007602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b6000546001600160a01b031633146111b25760405163118cdaa760e01b815233600482015260240161095e565b600081600111611b01575060008181526005602052604090205480600003611aee576001548210611aab57611aab636f96cda160e11b611996565b5b50600019016000818152600560205260409020548015611aac57600160e01b8116600003611ad957919050565b611ae9636f96cda160e11b611996565b611aac565b600160e01b8116600003611b0157919050565b611991636f96cda160e11b611996565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611734908590611d37565b610907828260405180602001604052806000815250611da8565b60408051608081018252600080825260208201819052918101829052606081019190915260008281526005602052604090205461082890604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611c89903390899088908890600401612614565b6020604051808303816000875af1925050508015611cc4575060408051601f3d908101601f19168201909252611cc191810190612651565b60015b611d19573d808015611cf2576040519150601f19603f3d011682016040523d82523d6000602084013e611cf7565b606091505b508051600003611d1157611d116368d2bf6b60e11b611996565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b600080602060008451602086016000885af180611d5a576040513d6000823e3d81fd5b50506000513d91508115611d72578060011415611d7f565b6001600160a01b0384163b155b1561173457604051635274afe760e01b81526001600160a01b038516600482015260240161095e565b611db28383611e0c565b6001600160a01b0383163b15610fb4576001548281035b611ddc6000868380600101945086611c54565b611df057611df06368d2bf6b60e11b611996565b818110611dc9578160015414611e0557600080fd5b5050505050565b6001546000829003611e2857611e2863b562e8dd60e01b611996565b60008181526005602090815260408083206001600160a01b0387164260a01b6001881460e11b17811790915580845260069092528220805468010000000000000001860201905590819003611e8657611e86622e076360e81b611996565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4818160010191508103611e8b575060015550505050565b6001600160e01b03198116811461137b57600080fd5b600060208284031215611ef357600080fd5b8135611efe81611ecb565b9392505050565b60005b83811015611f20578181015183820152602001611f08565b50506000910152565b60008151808452611f41816020860160208601611f05565b601f01601f19169290920160200192915050565b602081526000611efe6020830184611f29565b600060208284031215611f7a57600080fd5b5035919050565b80356001600160a01b038116811461199157600080fd5b60008060408385031215611fab57600080fd5b611fb483611f81565b946020939093013593505050565b600060208284031215611fd457600080fd5b611efe82611f81565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261200457600080fd5b813567ffffffffffffffff8082111561201f5761201f611fdd565b604051601f8301601f19908116603f0116810190828211818310171561204757612047611fdd565b8160405283815286602085880101111561206057600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561209557600080fd5b833567ffffffffffffffff808211156120ad57600080fd5b6120b987838801611ff3565b945060208601359150808211156120cf57600080fd5b506120dc86828701611ff3565b925050604084013590509250925092565b60008060006060848603121561210257600080fd5b61210b84611f81565b925061211960208501611f81565b9150604084013590509250925092565b600080600080600060a0868803121561214157600080fd5b61214a86611f81565b9450602086013567ffffffffffffffff8082111561216757600080fd5b61217389838a01611ff3565b9550604088013591508082111561218957600080fd5b61219589838a01611ff3565b945060608801359150808211156121ab57600080fd5b506121b888828901611ff3565b95989497509295608001359392505050565b6020808252825182820181905260009190848201906040850190845b818110156110b6578351835292840192918401916001016121e6565b6000806040838503121561221557600080fd5b82359150602083013567ffffffffffffffff81111561223357600080fd5b61223f85828601611ff3565b9150509250929050565b8035801515811461199157600080fd5b6000806040838503121561226c57600080fd5b61227583611f81565b915061228360208401612249565b90509250929050565b6000806000606084860312156122a157600080fd5b6122aa84611f81565b9250602084013567ffffffffffffffff8111156122c657600080fd5b6122d286828701611ff3565b9250506122e160408501612249565b90509250925092565b6000602082840312156122fc57600080fd5b813567ffffffffffffffff81111561231357600080fd5b611d2f84828501611ff3565b6000806000806080858703121561233557600080fd5b61233e85611f81565b935061234c60208601611f81565b925060408501359150606085013567ffffffffffffffff81111561236f57600080fd5b61237b87828801611ff3565b91505092959194509250565b6000806040838503121561239a57600080fd5b823567ffffffffffffffff8111156123b157600080fd5b6123bd85828601611ff3565b95602094909401359450505050565b600080604083850312156123df57600080fd5b6123e883611f81565b915061228360208401611f81565b600181811c9082168061240a57607f821691505b60208210810361242a57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561244257600080fd5b5051919050565b60208082526022908201527f4e6f7420656e6f75676820746f6b656e2073656e742c20636865636b20707269604082015261636560f01b606082015260800190565b6000825161249d818460208701611f05565b9190910192915050565b601f821115610fb4576000816000526020600020601f850160051c810160208610156124d05750805b601f850160051c820191505b818110156124ef578281556001016124dc565b505050505050565b815167ffffffffffffffff81111561251157612511611fdd565b6125258161251f84546123f6565b846124a7565b602080601f83116001811461255a57600084156125425750858301515b600019600386901b1c1916600185901b1785556124ef565b600085815260208120601f198616915b828110156125895788860151825594840194600190910190840161256a565b50858210156125a75787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b600083516125df818460208801611f05565b9190910191825250602001919050565b60008161260c57634e487b7160e01b600052601160045260246000fd5b506000190190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061264790830184611f29565b9695505050505050565b60006020828403121561266357600080fd5b8151611efe81611ecb56fea2646970667358221220eaf3d85393df389dcc971ea04031394198a1f836ad6c1673584eab3405c55cc264736f6c63430008160033000000000000000000000000000000000000000000000000000000000000dead000000000000000000000000ca0ce7afb4f77d034ca475837d2a3783cc784ca800000000000000000000000060acb812fbc9c933483b632a1d11de5adca24b6b0000000000000000000000004ebc651a80729e22fdc756b7eecf98666799a64900000000000000000000000050a63a191280053bd215cb31dab42ecdd29a701e000000000000000000000000000000000000000000000001a055690d9db8000000000000000000000000000000000000000000000000000270801d946c9400000000000000000000000000000000000000000000000000000000f407b39cf2ff
Deployed Bytecode
0x6080604052600436106102675760003560e01c8063715018a611610144578063a7bb5803116100b6578063ccb915961161007a578063ccb91596146106d8578063d4aa691614610713578063e985e9c514610733578063f2fde38b1461077c578063fa5408011461079c578063fc0c546a146107bc57600080fd5b8063a7bb580314610632578063b33712c514610670578063b88d4fde14610685578063c87b56dd14610698578063c9e720dc146106b857600080fd5b80638da5cb5b116101085780638da5cb5b146105a45780638ddb3636146105c257806395d89b41146105ca57806397aba7f9146105df578063a22cb465146105ff578063a68996fd1461061f57600080fd5b8063715018a61461050e5780637801a4ff146105235780637ad3def2146105435780637d32daea146105635780638a67456a1461058357600080fd5b806328f1a0e0116101dd578063438b6300116101a1578063438b630014610456578063439766ce146104835780635509d40814610498578063622e8ea3146104ae5780636352211e146104ce57806370a08231146104ee57600080fd5b806328f1a0e0146103e557806338a131cd146104055780633ccfd60b1461041b578063419bfcfc1461042357806342842e0e1461044357600080fd5b80630cf6e1dd1161022f5780630cf6e1dd14610334578063160d806e1461035457806318160ddd1461037457806321171b411461039257806322e7b464146103b257806323b872dd146103d257600080fd5b806301ffc9a71461026c5780630566f18a146102a157806306fdde03146102c5578063081812fc146102e7578063095ea7b31461031f575b600080fd5b34801561027857600080fd5b5061028c610287366004611ee1565b6107dc565b60405190151581526020015b60405180910390f35b3480156102ad57600080fd5b506102b7600e5481565b604051908152602001610298565b3480156102d157600080fd5b506102da61082e565b6040516102989190611f55565b3480156102f357600080fd5b50610307610302366004611f68565b6108c0565b6040516001600160a01b039091168152602001610298565b61033261032d366004611f98565b6108fb565b005b34801561034057600080fd5b5061033261034f366004611fc2565b61090b565b34801561036057600080fd5b5061033261036f366004611fc2565b610989565b34801561038057600080fd5b506102b7600254600154036000190190565b34801561039e57600080fd5b506103326103ad366004611fc2565b610a15565b3480156103be57600080fd5b5061028c6103cd366004612080565b610aa8565b6103326103e03660046120ed565b610aef565b3480156103f157600080fd5b50610332610400366004611f68565b610c54565b34801561041157600080fd5b506102b760105481565b610332610cb1565b34801561042f57600080fd5b5061033261043e366004612129565b610d7f565b6103326104513660046120ed565b610f99565b34801561046257600080fd5b50610476610471366004611fc2565b610fb9565b60405161029891906121ca565b34801561048f57600080fd5b506103326110c2565b3480156104a457600080fd5b506102b7600f5481565b3480156104ba57600080fd5b506103326104c9366004611f68565b6110df565b3480156104da57600080fd5b506103076104e9366004611f68565b61114f565b3480156104fa57600080fd5b506102b7610509366004611fc2565b61115a565b34801561051a57600080fd5b506103326111a0565b34801561052f57600080fd5b50600c54610307906001600160a01b031681565b34801561054f57600080fd5b5061033261055e366004611fc2565b6111b4565b34801561056f57600080fd5b5061033261057e366004611f68565b61122d565b34801561058f57600080fd5b50600d5461028c90600160a01b900460ff1681565b3480156105b057600080fd5b506000546001600160a01b0316610307565b61033261129d565b3480156105d657600080fd5b506102da61137e565b3480156105eb57600080fd5b506103076105fa366004612202565b61138d565b34801561060b57600080fd5b5061033261061a366004612259565b61140c565b61033261062d36600461228c565b611478565b34801561063e57600080fd5b5061065261064d3660046122ea565b61166e565b60408051938452602084019290925260ff1690820152606001610298565b34801561067c57600080fd5b506103326116e2565b61033261069336600461231f565b6116f9565b3480156106a457600080fd5b506102da6106b3366004611f68565b61173a565b3480156106c457600080fd5b50600d54610307906001600160a01b031681565b3480156106e457600080fd5b5061028c6106f33660046122ea565b805160208183018101805160118252928201919093012091525460ff1681565b34801561071f57600080fd5b506102b761072e366004612387565b611887565b34801561073f57600080fd5b5061028c61074e3660046123cc565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b34801561078857600080fd5b50610332610797366004611fc2565b6118ba565b3480156107a857600080fd5b506102b76107b7366004611f68565b6118f5565b3480156107c857600080fd5b50600b54610307906001600160a01b031681565b60006301ffc9a760e01b6001600160e01b03198316148061080d57506380ac58cd60e01b6001600160e01b03198316145b806108285750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606003805461083d906123f6565b80601f0160208091040260200160405190810160405280929190818152602001828054610869906123f6565b80156108b65780601f1061088b576101008083540402835291602001916108b6565b820191906000526020600020905b81548152906001019060200180831161089957829003601f168201915b5050505050905090565b60006108cb82611948565b6108df576108df6333d1c03960e21b611996565b506000908152600760205260409020546001600160a01b031690565b610907828260016119a0565b5050565b610913611a43565b6001600160a01b0381166109675760405162461bcd60e51b8152602060048201526016602482015275496e76616c69642077616c6c6574206164647265737360501b60448201526064015b60405180910390fd5b600a80546001600160a01b0319166001600160a01b0392909216919091179055565b610991611a43565b6001600160a01b0381166109f35760405162461bcd60e51b8152602060048201526024808201527f496e76616c6964206d696e742074726561737572792077616c6c6574206164646044820152637265737360e01b606482015260840161095e565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b610a1d611a43565b6001600160a01b038116610a865760405162461bcd60e51b815260206004820152602a60248201527f496e76616c69642067656e65726174696f6e2074726561737572792077616c6c6044820152696574206164647265737360b01b606482015260840161095e565b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b600080610ab58484611887565b90506000610ac2826118f5565b600a549091506001600160a01b0316610adb828861138d565b6001600160a01b0316149695505050505050565b6000610afa82611a70565b6001600160a01b039485169490915081168414610b2057610b2062a1148160e81b611996565b60008281526007602052604090208054338082146001600160a01b03881690911417610b6457610b50863361074e565b610b6457610b64632ce44b5f60e11b611996565b8015610b6f57600082555b6001600160a01b038681166000908152600660205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260056020526040812091909155600160e11b84169003610c0157600184016000818152600560205260408120549003610bff576001548114610bff5760008181526005602052604090208490555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003610c4b57610c4b633a954ecd60e21b611996565b50505050505050565b610c5c611a43565b60008111610cac5760405162461bcd60e51b815260206004820152601d60248201527f466565206d7573742062652067726561746572207468616e207a65726f000000604482015260640161095e565b600e55565b610cb9611a43565b6040514790600090339083908381818185875af1925050503d8060008114610cfd576040519150601f19603f3d011682016040523d82523d6000602084013e610d02565b606091505b5050905080610d465760405162461bcd60e51b815260206004820152601060248201526f2bb4ba34323930bb903330b4b632b21760811b604482015260640161095e565b60405182815233907f8353ffcac0876ad14e226d9783c04540bfebf13871e868157d2a391cad98e9189060200160405180910390a25050565b33600182600d60149054906101000a900460ff1615610dcf5760405162461bcd60e51b815260206004820152600c60248201526b53616c65205061757365642160a01b604482015260640161095e565b8115610e6157600b546040516370a0823160e01b81526001600160a01b038581166004830152839216906370a0823190602401602060405180830381865afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e439190612430565b1015610e615760405162461bcd60e51b815260040161095e90612449565b610e6c868686610aa8565b610eac5760405162461bcd60e51b81526020600482015260116024820152701cda59db985d1d5c99481a5b9d985b1a59607a1b604482015260640161095e565b601185604051610ebc919061248b565b9081526040519081900360200190205460ff1615610f0c5760405162461bcd60e51b815260206004820152600d60248201526c696e76616c6964206e6f6e636560981b604482015260640161095e565b6001601186604051610f1e919061248b565b908152604051908190036020019020805491151560ff19909216919091179055600c54600b54610f5d916001600160a01b039182169133911687611b11565b6000610f6860015490565b9050610f75896001611b6b565b6000818152601260205260409020610f8d89826124f7565b50505050505050505050565b610fb4838383604051806020016040528060008152506116f9565b505050565b60606000806000610fc98561115a565b905060008167ffffffffffffffff811115610fe657610fe6611fdd565b60405190808252806020026020018201604052801561100f578160200160208202803683370190505b50905061103c60408051608081018252600080825260208201819052918101829052606081019190915290565b60015b8386146110b65761104f81611b85565b915081604001516110ae5781516001600160a01b03161561106f57815194505b876001600160a01b0316856001600160a01b0316036110ae57808387806001019850815181106110a1576110a16125b7565b6020026020010181815250505b60010161103f565b50909695505050505050565b6110ca611a43565b600d805460ff60a01b1916600160a01b179055565b6110e7611a43565b6000811161114a5760405162461bcd60e51b815260206004820152602a60248201527f566964656f206d696e74207072696365206d7573742062652067726561746572604482015269207468616e207a65726f60b01b606482015260840161095e565b601055565b600061082882611a70565b60006001600160a01b03821661117a5761117a6323d3ad8160e21b611996565b506001600160a01b031660009081526006602052604090205467ffffffffffffffff1690565b6111a8611a43565b6111b26000611c04565b565b6111bc611a43565b6001600160a01b03811661120b5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964205f746f6b656e206164647265737360501b604482015260640161095e565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b611235611a43565b600081116112985760405162461bcd60e51b815260206004820152602a60248201527f496d616765206d696e74207072696365206d7573742062652067726561746572604482015269207468616e207a65726f60b01b606482015260840161095e565b600f55565b600e543410156112e25760405162461bcd60e51b815260206004820152601060248201526f496e73756666696369656e742066656560801b604482015260640161095e565b600d546040516000916001600160a01b03169034908381818185875af1925050503d806000811461132f576040519150601f19603f3d011682016040523d82523d6000602084013e611334565b606091505b505090508061137b5760405162461bcd60e51b8152602060048201526013602482015272119959481d1c985b9cd9995c8819985a5b1959606a1b604482015260640161095e565b50565b60606004805461083d906123f6565b60008060008061139c8561166e565b6040805160008152602081018083528b905260ff8316918101919091526060810184905260808101839052929550909350915060019060a0016020604051602081039080840390855afa1580156113f7573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b33600080600d60149054906101000a900460ff16156114c85760405162461bcd60e51b815260206004820152600c60248201526b53616c65205061757365642160a01b604482015260640161095e565b811561155a57600b546040516370a0823160e01b81526001600160a01b038581166004830152839216906370a0823190602401602060405180830381865afa158015611518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061153c9190612430565b101561155a5760405162461bcd60e51b815260040161095e90612449565b6000841561156b5750600f54611570565b506010545b803410156115cb5760405162461bcd60e51b815260206004820152602260248201527f496e73756666696369656e7420466565732073656e7420666f72206d696e74696044820152616e6760f01b606482015260840161095e565b600c546040516000916001600160a01b03169034908381818185875af1925050503d8060008114611618576040519150601f19603f3d011682016040523d82523d6000602084013e61161d565b606091505b5050905080610f5d5760405162461bcd60e51b815260206004820152601f60248201527f455448207472616e7366657220746f207472656173757279206661696c656400604482015260640161095e565b600080600083516041146116c45760405162461bcd60e51b815260206004820152601860248201527f696e76616c6964207369676e6174757265206c656e6774680000000000000000604482015260640161095e565b50505060208101516040820151606090920151909260009190911a90565b6116ea611a43565b600d805460ff60a01b19169055565b611704848484610aef565b6001600160a01b0383163b156117345761172084848484611c54565b611734576117346368d2bf6b60e11b611996565b50505050565b606061174582611948565b6117a95760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161095e565b600082815260126020526040812080546117c2906123f6565b80601f01602080910402602001604051908101604052809291908181526020018280546117ee906123f6565b801561183b5780601f106118105761010080835404028352916020019161183b565b820191906000526020600020905b81548152906001019060200180831161181e57829003601f168201915b5050505050905060008151116108285760405162461bcd60e51b8152602060048201526011602482015270151bdad95b88155492481b9bdd081cd95d607a1b604482015260640161095e565b6000828260405160200161189c9291906125cd565b60405160208183030381529060405280519060200120905092915050565b6118c2611a43565b6001600160a01b0381166118ec57604051631e4fbdf760e01b81526000600482015260240161095e565b61137b81611c04565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b600081600111611991576001548210156119915760005b506000828152600560205260408120549081900361198757611980836125ef565b925061195f565b600160e01b161590505b919050565b8060005260046000fd5b60006119ab8361114f565b90508180156119c35750336001600160a01b03821614155b156119e6576119d2813361074e565b6119e6576119e66367d9dca160e11b611996565b60008381526007602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b6000546001600160a01b031633146111b25760405163118cdaa760e01b815233600482015260240161095e565b600081600111611b01575060008181526005602052604090205480600003611aee576001548210611aab57611aab636f96cda160e11b611996565b5b50600019016000818152600560205260409020548015611aac57600160e01b8116600003611ad957919050565b611ae9636f96cda160e11b611996565b611aac565b600160e01b8116600003611b0157919050565b611991636f96cda160e11b611996565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611734908590611d37565b610907828260405180602001604052806000815250611da8565b60408051608081018252600080825260208201819052918101829052606081019190915260008281526005602052604090205461082890604080516080810182526001600160a01b038316815260a083901c67ffffffffffffffff166020820152600160e01b831615159181019190915260e89190911c606082015290565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611c89903390899088908890600401612614565b6020604051808303816000875af1925050508015611cc4575060408051601f3d908101601f19168201909252611cc191810190612651565b60015b611d19573d808015611cf2576040519150601f19603f3d011682016040523d82523d6000602084013e611cf7565b606091505b508051600003611d1157611d116368d2bf6b60e11b611996565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b600080602060008451602086016000885af180611d5a576040513d6000823e3d81fd5b50506000513d91508115611d72578060011415611d7f565b6001600160a01b0384163b155b1561173457604051635274afe760e01b81526001600160a01b038516600482015260240161095e565b611db28383611e0c565b6001600160a01b0383163b15610fb4576001548281035b611ddc6000868380600101945086611c54565b611df057611df06368d2bf6b60e11b611996565b818110611dc9578160015414611e0557600080fd5b5050505050565b6001546000829003611e2857611e2863b562e8dd60e01b611996565b60008181526005602090815260408083206001600160a01b0387164260a01b6001881460e11b17811790915580845260069092528220805468010000000000000001860201905590819003611e8657611e86622e076360e81b611996565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4818160010191508103611e8b575060015550505050565b6001600160e01b03198116811461137b57600080fd5b600060208284031215611ef357600080fd5b8135611efe81611ecb565b9392505050565b60005b83811015611f20578181015183820152602001611f08565b50506000910152565b60008151808452611f41816020860160208601611f05565b601f01601f19169290920160200192915050565b602081526000611efe6020830184611f29565b600060208284031215611f7a57600080fd5b5035919050565b80356001600160a01b038116811461199157600080fd5b60008060408385031215611fab57600080fd5b611fb483611f81565b946020939093013593505050565b600060208284031215611fd457600080fd5b611efe82611f81565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261200457600080fd5b813567ffffffffffffffff8082111561201f5761201f611fdd565b604051601f8301601f19908116603f0116810190828211818310171561204757612047611fdd565b8160405283815286602085880101111561206057600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561209557600080fd5b833567ffffffffffffffff808211156120ad57600080fd5b6120b987838801611ff3565b945060208601359150808211156120cf57600080fd5b506120dc86828701611ff3565b925050604084013590509250925092565b60008060006060848603121561210257600080fd5b61210b84611f81565b925061211960208501611f81565b9150604084013590509250925092565b600080600080600060a0868803121561214157600080fd5b61214a86611f81565b9450602086013567ffffffffffffffff8082111561216757600080fd5b61217389838a01611ff3565b9550604088013591508082111561218957600080fd5b61219589838a01611ff3565b945060608801359150808211156121ab57600080fd5b506121b888828901611ff3565b95989497509295608001359392505050565b6020808252825182820181905260009190848201906040850190845b818110156110b6578351835292840192918401916001016121e6565b6000806040838503121561221557600080fd5b82359150602083013567ffffffffffffffff81111561223357600080fd5b61223f85828601611ff3565b9150509250929050565b8035801515811461199157600080fd5b6000806040838503121561226c57600080fd5b61227583611f81565b915061228360208401612249565b90509250929050565b6000806000606084860312156122a157600080fd5b6122aa84611f81565b9250602084013567ffffffffffffffff8111156122c657600080fd5b6122d286828701611ff3565b9250506122e160408501612249565b90509250925092565b6000602082840312156122fc57600080fd5b813567ffffffffffffffff81111561231357600080fd5b611d2f84828501611ff3565b6000806000806080858703121561233557600080fd5b61233e85611f81565b935061234c60208601611f81565b925060408501359150606085013567ffffffffffffffff81111561236f57600080fd5b61237b87828801611ff3565b91505092959194509250565b6000806040838503121561239a57600080fd5b823567ffffffffffffffff8111156123b157600080fd5b6123bd85828601611ff3565b95602094909401359450505050565b600080604083850312156123df57600080fd5b6123e883611f81565b915061228360208401611f81565b600181811c9082168061240a57607f821691505b60208210810361242a57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561244257600080fd5b5051919050565b60208082526022908201527f4e6f7420656e6f75676820746f6b656e2073656e742c20636865636b20707269604082015261636560f01b606082015260800190565b6000825161249d818460208701611f05565b9190910192915050565b601f821115610fb4576000816000526020600020601f850160051c810160208610156124d05750805b601f850160051c820191505b818110156124ef578281556001016124dc565b505050505050565b815167ffffffffffffffff81111561251157612511611fdd565b6125258161251f84546123f6565b846124a7565b602080601f83116001811461255a57600084156125425750858301515b600019600386901b1c1916600185901b1785556124ef565b600085815260208120601f198616915b828110156125895788860151825594840194600190910190840161256a565b50858210156125a75787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b600083516125df818460208801611f05565b9190910191825250602001919050565b60008161260c57634e487b7160e01b600052601160045260246000fd5b506000190190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061264790830184611f29565b9695505050505050565b60006020828403121561266357600080fd5b8151611efe81611ecb56fea2646970667358221220eaf3d85393df389dcc971ea04031394198a1f836ad6c1673584eab3405c55cc264736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000dead000000000000000000000000ca0ce7afb4f77d034ca475837d2a3783cc784ca800000000000000000000000060acb812fbc9c933483b632a1d11de5adca24b6b0000000000000000000000004ebc651a80729e22fdc756b7eecf98666799a64900000000000000000000000050a63a191280053bd215cb31dab42ecdd29a701e000000000000000000000000000000000000000000000001a055690d9db8000000000000000000000000000000000000000000000000000270801d946c9400000000000000000000000000000000000000000000000000000000f407b39cf2ff
-----Decoded View---------------
Arg [0] : _token (address): 0x000000000000000000000000000000000000dEaD
Arg [1] : _signer (address): 0xcA0cE7afb4f77D034CA475837D2A3783cC784Ca8
Arg [2] : _owner (address): 0x60aCB812fbC9C933483B632A1d11De5ADca24B6B
Arg [3] : _mintTreasury (address): 0x4ebC651A80729E22FDc756B7EEcF98666799a649
Arg [4] : _generationTreasury (address): 0x50A63A191280053bd215cB31dAb42ECDD29A701E
Arg [5] : _NFTImageMintPrice (uint256): 30000000000000000000
Arg [6] : _NFTVideoMintPrice (uint256): 45000000000000000000
Arg [7] : _generationFee (uint256): 268313915355903
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000dead
Arg [1] : 000000000000000000000000ca0ce7afb4f77d034ca475837d2a3783cc784ca8
Arg [2] : 00000000000000000000000060acb812fbc9c933483b632a1d11de5adca24b6b
Arg [3] : 0000000000000000000000004ebc651a80729e22fdc756b7eecf98666799a649
Arg [4] : 00000000000000000000000050a63a191280053bd215cb31dab42ecdd29a701e
Arg [5] : 000000000000000000000000000000000000000000000001a055690d9db80000
Arg [6] : 00000000000000000000000000000000000000000000000270801d946c940000
Arg [7] : 0000000000000000000000000000000000000000000000000000f407b39cf2ff
Deployed Bytecode Sourcemap
407:8452:15:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10689:630:16;;;;;;;;;;-1:-1:-1;10689:630:16;;;;;:::i;:::-;;:::i;:::-;;;565:14:18;;558:22;540:41;;528:2;513:18;10689:630:16;;;;;;;;693:28:15;;;;;;;;;;;;;;;;;;;738:25:18;;;726:2;711:18;693:28:15;592:177:18;11573:98:16;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;18636:223::-;;;;;;;;;;-1:-1:-1;18636:223:16;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;1879:32:18;;;1861:51;;1849:2;1834:18;18636:223:16;1715:203:18;18364:122:16;;;;;;:::i;:::-;;:::i;:::-;;4525:166:15;;;;;;;;;;-1:-1:-1;4525:166:15;;;;;:::i;:::-;;:::i;3921:276::-;;;;;;;;;;-1:-1:-1;3921:276:15;;;;;:::i;:::-;;:::i;6890:564:16:-;;;;;;;;;;;;7328:12;;6219:1:15;7312:13:16;:28;-1:-1:-1;;7312:46:16;;6890:564;4205:312:15;;;;;;;;;;-1:-1:-1;4205:312:15;;;;;:::i;:::-;;:::i;7223:388::-;;;;;;;;;;-1:-1:-1;7223:388:15;;;;;:::i;:::-;;:::i;22796:3447:16:-;;;;;;:::i;:::-;;:::i;5549:159:15:-;;;;;;;;;;-1:-1:-1;5549:159:15;;;;;:::i;:::-;;:::i;767:32::-;;;;;;;;;;;;;;;;5280:261;;;:::i;2038:747::-;;;;;;;;;;-1:-1:-1;2038:747:15;;;;;:::i;:::-;;:::i;26334:187:16:-;;;;;;:::i;:::-;;:::i;6236:979:15:-;;;;;;;;;;-1:-1:-1;6236:979:15;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;3734:84::-;;;;;;;;;;;;;:::i;728:32::-;;;;;;;;;;;;;;;;5071:201;;;;;;;;;;-1:-1:-1;5071:201:15;;;;;:::i;:::-;;:::i;12934:150:16:-;;;;;;;;;;-1:-1:-1;12934:150:16;;;;;:::i;:::-;;:::i;8570:239::-;;;;;;;;;;-1:-1:-1;8570:239:16;;;;;:::i;:::-;;:::i;2293:101:0:-;;;;;;;;;;;;;:::i;586:27:15:-;;;;;;;;;;-1:-1:-1;586:27:15;;;;-1:-1:-1;;;;;586:27:15;;;4699:155;;;;;;;;;;-1:-1:-1;4699:155:15;;;;;:::i;:::-;;:::i;4862:201::-;;;;;;;;;;-1:-1:-1;4862:201:15;;;;;:::i;:::-;;:::i;660:26::-;;;;;;;;;;-1:-1:-1;660:26:15;;;;-1:-1:-1;;;660:26:15;;;;;;1638:85:0;;;;;;;;;;-1:-1:-1;1684:7:0;1710:6;-1:-1:-1;;;;;1710:6:0;1638:85;;3480:246:15;;;:::i;11742:102:16:-;;;;;;;;;;;;;:::i;8170:274:15:-;;;;;;;;;;-1:-1:-1;8170:274:15;;;;;:::i;:::-;;:::i;19186:231:16:-;;;;;;;;;;-1:-1:-1;19186:231:16;;;;;:::i;:::-;;:::i;2793:679:15:-;;;;;;:::i;:::-;;:::i;8452:404::-;;;;;;;;;;-1:-1:-1;8452:404:15;;;;;:::i;:::-;;:::i;:::-;;;;7685:25:18;;;7741:2;7726:18;;7719:34;;;;7801:4;7789:17;7769:18;;;7762:45;7673:2;7658:18;8452:404:15;7487:326:18;3826:87:15;;;;;;;;;;;;;:::i;27102:405:16:-;;;;;;:::i;:::-;;:::i;5716:403:15:-;;;;;;;;;;-1:-1:-1;5716:403:15;;;;;:::i;:::-;;:::i;620:33::-;;;;;;;;;;-1:-1:-1;620:33:15;;;;-1:-1:-1;;;;;620:33:15;;;808:46;;;;;;;;;;-1:-1:-1;808:46:15;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7619:209;;;;;;;;;;-1:-1:-1;7619:209:15;;;;;:::i;:::-;;:::i;19567:162:16:-;;;;;;;;;;-1:-1:-1;19567:162:16;;;;;:::i;:::-;-1:-1:-1;;;;;19687:25:16;;;19664:4;19687:25;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;;;19567:162;2543:215:0;;;;;;;;;;-1:-1:-1;2543:215:0;;;;;:::i;:::-;;:::i;7836:326:15:-;;;;;;;;;;-1:-1:-1;7836:326:15;;;;;:::i;:::-;;:::i;559:20::-;;;;;;;;;;-1:-1:-1;559:20:15;;;;-1:-1:-1;;;;;559:20:15;;;10689:630:16;10774:4;-1:-1:-1;;;;;;;;;11092:25:16;;;;:101;;-1:-1:-1;;;;;;;;;;11168:25:16;;;11092:101;:177;;;-1:-1:-1;;;;;;;;;;11244:25:16;;;11092:177;11073:196;10689:630;-1:-1:-1;;10689:630:16:o;11573:98::-;11627:13;11659:5;11652:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11573:98;:::o;18636:223::-;18712:7;18736:16;18744:7;18736;:16::i;:::-;18731:73;;18754:50;-1:-1:-1;;;18754:7:16;:50::i;:::-;-1:-1:-1;18822:24:16;;;;:15;:24;;;;;:30;-1:-1:-1;;;;;18822:30:16;;18636:223::o;18364:122::-;18452:27;18461:2;18465:7;18474:4;18452:8;:27::i;:::-;18364:122;;:::o;4525:166:15:-;1531:13:0;:11;:13::i;:::-;-1:-1:-1;;;;;4608:21:15;::::1;4600:56;;;::::0;-1:-1:-1;;;4600:56:15;;10299:2:18;4600:56:15::1;::::0;::::1;10281:21:18::0;10338:2;10318:18;;;10311:30;-1:-1:-1;;;10357:18:18;;;10350:52;10419:18;;4600:56:15::1;;;;;;;;;4667:6;:16:::0;;-1:-1:-1;;;;;;4667:16:15::1;-1:-1:-1::0;;;;;4667:16:15;;;::::1;::::0;;;::::1;::::0;;4525:166::o;3921:276::-;1531:13:0;:11;:13::i;:::-;-1:-1:-1;;;;;4053:30:15;::::1;4031:116;;;::::0;-1:-1:-1;;;4031:116:15;;10650:2:18;4031:116:15::1;::::0;::::1;10632:21:18::0;10689:2;10669:18;;;10662:30;10728:34;10708:18;;;10701:62;-1:-1:-1;;;10779:18:18;;;10772:34;10823:19;;4031:116:15::1;10448:400:18::0;4031:116:15::1;4158:12;:31:::0;;-1:-1:-1;;;;;;4158:31:15::1;-1:-1:-1::0;;;;;4158:31:15;;;::::1;::::0;;;::::1;::::0;;3921:276::o;4205:312::-;1531:13:0;:11;:13::i;:::-;-1:-1:-1;;;;;4349:36:15;::::1;4327:128;;;::::0;-1:-1:-1;;;4327:128:15;;11055:2:18;4327:128:15::1;::::0;::::1;11037:21:18::0;11094:2;11074:18;;;11067:30;11133:34;11113:18;;;11106:62;-1:-1:-1;;;11184:18:18;;;11177:40;11234:19;;4327:128:15::1;10853:406:18::0;4327:128:15::1;4466:18;:43:::0;;-1:-1:-1;;;;;;4466:43:15::1;-1:-1:-1::0;;;;;4466:43:15;;;::::1;::::0;;;::::1;::::0;;4205:312::o;7223:388::-;7373:4;7390:19;7412:38;7427:8;7437:12;7412:14;:38::i;:::-;7390:60;;7461:28;7492:36;7516:11;7492:23;:36::i;:::-;7597:6;;7461:67;;-1:-1:-1;;;;;;7597:6:15;7546:47;7461:67;7582:10;7546:13;:47::i;:::-;-1:-1:-1;;;;;7546:57:15;;;7223:388;-1:-1:-1;;;;;;7223:388:15:o;22796:3447:16:-;22933:27;22963;22982:7;22963:18;:27::i;:::-;-1:-1:-1;;;;;23115:22:16;;;;22933:57;;-1:-1:-1;23173:45:16;;;;23169:95;;23220:44;-1:-1:-1;;;23220:7:16;:44::i;:::-;23276:27;21929:24;;;:15;:24;;;;;22153:26;;47819:10;21566:30;;;-1:-1:-1;;;;;21263:28:16;;21544:20;;;21541:56;23459:188;;23551:43;23568:4;47819:10;19567:162;:::i;23551:43::-;23546:101;;23596:51;-1:-1:-1;;;23596:7:16;:51::i;:::-;23790:15;23787:157;;;23928:1;23907:19;23900:30;23787:157;-1:-1:-1;;;;;24316:24:16;;;;;;;:18;:24;;;;;;24314:26;;-1:-1:-1;;24314:26:16;;;24384:22;;;;;;;;;24382:24;;-1:-1:-1;24382:24:16;;;17492:11;17467:23;17463:41;17450:63;-1:-1:-1;;;17450:63:16;24670:26;;;;:17;:26;;;;;:172;;;;-1:-1:-1;;;24959:47:16;;:52;;24955:617;;25063:1;25053:11;;25031:19;25184:30;;;:17;:30;;;;;;:35;;25180:378;;25320:13;;25305:11;:28;25301:239;;25465:30;;;;:17;:30;;;;;:52;;;25301:239;25013:559;24955:617;-1:-1:-1;;;;;25700:20:16;;26071:7;25700:20;26003:4;25946:25;25681:16;;25814:292;26129:8;26141:1;26129:13;26125:58;;26144:39;-1:-1:-1;;;26144:7:16;:39::i;:::-;22923:3320;;;;22796:3447;;;:::o;5549:159:15:-;1531:13:0;:11;:13::i;:::-;5634:1:15::1;5627:4;:8;5619:50;;;::::0;-1:-1:-1;;;5619:50:15;;11466:2:18;5619:50:15::1;::::0;::::1;11448:21:18::0;11505:2;11485:18;;;11478:30;11544:31;11524:18;;;11517:59;11593:18;;5619:50:15::1;11264:353:18::0;5619:50:15::1;5680:13;:20:::0;5549:159::o;5280:261::-;1531:13:0;:11;:13::i;:::-;5406:34:15::1;::::0;5355:21:::1;::::0;5338:14:::1;::::0;5406:10:::1;::::0;5355:21;;5338:14;5406:34;5338:14;5406:34;5355:21;5406:10;:34:::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5387:53;;;5459:7;5451:36;;;::::0;-1:-1:-1;;;5451:36:15;;12034:2:18;5451:36:15::1;::::0;::::1;12016:21:18::0;12073:2;12053:18;;;12046:30;-1:-1:-1;;;12092:18:18;;;12085:46;12148:18;;5451:36:15::1;11832:340:18::0;5451:36:15::1;5505:28;::::0;738:25:18;;;5522:10:15::1;::::0;5505:28:::1;::::0;726:2:18;711:18;5505:28:15::1;;;;;;;5327:214;;5280:261::o:0;2038:747::-;2254:10;2266:4;2272:12;1783:14;;;;;;;;;;;1782:15;1774:40;;;;-1:-1:-1;;;1774:40:15;;12379:2:18;1774:40:15;;;12361:21:18;12418:2;12398:18;;;12391:30;-1:-1:-1;;;12437:18:18;;;12430:42;12489:18;;1774:40:15;12177:336:18;1774:40:15;1829:11;1825:186;;;1890:5;;1883:30;;-1:-1:-1;;;1883:30:15;;-1:-1:-1;;;;;1879:32:18;;;1883:30:15;;;1861:51:18;1917:12:15;;1890:5;;1883:23;;1834:18:18;;1883:30:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:46;;1857:142;;;;-1:-1:-1;;;1857:142:15;;;;;;;:::i;:::-;2319:50:::1;2334:10;2346:8;2356:12;2319:14;:50::i;:::-;2297:117;;;::::0;-1:-1:-1;;;2297:117:15;;13312:2:18;2297:117:15::1;::::0;::::1;13294:21:18::0;13351:2;13331:18;;;13324:30;-1:-1:-1;;;13370:18:18;;;13363:47;13427:18;;2297:117:15::1;13110:341:18::0;2297:117:15::1;2433:15;2449:8;2433:25;;;;;;:::i;:::-;::::0;;;::::1;::::0;;;;;::::1;::::0;;;;::::1;;:34;2425:60;;;::::0;-1:-1:-1;;;2425:60:15;;13952:2:18;2425:60:15::1;::::0;::::1;13934:21:18::0;13991:2;13971:18;;;13964:30;-1:-1:-1;;;14010:18:18;;;14003:43;14063:18;;2425:60:15::1;13750:337:18::0;2425:60:15::1;2524:4;2496:15;2512:8;2496:25;;;;;;:::i;:::-;::::0;;;::::1;::::0;;;;;::::1;::::0;;;:32;;;::::1;;-1:-1:-1::0;;2496:32:15;;::::1;::::0;;;::::1;::::0;;2609:12:::1;::::0;2546:5:::1;::::0;2539:120:::1;::::0;-1:-1:-1;;;;;2546:5:15;;::::1;::::0;2584:10:::1;::::0;2609:12:::1;2636::::0;2539:30:::1;:120::i;:::-;2670:20;2693:14;6667:13:16::0;;;6586:101;2693:14:15::1;2670:37;;2718:17;2728:3;2733:1;2718:9;:17::i;:::-;2746:24;::::0;;;:10:::1;:24;::::0;;;;:31:::1;2773:4:::0;2746:24;:31:::1;:::i;:::-;;2286:499;2038:747:::0;;;;;;;;:::o;26334:187:16:-;26475:39;26492:4;26498:2;26502:7;26475:39;;;;;;;;;;;;:16;:39::i;:::-;26334:187;;;:::o;6236:979:15:-;6322:16;6381:19;6415:25;6455:22;6480:16;6490:5;6480:9;:16::i;:::-;6455:41;;6511:25;6553:14;6539:29;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6539:29:15;;6511:57;;6583:31;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6583:31:15;6219:1;6629:538;6713:14;6698:11;:29;6629:538;;6796:15;6809:1;6796:12;:15::i;:::-;6784:27;;6834:9;:16;;;6875:8;6830:73;6925:14;;-1:-1:-1;;;;;6925:28:15;;6921:111;;6998:14;;;-1:-1:-1;6921:111:15;7075:5;-1:-1:-1;;;;;7054:26:15;:17;-1:-1:-1;;;;;7054:26:15;;7050:102;;7131:1;7105:8;7114:13;;;;;;7105:23;;;;;;;;:::i;:::-;;;;;;:27;;;;;7050:102;6746:3;;6629:538;;;-1:-1:-1;7188:8:15;;6236:979;-1:-1:-1;;;;;;6236:979:15:o;3734:84::-;1531:13:0;:11;:13::i;:::-;3789:14:15::1;:21:::0;;-1:-1:-1;;;;3789:21:15::1;-1:-1:-1::0;;;3789:21:15::1;::::0;;3734:84::o;5071:201::-;1531:13:0;:11;:13::i;:::-;5174:1:15::1;5160:11;:15;5152:70;;;::::0;-1:-1:-1;;;5152:70:15;;16621:2:18;5152:70:15::1;::::0;::::1;16603:21:18::0;16660:2;16640:18;;;16633:30;16699:34;16679:18;;;16672:62;-1:-1:-1;;;16750:18:18;;;16743:40;16800:19;;5152:70:15::1;16419:406:18::0;5152:70:15::1;5233:17;:31:::0;5071:201::o;12934:150:16:-;13006:7;13048:27;13067:7;13048:18;:27::i;8570:239::-;8642:7;-1:-1:-1;;;;;8665:19:16;;8661:69;;8686:44;-1:-1:-1;;;8686:7:16;:44::i;:::-;-1:-1:-1;;;;;;8747:25:16;;;;;:18;:25;;;;;;1518:13;8747:55;;8570:239::o;2293:101:0:-;1531:13;:11;:13::i;:::-;2357:30:::1;2384:1;2357:18;:30::i;:::-;2293:101::o:0;4699:155:15:-;1531:13:0;:11;:13::i;:::-;-1:-1:-1;;;;;4774:20:15;::::1;4766:55;;;::::0;-1:-1:-1;;;4766:55:15;;17032:2:18;4766:55:15::1;::::0;::::1;17014:21:18::0;17071:2;17051:18;;;17044:30;-1:-1:-1;;;17090:18:18;;;17083:52;17152:18;;4766:55:15::1;16830:346:18::0;4766:55:15::1;4832:5;:14:::0;;-1:-1:-1;;;;;;4832:14:15::1;-1:-1:-1::0;;;;;4832:14:15;;;::::1;::::0;;;::::1;::::0;;4699:155::o;4862:201::-;1531:13:0;:11;:13::i;:::-;4965:1:15::1;4951:11;:15;4943:70;;;::::0;-1:-1:-1;;;4943:70:15;;17383:2:18;4943:70:15::1;::::0;::::1;17365:21:18::0;17422:2;17402:18;;;17395:30;17461:34;17441:18;;;17434:62;-1:-1:-1;;;17512:18:18;;;17505:40;17562:19;;4943:70:15::1;17181:406:18::0;4943:70:15::1;5024:17;:31:::0;4862:201::o;3480:246::-;3557:13;;3544:9;:26;;3536:55;;;;-1:-1:-1;;;3536:55:15;;17794:2:18;3536:55:15;;;17776:21:18;17833:2;17813:18;;;17806:30;-1:-1:-1;;;17852:18:18;;;17845:46;17908:18;;3536:55:15;17592:340:18;3536:55:15;3623:18;;:45;;3605:12;;-1:-1:-1;;;;;3623:18:15;;3654:9;;3605:12;3623:45;3605:12;3623:45;3654:9;3623:18;:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3604:64;;;3687:7;3679:39;;;;-1:-1:-1;;;3679:39:15;;18139:2:18;3679:39:15;;;18121:21:18;18178:2;18158:18;;;18151:30;-1:-1:-1;;;18197:18:18;;;18190:49;18256:18;;3679:39:15;17937:343:18;3679:39:15;3525:201;3480:246::o;11742:102:16:-;11798:13;11830:7;11823:14;;;;;:::i;8170:274:15:-;8295:7;8316:9;8327;8338:7;8349:26;8364:10;8349:14;:26::i;:::-;8395:41;;;;;;;;;;;;18512:25:18;;;18585:4;18573:17;;18553:18;;;18546:45;;;;18607:18;;;18600:34;;;18650:18;;;18643:34;;;8315:60:15;;-1:-1:-1;8315:60:15;;-1:-1:-1;8315:60:15;-1:-1:-1;8395:41:15;;18484:19:18;;8395:41:15;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;8395:41:15;;-1:-1:-1;;8395:41:15;;;8170:274;-1:-1:-1;;;;;;;8170:274:15:o;19186:231:16:-;47819:10;19280:39;;;;:18;:39;;;;;;;;-1:-1:-1;;;;;19280:49:16;;;;;;;;;;;;:60;;-1:-1:-1;;19280:60:16;;;;;;;;;;19355:55;;540:41:18;;;19280:49:16;;47819:10;19355:55;;513:18:18;19355:55:16;;;;;;;19186:231;;:::o;2793:679:15:-;2940:10;2952:5;2959:1;1783:14;;;;;;;;;;;1782:15;1774:40;;;;-1:-1:-1;;;1774:40:15;;12379:2:18;1774:40:15;;;12361:21:18;12418:2;12398:18;;;12391:30;-1:-1:-1;;;12437:18:18;;;12430:42;12489:18;;1774:40:15;12177:336:18;1774:40:15;1829:11;1825:186;;;1890:5;;1883:30;;-1:-1:-1;;;1883:30:15;;-1:-1:-1;;;;;1879:32:18;;;1883:30:15;;;1861:51:18;1917:12:15;;1890:5;;1883:23;;1834:18:18;;1883:30:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:46;;1857:142;;;;-1:-1:-1;;;1857:142:15;;;;;;;:::i;:::-;2973:17:::1;3005:7;3001:131;;;-1:-1:-1::0;3041:17:15::1;::::0;3001:131:::1;;;-1:-1:-1::0;3103:17:15::1;::::0;3001:131:::1;3165:9;3152;:22;;3144:69;;;::::0;-1:-1:-1;;;3144:69:15;;18890:2:18;3144:69:15::1;::::0;::::1;18872:21:18::0;18929:2;18909:18;;;18902:30;18968:34;18948:18;;;18941:62;-1:-1:-1;;;19019:18:18;;;19012:32;19061:19;;3144:69:15::1;18688:398:18::0;3144:69:15::1;3243:12;::::0;:39:::1;::::0;3225:12:::1;::::0;-1:-1:-1;;;;;3243:12:15::1;::::0;3268:9:::1;::::0;3225:12;3243:39;3225:12;3243:39;3268:9;3243:12;:39:::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3224:58;;;3301:7;3293:51;;;::::0;-1:-1:-1;;;3293:51:15;;19293:2:18;3293:51:15::1;::::0;::::1;19275:21:18::0;19332:2;19312:18;;;19305:30;19371:33;19351:18;;;19344:61;19422:18;;3293:51:15::1;19091:355:18::0;8452:404:15;8556:9;8580;8604:7;8647:3;:10;8661:2;8647:16;8639:53;;;;-1:-1:-1;;;8639:53:15;;19653:2:18;8639:53:15;;;19635:21:18;19692:2;19672:18;;;19665:30;19731:26;19711:18;;;19704:54;19775:18;;8639:53:15;19451:348:18;8639:53:15;-1:-1:-1;;;8749:2:15;8740:12;;8734:19;8787:2;8778:12;;8772:19;8833:2;8824:12;;;8818:19;8734;;8815:1;8810:28;;;;;8452:404::o;3826:87::-;1531:13:0;:11;:13::i;:::-;3883:14:15::1;:22:::0;;-1:-1:-1;;;;3883:22:15::1;::::0;;3826:87::o;27102:405:16:-;27271:31;27284:4;27290:2;27294:7;27271:12;:31::i;:::-;-1:-1:-1;;;;;27316:14:16;;;:19;27312:189;;27354:56;27385:4;27391:2;27395:7;27404:5;27354:30;:56::i;:::-;27349:152;;27430:56;-1:-1:-1;;;27430:7:16;:56::i;:::-;27102:405;;;;:::o;5716:403:15:-;5817:13;5870:16;5878:7;5870;:16::i;:::-;5848:113;;;;-1:-1:-1;;;5848:113:15;;20006:2:18;5848:113:15;;;19988:21:18;20045:2;20025:18;;;20018:30;20084:34;20064:18;;;20057:62;-1:-1:-1;;;20135:18:18;;;20128:45;20190:19;;5848:113:15;19804:411:18;5848:113:15;5974:22;5999:19;;;:10;:19;;;;;5974:44;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6062:1;6043:8;6037:22;:26;6029:56;;;;-1:-1:-1;;;6029:56:15;;20422:2:18;6029:56:15;;;20404:21:18;20461:2;20441:18;;;20434:30;-1:-1:-1;;;20480:18:18;;;20473:47;20537:18;;6029:56:15;20220:341:18;7619:209:15;7737:7;7796:8;7806:12;7779:40;;;;;;;;;:::i;:::-;;;;;;;;;;;;;7769:51;;;;;;7762:58;;7619:209;;;;:::o;2543:215:0:-;1531:13;:11;:13::i;:::-;-1:-1:-1;;;;;2627:22:0;::::1;2623:91;;2672:31;::::0;-1:-1:-1;;;2672:31:0;;2700:1:::1;2672:31;::::0;::::1;1861:51:18::0;1834:18;;2672:31:0::1;1715:203:18::0;2623:91:0::1;2723:28;2742:8;2723:18;:28::i;7836:326:15:-:0;8012:127;;21198:66:18;8012:127:15;;;21186:79:18;21281:12;;;21274:28;;;7939:7:15;;21318:12:18;;8012:127:15;;;;;;;;;;;;7984:170;;;;;;7964:190;;7836:326;;;:::o;19978:465:16:-;20043:11;20089:7;6219:1:15;20070:26:16;20066:371;;20231:13;;20221:7;:23;20217:210;;;20264:14;20296:60;-1:-1:-1;20313:26:16;;;;:17;:26;;;;;;;20303:42;;;20296:60;;20347:9;;;:::i;:::-;;;20296:60;;;-1:-1:-1;;;20383:24:16;:29;;-1:-1:-1;20217:210:16;19978:465;;;:::o;49703:160::-;49802:13;49796:4;49789:27;49842:4;49836;49829:18;41333:460;41457:13;41473:16;41481:7;41473;:16::i;:::-;41457:32;;41504:13;:45;;;;-1:-1:-1;47819:10:16;-1:-1:-1;;;;;41521:28:16;;;;41504:45;41500:198;;;41568:44;41585:5;47819:10;19567:162;:::i;41568:44::-;41563:135;;41632:51;-1:-1:-1;;;41632:7:16;:51::i;:::-;41708:24;;;;:15;:24;;;;;;:35;;-1:-1:-1;;;;;;41708:35:16;-1:-1:-1;;;;;41708:35:16;;;;;;;;;41758:28;;41708:24;;41758:28;;;;;;;41447:346;41333:460;;;:::o;1796:162:0:-;1684:7;1710:6;-1:-1:-1;;;;;1710:6:0;47819:10:16;1855:23:0;1851:101;;1901:40;;-1:-1:-1;;;1901:40:0;;47819:10:16;1901:40:0;;;1861:51:18;1834:18;;1901:40:0;1715:203:18;14380:2173:16;14447:14;14496:7;6219:1:15;14477:26:16;14473:2017;;-1:-1:-1;14528:26:16;;;;:17;:26;;;;;;14847:6;14857:1;14847:11;14843:1270;;14893:13;;14882:7;:24;14878:77;;14908:47;-1:-1:-1;;;14908:7:16;:47::i;:::-;15502:597;-1:-1:-1;;;15596:9:16;15578:28;;;;:17;:28;;;;;;15650:25;;15502:597;15650:25;-1:-1:-1;;;15701:6:16;:24;15729:1;15701:29;15697:48;;14380:2173;;;:::o;15697:48::-;16033:47;-1:-1:-1;;;16033:7:16;:47::i;:::-;15502:597;;14843:1270;-1:-1:-1;;;16435:6:16;:24;16463:1;16435:29;16431:48;;14380:2173;;;:::o;16431:48::-;16499:47;-1:-1:-1;;;16499:7:16;:47::i;1670:188:5:-;1797:53;;;-1:-1:-1;;;;;21837:15:18;;;1797:53:5;;;21819:34:18;21889:15;;21869:18;;;21862:43;21921:18;;;;21914:34;;;1797:53:5;;;;;;;;;;21754:18:18;;;;1797:53:5;;;;;;;;-1:-1:-1;;;;;1797:53:5;-1:-1:-1;;;1797:53:5;;;1770:81;;1790:5;;1770:19;:81::i;36661:110:16:-;36737:27;36747:2;36751:8;36737:27;;;;;;;;;;;;:9;:27::i;13522:159::-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13649:24:16;;;;:17;:24;;;;;;13630:44;;-1:-1:-1;;;;;;;;;;;;;16756:41:16;;;;2162:3;16841:33;;;16807:68;;-1:-1:-1;;;16807:68:16;-1:-1:-1;;;16904:24:16;;:29;;-1:-1:-1;;;16885:48:16;;;;2671:3;16972:28;;;;-1:-1:-1;;;16943:58:16;-1:-1:-1;16647:361:16;2912:187:0;2985:16;3004:6;;-1:-1:-1;;;;;3020:17:0;;;-1:-1:-1;;;;;;3020:17:0;;;;;;3052:40;;3004:6;;;;;;;3052:40;;2985:16;3052:40;2975:124;2912:187;:::o;29533:673:16:-;29711:88;;-1:-1:-1;;;29711:88:16;;29691:4;;-1:-1:-1;;;;;29711:45:16;;;;;:88;;47819:10;;29778:4;;29784:7;;29793:5;;29711:88;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;-1:-1:-1;29711:88:16;;;;;;;;-1:-1:-1;;29711:88:16;;;;;;;;;;;;:::i;:::-;;;29707:493;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;29989:6;:13;30006:1;29989:18;29985:113;;30027:56;-1:-1:-1;;;30027:7:16;:56::i;:::-;30168:6;30162:13;30153:6;30149:2;30145:15;30138:38;29707:493;-1:-1:-1;;;;;;29867:64:16;-1:-1:-1;;;29867:64:16;;-1:-1:-1;29707:493:16;29533:673;;;;;;:::o;7738:720:5:-;7818:18;7846:19;7984:4;7981:1;7974:4;7968:11;7961:4;7955;7951:15;7948:1;7941:5;7934;7929:60;8041:7;8031:176;;8085:4;8079:11;8130:16;8127:1;8122:3;8107:40;8176:16;8171:3;8164:29;8031:176;-1:-1:-1;;8284:1:5;8278:8;8234:16;;-1:-1:-1;8310:15:5;;:68;;8362:11;8377:1;8362:16;;8310:68;;;-1:-1:-1;;;;;8328:26:5;;;:31;8310:68;8306:146;;;8401:40;;-1:-1:-1;;;8401:40:5;;-1:-1:-1;;;;;1879:32:18;;8401:40:5;;;1861:51:18;1834:18;;8401:40:5;1715:203:18;35816:766:16;35942:19;35948:2;35952:8;35942:5;:19::i;:::-;-1:-1:-1;;;;;36000:14:16;;;:19;35996:570;;36053:13;;36100:14;;;36132:238;36162:62;36201:1;36205:2;36209:7;;;;;;36218:5;36162:30;:62::i;:::-;36157:174;;36252:56;-1:-1:-1;;;36252:7:16;:56::i;:::-;36365:3;36357:5;:11;36132:238;;36538:3;36521:13;;:20;36517:34;;36543:8;;;36517:34;36021:545;;35816:766;;;:::o;30652:2343::-;30747:13;;30724:20;30774:13;;;30770:53;;30789:34;-1:-1:-1;;;30789:7:16;:34::i;:::-;31323:31;;;;:17;:31;;;;;;;;-1:-1:-1;;;;;17320:28:16;;17492:11;17467:23;17463:41;17925:1;17912:15;;17886:24;17882:46;17460:52;17450:63;;31323:170;;;31704:22;;;:18;:22;;;;;:71;;31742:32;31730:45;;31704:71;;;17320:28;31960:13;;;31956:54;;31975:35;-1:-1:-1;;;31975:7:16;:35::i;:::-;32039:23;;;;32213:662;32623:7;32580:8;32536:1;32471:25;32409:1;32345;32315:351;32870:3;32857:9;;;;;;:16;32213:662;;-1:-1:-1;32889:13:16;:19;-1:-1:-1;26334:187:16;;;:::o;14:131:18:-;-1:-1:-1;;;;;;88:32:18;;78:43;;68:71;;135:1;132;125:12;150:245;208:6;261:2;249:9;240:7;236:23;232:32;229:52;;;277:1;274;267:12;229:52;316:9;303:23;335:30;359:5;335:30;:::i;:::-;384:5;150:245;-1:-1:-1;;;150:245:18:o;774:250::-;859:1;869:113;883:6;880:1;877:13;869:113;;;959:11;;;953:18;940:11;;;933:39;905:2;898:10;869:113;;;-1:-1:-1;;1016:1:18;998:16;;991:27;774:250::o;1029:271::-;1071:3;1109:5;1103:12;1136:6;1131:3;1124:19;1152:76;1221:6;1214:4;1209:3;1205:14;1198:4;1191:5;1187:16;1152:76;:::i;:::-;1282:2;1261:15;-1:-1:-1;;1257:29:18;1248:39;;;;1289:4;1244:50;;1029:271;-1:-1:-1;;1029:271:18:o;1305:220::-;1454:2;1443:9;1436:21;1417:4;1474:45;1515:2;1504:9;1500:18;1492:6;1474:45;:::i;1530:180::-;1589:6;1642:2;1630:9;1621:7;1617:23;1613:32;1610:52;;;1658:1;1655;1648:12;1610:52;-1:-1:-1;1681:23:18;;1530:180;-1:-1:-1;1530:180:18:o;1923:173::-;1991:20;;-1:-1:-1;;;;;2040:31:18;;2030:42;;2020:70;;2086:1;2083;2076:12;2101:254;2169:6;2177;2230:2;2218:9;2209:7;2205:23;2201:32;2198:52;;;2246:1;2243;2236:12;2198:52;2269:29;2288:9;2269:29;:::i;:::-;2259:39;2345:2;2330:18;;;;2317:32;;-1:-1:-1;;;2101:254:18:o;2360:186::-;2419:6;2472:2;2460:9;2451:7;2447:23;2443:32;2440:52;;;2488:1;2485;2478:12;2440:52;2511:29;2530:9;2511:29;:::i;2551:127::-;2612:10;2607:3;2603:20;2600:1;2593:31;2643:4;2640:1;2633:15;2667:4;2664:1;2657:15;2683:718;2725:5;2778:3;2771:4;2763:6;2759:17;2755:27;2745:55;;2796:1;2793;2786:12;2745:55;2832:6;2819:20;2858:18;2895:2;2891;2888:10;2885:36;;;2901:18;;:::i;:::-;2976:2;2970:9;2944:2;3030:13;;-1:-1:-1;;3026:22:18;;;3050:2;3022:31;3018:40;3006:53;;;3074:18;;;3094:22;;;3071:46;3068:72;;;3120:18;;:::i;:::-;3160:10;3156:2;3149:22;3195:2;3187:6;3180:18;3241:3;3234:4;3229:2;3221:6;3217:15;3213:26;3210:35;3207:55;;;3258:1;3255;3248:12;3207:55;3322:2;3315:4;3307:6;3303:17;3296:4;3288:6;3284:17;3271:54;3369:1;3362:4;3357:2;3349:6;3345:15;3341:26;3334:37;3389:6;3380:15;;;;;;2683:718;;;;:::o;3406:608::-;3502:6;3510;3518;3571:2;3559:9;3550:7;3546:23;3542:32;3539:52;;;3587:1;3584;3577:12;3539:52;3627:9;3614:23;3656:18;3697:2;3689:6;3686:14;3683:34;;;3713:1;3710;3703:12;3683:34;3736:49;3777:7;3768:6;3757:9;3753:22;3736:49;:::i;:::-;3726:59;;3838:2;3827:9;3823:18;3810:32;3794:48;;3867:2;3857:8;3854:16;3851:36;;;3883:1;3880;3873:12;3851:36;;3906:51;3949:7;3938:8;3927:9;3923:24;3906:51;:::i;:::-;3896:61;;;4004:2;3993:9;3989:18;3976:32;3966:42;;3406:608;;;;;:::o;4019:328::-;4096:6;4104;4112;4165:2;4153:9;4144:7;4140:23;4136:32;4133:52;;;4181:1;4178;4171:12;4133:52;4204:29;4223:9;4204:29;:::i;:::-;4194:39;;4252:38;4286:2;4275:9;4271:18;4252:38;:::i;:::-;4242:48;;4337:2;4326:9;4322:18;4309:32;4299:42;;4019:328;;;;;:::o;4352:883::-;4476:6;4484;4492;4500;4508;4561:3;4549:9;4540:7;4536:23;4532:33;4529:53;;;4578:1;4575;4568:12;4529:53;4601:29;4620:9;4601:29;:::i;:::-;4591:39;;4681:2;4670:9;4666:18;4653:32;4704:18;4745:2;4737:6;4734:14;4731:34;;;4761:1;4758;4751:12;4731:34;4784:49;4825:7;4816:6;4805:9;4801:22;4784:49;:::i;:::-;4774:59;;4886:2;4875:9;4871:18;4858:32;4842:48;;4915:2;4905:8;4902:16;4899:36;;;4931:1;4928;4921:12;4899:36;4954:51;4997:7;4986:8;4975:9;4971:24;4954:51;:::i;:::-;4944:61;;5058:2;5047:9;5043:18;5030:32;5014:48;;5087:2;5077:8;5074:16;5071:36;;;5103:1;5100;5093:12;5071:36;;5126:51;5169:7;5158:8;5147:9;5143:24;5126:51;:::i;:::-;4352:883;;;;-1:-1:-1;4352:883:18;;5224:3;5209:19;5196:33;;4352:883;-1:-1:-1;;;4352:883:18:o;5240:632::-;5411:2;5463:21;;;5533:13;;5436:18;;;5555:22;;;5382:4;;5411:2;5634:15;;;;5608:2;5593:18;;;5382:4;5677:169;5691:6;5688:1;5685:13;5677:169;;;5752:13;;5740:26;;5821:15;;;;5786:12;;;;5713:1;5706:9;5677:169;;5877:388;5954:6;5962;6015:2;6003:9;5994:7;5990:23;5986:32;5983:52;;;6031:1;6028;6021:12;5983:52;6067:9;6054:23;6044:33;;6128:2;6117:9;6113:18;6100:32;6155:18;6147:6;6144:30;6141:50;;;6187:1;6184;6177:12;6141:50;6210:49;6251:7;6242:6;6231:9;6227:22;6210:49;:::i;:::-;6200:59;;;5877:388;;;;;:::o;6270:160::-;6335:20;;6391:13;;6384:21;6374:32;;6364:60;;6420:1;6417;6410:12;6435:254;6500:6;6508;6561:2;6549:9;6540:7;6536:23;6532:32;6529:52;;;6577:1;6574;6567:12;6529:52;6600:29;6619:9;6600:29;:::i;:::-;6590:39;;6648:35;6679:2;6668:9;6664:18;6648:35;:::i;:::-;6638:45;;6435:254;;;;;:::o;6694:463::-;6778:6;6786;6794;6847:2;6835:9;6826:7;6822:23;6818:32;6815:52;;;6863:1;6860;6853:12;6815:52;6886:29;6905:9;6886:29;:::i;:::-;6876:39;;6966:2;6955:9;6951:18;6938:32;6993:18;6985:6;6982:30;6979:50;;;7025:1;7022;7015:12;6979:50;7048:49;7089:7;7080:6;7069:9;7065:22;7048:49;:::i;:::-;7038:59;;;7116:35;7147:2;7136:9;7132:18;7116:35;:::i;:::-;7106:45;;6694:463;;;;;:::o;7162:320::-;7230:6;7283:2;7271:9;7262:7;7258:23;7254:32;7251:52;;;7299:1;7296;7289:12;7251:52;7339:9;7326:23;7372:18;7364:6;7361:30;7358:50;;;7404:1;7401;7394:12;7358:50;7427:49;7468:7;7459:6;7448:9;7444:22;7427:49;:::i;7818:537::-;7913:6;7921;7929;7937;7990:3;7978:9;7969:7;7965:23;7961:33;7958:53;;;8007:1;8004;7997:12;7958:53;8030:29;8049:9;8030:29;:::i;:::-;8020:39;;8078:38;8112:2;8101:9;8097:18;8078:38;:::i;:::-;8068:48;;8163:2;8152:9;8148:18;8135:32;8125:42;;8218:2;8207:9;8203:18;8190:32;8245:18;8237:6;8234:30;8231:50;;;8277:1;8274;8267:12;8231:50;8300:49;8341:7;8332:6;8321:9;8317:22;8300:49;:::i;:::-;8290:59;;;7818:537;;;;;;;:::o;8686:389::-;8764:6;8772;8825:2;8813:9;8804:7;8800:23;8796:32;8793:52;;;8841:1;8838;8831:12;8793:52;8881:9;8868:23;8914:18;8906:6;8903:30;8900:50;;;8946:1;8943;8936:12;8900:50;8969:49;9010:7;9001:6;8990:9;8986:22;8969:49;:::i;:::-;8959:59;9065:2;9050:18;;;;9037:32;;-1:-1:-1;;;;8686:389:18:o;9262:260::-;9330:6;9338;9391:2;9379:9;9370:7;9366:23;9362:32;9359:52;;;9407:1;9404;9397:12;9359:52;9430:29;9449:9;9430:29;:::i;:::-;9420:39;;9478:38;9512:2;9501:9;9497:18;9478:38;:::i;9712:380::-;9791:1;9787:12;;;;9834;;;9855:61;;9909:4;9901:6;9897:17;9887:27;;9855:61;9962:2;9954:6;9951:14;9931:18;9928:38;9925:161;;10008:10;10003:3;9999:20;9996:1;9989:31;10043:4;10040:1;10033:15;10071:4;10068:1;10061:15;9925:161;;9712:380;;;:::o;12518:184::-;12588:6;12641:2;12629:9;12620:7;12616:23;12612:32;12609:52;;;12657:1;12654;12647:12;12609:52;-1:-1:-1;12680:16:18;;12518:184;-1:-1:-1;12518:184:18:o;12707:398::-;12909:2;12891:21;;;12948:2;12928:18;;;12921:30;12987:34;12982:2;12967:18;;12960:62;-1:-1:-1;;;13053:2:18;13038:18;;13031:32;13095:3;13080:19;;12707:398::o;13456:289::-;13587:3;13625:6;13619:13;13641:66;13700:6;13695:3;13688:4;13680:6;13676:17;13641:66;:::i;:::-;13723:16;;;;;13456:289;-1:-1:-1;;13456:289:18:o;14218:543::-;14320:2;14315:3;14312:11;14309:446;;;14356:1;14380:5;14377:1;14370:16;14424:4;14421:1;14411:18;14494:2;14482:10;14478:19;14475:1;14471:27;14465:4;14461:38;14530:4;14518:10;14515:20;14512:47;;;-1:-1:-1;14553:4:18;14512:47;14608:2;14603:3;14599:12;14596:1;14592:20;14586:4;14582:31;14572:41;;14663:82;14681:2;14674:5;14671:13;14663:82;;;14726:17;;;14707:1;14696:13;14663:82;;;14667:3;;;14218:543;;;:::o;14937:1345::-;15063:3;15057:10;15090:18;15082:6;15079:30;15076:56;;;15112:18;;:::i;:::-;15141:97;15231:6;15191:38;15223:4;15217:11;15191:38;:::i;:::-;15185:4;15141:97;:::i;:::-;15293:4;;15350:2;15339:14;;15367:1;15362:663;;;;16069:1;16086:6;16083:89;;;-1:-1:-1;16138:19:18;;;16132:26;16083:89;-1:-1:-1;;14894:1:18;14890:11;;;14886:24;14882:29;14872:40;14918:1;14914:11;;;14869:57;16185:81;;15332:944;;15362:663;14165:1;14158:14;;;14202:4;14189:18;;-1:-1:-1;;15398:20:18;;;15516:236;15530:7;15527:1;15524:14;15516:236;;;15619:19;;;15613:26;15598:42;;15711:27;;;;15679:1;15667:14;;;;15546:19;;15516:236;;;15520:3;15780:6;15771:7;15768:19;15765:201;;;15841:19;;;15835:26;-1:-1:-1;;15924:1:18;15920:14;;;15936:3;15916:24;15912:37;15908:42;15893:58;15878:74;;15765:201;-1:-1:-1;;;;;16012:1:18;15996:14;;;15992:22;15979:36;;-1:-1:-1;14937:1345:18:o;16287:127::-;16348:10;16343:3;16339:20;16336:1;16329:31;16379:4;16376:1;16369:15;16403:4;16400:1;16393:15;20566:385;20725:3;20763:6;20757:13;20779:66;20838:6;20833:3;20826:4;20818:6;20814:17;20779:66;:::i;:::-;20867:16;;;;20892:21;;;-1:-1:-1;20940:4:18;20929:16;;20566:385;-1:-1:-1;20566:385:18:o;21341:233::-;21380:3;21408:5;21398:136;;21456:10;21451:3;21447:20;21444:1;21437:31;21491:4;21488:1;21481:15;21519:4;21516:1;21509:15;21398:136;-1:-1:-1;;;21550:18:18;;21341:233::o;21959:489::-;-1:-1:-1;;;;;22228:15:18;;;22210:34;;22280:15;;22275:2;22260:18;;22253:43;22327:2;22312:18;;22305:34;;;22375:3;22370:2;22355:18;;22348:31;;;22153:4;;22396:46;;22422:19;;22414:6;22396:46;:::i;:::-;22388:54;21959:489;-1:-1:-1;;;;;;21959:489:18:o;22453:249::-;22522:6;22575:2;22563:9;22554:7;22550:23;22546:32;22543:52;;;22591:1;22588;22581:12;22543:52;22623:9;22617:16;22642:30;22666:5;22642:30;:::i
Swarm Source
ipfs://eaf3d85393df389dcc971ea04031394198a1f836ad6c1673584eab3405c55cc2
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.