Overview
APE Balance
APE Value
$195.67 (@ $0.15/APE)More Info
Private Name Tags
ContractCreator
TokenTracker
Multichain Info
Latest 25 from a total of 70 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Transfer From | 21397839 | 164 days ago | IN | 0 APE | 0.0011 | ||||
| Mint | 21397543 | 164 days ago | IN | 15 APE | 0.00233603 | ||||
| Mint | 19393229 | 199 days ago | IN | 15 APE | 0.00233603 | ||||
| Mint | 19393222 | 199 days ago | IN | 30 APE | 0.00363096 | ||||
| Mint | 19393211 | 199 days ago | IN | 15 APE | 0.00233603 | ||||
| Mint | 19393196 | 199 days ago | IN | 15 APE | 0.00236028 | ||||
| Transfer From | 19393121 | 199 days ago | IN | 0 APE | 0.00153469 | ||||
| Mint | 19392991 | 199 days ago | IN | 15 APE | 0.00233603 | ||||
| Mint | 19392928 | 199 days ago | IN | 45 APE | 0.00499473 | ||||
| Mint | 19392899 | 199 days ago | IN | 75 APE | 0.00760518 | ||||
| Mint | 17701860 | 236 days ago | IN | 30 APE | 0.00363098 | ||||
| Mint | 17694888 | 236 days ago | IN | 30 APE | 0.00363098 | ||||
| Mint | 16797635 | 244 days ago | IN | 30 APE | 0.00363098 | ||||
| Mint | 16795811 | 244 days ago | IN | 30 APE | 0.00363098 | ||||
| Set Approval For... | 16159408 | 250 days ago | IN | 0 APE | 0.00118442 | ||||
| Mint | 16159379 | 250 days ago | IN | 30 APE | 0.00406568 | ||||
| Mint | 16098258 | 252 days ago | IN | 30 APE | 0.00363098 | ||||
| Mint | 16098254 | 252 days ago | IN | 30 APE | 0.00366035 | ||||
| Mint | 16012215 | 254 days ago | IN | 30 APE | 0.00363098 | ||||
| Mint | 16012101 | 254 days ago | IN | 30 APE | 0.00363098 | ||||
| Mint | 15554931 | 264 days ago | IN | 30 APE | 0.00363098 | ||||
| Mint | 15554760 | 264 days ago | IN | 30 APE | 0.00363098 | ||||
| Transfer From | 15554722 | 264 days ago | IN | 0 APE | 0.0011 | ||||
| Transfer From | 15554695 | 264 days ago | IN | 0 APE | 0.0011 | ||||
| Mint | 15554680 | 264 days ago | IN | 15 APE | 0.00233605 |
View more zero value Internal Transactions in Advanced View mode
Cross-Chain Transactions
Contract Source Code (Solidity)
/**
*Submitted for verification at apescan.io on 2025-03-18
*/
// File: erc721a/contracts/IERC721A.sol
// 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);
}
// File: erc721a/contracts/ERC721A.sol
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @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)
}
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// 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;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
/**
* @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);
}
}
// File: @openzeppelin/contracts/utils/Panic.sol
// 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)
}
}
}
// File: @openzeppelin/contracts/utils/math/SafeCast.sol
// 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))
}
}
}
// File: @openzeppelin/contracts/utils/math/Math.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
}
// File: @openzeppelin/contracts/utils/math/SignedMath.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
/**
* @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);
}
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts (last updated v5.2.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
/**
* @dev String operations.
*/
library Strings {
using SafeCast for *;
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 The string being parsed contains characters that are not in scope of the given base.
*/
error StringsInvalidChar();
/**
* @dev The string being parsed is not a properly formatted address.
*/
error StringsInvalidAddressFormat();
/**
* @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));
}
/**
* @dev Parse a decimal string and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input) internal pure returns (uint256) {
return parseUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseUint} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
uint256 result = 0;
for (uint256 i = begin; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 9) return (false, 0);
result *= 10;
result += chr;
}
return (true, result);
}
/**
* @dev Parse a decimal string and returns the value as a `int256`.
*
* Requirements:
* - The string must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input) internal pure returns (int256) {
return parseInt(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {
(bool success, int256 value) = tryParseInt(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if
* the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {
return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);
}
uint256 private constant ABS_MIN_INT256 = 2 ** 255;
/**
* @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character or if the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, int256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseIntUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseInt} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseIntUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, int256 value) {
bytes memory buffer = bytes(input);
// Check presence of a negative sign.
bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
bool positiveSign = sign == bytes1("+");
bool negativeSign = sign == bytes1("-");
uint256 offset = (positiveSign || negativeSign).toUint();
(bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);
if (absSuccess && absValue < ABS_MIN_INT256) {
return (true, negativeSign ? -int256(absValue) : int256(absValue));
} else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {
return (true, type(int256).min);
} else return (false, 0);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input) internal pure returns (uint256) {
return parseHexUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseHexUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an
* invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseHexUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseHexUint} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseHexUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
// skip 0x prefix if present
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 offset = hasPrefix.toUint() * 2;
uint256 result = 0;
for (uint256 i = begin + offset; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 15) return (false, 0);
result *= 16;
unchecked {
// Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).
// This guaratees that adding a value < 16 will not cause an overflow, hence the unchecked.
result += chr;
}
}
return (true, result);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as an `address`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input) internal pure returns (address) {
return parseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {
(bool success, address value) = tryParseAddress(input, begin, end);
if (!success) revert StringsInvalidAddressFormat();
return value;
}
/**
* @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly
* formatted address. See {parseAddress} requirements.
*/
function tryParseAddress(string memory input) internal pure returns (bool success, address value) {
return tryParseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly
* formatted address. See {parseAddress} requirements.
*/
function tryParseAddress(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, address value) {
if (end > bytes(input).length || begin > end) return (false, address(0));
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 expectedLength = 40 + hasPrefix.toUint() * 2;
// check that input is the correct length
if (end - begin == expectedLength) {
// length guarantees that this does not overflow, and value is at most type(uint160).max
(bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);
return (s, address(uint160(v)));
} else {
return (false, address(0));
}
}
function _tryParseChr(bytes1 chr) private pure returns (uint8) {
uint8 value = uint8(chr);
// Try to parse `chr`:
// - Case 1: [0-9]
// - Case 2: [a-f]
// - Case 3: [A-F]
// - otherwise not supported
unchecked {
if (value > 47 && value < 58) value -= 48;
else if (value > 96 && value < 103) value -= 87;
else if (value > 64 && value < 71) value -= 55;
else return type(uint8).max;
}
return value;
}
/**
* @dev Reads a bytes32 from a bytes array without bounds checking.
*
* NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the
* assembly block as such would prevent some optimizations.
*/
function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {
// This is not memory safe in the general case, but all calls to this private function are within bounds.
assembly ("memory-safe") {
value := mload(add(buffer, add(0x20, offset)))
}
}
}
// File: @openzeppelin/contracts/utils/cryptography/Hashes.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/Hashes.sol)
pragma solidity ^0.8.20;
/**
* @dev Library of standard hash functions.
*
* _Available since v5.1._
*/
library Hashes {
/**
* @dev Commutative Keccak256 hash of a sorted pair of bytes32. Frequently used when working with merkle proofs.
*
* NOTE: Equivalent to the `standardNodeHash` in our https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
*/
function commutativeKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32) {
return a < b ? _efficientKeccak256(a, b) : _efficientKeccak256(b, a);
}
/**
* @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory.
*/
function _efficientKeccak256(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly ("memory-safe") {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MerkleProof.sol)
// This file was procedurally generated from scripts/generate/templates/MerkleProof.js.
pragma solidity ^0.8.20;
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The tree and the proofs can be generated using our
* https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
* You will find a quickstart guide in the readme.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the Merkle tree could be reinterpreted as a leaf value.
* OpenZeppelin's JavaScript library generates Merkle trees that are safe
* against this attack out of the box.
*
* IMPORTANT: Consider memory side-effects when using custom hashing functions
* that access memory in an unsafe way.
*
* NOTE: This library supports proof verification for merkle trees built using
* custom _commutative_ hashing functions (i.e. `H(a, b) == H(b, a)`). Proving
* leaf inclusion in trees built using non-commutative hashing functions requires
* additional logic that is not supported by this library.
*/
library MerkleProof {
/**
*@dev The multiproof provided is not valid.
*/
error MerkleProofInvalidMultiproof();
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in memory with the default hashing function.
*/
function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in memory with the default hashing function.
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in memory with a custom hashing function.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processProof(proof, leaf, hasher) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in memory with a custom hashing function.
*/
function processProof(
bytes32[] memory proof,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = hasher(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with the default hashing function.
*/
function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with the default hashing function.
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with a custom hashing function.
*/
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processProofCalldata(proof, leaf, hasher) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with a custom hashing function.
*/
function processProofCalldata(
bytes32[] calldata proof,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = hasher(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in memory with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProof}.
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in memory with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = Hashes.commutativeKeccak256(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in memory with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProof}.
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processMultiProof(proof, proofFlags, leaves, hasher) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in memory with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = hasher(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in calldata with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProofCalldata}.
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in calldata with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = Hashes.commutativeKeccak256(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in calldata with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProofCalldata}.
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves, hasher) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in calldata with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = hasher(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
}
// File: @openzeppelin/contracts/utils/cryptography/ECDSA.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.20;
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS
}
/**
* @dev The signature derives the `address(0)`.
*/
error ECDSAInvalidSignature();
/**
* @dev The signature has an invalid length.
*/
error ECDSAInvalidSignatureLength(uint256 length);
/**
* @dev The signature has an S value that is in the upper half order.
*/
error ECDSAInvalidSignatureS(bytes32 s);
/**
* @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
* return address(0) without also returning an error description. Errors are documented using an enum (error type)
* and a bytes32 providing additional information about the error.
*
* If no error is returned, then the address can be used for verification purposes.
*
* The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*/
function tryRecover(
bytes32 hash,
bytes memory signature
) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
assembly ("memory-safe") {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {
unchecked {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
// We do not check for an overflow here since the shift operation results in 0 or 1.
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS, s);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature, bytes32(0));
}
return (signer, RecoverError.NoError, bytes32(0));
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
*/
function _throwError(RecoverError error, bytes32 errorArg) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert ECDSAInvalidSignature();
} else if (error == RecoverError.InvalidSignatureLength) {
revert ECDSAInvalidSignatureLength(uint256(errorArg));
} else if (error == RecoverError.InvalidSignatureS) {
revert ECDSAInvalidSignatureS(errorArg);
}
}
}
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
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 division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// File: GSRCMarchMadness.sol
/*
░█▀▀░█▀▀░█▀▄░█▀▀░░░█▄█░█▀█░█▀▄░█▀▀░█░█░░░█▄█░█▀█░█▀▄░█▀█░█▀▀░█▀▀░█▀▀
░█░█░▀▀█░█▀▄░█░░░░░█░█░█▀█░█▀▄░█░░░█▀█░░░█░█░█▀█░█░█░█░█░█▀▀░▀▀█░▀▀█
░▀▀▀░▀▀▀░▀░▀░▀▀▀░░░▀░▀░▀░▀░▀░▀░▀▀▀░▀░▀░░░▀░▀░▀░▀░▀▀░░▀░▀░▀▀▀░▀▀▀░▀▀▀
*/
pragma solidity ^0.8.20;
contract GSRCMARCHMADNESS is ERC721A, Ownable {
using Strings for uint256;
using SafeMath for uint256;
uint256 public MAX_SUPPLY = 680;
uint256 public constant MAX_PER_WALLET = 100;
uint256 public PRICE = 5 ether;
bool public saleActive = false;
string public baseURI;
mapping(uint256 => bool) private _mintedTokens;
event Mint(address indexed minter, uint256 tokenId);
event Airdrop(address indexed recipient, uint256 quantity);
event Burn(address indexed owner, uint256[] tokenIds);
event Withdraw(address indexed owner, uint256 amount);
constructor(string memory _initialBaseURI) ERC721A("GSRC March Madness", "GSRCMM") Ownable(msg.sender) {
baseURI = _initialBaseURI;
}
function _startTokenId() internal pure override returns (uint256) {
return 1;
}
function getRandomAvailableTokenId() internal view returns (uint256) {
uint256 randomTokenId;
do {
randomTokenId = (uint256(keccak256(abi.encodePacked(block.timestamp, msg.sender, totalSupply()))) % MAX_SUPPLY) + 1;
} while (_mintedTokens[randomTokenId]);
return randomTokenId;
}
function mint(uint256 quantity) external payable {
require(saleActive, "Sale is not active");
require(totalSupply() + quantity <= MAX_SUPPLY, "Minting would exceed max supply");
require(balanceOf(msg.sender) + quantity <= MAX_PER_WALLET, "Wallet limit exceeded");
require(msg.value >= PRICE * quantity, "Insufficient funds provided");
for (uint256 i = 0; i < quantity; i++) {
uint256 randomTokenId = getRandomAvailableTokenId();
_mintedTokens[randomTokenId] = true;
_mint(msg.sender, 1);
emit Mint(msg.sender, randomTokenId);
}
}
function airdrop(address recipient, uint256 quantity) external onlyOwner {
require(totalSupply() + quantity <= MAX_SUPPLY, "Exceeds max supply");
_mint(recipient, quantity);
emit Airdrop(recipient, quantity);
}
function burn(uint256[] calldata tokenIds) external onlyOwner {
for (uint256 i = 0; i < tokenIds.length; i++) {
require(_exists(tokenIds[i]), "Token does not exist");
_burn(tokenIds[i]);
_mintedTokens[tokenIds[i]] = false;
}
emit Burn(msg.sender, tokenIds);
}
function toggleSale() external onlyOwner {
saleActive = !saleActive;
}
function updatePrice(uint256 newPrice) external onlyOwner {
PRICE = newPrice;
}
function _baseURI() internal view override returns (string memory) {
return baseURI;
}
function setBaseURI(string memory _newBaseURI) external onlyOwner {
baseURI = _newBaseURI;
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
if (!_exists(tokenId)) revert("URI query for nonexistent token");
return string(abi.encodePacked(baseURI, tokenId.toString(), ".json"));
}
function withdraw() external onlyOwner {
uint256 balance = address(this).balance;
(bool success, ) = payable(owner()).call{ gas: 210000, value: balance }("");
require(success, "Owner withdrawal transfer failed");
emit Withdraw(owner(), balance);
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"string","name":"_initialBaseURI","type":"string"}],"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":[],"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":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"Airdrop","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"Burn","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":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Mint","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":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"MAX_PER_WALLET","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","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":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"uint256","name":"quantity","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"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":[],"name":"saleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleSale","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"uint256","name":"newPrice","type":"uint256"}],"name":"updatePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040526102a8600a55674563918244f40000600b555f600c5f6101000a81548160ff02191690831515021790555034801561003a575f80fd5b50604051613bf6380380613bf6833981810160405281019061005c9190610414565b336040518060400160405280601281526020017f47535243204d61726368204d61646e65737300000000000000000000000000008152506040518060400160405280600681526020017f475352434d4d000000000000000000000000000000000000000000000000000081525081600290816100d89190610668565b5080600390816100e89190610668565b506100f76101cd60201b60201c565b5f8190555061010a6101cd60201b60201c565b6101186101d560201b60201c565b10156101355761013463fed8210f60e01b6101fc60201b60201c565b5b50505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036101a7575f6040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161019e9190610776565b60405180910390fd5b6101b68161020460201b60201c565b5080600d90816101c69190610668565b505061078f565b5f6001905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905090565b805f5260045ffd5b5f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f604051905090565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610326826102e0565b810181811067ffffffffffffffff82111715610345576103446102f0565b5b80604052505050565b5f6103576102c7565b9050610363828261031d565b919050565b5f67ffffffffffffffff821115610382576103816102f0565b5b61038b826102e0565b9050602081019050919050565b8281835e5f83830152505050565b5f6103b86103b384610368565b61034e565b9050828152602081018484840111156103d4576103d36102dc565b5b6103df848285610398565b509392505050565b5f82601f8301126103fb576103fa6102d8565b5b815161040b8482602086016103a6565b91505092915050565b5f60208284031215610429576104286102d0565b5b5f82015167ffffffffffffffff811115610446576104456102d4565b5b610452848285016103e7565b91505092915050565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806104a957607f821691505b6020821081036104bc576104bb610465565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f6008830261051e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826104e3565b61052886836104e3565b95508019841693508086168417925050509392505050565b5f819050919050565b5f819050919050565b5f61056c61056761056284610540565b610549565b610540565b9050919050565b5f819050919050565b61058583610552565b61059961059182610573565b8484546104ef565b825550505050565b5f90565b6105ad6105a1565b6105b881848461057c565b505050565b5b818110156105db576105d05f826105a5565b6001810190506105be565b5050565b601f821115610620576105f1816104c2565b6105fa846104d4565b81016020851015610609578190505b61061d610615856104d4565b8301826105bd565b50505b505050565b5f82821c905092915050565b5f6106405f1984600802610625565b1980831691505092915050565b5f6106588383610631565b9150826002028217905092915050565b6106718261045b565b67ffffffffffffffff81111561068a576106896102f0565b5b6106948254610492565b61069f8282856105df565b5f60209050601f8311600181146106d0575f84156106be578287015190505b6106c8858261064d565b86555061072f565b601f1984166106de866104c2565b5f5b82811015610705578489015182556001820191506020850194506020810190506106e0565b86831015610722578489015161071e601f891682610631565b8355505b6001600288020188555050505b505050505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61076082610737565b9050919050565b61077081610756565b82525050565b5f6020820190506107895f830184610767565b92915050565b61345a8061079c5f395ff3fe6080604052600436106101c1575f3560e01c806370a08231116100f657806395d89b4111610094578063b88d4fde11610063578063b88d4fde146105a9578063c87b56dd146105c5578063e985e9c514610601578063f2fde38b1461063d576101c1565b806395d89b4114610513578063a0712d681461053d578063a22cb46514610559578063b80f55c914610581576101c1565b80638ba4cc3c116100d05780638ba4cc3c1461046f5780638d6cc56d146104975780638d859f3e146104bf5780638da5cb5b146104e9576101c1565b806370a0823114610407578063715018a6146104435780637d8966e414610459576101c1565b806332cb6b0c1161016357806355f804b31161013d57806355f804b31461034f5780636352211e1461037757806368428a1b146103b35780636c0360eb146103dd576101c1565b806332cb6b0c146102f35780633ccfd60b1461031d57806342842e0e14610333576101c1565b8063095ea7b31161019f578063095ea7b3146102675780630f2cdd6c1461028357806318160ddd146102ad57806323b872dd146102d7576101c1565b806301ffc9a7146101c557806306fdde0314610201578063081812fc1461022b575b5f80fd5b3480156101d0575f80fd5b506101eb60048036038101906101e691906122b2565b610665565b6040516101f891906122f7565b60405180910390f35b34801561020c575f80fd5b506102156106f6565b6040516102229190612380565b60405180910390f35b348015610236575f80fd5b50610251600480360381019061024c91906123d3565b610786565b60405161025e919061243d565b60405180910390f35b610281600480360381019061027c9190612480565b6107df565b005b34801561028e575f80fd5b506102976107ef565b6040516102a491906124cd565b60405180910390f35b3480156102b8575f80fd5b506102c16107f4565b6040516102ce91906124cd565b60405180910390f35b6102f160048036038101906102ec91906124e6565b61083f565b005b3480156102fe575f80fd5b50610307610aea565b60405161031491906124cd565b60405180910390f35b348015610328575f80fd5b50610331610af0565b005b61034d600480360381019061034891906124e6565b610c09565b005b34801561035a575f80fd5b5061037560048036038101906103709190612662565b610c28565b005b348015610382575f80fd5b5061039d600480360381019061039891906123d3565b610c43565b6040516103aa919061243d565b60405180910390f35b3480156103be575f80fd5b506103c7610c54565b6040516103d491906122f7565b60405180910390f35b3480156103e8575f80fd5b506103f1610c66565b6040516103fe9190612380565b60405180910390f35b348015610412575f80fd5b5061042d600480360381019061042891906126a9565b610cf2565b60405161043a91906124cd565b60405180910390f35b34801561044e575f80fd5b50610457610d86565b005b348015610464575f80fd5b5061046d610d99565b005b34801561047a575f80fd5b5061049560048036038101906104909190612480565b610dcb565b005b3480156104a2575f80fd5b506104bd60048036038101906104b891906123d3565b610e86565b005b3480156104ca575f80fd5b506104d3610e98565b6040516104e091906124cd565b60405180910390f35b3480156104f4575f80fd5b506104fd610e9e565b60405161050a919061243d565b60405180910390f35b34801561051e575f80fd5b50610527610ec6565b6040516105349190612380565b60405180910390f35b610557600480360381019061055291906123d3565b610f56565b005b348015610564575f80fd5b5061057f600480360381019061057a91906126fe565b61114b565b005b34801561058c575f80fd5b506105a760048036038101906105a29190612799565b611251565b005b6105c360048036038101906105be9190612882565b61138c565b005b3480156105d0575f80fd5b506105eb60048036038101906105e691906123d3565b6113dd565b6040516105f89190612380565b60405180910390f35b34801561060c575f80fd5b5061062760048036038101906106229190612902565b611459565b60405161063491906122f7565b60405180910390f35b348015610648575f80fd5b50610663600480360381019061065e91906126a9565b6114e7565b005b5f6301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106bf57506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806106ef5750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b6060600280546107059061296d565b80601f01602080910402602001604051908101604052809291908181526020018280546107319061296d565b801561077c5780601f106107535761010080835404028352916020019161077c565b820191905f5260205f20905b81548152906001019060200180831161075f57829003601f168201915b5050505050905090565b5f6107908261156b565b6107a5576107a463cf4700e460e01b61160e565b5b60065f8381526020019081526020015f205f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6107eb82826001611616565b5050565b606481565b5f6107fd611740565b6001545f54030390507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61082f611748565b1461083c57600854810190505b90565b5f6108498261176f565b905073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161693508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108be576108bd63a114810060e01b61160e565b5b5f806108c98461187e565b915091506108df81876108da6118a1565b6118a8565b61090a576108f4866108ef6118a1565b611459565b610909576109086359c896be60e01b61160e565b5b5b61091786868660016118eb565b8015610921575f82555b60055f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154600190039190508190555060055f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154600101919050819055506109e9856109c58888876118f1565b7c020000000000000000000000000000000000000000000000000000000017611918565b60045f8681526020019081526020015f20819055505f7c0200000000000000000000000000000000000000000000000000000000841603610a65575f6001850190505f60045f8381526020019081526020015f205403610a63575f548114610a62578360045f8381526020019081526020015f20819055505b5b505b5f73ffffffffffffffffffffffffffffffffffffffff8673ffffffffffffffffffffffffffffffffffffffff161690508481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a45f8103610ad457610ad363ea553b3460e01b61160e565b5b610ae18787876001611942565b50505050505050565b600a5481565b610af8611948565b5f4790505f610b05610e9e565b73ffffffffffffffffffffffffffffffffffffffff166203345083604051610b2c906129ca565b5f60405180830381858888f193505050503d805f8114610b67576040519150601f19603f3d011682016040523d82523d5f602084013e610b6c565b606091505b5050905080610bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba790612a28565b60405180910390fd5b610bb8610e9e565b73ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436483604051610bfd91906124cd565b60405180910390a25050565b610c2383838360405180602001604052805f81525061138c565b505050565b610c30611948565b80600d9081610c3f9190612be3565b5050565b5f610c4d8261176f565b9050919050565b600c5f9054906101000a900460ff1681565b600d8054610c739061296d565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9f9061296d565b8015610cea5780601f10610cc157610100808354040283529160200191610cea565b820191905f5260205f20905b815481529060010190602001808311610ccd57829003601f168201915b505050505081565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610d3757610d36638f4eb60460e01b61160e565b5b67ffffffffffffffff60055f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054169050919050565b610d8e611948565b610d975f6119cf565b565b610da1611948565b600c5f9054906101000a900460ff1615600c5f6101000a81548160ff021916908315150217905550565b610dd3611948565b600a5481610ddf6107f4565b610de99190612cdf565b1115610e2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2190612d5c565b60405180910390fd5b610e348282611a92565b8173ffffffffffffffffffffffffffffffffffffffff167f8c32c568416fcf97be35ce5b27844cfddcd63a67a1a602c3595ba5dac38f303a82604051610e7a91906124cd565b60405180910390a25050565b610e8e611948565b80600b8190555050565b600b5481565b5f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610ed59061296d565b80601f0160208091040260200160405190810160405280929190818152602001828054610f019061296d565b8015610f4c5780601f10610f2357610100808354040283529160200191610f4c565b820191905f5260205f20905b815481529060010190602001808311610f2f57829003601f168201915b5050505050905090565b600c5f9054906101000a900460ff16610fa4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9b90612dc4565b60405180910390fd5b600a5481610fb06107f4565b610fba9190612cdf565b1115610ffb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff290612e2c565b60405180910390fd5b60648161100733610cf2565b6110119190612cdf565b1115611052576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104990612e94565b60405180910390fd5b80600b546110609190612eb2565b3410156110a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109990612f3d565b60405180910390fd5b5f5b81811015611147575f6110b5611c06565b90506001600e5f8381526020019081526020015f205f6101000a81548160ff0219169083151502179055506110eb336001611a92565b3373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858260405161113191906124cd565b60405180910390a25080806001019150506110a4565b5050565b8060075f6111576118a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166112006118a1565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161124591906122f7565b60405180910390a35050565b611259611948565b5f5b828290508110156113375761128883838381811061127c5761127b612f5b565b5b9050602002013561156b565b6112c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112be90612fd2565b60405180910390fd5b6112e98383838181106112dd576112dc612f5b565b5b90506020020135611c81565b5f600e5f858585818110611300576112ff612f5b565b5b9050602002013581526020019081526020015f205f6101000a81548160ff021916908315150217905550808060010191505061125b565b503373ffffffffffffffffffffffffffffffffffffffff167f4c3f61bbac5dc8dc1f47677a57a23e312af5e0b7ce11ce20b40bb1ec82f888228383604051611380929190613068565b60405180910390a25050565b61139784848461083f565b5f8373ffffffffffffffffffffffffffffffffffffffff163b146113d7576113c184848484611c8e565b6113d6576113d563d1a57ed660e01b61160e565b5b5b50505050565b60606113e88261156b565b611427576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141e906130d4565b60405180910390fd5b600d61143283611db8565b6040516020016114439291906131f6565b6040516020818303038152906040529050919050565b5f60075f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b6114ef611948565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361155f575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611556919061243d565b60405180910390fd5b611568816119cf565b50565b5f81611575611740565b1161160857611582611748565b8211156115aa576115a360045f8481526020019081526020015f2054611e82565b9050611609565b5f54821015611607575f5b5f60045f8581526020019081526020015f2054915081036115e157826115da90613224565b92506115b5565b5f7c01000000000000000000000000000000000000000000000000000000008216149150505b5b5b919050565b805f5260045ffd5b5f61162083610c43565b905081801561166257508073ffffffffffffffffffffffffffffffffffffffff166116496118a1565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561168e57611678816116736118a1565b611459565b61168d5761168c63cfb3b94260e01b61160e565b5b5b8360065f8581526020019081526020015f205f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a450505050565b5f6001905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905090565b5f81611779611740565b116118685760045f8381526020019081526020015f2054905061179a611748565b8211156117bf576117aa81611e82565b611879576117be63df2d9b4260e01b61160e565b5b5f8103611840575f5482106117df576117de63df2d9b4260e01b61160e565b5b5b60045f836001900393508381526020019081526020015f205490505f81031561183b575f7c0100000000000000000000000000000000000000000000000000000000821603156118795761183a63df2d9b4260e01b61160e565b5b6117e0565b5f7c010000000000000000000000000000000000000000000000000000000082160315611879575b61187863df2d9b4260e01b61160e565b5b919050565b5f805f60065f8581526020019081526020015f2090508092508254915050915091565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b5f8060e883901c905060e8611907868684611ec2565b62ffffff16901b9150509392505050565b5f73ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b611950611eca565b73ffffffffffffffffffffffffffffffffffffffff1661196e610e9e565b73ffffffffffffffffffffffffffffffffffffffff16146119cd57611991611eca565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016119c4919061243d565b60405180910390fd5b565b5f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f805490505f8203611aaf57611aae63b562e8dd60e01b61160e565b5b611abb5f8483856118eb565b611ad983611aca5f865f6118f1565b611ad385611ed1565b17611918565b60045f8381526020019081526020015f2081905550600160406001901b17820260055f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505f73ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161690505f8103611b8a57611b89632e07630060e01b61160e565b5b5f83830190505f839050611b9c611748565b600183031115611bb757611bb66381647e3a60e01b61160e565b5b5b80835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4818160010191508103611bb857815f81905550505050611c015f848385611942565b505050565b5f805b6001600a544233611c186107f4565b604051602001611c2a939291906132b0565b604051602081830303815290604052805190602001205f1c611c4c9190613319565b611c569190612cdf565b9050600e5f8281526020019081526020015f205f9054906101000a900460ff16611c09578091505090565b611c8b815f611ee0565b50565b5f8373ffffffffffffffffffffffffffffffffffffffff1663150b7a02611cb36118a1565b8786866040518563ffffffff1660e01b8152600401611cd5949392919061339b565b6020604051808303815f875af1925050508015611d1057506040513d601f19601f82011682018060405250810190611d0d91906133f9565b60015b611d65573d805f8114611d3e576040519150601f19603f3d011682016040523d82523d5f602084013e611d43565b606091505b505f815103611d5d57611d5c63d1a57ed660e01b61160e565b5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b60605f6001611dc6846120fb565b0190505f8167ffffffffffffffff811115611de457611de361253e565b5b6040519080825280601f01601f191660200182016040528015611e165781602001600182028036833780820191505090505b5090505f82602001820190505b600115611e77578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611e6c57611e6b6132ec565b5b0494505f8503611e23575b819350505050919050565b5f7c0100000000000000000000000000000000000000000000000000000000821673ffffffffffffffffffffffffffffffffffffffff8316119050919050565b5f9392505050565b5f33905090565b5f6001821460e11b9050919050565b5f611eea8361176f565b90505f8190505f80611efb8661187e565b915091508415611f4357611f178184611f126118a1565b6118a8565b611f4257611f2c83611f276118a1565b611459565b611f4157611f406359c896be60e01b61160e565b5b5b5b611f50835f8860016118eb565b8015611f5a575f82555b600160806001901b0360055f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282540192505081905550611ffe83611fbb855f886118f1565b7c02000000000000000000000000000000000000000000000000000000007c01000000000000000000000000000000000000000000000000000000001717611918565b60045f8881526020019081526020015f20819055505f7c020000000000000000000000000000000000000000000000000000000085160361207a575f6001870190505f60045f8381526020019081526020015f205403612078575f548114612077578460045f8381526020019081526020015f20819055505b5b505b855f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46120e2835f886001611942565b60015f8154809291906001019190505550505050505050565b5f805f90507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612157577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161214d5761214c6132ec565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310612194576d04ee2d6d415b85acef8100000000838161218a576121896132ec565b5b0492506020810190505b662386f26fc1000083106121c357662386f26fc1000083816121b9576121b86132ec565b5b0492506010810190505b6305f5e10083106121ec576305f5e10083816121e2576121e16132ec565b5b0492506008810190505b6127108310612211576127108381612207576122066132ec565b5b0492506004810190505b60648310612234576064838161222a576122296132ec565b5b0492506002810190505b600a8310612243576001810190505b80915050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6122918161225d565b811461229b575f80fd5b50565b5f813590506122ac81612288565b92915050565b5f602082840312156122c7576122c6612255565b5b5f6122d48482850161229e565b91505092915050565b5f8115159050919050565b6122f1816122dd565b82525050565b5f60208201905061230a5f8301846122e8565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61235282612310565b61235c818561231a565b935061236c81856020860161232a565b61237581612338565b840191505092915050565b5f6020820190508181035f8301526123988184612348565b905092915050565b5f819050919050565b6123b2816123a0565b81146123bc575f80fd5b50565b5f813590506123cd816123a9565b92915050565b5f602082840312156123e8576123e7612255565b5b5f6123f5848285016123bf565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f612427826123fe565b9050919050565b6124378161241d565b82525050565b5f6020820190506124505f83018461242e565b92915050565b61245f8161241d565b8114612469575f80fd5b50565b5f8135905061247a81612456565b92915050565b5f806040838503121561249657612495612255565b5b5f6124a38582860161246c565b92505060206124b4858286016123bf565b9150509250929050565b6124c7816123a0565b82525050565b5f6020820190506124e05f8301846124be565b92915050565b5f805f606084860312156124fd576124fc612255565b5b5f61250a8682870161246c565b935050602061251b8682870161246c565b925050604061252c868287016123bf565b9150509250925092565b5f80fd5b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61257482612338565b810181811067ffffffffffffffff821117156125935761259261253e565b5b80604052505050565b5f6125a561224c565b90506125b1828261256b565b919050565b5f67ffffffffffffffff8211156125d0576125cf61253e565b5b6125d982612338565b9050602081019050919050565b828183375f83830152505050565b5f612606612601846125b6565b61259c565b9050828152602081018484840111156126225761262161253a565b5b61262d8482856125e6565b509392505050565b5f82601f83011261264957612648612536565b5b81356126598482602086016125f4565b91505092915050565b5f6020828403121561267757612676612255565b5b5f82013567ffffffffffffffff81111561269457612693612259565b5b6126a084828501612635565b91505092915050565b5f602082840312156126be576126bd612255565b5b5f6126cb8482850161246c565b91505092915050565b6126dd816122dd565b81146126e7575f80fd5b50565b5f813590506126f8816126d4565b92915050565b5f806040838503121561271457612713612255565b5b5f6127218582860161246c565b9250506020612732858286016126ea565b9150509250929050565b5f80fd5b5f80fd5b5f8083601f84011261275957612758612536565b5b8235905067ffffffffffffffff8111156127765761277561273c565b5b60208301915083602082028301111561279257612791612740565b5b9250929050565b5f80602083850312156127af576127ae612255565b5b5f83013567ffffffffffffffff8111156127cc576127cb612259565b5b6127d885828601612744565b92509250509250929050565b5f67ffffffffffffffff8211156127fe576127fd61253e565b5b61280782612338565b9050602081019050919050565b5f612826612821846127e4565b61259c565b9050828152602081018484840111156128425761284161253a565b5b61284d8482856125e6565b509392505050565b5f82601f83011261286957612868612536565b5b8135612879848260208601612814565b91505092915050565b5f805f806080858703121561289a57612899612255565b5b5f6128a78782880161246c565b94505060206128b88782880161246c565b93505060406128c9878288016123bf565b925050606085013567ffffffffffffffff8111156128ea576128e9612259565b5b6128f687828801612855565b91505092959194509250565b5f806040838503121561291857612917612255565b5b5f6129258582860161246c565b92505060206129368582860161246c565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061298457607f821691505b60208210810361299757612996612940565b5b50919050565b5f81905092915050565b50565b5f6129b55f8361299d565b91506129c0826129a7565b5f82019050919050565b5f6129d4826129aa565b9150819050919050565b7f4f776e6572207769746864726177616c207472616e73666572206661696c65645f82015250565b5f612a1260208361231a565b9150612a1d826129de565b602082019050919050565b5f6020820190508181035f830152612a3f81612a06565b9050919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302612aa27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612a67565b612aac8683612a67565b95508019841693508086168417925050509392505050565b5f819050919050565b5f612ae7612ae2612add846123a0565b612ac4565b6123a0565b9050919050565b5f819050919050565b612b0083612acd565b612b14612b0c82612aee565b848454612a73565b825550505050565b5f90565b612b28612b1c565b612b33818484612af7565b505050565b5b81811015612b5657612b4b5f82612b20565b600181019050612b39565b5050565b601f821115612b9b57612b6c81612a46565b612b7584612a58565b81016020851015612b84578190505b612b98612b9085612a58565b830182612b38565b50505b505050565b5f82821c905092915050565b5f612bbb5f1984600802612ba0565b1980831691505092915050565b5f612bd38383612bac565b9150826002028217905092915050565b612bec82612310565b67ffffffffffffffff811115612c0557612c0461253e565b5b612c0f825461296d565b612c1a828285612b5a565b5f60209050601f831160018114612c4b575f8415612c39578287015190505b612c438582612bc8565b865550612caa565b601f198416612c5986612a46565b5f5b82811015612c8057848901518255600182019150602085019450602081019050612c5b565b86831015612c9d5784890151612c99601f891682612bac565b8355505b6001600288020188555050505b505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612ce9826123a0565b9150612cf4836123a0565b9250828201905080821115612d0c57612d0b612cb2565b5b92915050565b7f45786365656473206d617820737570706c7900000000000000000000000000005f82015250565b5f612d4660128361231a565b9150612d5182612d12565b602082019050919050565b5f6020820190508181035f830152612d7381612d3a565b9050919050565b7f53616c65206973206e6f742061637469766500000000000000000000000000005f82015250565b5f612dae60128361231a565b9150612db982612d7a565b602082019050919050565b5f6020820190508181035f830152612ddb81612da2565b9050919050565b7f4d696e74696e6720776f756c6420657863656564206d617820737570706c79005f82015250565b5f612e16601f8361231a565b9150612e2182612de2565b602082019050919050565b5f6020820190508181035f830152612e4381612e0a565b9050919050565b7f57616c6c6574206c696d697420657863656564656400000000000000000000005f82015250565b5f612e7e60158361231a565b9150612e8982612e4a565b602082019050919050565b5f6020820190508181035f830152612eab81612e72565b9050919050565b5f612ebc826123a0565b9150612ec7836123a0565b9250828202612ed5816123a0565b91508282048414831517612eec57612eeb612cb2565b5b5092915050565b7f496e73756666696369656e742066756e64732070726f766964656400000000005f82015250565b5f612f27601b8361231a565b9150612f3282612ef3565b602082019050919050565b5f6020820190508181035f830152612f5481612f1b565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f546f6b656e20646f6573206e6f742065786973740000000000000000000000005f82015250565b5f612fbc60148361231a565b9150612fc782612f88565b602082019050919050565b5f6020820190508181035f830152612fe981612fb0565b9050919050565b5f82825260208201905092915050565b5f80fd5b82818337505050565b5f6130188385612ff0565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561304b5761304a613000565b5b60208302925061305c838584613004565b82840190509392505050565b5f6020820190508181035f83015261308181848661300d565b90509392505050565b7f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e005f82015250565b5f6130be601f8361231a565b91506130c98261308a565b602082019050919050565b5f6020820190508181035f8301526130eb816130b2565b9050919050565b5f81905092915050565b5f81546131088161296d565b61311281866130f2565b9450600182165f811461312c576001811461314157613173565b60ff1983168652811515820286019350613173565b61314a85612a46565b5f5b8381101561316b5781548189015260018201915060208101905061314c565b838801955050505b50505092915050565b5f61318682612310565b61319081856130f2565b93506131a081856020860161232a565b80840191505092915050565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000005f82015250565b5f6131e06005836130f2565b91506131eb826131ac565b600582019050919050565b5f61320182856130fc565b915061320d828461317c565b9150613218826131d4565b91508190509392505050565b5f61322e826123a0565b91505f82036132405761323f612cb2565b5b600182039050919050565b5f819050919050565b613265613260826123a0565b61324b565b82525050565b5f8160601b9050919050565b5f6132818261326b565b9050919050565b5f61329282613277565b9050919050565b6132aa6132a58261241d565b613288565b82525050565b5f6132bb8286613254565b6020820191506132cb8285613299565b6014820191506132db8284613254565b602082019150819050949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f613323826123a0565b915061332e836123a0565b92508261333e5761333d6132ec565b5b828206905092915050565b5f81519050919050565b5f82825260208201905092915050565b5f61336d82613349565b6133778185613353565b935061338781856020860161232a565b61339081612338565b840191505092915050565b5f6080820190506133ae5f83018761242e565b6133bb602083018661242e565b6133c860408301856124be565b81810360608301526133da8184613363565b905095945050505050565b5f815190506133f381612288565b92915050565b5f6020828403121561340e5761340d612255565b5b5f61341b848285016133e5565b9150509291505056fea264697066735822122030cf30062aaeca0877c2cc8082e9031569df0ac4f5398add8863d7e566d45bc964736f6c634300081a003300000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000043697066733a2f2f62616679626569673671373671686163686c3671726c65686675346a7a37686737616868767a646663656f7a6f676e656178786a7632626965726d2f0000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106101c1575f3560e01c806370a08231116100f657806395d89b4111610094578063b88d4fde11610063578063b88d4fde146105a9578063c87b56dd146105c5578063e985e9c514610601578063f2fde38b1461063d576101c1565b806395d89b4114610513578063a0712d681461053d578063a22cb46514610559578063b80f55c914610581576101c1565b80638ba4cc3c116100d05780638ba4cc3c1461046f5780638d6cc56d146104975780638d859f3e146104bf5780638da5cb5b146104e9576101c1565b806370a0823114610407578063715018a6146104435780637d8966e414610459576101c1565b806332cb6b0c1161016357806355f804b31161013d57806355f804b31461034f5780636352211e1461037757806368428a1b146103b35780636c0360eb146103dd576101c1565b806332cb6b0c146102f35780633ccfd60b1461031d57806342842e0e14610333576101c1565b8063095ea7b31161019f578063095ea7b3146102675780630f2cdd6c1461028357806318160ddd146102ad57806323b872dd146102d7576101c1565b806301ffc9a7146101c557806306fdde0314610201578063081812fc1461022b575b5f80fd5b3480156101d0575f80fd5b506101eb60048036038101906101e691906122b2565b610665565b6040516101f891906122f7565b60405180910390f35b34801561020c575f80fd5b506102156106f6565b6040516102229190612380565b60405180910390f35b348015610236575f80fd5b50610251600480360381019061024c91906123d3565b610786565b60405161025e919061243d565b60405180910390f35b610281600480360381019061027c9190612480565b6107df565b005b34801561028e575f80fd5b506102976107ef565b6040516102a491906124cd565b60405180910390f35b3480156102b8575f80fd5b506102c16107f4565b6040516102ce91906124cd565b60405180910390f35b6102f160048036038101906102ec91906124e6565b61083f565b005b3480156102fe575f80fd5b50610307610aea565b60405161031491906124cd565b60405180910390f35b348015610328575f80fd5b50610331610af0565b005b61034d600480360381019061034891906124e6565b610c09565b005b34801561035a575f80fd5b5061037560048036038101906103709190612662565b610c28565b005b348015610382575f80fd5b5061039d600480360381019061039891906123d3565b610c43565b6040516103aa919061243d565b60405180910390f35b3480156103be575f80fd5b506103c7610c54565b6040516103d491906122f7565b60405180910390f35b3480156103e8575f80fd5b506103f1610c66565b6040516103fe9190612380565b60405180910390f35b348015610412575f80fd5b5061042d600480360381019061042891906126a9565b610cf2565b60405161043a91906124cd565b60405180910390f35b34801561044e575f80fd5b50610457610d86565b005b348015610464575f80fd5b5061046d610d99565b005b34801561047a575f80fd5b5061049560048036038101906104909190612480565b610dcb565b005b3480156104a2575f80fd5b506104bd60048036038101906104b891906123d3565b610e86565b005b3480156104ca575f80fd5b506104d3610e98565b6040516104e091906124cd565b60405180910390f35b3480156104f4575f80fd5b506104fd610e9e565b60405161050a919061243d565b60405180910390f35b34801561051e575f80fd5b50610527610ec6565b6040516105349190612380565b60405180910390f35b610557600480360381019061055291906123d3565b610f56565b005b348015610564575f80fd5b5061057f600480360381019061057a91906126fe565b61114b565b005b34801561058c575f80fd5b506105a760048036038101906105a29190612799565b611251565b005b6105c360048036038101906105be9190612882565b61138c565b005b3480156105d0575f80fd5b506105eb60048036038101906105e691906123d3565b6113dd565b6040516105f89190612380565b60405180910390f35b34801561060c575f80fd5b5061062760048036038101906106229190612902565b611459565b60405161063491906122f7565b60405180910390f35b348015610648575f80fd5b50610663600480360381019061065e91906126a9565b6114e7565b005b5f6301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106bf57506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806106ef5750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b6060600280546107059061296d565b80601f01602080910402602001604051908101604052809291908181526020018280546107319061296d565b801561077c5780601f106107535761010080835404028352916020019161077c565b820191905f5260205f20905b81548152906001019060200180831161075f57829003601f168201915b5050505050905090565b5f6107908261156b565b6107a5576107a463cf4700e460e01b61160e565b5b60065f8381526020019081526020015f205f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6107eb82826001611616565b5050565b606481565b5f6107fd611740565b6001545f54030390507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61082f611748565b1461083c57600854810190505b90565b5f6108498261176f565b905073ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161693508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108be576108bd63a114810060e01b61160e565b5b5f806108c98461187e565b915091506108df81876108da6118a1565b6118a8565b61090a576108f4866108ef6118a1565b611459565b610909576109086359c896be60e01b61160e565b5b5b61091786868660016118eb565b8015610921575f82555b60055f8773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154600190039190508190555060055f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8154600101919050819055506109e9856109c58888876118f1565b7c020000000000000000000000000000000000000000000000000000000017611918565b60045f8681526020019081526020015f20819055505f7c0200000000000000000000000000000000000000000000000000000000841603610a65575f6001850190505f60045f8381526020019081526020015f205403610a63575f548114610a62578360045f8381526020019081526020015f20819055505b5b505b5f73ffffffffffffffffffffffffffffffffffffffff8673ffffffffffffffffffffffffffffffffffffffff161690508481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a45f8103610ad457610ad363ea553b3460e01b61160e565b5b610ae18787876001611942565b50505050505050565b600a5481565b610af8611948565b5f4790505f610b05610e9e565b73ffffffffffffffffffffffffffffffffffffffff166203345083604051610b2c906129ca565b5f60405180830381858888f193505050503d805f8114610b67576040519150601f19603f3d011682016040523d82523d5f602084013e610b6c565b606091505b5050905080610bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba790612a28565b60405180910390fd5b610bb8610e9e565b73ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436483604051610bfd91906124cd565b60405180910390a25050565b610c2383838360405180602001604052805f81525061138c565b505050565b610c30611948565b80600d9081610c3f9190612be3565b5050565b5f610c4d8261176f565b9050919050565b600c5f9054906101000a900460ff1681565b600d8054610c739061296d565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9f9061296d565b8015610cea5780601f10610cc157610100808354040283529160200191610cea565b820191905f5260205f20905b815481529060010190602001808311610ccd57829003601f168201915b505050505081565b5f8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610d3757610d36638f4eb60460e01b61160e565b5b67ffffffffffffffff60055f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054169050919050565b610d8e611948565b610d975f6119cf565b565b610da1611948565b600c5f9054906101000a900460ff1615600c5f6101000a81548160ff021916908315150217905550565b610dd3611948565b600a5481610ddf6107f4565b610de99190612cdf565b1115610e2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2190612d5c565b60405180910390fd5b610e348282611a92565b8173ffffffffffffffffffffffffffffffffffffffff167f8c32c568416fcf97be35ce5b27844cfddcd63a67a1a602c3595ba5dac38f303a82604051610e7a91906124cd565b60405180910390a25050565b610e8e611948565b80600b8190555050565b600b5481565b5f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060038054610ed59061296d565b80601f0160208091040260200160405190810160405280929190818152602001828054610f019061296d565b8015610f4c5780601f10610f2357610100808354040283529160200191610f4c565b820191905f5260205f20905b815481529060010190602001808311610f2f57829003601f168201915b5050505050905090565b600c5f9054906101000a900460ff16610fa4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9b90612dc4565b60405180910390fd5b600a5481610fb06107f4565b610fba9190612cdf565b1115610ffb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff290612e2c565b60405180910390fd5b60648161100733610cf2565b6110119190612cdf565b1115611052576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104990612e94565b60405180910390fd5b80600b546110609190612eb2565b3410156110a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109990612f3d565b60405180910390fd5b5f5b81811015611147575f6110b5611c06565b90506001600e5f8381526020019081526020015f205f6101000a81548160ff0219169083151502179055506110eb336001611a92565b3373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858260405161113191906124cd565b60405180910390a25080806001019150506110a4565b5050565b8060075f6111576118a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166112006118a1565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161124591906122f7565b60405180910390a35050565b611259611948565b5f5b828290508110156113375761128883838381811061127c5761127b612f5b565b5b9050602002013561156b565b6112c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112be90612fd2565b60405180910390fd5b6112e98383838181106112dd576112dc612f5b565b5b90506020020135611c81565b5f600e5f858585818110611300576112ff612f5b565b5b9050602002013581526020019081526020015f205f6101000a81548160ff021916908315150217905550808060010191505061125b565b503373ffffffffffffffffffffffffffffffffffffffff167f4c3f61bbac5dc8dc1f47677a57a23e312af5e0b7ce11ce20b40bb1ec82f888228383604051611380929190613068565b60405180910390a25050565b61139784848461083f565b5f8373ffffffffffffffffffffffffffffffffffffffff163b146113d7576113c184848484611c8e565b6113d6576113d563d1a57ed660e01b61160e565b5b5b50505050565b60606113e88261156b565b611427576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141e906130d4565b60405180910390fd5b600d61143283611db8565b6040516020016114439291906131f6565b6040516020818303038152906040529050919050565b5f60075f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b6114ef611948565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361155f575f6040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611556919061243d565b60405180910390fd5b611568816119cf565b50565b5f81611575611740565b1161160857611582611748565b8211156115aa576115a360045f8481526020019081526020015f2054611e82565b9050611609565b5f54821015611607575f5b5f60045f8581526020019081526020015f2054915081036115e157826115da90613224565b92506115b5565b5f7c01000000000000000000000000000000000000000000000000000000008216149150505b5b5b919050565b805f5260045ffd5b5f61162083610c43565b905081801561166257508073ffffffffffffffffffffffffffffffffffffffff166116496118a1565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561168e57611678816116736118a1565b611459565b61168d5761168c63cfb3b94260e01b61160e565b5b5b8360065f8581526020019081526020015f205f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a450505050565b5f6001905090565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905090565b5f81611779611740565b116118685760045f8381526020019081526020015f2054905061179a611748565b8211156117bf576117aa81611e82565b611879576117be63df2d9b4260e01b61160e565b5b5f8103611840575f5482106117df576117de63df2d9b4260e01b61160e565b5b5b60045f836001900393508381526020019081526020015f205490505f81031561183b575f7c0100000000000000000000000000000000000000000000000000000000821603156118795761183a63df2d9b4260e01b61160e565b5b6117e0565b5f7c010000000000000000000000000000000000000000000000000000000082160315611879575b61187863df2d9b4260e01b61160e565b5b919050565b5f805f60065f8581526020019081526020015f2090508092508254915050915091565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b5f8060e883901c905060e8611907868684611ec2565b62ffffff16901b9150509392505050565b5f73ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b611950611eca565b73ffffffffffffffffffffffffffffffffffffffff1661196e610e9e565b73ffffffffffffffffffffffffffffffffffffffff16146119cd57611991611eca565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016119c4919061243d565b60405180910390fd5b565b5f60095f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160095f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f805490505f8203611aaf57611aae63b562e8dd60e01b61160e565b5b611abb5f8483856118eb565b611ad983611aca5f865f6118f1565b611ad385611ed1565b17611918565b60045f8381526020019081526020015f2081905550600160406001901b17820260055f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505f73ffffffffffffffffffffffffffffffffffffffff8473ffffffffffffffffffffffffffffffffffffffff161690505f8103611b8a57611b89632e07630060e01b61160e565b5b5f83830190505f839050611b9c611748565b600183031115611bb757611bb66381647e3a60e01b61160e565b5b5b80835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4818160010191508103611bb857815f81905550505050611c015f848385611942565b505050565b5f805b6001600a544233611c186107f4565b604051602001611c2a939291906132b0565b604051602081830303815290604052805190602001205f1c611c4c9190613319565b611c569190612cdf565b9050600e5f8281526020019081526020015f205f9054906101000a900460ff16611c09578091505090565b611c8b815f611ee0565b50565b5f8373ffffffffffffffffffffffffffffffffffffffff1663150b7a02611cb36118a1565b8786866040518563ffffffff1660e01b8152600401611cd5949392919061339b565b6020604051808303815f875af1925050508015611d1057506040513d601f19601f82011682018060405250810190611d0d91906133f9565b60015b611d65573d805f8114611d3e576040519150601f19603f3d011682016040523d82523d5f602084013e611d43565b606091505b505f815103611d5d57611d5c63d1a57ed660e01b61160e565b5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b60605f6001611dc6846120fb565b0190505f8167ffffffffffffffff811115611de457611de361253e565b5b6040519080825280601f01601f191660200182016040528015611e165781602001600182028036833780820191505090505b5090505f82602001820190505b600115611e77578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611e6c57611e6b6132ec565b5b0494505f8503611e23575b819350505050919050565b5f7c0100000000000000000000000000000000000000000000000000000000821673ffffffffffffffffffffffffffffffffffffffff8316119050919050565b5f9392505050565b5f33905090565b5f6001821460e11b9050919050565b5f611eea8361176f565b90505f8190505f80611efb8661187e565b915091508415611f4357611f178184611f126118a1565b6118a8565b611f4257611f2c83611f276118a1565b611459565b611f4157611f406359c896be60e01b61160e565b5b5b5b611f50835f8860016118eb565b8015611f5a575f82555b600160806001901b0360055f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282540192505081905550611ffe83611fbb855f886118f1565b7c02000000000000000000000000000000000000000000000000000000007c01000000000000000000000000000000000000000000000000000000001717611918565b60045f8881526020019081526020015f20819055505f7c020000000000000000000000000000000000000000000000000000000085160361207a575f6001870190505f60045f8381526020019081526020015f205403612078575f548114612077578460045f8381526020019081526020015f20819055505b5b505b855f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46120e2835f886001611942565b60015f8154809291906001019190505550505050505050565b5f805f90507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612157577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161214d5761214c6132ec565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310612194576d04ee2d6d415b85acef8100000000838161218a576121896132ec565b5b0492506020810190505b662386f26fc1000083106121c357662386f26fc1000083816121b9576121b86132ec565b5b0492506010810190505b6305f5e10083106121ec576305f5e10083816121e2576121e16132ec565b5b0492506008810190505b6127108310612211576127108381612207576122066132ec565b5b0492506004810190505b60648310612234576064838161222a576122296132ec565b5b0492506002810190505b600a8310612243576001810190505b80915050919050565b5f604051905090565b5f80fd5b5f80fd5b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6122918161225d565b811461229b575f80fd5b50565b5f813590506122ac81612288565b92915050565b5f602082840312156122c7576122c6612255565b5b5f6122d48482850161229e565b91505092915050565b5f8115159050919050565b6122f1816122dd565b82525050565b5f60208201905061230a5f8301846122e8565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f61235282612310565b61235c818561231a565b935061236c81856020860161232a565b61237581612338565b840191505092915050565b5f6020820190508181035f8301526123988184612348565b905092915050565b5f819050919050565b6123b2816123a0565b81146123bc575f80fd5b50565b5f813590506123cd816123a9565b92915050565b5f602082840312156123e8576123e7612255565b5b5f6123f5848285016123bf565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f612427826123fe565b9050919050565b6124378161241d565b82525050565b5f6020820190506124505f83018461242e565b92915050565b61245f8161241d565b8114612469575f80fd5b50565b5f8135905061247a81612456565b92915050565b5f806040838503121561249657612495612255565b5b5f6124a38582860161246c565b92505060206124b4858286016123bf565b9150509250929050565b6124c7816123a0565b82525050565b5f6020820190506124e05f8301846124be565b92915050565b5f805f606084860312156124fd576124fc612255565b5b5f61250a8682870161246c565b935050602061251b8682870161246c565b925050604061252c868287016123bf565b9150509250925092565b5f80fd5b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61257482612338565b810181811067ffffffffffffffff821117156125935761259261253e565b5b80604052505050565b5f6125a561224c565b90506125b1828261256b565b919050565b5f67ffffffffffffffff8211156125d0576125cf61253e565b5b6125d982612338565b9050602081019050919050565b828183375f83830152505050565b5f612606612601846125b6565b61259c565b9050828152602081018484840111156126225761262161253a565b5b61262d8482856125e6565b509392505050565b5f82601f83011261264957612648612536565b5b81356126598482602086016125f4565b91505092915050565b5f6020828403121561267757612676612255565b5b5f82013567ffffffffffffffff81111561269457612693612259565b5b6126a084828501612635565b91505092915050565b5f602082840312156126be576126bd612255565b5b5f6126cb8482850161246c565b91505092915050565b6126dd816122dd565b81146126e7575f80fd5b50565b5f813590506126f8816126d4565b92915050565b5f806040838503121561271457612713612255565b5b5f6127218582860161246c565b9250506020612732858286016126ea565b9150509250929050565b5f80fd5b5f80fd5b5f8083601f84011261275957612758612536565b5b8235905067ffffffffffffffff8111156127765761277561273c565b5b60208301915083602082028301111561279257612791612740565b5b9250929050565b5f80602083850312156127af576127ae612255565b5b5f83013567ffffffffffffffff8111156127cc576127cb612259565b5b6127d885828601612744565b92509250509250929050565b5f67ffffffffffffffff8211156127fe576127fd61253e565b5b61280782612338565b9050602081019050919050565b5f612826612821846127e4565b61259c565b9050828152602081018484840111156128425761284161253a565b5b61284d8482856125e6565b509392505050565b5f82601f83011261286957612868612536565b5b8135612879848260208601612814565b91505092915050565b5f805f806080858703121561289a57612899612255565b5b5f6128a78782880161246c565b94505060206128b88782880161246c565b93505060406128c9878288016123bf565b925050606085013567ffffffffffffffff8111156128ea576128e9612259565b5b6128f687828801612855565b91505092959194509250565b5f806040838503121561291857612917612255565b5b5f6129258582860161246c565b92505060206129368582860161246c565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061298457607f821691505b60208210810361299757612996612940565b5b50919050565b5f81905092915050565b50565b5f6129b55f8361299d565b91506129c0826129a7565b5f82019050919050565b5f6129d4826129aa565b9150819050919050565b7f4f776e6572207769746864726177616c207472616e73666572206661696c65645f82015250565b5f612a1260208361231a565b9150612a1d826129de565b602082019050919050565b5f6020820190508181035f830152612a3f81612a06565b9050919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f60088302612aa27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612a67565b612aac8683612a67565b95508019841693508086168417925050509392505050565b5f819050919050565b5f612ae7612ae2612add846123a0565b612ac4565b6123a0565b9050919050565b5f819050919050565b612b0083612acd565b612b14612b0c82612aee565b848454612a73565b825550505050565b5f90565b612b28612b1c565b612b33818484612af7565b505050565b5b81811015612b5657612b4b5f82612b20565b600181019050612b39565b5050565b601f821115612b9b57612b6c81612a46565b612b7584612a58565b81016020851015612b84578190505b612b98612b9085612a58565b830182612b38565b50505b505050565b5f82821c905092915050565b5f612bbb5f1984600802612ba0565b1980831691505092915050565b5f612bd38383612bac565b9150826002028217905092915050565b612bec82612310565b67ffffffffffffffff811115612c0557612c0461253e565b5b612c0f825461296d565b612c1a828285612b5a565b5f60209050601f831160018114612c4b575f8415612c39578287015190505b612c438582612bc8565b865550612caa565b601f198416612c5986612a46565b5f5b82811015612c8057848901518255600182019150602085019450602081019050612c5b565b86831015612c9d5784890151612c99601f891682612bac565b8355505b6001600288020188555050505b505050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612ce9826123a0565b9150612cf4836123a0565b9250828201905080821115612d0c57612d0b612cb2565b5b92915050565b7f45786365656473206d617820737570706c7900000000000000000000000000005f82015250565b5f612d4660128361231a565b9150612d5182612d12565b602082019050919050565b5f6020820190508181035f830152612d7381612d3a565b9050919050565b7f53616c65206973206e6f742061637469766500000000000000000000000000005f82015250565b5f612dae60128361231a565b9150612db982612d7a565b602082019050919050565b5f6020820190508181035f830152612ddb81612da2565b9050919050565b7f4d696e74696e6720776f756c6420657863656564206d617820737570706c79005f82015250565b5f612e16601f8361231a565b9150612e2182612de2565b602082019050919050565b5f6020820190508181035f830152612e4381612e0a565b9050919050565b7f57616c6c6574206c696d697420657863656564656400000000000000000000005f82015250565b5f612e7e60158361231a565b9150612e8982612e4a565b602082019050919050565b5f6020820190508181035f830152612eab81612e72565b9050919050565b5f612ebc826123a0565b9150612ec7836123a0565b9250828202612ed5816123a0565b91508282048414831517612eec57612eeb612cb2565b5b5092915050565b7f496e73756666696369656e742066756e64732070726f766964656400000000005f82015250565b5f612f27601b8361231a565b9150612f3282612ef3565b602082019050919050565b5f6020820190508181035f830152612f5481612f1b565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f546f6b656e20646f6573206e6f742065786973740000000000000000000000005f82015250565b5f612fbc60148361231a565b9150612fc782612f88565b602082019050919050565b5f6020820190508181035f830152612fe981612fb0565b9050919050565b5f82825260208201905092915050565b5f80fd5b82818337505050565b5f6130188385612ff0565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561304b5761304a613000565b5b60208302925061305c838584613004565b82840190509392505050565b5f6020820190508181035f83015261308181848661300d565b90509392505050565b7f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e005f82015250565b5f6130be601f8361231a565b91506130c98261308a565b602082019050919050565b5f6020820190508181035f8301526130eb816130b2565b9050919050565b5f81905092915050565b5f81546131088161296d565b61311281866130f2565b9450600182165f811461312c576001811461314157613173565b60ff1983168652811515820286019350613173565b61314a85612a46565b5f5b8381101561316b5781548189015260018201915060208101905061314c565b838801955050505b50505092915050565b5f61318682612310565b61319081856130f2565b93506131a081856020860161232a565b80840191505092915050565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000005f82015250565b5f6131e06005836130f2565b91506131eb826131ac565b600582019050919050565b5f61320182856130fc565b915061320d828461317c565b9150613218826131d4565b91508190509392505050565b5f61322e826123a0565b91505f82036132405761323f612cb2565b5b600182039050919050565b5f819050919050565b613265613260826123a0565b61324b565b82525050565b5f8160601b9050919050565b5f6132818261326b565b9050919050565b5f61329282613277565b9050919050565b6132aa6132a58261241d565b613288565b82525050565b5f6132bb8286613254565b6020820191506132cb8285613299565b6014820191506132db8284613254565b602082019150819050949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f613323826123a0565b915061332e836123a0565b92508261333e5761333d6132ec565b5b828206905092915050565b5f81519050919050565b5f82825260208201905092915050565b5f61336d82613349565b6133778185613353565b935061338781856020860161232a565b61339081612338565b840191505092915050565b5f6080820190506133ae5f83018761242e565b6133bb602083018661242e565b6133c860408301856124be565b81810360608301526133da8184613363565b905095945050505050565b5f815190506133f381612288565b92915050565b5f6020828403121561340e5761340d612255565b5b5f61341b848285016133e5565b9150509291505056fea264697066735822122030cf30062aaeca0877c2cc8082e9031569df0ac4f5398add8863d7e566d45bc964736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000043697066733a2f2f62616679626569673671373671686163686c3671726c65686675346a7a37686737616868767a646663656f7a6f676e656178786a7632626965726d2f0000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _initialBaseURI (string): ipfs://bafybeig6q76qhachl6qrlehfu4jz7hg7ahhvzdfceozogneaxxjv2bierm/
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [2] : 697066733a2f2f62616679626569673671373671686163686c3671726c656866
Arg [3] : 75346a7a37686737616868767a646663656f7a6f676e656178786a7632626965
Arg [4] : 726d2f0000000000000000000000000000000000000000000000000000000000
Deployed Bytecode Sourcemap
193594:3405:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;20588:639;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;21490:100;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;28730:227;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;28447:124;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;193752:44;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;16692:573;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;33002:3523;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;193714:31;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;196708:288;;;;;;;;;;;;;:::i;:::-;;36621:193;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;196343:106;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;22892:152;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;193840:30;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;193879:21;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;18416:242;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;64152:103;;;;;;;;;;;;;:::i;:::-;;196042:84;;;;;;;;;;;;;:::i;:::-;;195454:242;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;196134:93;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;193803:30;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;63477:87;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;21666:104;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;194804:642;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;29297:234;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;195704:330;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;37412:416;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;196457:243;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;29688:164;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;64410:220;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;20588:639;20673:4;21012:10;20997:25;;:11;:25;;;;:102;;;;21089:10;21074:25;;:11;:25;;;;20997:102;:179;;;;21166:10;21151:25;;:11;:25;;;;20997:179;20977:199;;20588:639;;;:::o;21490:100::-;21544:13;21577:5;21570:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21490:100;:::o;28730:227::-;28806:7;28831:16;28839:7;28831;:16::i;:::-;28826:73;;28849:50;28857:41;;;28849:7;:50::i;:::-;28826:73;28919:15;:24;28935:7;28919:24;;;;;;;;;;;:30;;;;;;;;;;;;28912:37;;28730:227;;;:::o;28447:124::-;28536:27;28545:2;28549:7;28558:4;28536:8;:27::i;:::-;28447:124;;:::o;193752:44::-;193793:3;193752:44;:::o;16692:573::-;16753:14;17151:15;:13;:15::i;:::-;17136:12;;17120:13;;:28;:46;17111:55;;17206:17;17185;:15;:17::i;:::-;:38;17181:65;;17235:11;;17225:21;;;;17181:65;16692:573;:::o;33002:3523::-;33144:27;33174;33193:7;33174:18;:27::i;:::-;33144:57;;12634:14;33345:4;33329:22;;:41;33306:66;;33430:4;33389:45;;33405:19;33389:45;;;33385:95;;33436:44;33444:35;;;33436:7;:44::i;:::-;33385:95;33494:27;33523:23;33550:35;33577:7;33550:26;:35::i;:::-;33493:92;;;;33685:68;33710:15;33727:4;33733:19;:17;:19::i;:::-;33685:24;:68::i;:::-;33680:189;;33773:43;33790:4;33796:19;:17;:19::i;:::-;33773:16;:43::i;:::-;33768:101;;33818:51;33826:42;;;33818:7;:51::i;:::-;33768:101;33680:189;33882:43;33904:4;33910:2;33914:7;33923:1;33882:21;:43::i;:::-;34018:15;34015:160;;;34158:1;34137:19;34130:30;34015:160;34555:18;:24;34574:4;34555:24;;;;;;;;;;;;;;;;34553:26;;;;;;;;;;;;34624:18;:22;34643:2;34624:22;;;;;;;;;;;;;;;;34622:24;;;;;;;;;;;34946:146;34983:2;35032:45;35047:4;35053:2;35057:19;35032:14;:45::i;:::-;12232:8;35004:73;34946:18;:146::i;:::-;34917:17;:26;34935:7;34917:26;;;;;;;;;;;:175;;;;35263:1;12232:8;35212:19;:47;:52;35208:627;;35285:19;35317:1;35307:7;:11;35285:33;;35474:1;35440:17;:30;35458:11;35440:30;;;;;;;;;;;;:35;35436:384;;35578:13;;35563:11;:28;35559:242;;35758:19;35725:17;:30;35743:11;35725:30;;;;;;;;;;;:52;;;;35559:242;35436:384;35266:569;35208:627;35948:16;12634:14;35983:2;35967:20;;:39;35948:58;;36347:7;36311:8;36277:4;36219:25;36164:1;36107;36084:299;36420:1;36408:8;:13;36404:58;;36423:39;36431:30;;;36423:7;:39::i;:::-;36404:58;36475:42;36496:4;36502:2;36506:7;36515:1;36475:20;:42::i;:::-;33133:3392;;;;33002:3523;;;:::o;193714:31::-;;;;:::o;196708:288::-;63363:13;:11;:13::i;:::-;196758:15:::1;196776:21;196758:39;;196809:12;196835:7;:5;:7::i;:::-;196827:21;;196855:6;196870:7;196827:56;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;196808:75;;;196902:7;196894:52;;;;;;;;;;;;:::i;:::-;;;;;;;;;196971:7;:5;:7::i;:::-;196962:26;;;196980:7;196962:26;;;;;;:::i;:::-;;;;;;;;196747:249;;196708:288::o:0;36621:193::-;36767:39;36784:4;36790:2;36794:7;36767:39;;;;;;;;;;;;:16;:39::i;:::-;36621:193;;;:::o;196343:106::-;63363:13;:11;:13::i;:::-;196430:11:::1;196420:7;:21;;;;;;:::i;:::-;;196343:106:::0;:::o;22892:152::-;22964:7;23007:27;23026:7;23007:18;:27::i;:::-;22984:52;;22892:152;;;:::o;193840:30::-;;;;;;;;;;;;;:::o;193879:21::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;18416:242::-;18488:7;18529:1;18512:19;;:5;:19;;;18508:69;;18533:44;18541:35;;;18533:7;:44::i;:::-;18508:69;11176:13;18595:18;:25;18614:5;18595:25;;;;;;;;;;;;;;;;:55;18588:62;;18416:242;;;:::o;64152:103::-;63363:13;:11;:13::i;:::-;64217:30:::1;64244:1;64217:18;:30::i;:::-;64152:103::o:0;196042:84::-;63363:13;:11;:13::i;:::-;196108:10:::1;;;;;;;;;;;196107:11;196094:10;;:24;;;;;;;;;;;;;;;;;;196042:84::o:0;195454:242::-;63363:13;:11;:13::i;:::-;195574:10:::1;;195562:8;195546:13;:11;:13::i;:::-;:24;;;;:::i;:::-;:38;;195538:69;;;;;;;;;;;;:::i;:::-;;;;;;;;;195618:26;195624:9;195635:8;195618:5;:26::i;:::-;195668:9;195660:28;;;195679:8;195660:28;;;;;;:::i;:::-;;;;;;;;195454:242:::0;;:::o;196134:93::-;63363:13;:11;:13::i;:::-;196211:8:::1;196203:5;:16;;;;196134:93:::0;:::o;193803:30::-;;;;:::o;63477:87::-;63523:7;63550:6;;;;;;;;;;;63543:13;;63477:87;:::o;21666:104::-;21722:13;21755:7;21748:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21666:104;:::o;194804:642::-;194872:10;;;;;;;;;;;194864:41;;;;;;;;;;;;:::i;:::-;;;;;;;;;194952:10;;194940:8;194924:13;:11;:13::i;:::-;:24;;;;:::i;:::-;:38;;194916:82;;;;;;;;;;;;:::i;:::-;;;;;;;;;193793:3;195041:8;195017:21;195027:10;195017:9;:21::i;:::-;:32;;;;:::i;:::-;:50;;195009:84;;;;;;;;;;;;:::i;:::-;;;;;;;;;195133:8;195125:5;;:16;;;;:::i;:::-;195112:9;:29;;195104:69;;;;;;;;;;;;:::i;:::-;;;;;;;;;195191:9;195186:253;195210:8;195206:1;:12;195186:253;;;195240:21;195264:27;:25;:27::i;:::-;195240:51;;195337:4;195306:13;:28;195320:13;195306:28;;;;;;;;;;;;:35;;;;;;;;;;;;;;;;;;195356:20;195362:10;195374:1;195356:5;:20::i;:::-;195401:10;195396:31;;;195413:13;195396:31;;;;;;:::i;:::-;;;;;;;;195225:214;195220:3;;;;;;;195186:253;;;;194804:642;:::o;29297:234::-;29444:8;29392:18;:39;29411:19;:17;:19::i;:::-;29392:39;;;;;;;;;;;;;;;:49;29432:8;29392:49;;;;;;;;;;;;;;;;:60;;;;;;;;;;;;;;;;;;29504:8;29468:55;;29483:19;:17;:19::i;:::-;29468:55;;;29514:8;29468:55;;;;;;:::i;:::-;;;;;;;;29297:234;;:::o;195704:330::-;63363:13;:11;:13::i;:::-;195782:9:::1;195777:208;195801:8;;:15;;195797:1;:19;195777:208;;;195846:20;195854:8;;195863:1;195854:11;;;;;;;:::i;:::-;;;;;;;;195846:7;:20::i;:::-;195838:53;;;;;;;;;;;;:::i;:::-;;;;;;;;;195906:18;195912:8;;195921:1;195912:11;;;;;;;:::i;:::-;;;;;;;;195906:5;:18::i;:::-;195968:5;195939:13;:26;195953:8;;195962:1;195953:11;;;;;;;:::i;:::-;;;;;;;;195939:26;;;;;;;;;;;;:34;;;;;;;;;;;;;;;;;;195818:3;;;;;;;195777:208;;;;196005:10;196000:26;;;196017:8;;196000:26;;;;;;;:::i;:::-;;;;;;;;195704:330:::0;;:::o;37412:416::-;37587:31;37600:4;37606:2;37610:7;37587:12;:31::i;:::-;37651:1;37633:2;:14;;;:19;37629:192;;37672:56;37703:4;37709:2;37713:7;37722:5;37672:30;:56::i;:::-;37667:154;;37749:56;37757:47;;;37749:7;:56::i;:::-;37667:154;37629:192;37412:416;;;;:::o;196457:243::-;196522:13;196553:16;196561:7;196553;:16::i;:::-;196548:64;;196571:41;;;;;;;;;;:::i;:::-;;;;;;;;196548:64;196654:7;196663:18;:7;:16;:18::i;:::-;196637:54;;;;;;;;;:::i;:::-;;;;;;;;;;;;;196623:69;;196457:243;;;:::o;29688:164::-;29785:4;29809:18;:25;29828:5;29809:25;;;;;;;;;;;;;;;:35;29835:8;29809:35;;;;;;;;;;;;;;;;;;;;;;;;;29802:42;;29688:164;;;;:::o;64410:220::-;63363:13;:11;:13::i;:::-;64515:1:::1;64495:22;;:8;:22;;::::0;64491:93:::1;;64569:1;64541:31;;;;;;;;;;;:::i;:::-;;;;;;;;64491:93;64594:28;64613:8;64594:18;:28::i;:::-;64410:220:::0;:::o;30110:475::-;30175:11;30222:7;30203:15;:13;:15::i;:::-;:26;30199:379;;30260:17;:15;:17::i;:::-;30250:7;:27;30246:90;;;30286:50;30309:17;:26;30327:7;30309:26;;;;;;;;;;;;30286:22;:50::i;:::-;30279:57;;;;30246:90;30367:13;;30357:7;:23;30353:214;;;30401:14;30434:60;30482:1;30451:17;:26;30469:7;30451:26;;;;;;;;;;;;30442:35;;;30441:42;30434:60;;30485:9;;;;:::i;:::-;;;30434:60;;;30550:1;11952:8;30522:6;:24;:29;30513:38;;30382:185;30353:214;30199:379;30110:475;;;;:::o;60619:165::-;60720:13;60714:4;60707:27;60761:4;60755;60748:18;52034:474;52163:13;52179:16;52187:7;52179;:16::i;:::-;52163:32;;52212:13;:45;;;;;52252:5;52229:28;;:19;:17;:19::i;:::-;:28;;;;52212:45;52208:201;;;52277:44;52294:5;52301:19;:17;:19::i;:::-;52277:16;:44::i;:::-;52272:137;;52342:51;52350:42;;;52342:7;:51::i;:::-;52272:137;52208:201;52454:2;52421:15;:24;52437:7;52421:24;;;;;;;;;;;:30;;;:35;;;;;;;;;;;;;;;;;;52492:7;52488:2;52472:28;;52481:5;52472:28;;;;;;;;;;;;52152:356;52034:474;;;:::o;194362:93::-;194419:7;194446:1;194439:8;;194362:93;:::o;16190:110::-;16248:7;16275:17;16268:24;;16190:110;:::o;24377:2213::-;24444:14;24494:7;24475:15;:13;:15::i;:::-;:26;24471:2054;;24527:17;:26;24545:7;24527:26;;;;;;;;;;;;24518:35;;24584:17;:15;:17::i;:::-;24574:7;:27;24570:183;;;24626:30;24649:6;24626:22;:30::i;:::-;24658:13;24622:49;24690:47;24698:38;;;24690:7;:47::i;:::-;24570:183;24864:1;24854:6;:11;24850:1292;;24901:13;;24890:7;:24;24886:77;;24916:47;24924:38;;;24916:7;:47::i;:::-;24886:77;25520:607;25598:17;:28;25616:9;;;;;;;25598:28;;;;;;;;;;;;25589:37;;25686:1;25676:6;:11;25672:25;25689:8;25672:25;25752:1;11952:8;25724:6;:24;:29;25720:48;25755:13;25720:48;26060:47;26068:38;;;26060:7;:47::i;:::-;25520:607;;;24850:1292;26497:1;11952:8;26469:6;:24;:29;26465:48;26500:13;26465:48;24471:2054;26535:47;26543:38;;;26535:7;:47::i;:::-;24377:2213;;;;:::o;31897:485::-;31999:27;32028:23;32069:38;32110:15;:24;32126:7;32110:24;;;;;;;;;;;32069:65;;32287:18;32264:41;;32344:19;32338:26;32319:45;;32249:126;31897:485;;;:::o;58600:105::-;58660:7;58687:10;58680:17;;58600:105;:::o;31125:659::-;31274:11;31439:16;31432:5;31428:28;31419:37;;31599:16;31588:9;31584:32;31571:45;;31749:15;31738:9;31735:30;31727:5;31716:9;31713:20;31710:56;31700:66;;31125:659;;;;;:::o;38490:159::-;;;;;:::o;57909:311::-;58044:7;58064:16;12356:3;58090:19;:41;;58064:68;;12356:3;58158:31;58169:4;58175:2;58179:9;58158:10;:31::i;:::-;58150:40;;:62;;58143:69;;;57909:311;;;;;:::o;27138:450::-;27218:14;27386:16;27379:5;27375:28;27366:37;;27563:5;27549:11;27524:23;27520:41;27517:52;27510:5;27507:63;27497:73;;27138:450;;;;:::o;39314:158::-;;;;;:::o;63642:166::-;63713:12;:10;:12::i;:::-;63702:23;;:7;:5;:7::i;:::-;:23;;;63698:103;;63776:12;:10;:12::i;:::-;63749:40;;;;;;;;;;;:::i;:::-;;;;;;;;63698:103;63642:166::o;64790:191::-;64864:16;64883:6;;;;;;;;;;;64864:25;;64909:8;64900:6;;:17;;;;;;;;;;;;;;;;;;64964:8;64933:40;;64954:8;64933:40;;;;;;;;;;;;64853:128;64790:191;:::o;41065:2399::-;41138:20;41161:13;;41138:36;;41201:1;41189:8;:13;41185:53;;41204:34;41212:25;;;41204:7;:34::i;:::-;41185:53;41251:61;41281:1;41285:2;41289:12;41303:8;41251:21;:61::i;:::-;41785:139;41822:2;41876:33;41899:1;41903:2;41907:1;41876:14;:33::i;:::-;41843:30;41864:8;41843:20;:30::i;:::-;:66;41785:18;:139::i;:::-;41751:17;:31;41769:12;41751:31;;;;;;;;;;;:173;;;;42211:1;11314:2;42181:1;:26;;42180:32;42168:8;:45;42142:18;:22;42161:2;42142:22;;;;;;;;;;;;;;;;:71;;;;;;;;;;;42324:16;12634:14;42359:2;42343:20;;:39;42324:58;;42415:1;42403:8;:13;42399:54;;42418:35;42426:26;;;42418:7;:35::i;:::-;42399:54;42470:11;42499:8;42484:12;:23;42470:37;;42522:15;42540:12;42522:30;;42583:17;:15;:17::i;:::-;42579:1;42573:3;:7;:27;42569:77;;;42602:44;42610:35;;;42602:7;:44::i;:::-;42569:77;42663:676;43082:7;43038:8;42993:1;42927:25;42864:1;42799;42768:358;43334:3;43321:9;;;;;;:16;42663:676;;43371:3;43355:13;:19;;;;41500:1886;;;43396:60;43425:1;43429:2;43433:12;43447:8;43396:20;:60::i;:::-;41127:2337;41065:2399;;:::o;194463:333::-;194523:7;194543:21;194575:183;194707:1;194693:10;;194645:15;194662:10;194674:13;:11;:13::i;:::-;194628:60;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;194618:71;;;;;;194610:80;;:93;;;;:::i;:::-;194609:99;;;;:::i;:::-;194593:115;;194728:13;:28;194742:13;194728:28;;;;;;;;;;;;;;;;;;;;;194575:183;;194775:13;194768:20;;;194463:333;:::o;52775:89::-;52835:21;52841:7;52850:5;52835;:21::i;:::-;52775:89;:::o;39912:691::-;40075:4;40121:2;40096:45;;;40142:19;:17;:19::i;:::-;40163:4;40169:7;40178:5;40096:88;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;40092:504;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;40396:1;40379:6;:13;:18;40375:115;;40418:56;40426:47;;;40418:7;:56::i;:::-;40375:115;40562:6;40556:13;40547:6;40543:2;40539:15;40532:38;40092:504;40265:54;;;40255:64;;;:6;:64;;;;40248:71;;;39912:691;;;;;;:::o;135705:650::-;135761:13;135812:14;135849:1;135829:17;135840:5;135829:10;:17::i;:::-;:21;135812:38;;135865:20;135899:6;135888:18;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;135865:41;;135921:11;136018:6;136014:2;136010:15;136002:6;135998:28;135991:35;;136055:254;136062:4;136055:254;;;136087:5;;;;;;;;136193:10;136188:2;136181:5;136177:14;136172:32;136167:3;136159:46;136251:2;136242:11;;;;;;:::i;:::-;;;;;136285:1;136276:5;:10;136055:254;136272:21;136055:254;136330:6;136323:13;;;;;135705:650;;;:::o;30681:335::-;30751:11;30981:15;30973:6;30969:28;30950:16;30942:6;30938:29;30935:63;30925:73;;30681:335;;;:::o;57610:147::-;57747:6;57610:147;;;;;:::o;61486:98::-;61539:7;61566:10;61559:17;;61486:98;:::o;27690:324::-;27760:14;27993:1;27983:8;27980:15;27954:24;27950:46;27940:56;;27690:324;;;:::o;53093:3108::-;53173:27;53203;53222:7;53203:18;:27::i;:::-;53173:57;;53243:12;53274:19;53243:52;;53309:27;53338:23;53365:35;53392:7;53365:26;:35::i;:::-;53308:92;;;;53417:13;53413:325;;;53538:68;53563:15;53580:4;53586:19;:17;:19::i;:::-;53538:24;:68::i;:::-;53533:193;;53630:43;53647:4;53653:19;:17;:19::i;:::-;53630:16;:43::i;:::-;53625:101;;53675:51;53683:42;;;53675:7;:51::i;:::-;53625:101;53533:193;53413:325;53750:51;53772:4;53786:1;53790:7;53799:1;53750:21;:51::i;:::-;53894:15;53891:160;;;54034:1;54013:19;54006:30;53891:160;54712:1;11441:3;54682:1;:26;;54681:32;54653:18;:24;54672:4;54653:24;;;;;;;;;;;;;;;;:60;;;;;;;;;;;54980:176;55017:4;55088:53;55103:4;55117:1;55121:19;55088:14;:53::i;:::-;12232:8;11952;55041:43;55040:101;54980:18;:176::i;:::-;54951:17;:26;54969:7;54951:26;;;;;;;;;;;:205;;;;55327:1;12232:8;55276:19;:47;:52;55272:627;;55349:19;55381:1;55371:7;:11;55349:33;;55538:1;55504:17;:30;55522:11;55504:30;;;;;;;;;;;;:35;55500:384;;55642:13;;55627:11;:28;55623:242;;55822:19;55789:17;:30;55807:11;55789:30;;;;;;;;;;;:52;;;;55623:242;55500:384;55330:569;55272:627;55954:7;55950:1;55927:35;;55936:4;55927:35;;;;;;;;;;;;55973:50;55994:4;56008:1;56012:7;56021:1;55973:20;:50::i;:::-;56168:12;;:14;;;;;;;;;;;;;53162:3039;;;;53093:3108;;:::o;129032:948::-;129085:7;129105:14;129122:1;129105:18;;129172:8;129163:5;:17;129159:106;;129210:8;129201:17;;;;;;:::i;:::-;;;;;129247:2;129237:12;;;;129159:106;129292:8;129283:5;:17;129279:106;;129330:8;129321:17;;;;;;:::i;:::-;;;;;129367:2;129357:12;;;;129279:106;129412:8;129403:5;:17;129399:106;;129450:8;129441:17;;;;;;:::i;:::-;;;;;129487:2;129477:12;;;;129399:106;129532:7;129523:5;:16;129519:103;;129569:7;129560:16;;;;;;:::i;:::-;;;;;129605:1;129595:11;;;;129519:103;129649:7;129640:5;:16;129636:103;;129686:7;129677:16;;;;;;:::i;:::-;;;;;129722:1;129712:11;;;;129636:103;129766:7;129757:5;:16;129753:103;;129803:7;129794:16;;;;;;:::i;:::-;;;;;129839:1;129829:11;;;;129753:103;129883:7;129874:5;:16;129870:68;;129921:1;129911:11;;;;129870:68;129966:6;129959:13;;;129032:948;;;:::o;7:75:1:-;40:6;73:2;67:9;57:19;;7:75;:::o;88:117::-;197:1;194;187:12;211:117;320:1;317;310:12;334:149;370:7;410:66;403:5;399:78;388:89;;334:149;;;:::o;489:120::-;561:23;578:5;561:23;:::i;:::-;554:5;551:34;541:62;;599:1;596;589:12;541:62;489:120;:::o;615:137::-;660:5;698:6;685:20;676:29;;714:32;740:5;714:32;:::i;:::-;615:137;;;;:::o;758:327::-;816:6;865:2;853:9;844:7;840:23;836:32;833:119;;;871:79;;:::i;:::-;833:119;991:1;1016:52;1060:7;1051:6;1040:9;1036:22;1016:52;:::i;:::-;1006:62;;962:116;758:327;;;;:::o;1091:90::-;1125:7;1168:5;1161:13;1154:21;1143:32;;1091:90;;;:::o;1187:109::-;1268:21;1283:5;1268:21;:::i;:::-;1263:3;1256:34;1187:109;;:::o;1302:210::-;1389:4;1427:2;1416:9;1412:18;1404:26;;1440:65;1502:1;1491:9;1487:17;1478:6;1440:65;:::i;:::-;1302:210;;;;:::o;1518:99::-;1570:6;1604:5;1598:12;1588:22;;1518:99;;;:::o;1623:169::-;1707:11;1741:6;1736:3;1729:19;1781:4;1776:3;1772:14;1757:29;;1623:169;;;;:::o;1798:139::-;1887:6;1882:3;1877;1871:23;1928:1;1919:6;1914:3;1910:16;1903:27;1798:139;;;:::o;1943:102::-;1984:6;2035:2;2031:7;2026:2;2019:5;2015:14;2011:28;2001:38;;1943:102;;;:::o;2051:377::-;2139:3;2167:39;2200:5;2167:39;:::i;:::-;2222:71;2286:6;2281:3;2222:71;:::i;:::-;2215:78;;2302:65;2360:6;2355:3;2348:4;2341:5;2337:16;2302:65;:::i;:::-;2392:29;2414:6;2392:29;:::i;:::-;2387:3;2383:39;2376:46;;2143:285;2051:377;;;;:::o;2434:313::-;2547:4;2585:2;2574:9;2570:18;2562:26;;2634:9;2628:4;2624:20;2620:1;2609:9;2605:17;2598:47;2662:78;2735:4;2726:6;2662:78;:::i;:::-;2654:86;;2434:313;;;;:::o;2753:77::-;2790:7;2819:5;2808:16;;2753:77;;;:::o;2836:122::-;2909:24;2927:5;2909:24;:::i;:::-;2902:5;2899:35;2889:63;;2948:1;2945;2938:12;2889:63;2836:122;:::o;2964:139::-;3010:5;3048:6;3035:20;3026:29;;3064:33;3091:5;3064:33;:::i;:::-;2964:139;;;;:::o;3109:329::-;3168:6;3217:2;3205:9;3196:7;3192:23;3188:32;3185:119;;;3223:79;;:::i;:::-;3185:119;3343:1;3368:53;3413:7;3404:6;3393:9;3389:22;3368:53;:::i;:::-;3358:63;;3314:117;3109:329;;;;:::o;3444:126::-;3481:7;3521:42;3514:5;3510:54;3499:65;;3444:126;;;:::o;3576:96::-;3613:7;3642:24;3660:5;3642:24;:::i;:::-;3631:35;;3576:96;;;:::o;3678:118::-;3765:24;3783:5;3765:24;:::i;:::-;3760:3;3753:37;3678:118;;:::o;3802:222::-;3895:4;3933:2;3922:9;3918:18;3910:26;;3946:71;4014:1;4003:9;3999:17;3990:6;3946:71;:::i;:::-;3802:222;;;;:::o;4030:122::-;4103:24;4121:5;4103:24;:::i;:::-;4096:5;4093:35;4083:63;;4142:1;4139;4132:12;4083:63;4030:122;:::o;4158:139::-;4204:5;4242:6;4229:20;4220:29;;4258:33;4285:5;4258:33;:::i;:::-;4158:139;;;;:::o;4303:474::-;4371:6;4379;4428:2;4416:9;4407:7;4403:23;4399:32;4396:119;;;4434:79;;:::i;:::-;4396:119;4554:1;4579:53;4624:7;4615:6;4604:9;4600:22;4579:53;:::i;:::-;4569:63;;4525:117;4681:2;4707:53;4752:7;4743:6;4732:9;4728:22;4707:53;:::i;:::-;4697:63;;4652:118;4303:474;;;;;:::o;4783:118::-;4870:24;4888:5;4870:24;:::i;:::-;4865:3;4858:37;4783:118;;:::o;4907:222::-;5000:4;5038:2;5027:9;5023:18;5015:26;;5051:71;5119:1;5108:9;5104:17;5095:6;5051:71;:::i;:::-;4907:222;;;;:::o;5135:619::-;5212:6;5220;5228;5277:2;5265:9;5256:7;5252:23;5248:32;5245:119;;;5283:79;;:::i;:::-;5245:119;5403:1;5428:53;5473:7;5464:6;5453:9;5449:22;5428:53;:::i;:::-;5418:63;;5374:117;5530:2;5556:53;5601:7;5592:6;5581:9;5577:22;5556:53;:::i;:::-;5546:63;;5501:118;5658:2;5684:53;5729:7;5720:6;5709:9;5705:22;5684:53;:::i;:::-;5674:63;;5629:118;5135:619;;;;;:::o;5760:117::-;5869:1;5866;5859:12;5883:117;5992:1;5989;5982:12;6006:180;6054:77;6051:1;6044:88;6151:4;6148:1;6141:15;6175:4;6172:1;6165:15;6192:281;6275:27;6297:4;6275:27;:::i;:::-;6267:6;6263:40;6405:6;6393:10;6390:22;6369:18;6357:10;6354:34;6351:62;6348:88;;;6416:18;;:::i;:::-;6348:88;6456:10;6452:2;6445:22;6235:238;6192:281;;:::o;6479:129::-;6513:6;6540:20;;:::i;:::-;6530:30;;6569:33;6597:4;6589:6;6569:33;:::i;:::-;6479:129;;;:::o;6614:308::-;6676:4;6766:18;6758:6;6755:30;6752:56;;;6788:18;;:::i;:::-;6752:56;6826:29;6848:6;6826:29;:::i;:::-;6818:37;;6910:4;6904;6900:15;6892:23;;6614:308;;;:::o;6928:148::-;7026:6;7021:3;7016;7003:30;7067:1;7058:6;7053:3;7049:16;7042:27;6928:148;;;:::o;7082:425::-;7160:5;7185:66;7201:49;7243:6;7201:49;:::i;:::-;7185:66;:::i;:::-;7176:75;;7274:6;7267:5;7260:21;7312:4;7305:5;7301:16;7350:3;7341:6;7336:3;7332:16;7329:25;7326:112;;;7357:79;;:::i;:::-;7326:112;7447:54;7494:6;7489:3;7484;7447:54;:::i;:::-;7166:341;7082:425;;;;;:::o;7527:340::-;7583:5;7632:3;7625:4;7617:6;7613:17;7609:27;7599:122;;7640:79;;:::i;:::-;7599:122;7757:6;7744:20;7782:79;7857:3;7849:6;7842:4;7834:6;7830:17;7782:79;:::i;:::-;7773:88;;7589:278;7527:340;;;;:::o;7873:509::-;7942:6;7991:2;7979:9;7970:7;7966:23;7962:32;7959:119;;;7997:79;;:::i;:::-;7959:119;8145:1;8134:9;8130:17;8117:31;8175:18;8167:6;8164:30;8161:117;;;8197:79;;:::i;:::-;8161:117;8302:63;8357:7;8348:6;8337:9;8333:22;8302:63;:::i;:::-;8292:73;;8088:287;7873:509;;;;:::o;8388:329::-;8447:6;8496:2;8484:9;8475:7;8471:23;8467:32;8464:119;;;8502:79;;:::i;:::-;8464:119;8622:1;8647:53;8692:7;8683:6;8672:9;8668:22;8647:53;:::i;:::-;8637:63;;8593:117;8388:329;;;;:::o;8723:116::-;8793:21;8808:5;8793:21;:::i;:::-;8786:5;8783:32;8773:60;;8829:1;8826;8819:12;8773:60;8723:116;:::o;8845:133::-;8888:5;8926:6;8913:20;8904:29;;8942:30;8966:5;8942:30;:::i;:::-;8845:133;;;;:::o;8984:468::-;9049:6;9057;9106:2;9094:9;9085:7;9081:23;9077:32;9074:119;;;9112:79;;:::i;:::-;9074:119;9232:1;9257:53;9302:7;9293:6;9282:9;9278:22;9257:53;:::i;:::-;9247:63;;9203:117;9359:2;9385:50;9427:7;9418:6;9407:9;9403:22;9385:50;:::i;:::-;9375:60;;9330:115;8984:468;;;;;:::o;9458:117::-;9567:1;9564;9557:12;9581:117;9690:1;9687;9680:12;9721:568;9794:8;9804:6;9854:3;9847:4;9839:6;9835:17;9831:27;9821:122;;9862:79;;:::i;:::-;9821:122;9975:6;9962:20;9952:30;;10005:18;9997:6;9994:30;9991:117;;;10027:79;;:::i;:::-;9991:117;10141:4;10133:6;10129:17;10117:29;;10195:3;10187:4;10179:6;10175:17;10165:8;10161:32;10158:41;10155:128;;;10202:79;;:::i;:::-;10155:128;9721:568;;;;;:::o;10295:559::-;10381:6;10389;10438:2;10426:9;10417:7;10413:23;10409:32;10406:119;;;10444:79;;:::i;:::-;10406:119;10592:1;10581:9;10577:17;10564:31;10622:18;10614:6;10611:30;10608:117;;;10644:79;;:::i;:::-;10608:117;10757:80;10829:7;10820:6;10809:9;10805:22;10757:80;:::i;:::-;10739:98;;;;10535:312;10295:559;;;;;:::o;10860:307::-;10921:4;11011:18;11003:6;11000:30;10997:56;;;11033:18;;:::i;:::-;10997:56;11071:29;11093:6;11071:29;:::i;:::-;11063:37;;11155:4;11149;11145:15;11137:23;;10860:307;;;:::o;11173:423::-;11250:5;11275:65;11291:48;11332:6;11291:48;:::i;:::-;11275:65;:::i;:::-;11266:74;;11363:6;11356:5;11349:21;11401:4;11394:5;11390:16;11439:3;11430:6;11425:3;11421:16;11418:25;11415:112;;;11446:79;;:::i;:::-;11415:112;11536:54;11583:6;11578:3;11573;11536:54;:::i;:::-;11256:340;11173:423;;;;;:::o;11615:338::-;11670:5;11719:3;11712:4;11704:6;11700:17;11696:27;11686:122;;11727:79;;:::i;:::-;11686:122;11844:6;11831:20;11869:78;11943:3;11935:6;11928:4;11920:6;11916:17;11869:78;:::i;:::-;11860:87;;11676:277;11615:338;;;;:::o;11959:943::-;12054:6;12062;12070;12078;12127:3;12115:9;12106:7;12102:23;12098:33;12095:120;;;12134:79;;:::i;:::-;12095:120;12254:1;12279:53;12324:7;12315:6;12304:9;12300:22;12279:53;:::i;:::-;12269:63;;12225:117;12381:2;12407:53;12452:7;12443:6;12432:9;12428:22;12407:53;:::i;:::-;12397:63;;12352:118;12509:2;12535:53;12580:7;12571:6;12560:9;12556:22;12535:53;:::i;:::-;12525:63;;12480:118;12665:2;12654:9;12650:18;12637:32;12696:18;12688:6;12685:30;12682:117;;;12718:79;;:::i;:::-;12682:117;12823:62;12877:7;12868:6;12857:9;12853:22;12823:62;:::i;:::-;12813:72;;12608:287;11959:943;;;;;;;:::o;12908:474::-;12976:6;12984;13033:2;13021:9;13012:7;13008:23;13004:32;13001:119;;;13039:79;;:::i;:::-;13001:119;13159:1;13184:53;13229:7;13220:6;13209:9;13205:22;13184:53;:::i;:::-;13174:63;;13130:117;13286:2;13312:53;13357:7;13348:6;13337:9;13333:22;13312:53;:::i;:::-;13302:63;;13257:118;12908:474;;;;;:::o;13388:180::-;13436:77;13433:1;13426:88;13533:4;13530:1;13523:15;13557:4;13554:1;13547:15;13574:320;13618:6;13655:1;13649:4;13645:12;13635:22;;13702:1;13696:4;13692:12;13723:18;13713:81;;13779:4;13771:6;13767:17;13757:27;;13713:81;13841:2;13833:6;13830:14;13810:18;13807:38;13804:84;;13860:18;;:::i;:::-;13804:84;13625:269;13574:320;;;:::o;13900:147::-;14001:11;14038:3;14023:18;;13900:147;;;;:::o;14053:114::-;;:::o;14173:398::-;14332:3;14353:83;14434:1;14429:3;14353:83;:::i;:::-;14346:90;;14445:93;14534:3;14445:93;:::i;:::-;14563:1;14558:3;14554:11;14547:18;;14173:398;;;:::o;14577:379::-;14761:3;14783:147;14926:3;14783:147;:::i;:::-;14776:154;;14947:3;14940:10;;14577:379;;;:::o;14962:182::-;15102:34;15098:1;15090:6;15086:14;15079:58;14962:182;:::o;15150:366::-;15292:3;15313:67;15377:2;15372:3;15313:67;:::i;:::-;15306:74;;15389:93;15478:3;15389:93;:::i;:::-;15507:2;15502:3;15498:12;15491:19;;15150:366;;;:::o;15522:419::-;15688:4;15726:2;15715:9;15711:18;15703:26;;15775:9;15769:4;15765:20;15761:1;15750:9;15746:17;15739:47;15803:131;15929:4;15803:131;:::i;:::-;15795:139;;15522:419;;;:::o;15947:141::-;15996:4;16019:3;16011:11;;16042:3;16039:1;16032:14;16076:4;16073:1;16063:18;16055:26;;15947:141;;;:::o;16094:93::-;16131:6;16178:2;16173;16166:5;16162:14;16158:23;16148:33;;16094:93;;;:::o;16193:107::-;16237:8;16287:5;16281:4;16277:16;16256:37;;16193:107;;;;:::o;16306:393::-;16375:6;16425:1;16413:10;16409:18;16448:97;16478:66;16467:9;16448:97;:::i;:::-;16566:39;16596:8;16585:9;16566:39;:::i;:::-;16554:51;;16638:4;16634:9;16627:5;16623:21;16614:30;;16687:4;16677:8;16673:19;16666:5;16663:30;16653:40;;16382:317;;16306:393;;;;;:::o;16705:60::-;16733:3;16754:5;16747:12;;16705:60;;;:::o;16771:142::-;16821:9;16854:53;16872:34;16881:24;16899:5;16881:24;:::i;:::-;16872:34;:::i;:::-;16854:53;:::i;:::-;16841:66;;16771:142;;;:::o;16919:75::-;16962:3;16983:5;16976:12;;16919:75;;;:::o;17000:269::-;17110:39;17141:7;17110:39;:::i;:::-;17171:91;17220:41;17244:16;17220:41;:::i;:::-;17212:6;17205:4;17199:11;17171:91;:::i;:::-;17165:4;17158:105;17076:193;17000:269;;;:::o;17275:73::-;17320:3;17275:73;:::o;17354:189::-;17431:32;;:::i;:::-;17472:65;17530:6;17522;17516:4;17472:65;:::i;:::-;17407:136;17354:189;;:::o;17549:186::-;17609:120;17626:3;17619:5;17616:14;17609:120;;;17680:39;17717:1;17710:5;17680:39;:::i;:::-;17653:1;17646:5;17642:13;17633:22;;17609:120;;;17549:186;;:::o;17741:543::-;17842:2;17837:3;17834:11;17831:446;;;17876:38;17908:5;17876:38;:::i;:::-;17960:29;17978:10;17960:29;:::i;:::-;17950:8;17946:44;18143:2;18131:10;18128:18;18125:49;;;18164:8;18149:23;;18125:49;18187:80;18243:22;18261:3;18243:22;:::i;:::-;18233:8;18229:37;18216:11;18187:80;:::i;:::-;17846:431;;17831:446;17741:543;;;:::o;18290:117::-;18344:8;18394:5;18388:4;18384:16;18363:37;;18290:117;;;;:::o;18413:169::-;18457:6;18490:51;18538:1;18534:6;18526:5;18523:1;18519:13;18490:51;:::i;:::-;18486:56;18571:4;18565;18561:15;18551:25;;18464:118;18413:169;;;;:::o;18587:295::-;18663:4;18809:29;18834:3;18828:4;18809:29;:::i;:::-;18801:37;;18871:3;18868:1;18864:11;18858:4;18855:21;18847:29;;18587:295;;;;:::o;18887:1395::-;19004:37;19037:3;19004:37;:::i;:::-;19106:18;19098:6;19095:30;19092:56;;;19128:18;;:::i;:::-;19092:56;19172:38;19204:4;19198:11;19172:38;:::i;:::-;19257:67;19317:6;19309;19303:4;19257:67;:::i;:::-;19351:1;19375:4;19362:17;;19407:2;19399:6;19396:14;19424:1;19419:618;;;;20081:1;20098:6;20095:77;;;20147:9;20142:3;20138:19;20132:26;20123:35;;20095:77;20198:67;20258:6;20251:5;20198:67;:::i;:::-;20192:4;20185:81;20054:222;19389:887;;19419:618;19471:4;19467:9;19459:6;19455:22;19505:37;19537:4;19505:37;:::i;:::-;19564:1;19578:208;19592:7;19589:1;19586:14;19578:208;;;19671:9;19666:3;19662:19;19656:26;19648:6;19641:42;19722:1;19714:6;19710:14;19700:24;;19769:2;19758:9;19754:18;19741:31;;19615:4;19612:1;19608:12;19603:17;;19578:208;;;19814:6;19805:7;19802:19;19799:179;;;19872:9;19867:3;19863:19;19857:26;19915:48;19957:4;19949:6;19945:17;19934:9;19915:48;:::i;:::-;19907:6;19900:64;19822:156;19799:179;20024:1;20020;20012:6;20008:14;20004:22;19998:4;19991:36;19426:611;;;19389:887;;18979:1303;;;18887:1395;;:::o;20288:180::-;20336:77;20333:1;20326:88;20433:4;20430:1;20423:15;20457:4;20454:1;20447:15;20474:191;20514:3;20533:20;20551:1;20533:20;:::i;:::-;20528:25;;20567:20;20585:1;20567:20;:::i;:::-;20562:25;;20610:1;20607;20603:9;20596:16;;20631:3;20628:1;20625:10;20622:36;;;20638:18;;:::i;:::-;20622:36;20474:191;;;;:::o;20671:168::-;20811:20;20807:1;20799:6;20795:14;20788:44;20671:168;:::o;20845:366::-;20987:3;21008:67;21072:2;21067:3;21008:67;:::i;:::-;21001:74;;21084:93;21173:3;21084:93;:::i;:::-;21202:2;21197:3;21193:12;21186:19;;20845:366;;;:::o;21217:419::-;21383:4;21421:2;21410:9;21406:18;21398:26;;21470:9;21464:4;21460:20;21456:1;21445:9;21441:17;21434:47;21498:131;21624:4;21498:131;:::i;:::-;21490:139;;21217:419;;;:::o;21642:168::-;21782:20;21778:1;21770:6;21766:14;21759:44;21642:168;:::o;21816:366::-;21958:3;21979:67;22043:2;22038:3;21979:67;:::i;:::-;21972:74;;22055:93;22144:3;22055:93;:::i;:::-;22173:2;22168:3;22164:12;22157:19;;21816:366;;;:::o;22188:419::-;22354:4;22392:2;22381:9;22377:18;22369:26;;22441:9;22435:4;22431:20;22427:1;22416:9;22412:17;22405:47;22469:131;22595:4;22469:131;:::i;:::-;22461:139;;22188:419;;;:::o;22613:181::-;22753:33;22749:1;22741:6;22737:14;22730:57;22613:181;:::o;22800:366::-;22942:3;22963:67;23027:2;23022:3;22963:67;:::i;:::-;22956:74;;23039:93;23128:3;23039:93;:::i;:::-;23157:2;23152:3;23148:12;23141:19;;22800:366;;;:::o;23172:419::-;23338:4;23376:2;23365:9;23361:18;23353:26;;23425:9;23419:4;23415:20;23411:1;23400:9;23396:17;23389:47;23453:131;23579:4;23453:131;:::i;:::-;23445:139;;23172:419;;;:::o;23597:171::-;23737:23;23733:1;23725:6;23721:14;23714:47;23597:171;:::o;23774:366::-;23916:3;23937:67;24001:2;23996:3;23937:67;:::i;:::-;23930:74;;24013:93;24102:3;24013:93;:::i;:::-;24131:2;24126:3;24122:12;24115:19;;23774:366;;;:::o;24146:419::-;24312:4;24350:2;24339:9;24335:18;24327:26;;24399:9;24393:4;24389:20;24385:1;24374:9;24370:17;24363:47;24427:131;24553:4;24427:131;:::i;:::-;24419:139;;24146:419;;;:::o;24571:410::-;24611:7;24634:20;24652:1;24634:20;:::i;:::-;24629:25;;24668:20;24686:1;24668:20;:::i;:::-;24663:25;;24723:1;24720;24716:9;24745:30;24763:11;24745:30;:::i;:::-;24734:41;;24924:1;24915:7;24911:15;24908:1;24905:22;24885:1;24878:9;24858:83;24835:139;;24954:18;;:::i;:::-;24835:139;24619:362;24571:410;;;;:::o;24987:177::-;25127:29;25123:1;25115:6;25111:14;25104:53;24987:177;:::o;25170:366::-;25312:3;25333:67;25397:2;25392:3;25333:67;:::i;:::-;25326:74;;25409:93;25498:3;25409:93;:::i;:::-;25527:2;25522:3;25518:12;25511:19;;25170:366;;;:::o;25542:419::-;25708:4;25746:2;25735:9;25731:18;25723:26;;25795:9;25789:4;25785:20;25781:1;25770:9;25766:17;25759:47;25823:131;25949:4;25823:131;:::i;:::-;25815:139;;25542:419;;;:::o;25967:180::-;26015:77;26012:1;26005:88;26112:4;26109:1;26102:15;26136:4;26133:1;26126:15;26153:170;26293:22;26289:1;26281:6;26277:14;26270:46;26153:170;:::o;26329:366::-;26471:3;26492:67;26556:2;26551:3;26492:67;:::i;:::-;26485:74;;26568:93;26657:3;26568:93;:::i;:::-;26686:2;26681:3;26677:12;26670:19;;26329:366;;;:::o;26701:419::-;26867:4;26905:2;26894:9;26890:18;26882:26;;26954:9;26948:4;26944:20;26940:1;26929:9;26925:17;26918:47;26982:131;27108:4;26982:131;:::i;:::-;26974:139;;26701:419;;;:::o;27126:184::-;27225:11;27259:6;27254:3;27247:19;27299:4;27294:3;27290:14;27275:29;;27126:184;;;;:::o;27316:117::-;27425:1;27422;27415:12;27439:99;27524:6;27519:3;27514;27501:30;27439:99;;;:::o;27574:537::-;27702:3;27723:86;27802:6;27797:3;27723:86;:::i;:::-;27716:93;;27833:66;27825:6;27822:78;27819:165;;;27903:79;;:::i;:::-;27819:165;28015:4;28007:6;28003:17;27993:27;;28030:43;28066:6;28061:3;28054:5;28030:43;:::i;:::-;28098:6;28093:3;28089:16;28082:23;;27574:537;;;;;:::o;28117:393::-;28270:4;28308:2;28297:9;28293:18;28285:26;;28357:9;28351:4;28347:20;28343:1;28332:9;28328:17;28321:47;28385:118;28498:4;28489:6;28481;28385:118;:::i;:::-;28377:126;;28117:393;;;;;:::o;28516:181::-;28656:33;28652:1;28644:6;28640:14;28633:57;28516:181;:::o;28703:366::-;28845:3;28866:67;28930:2;28925:3;28866:67;:::i;:::-;28859:74;;28942:93;29031:3;28942:93;:::i;:::-;29060:2;29055:3;29051:12;29044:19;;28703:366;;;:::o;29075:419::-;29241:4;29279:2;29268:9;29264:18;29256:26;;29328:9;29322:4;29318:20;29314:1;29303:9;29299:17;29292:47;29356:131;29482:4;29356:131;:::i;:::-;29348:139;;29075:419;;;:::o;29500:148::-;29602:11;29639:3;29624:18;;29500:148;;;;:::o;29678:874::-;29781:3;29818:5;29812:12;29847:36;29873:9;29847:36;:::i;:::-;29899:89;29981:6;29976:3;29899:89;:::i;:::-;29892:96;;30019:1;30008:9;30004:17;30035:1;30030:166;;;;30210:1;30205:341;;;;29997:549;;30030:166;30114:4;30110:9;30099;30095:25;30090:3;30083:38;30176:6;30169:14;30162:22;30154:6;30150:35;30145:3;30141:45;30134:52;;30030:166;;30205:341;30272:38;30304:5;30272:38;:::i;:::-;30332:1;30346:154;30360:6;30357:1;30354:13;30346:154;;;30434:7;30428:14;30424:1;30419:3;30415:11;30408:35;30484:1;30475:7;30471:15;30460:26;;30382:4;30379:1;30375:12;30370:17;;30346:154;;;30529:6;30524:3;30520:16;30513:23;;30212:334;;29997:549;;29785:767;;29678:874;;;;:::o;30558:390::-;30664:3;30692:39;30725:5;30692:39;:::i;:::-;30747:89;30829:6;30824:3;30747:89;:::i;:::-;30740:96;;30845:65;30903:6;30898:3;30891:4;30884:5;30880:16;30845:65;:::i;:::-;30935:6;30930:3;30926:16;30919:23;;30668:280;30558:390;;;;:::o;30954:155::-;31094:7;31090:1;31082:6;31078:14;31071:31;30954:155;:::o;31115:400::-;31275:3;31296:84;31378:1;31373:3;31296:84;:::i;:::-;31289:91;;31389:93;31478:3;31389:93;:::i;:::-;31507:1;31502:3;31498:11;31491:18;;31115:400;;;:::o;31521:695::-;31799:3;31821:92;31909:3;31900:6;31821:92;:::i;:::-;31814:99;;31930:95;32021:3;32012:6;31930:95;:::i;:::-;31923:102;;32042:148;32186:3;32042:148;:::i;:::-;32035:155;;32207:3;32200:10;;31521:695;;;;;:::o;32222:171::-;32261:3;32284:24;32302:5;32284:24;:::i;:::-;32275:33;;32330:4;32323:5;32320:15;32317:41;;32338:18;;:::i;:::-;32317:41;32385:1;32378:5;32374:13;32367:20;;32222:171;;;:::o;32399:79::-;32438:7;32467:5;32456:16;;32399:79;;;:::o;32484:157::-;32589:45;32609:24;32627:5;32609:24;:::i;:::-;32589:45;:::i;:::-;32584:3;32577:58;32484:157;;:::o;32647:94::-;32680:8;32728:5;32724:2;32720:14;32699:35;;32647:94;;;:::o;32747:::-;32786:7;32815:20;32829:5;32815:20;:::i;:::-;32804:31;;32747:94;;;:::o;32847:100::-;32886:7;32915:26;32935:5;32915:26;:::i;:::-;32904:37;;32847:100;;;:::o;32953:157::-;33058:45;33078:24;33096:5;33078:24;:::i;:::-;33058:45;:::i;:::-;33053:3;33046:58;32953:157;;:::o;33116:538::-;33284:3;33299:75;33370:3;33361:6;33299:75;:::i;:::-;33399:2;33394:3;33390:12;33383:19;;33412:75;33483:3;33474:6;33412:75;:::i;:::-;33512:2;33507:3;33503:12;33496:19;;33525:75;33596:3;33587:6;33525:75;:::i;:::-;33625:2;33620:3;33616:12;33609:19;;33645:3;33638:10;;33116:538;;;;;;:::o;33660:180::-;33708:77;33705:1;33698:88;33805:4;33802:1;33795:15;33829:4;33826:1;33819:15;33846:176;33878:1;33895:20;33913:1;33895:20;:::i;:::-;33890:25;;33929:20;33947:1;33929:20;:::i;:::-;33924:25;;33968:1;33958:35;;33973:18;;:::i;:::-;33958:35;34014:1;34011;34007:9;34002:14;;33846:176;;;;:::o;34028:98::-;34079:6;34113:5;34107:12;34097:22;;34028:98;;;:::o;34132:168::-;34215:11;34249:6;34244:3;34237:19;34289:4;34284:3;34280:14;34265:29;;34132:168;;;;:::o;34306:373::-;34392:3;34420:38;34452:5;34420:38;:::i;:::-;34474:70;34537:6;34532:3;34474:70;:::i;:::-;34467:77;;34553:65;34611:6;34606:3;34599:4;34592:5;34588:16;34553:65;:::i;:::-;34643:29;34665:6;34643:29;:::i;:::-;34638:3;34634:39;34627:46;;34396:283;34306:373;;;;:::o;34685:640::-;34880:4;34918:3;34907:9;34903:19;34895:27;;34932:71;35000:1;34989:9;34985:17;34976:6;34932:71;:::i;:::-;35013:72;35081:2;35070:9;35066:18;35057:6;35013:72;:::i;:::-;35095;35163:2;35152:9;35148:18;35139:6;35095:72;:::i;:::-;35214:9;35208:4;35204:20;35199:2;35188:9;35184:18;35177:48;35242:76;35313:4;35304:6;35242:76;:::i;:::-;35234:84;;34685:640;;;;;;;:::o;35331:141::-;35387:5;35418:6;35412:13;35403:22;;35434:32;35460:5;35434:32;:::i;:::-;35331:141;;;;:::o;35478:349::-;35547:6;35596:2;35584:9;35575:7;35571:23;35567:32;35564:119;;;35602:79;;:::i;:::-;35564:119;35722:1;35747:63;35802:7;35793:6;35782:9;35778:22;35747:63;:::i;:::-;35737:73;;35693:127;35478:349;;;;:::o
Swarm Source
ipfs://30cf30062aaeca0877c2cc8082e9031569df0ac4f5398add8863d7e566d45bc9
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.