Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 376 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Claim | 24563720 | 3 days ago | IN | 0 ETH | 0.00026211 | ||||
| Claim | 24446843 | 19 days ago | IN | 0 ETH | 0.00000515 | ||||
| Claim | 22940790 | 230 days ago | IN | 0 ETH | 0.00125651 | ||||
| Claim | 22875288 | 239 days ago | IN | 0 ETH | 0.00038695 | ||||
| Claim | 22780136 | 252 days ago | IN | 0 ETH | 0.00059263 | ||||
| Claim | 22742770 | 257 days ago | IN | 0 ETH | 0.00006102 | ||||
| Claim | 22742768 | 257 days ago | IN | 0 ETH | 0.00006134 | ||||
| Claim | 22742752 | 257 days ago | IN | 0 ETH | 0.00005049 | ||||
| Claim | 22701195 | 263 days ago | IN | 0 ETH | 0.0003022 | ||||
| Claim | 22655508 | 270 days ago | IN | 0 ETH | 0.00037606 | ||||
| Claim | 22517958 | 289 days ago | IN | 0 ETH | 0.00039061 | ||||
| Claim | 22496685 | 292 days ago | IN | 0 ETH | 0.0007035 | ||||
| Claim | 22494046 | 292 days ago | IN | 0 ETH | 0.00037897 | ||||
| Claim | 22494041 | 292 days ago | IN | 0 ETH | 0.00045374 | ||||
| Claim | 22494030 | 292 days ago | IN | 0 ETH | 0.00043734 | ||||
| Claim | 22387218 | 307 days ago | IN | 0 ETH | 0.00029033 | ||||
| Claim | 22374837 | 309 days ago | IN | 0 ETH | 0.00039146 | ||||
| Claim | 22374835 | 309 days ago | IN | 0 ETH | 0.00032274 | ||||
| Claim | 22374832 | 309 days ago | IN | 0 ETH | 0.0003809 | ||||
| Claim | 22374830 | 309 days ago | IN | 0 ETH | 0.00032286 | ||||
| Claim | 22349287 | 313 days ago | IN | 0 ETH | 0.00029651 | ||||
| Claim | 22323709 | 316 days ago | IN | 0 ETH | 0.0000919 | ||||
| Claim | 22313164 | 318 days ago | IN | 0 ETH | 0.00035052 | ||||
| Claim | 22300953 | 319 days ago | IN | 0 ETH | 0.00034725 | ||||
| Claim | 22298625 | 320 days ago | IN | 0 ETH | 0.00003539 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
NEW_AGE
Compiler Version
v0.8.25+commit.b61c2a91
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./ERC721Psi.sol";
interface ContractNTP {
function ownerOf(uint256 _tokenId) external view returns (address);
function walletOfOwner(address _address)
external
view
returns (uint256[] memory);
}
interface ContractStake {
function getUserStakedTokensNTP(address _address)
external
view
returns (uint256[] memory);
}
interface ContractRegistory {
function account(
address implementation,
uint256 chainId,
address tokenContract,
uint256 tokenId,
uint256 salt
) external view returns (address);
function created(uint256 tokenId) external view returns (bool);
}
contract NEW_AGE is ERC721Psi, Ownable, ReentrancyGuard {
using Strings for uint256;
bool private individual = false;
mapping(uint256 => uint256) public character;
mapping(uint256 => string) private _unificationURI;
string private _baseTokenURI;
mapping(uint256 => bool) public claimed;
bool public claimStart = true;
address private ContractAddressNTP =
0xA65bA71d653f62c64d97099b58D25a955Eb374a0;
address private ContractAddressStake =
0x493ed2537Be3a2AA380d63f943220616f27b6a78;
address private ContractAddressRegistory =
0x9eb8788BEA8BEeb00427b3cBFA826048C0B4b343;
address private ContractAccount =
0xb032ca260b1CaBd144f47825c6AE32fB3026F12C;
constructor()
ERC721Psi("NEW AGE", "NA")
Ownable(msg.sender)
{
setUnificationURI(
0,
"ipfs://bafkreiaaoue6tu6kaftpptjarvf3pj72u7l37q7cghbkpchsq77e6zawbe"
);
setUnificationURI(
1,
"ipfs://bafkreidssfhytk5n6lklbfsi2xnhiwe24l4erw2mkurvrijyj63th7vhym"
);
}
// URI
function _baseURI() internal view virtual override returns (string memory) {
return _baseTokenURI;
}
function tokenURI(uint256 _tokenId)
public
view
virtual
override(ERC721Psi)
returns (string memory)
{
if (individual) {
return
string(abi.encodePacked(ERC721Psi.tokenURI(_tokenId), ".json"));
} else {
uint256 _characterType = character[_tokenId];
string memory _characterTypeURI = _unificationURI[_characterType];
return _characterTypeURI;
}
}
// ownedNTP
function sortAscending(uint256[] memory arr) internal pure {
for (uint256 i = 0; i < arr.length; i++) {
for (uint256 j = i + 1; j < arr.length; j++) {
if (arr[i] > arr[j]) {
uint256 temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
}
}
function getHoldNTP(address _address)
public
view
returns (uint256[] memory)
{
uint256[] memory holdToken = getWalletOfOwnerNTP(_address);
uint256[] memory stakeToken = getWalletOfStakeToken(_address);
uint256[] memory result = new uint256[](
holdToken.length + stakeToken.length
);
uint256 index = 0;
for (uint256 i = 0; i < holdToken.length; i++) {
result[index] = holdToken[i];
index++;
}
for (uint256 j = 0; j < stakeToken.length; j++) {
result[index] = stakeToken[j];
index++;
}
sortAscending(result);
return result;
}
// claim
function claim(uint256 _NTPid, uint256 _characterType) public nonReentrant {
bool claimedID = claimed[_NTPid];
address _to = getTBA(
ContractAccount,
1,
ContractAddressNTP,
_NTPid,
0
);
require(claimStart, "Before begin.");
require(!claimedID, "NTP ID already claimed");
_safeMint(_to, 1);
uint256 supply = totalSupply();
character[supply] = _characterType;
claimed[_NTPid] = true;
}
// SBT
function _beforeTokenTransfers(
address from,
address to,
uint256 tokenId,
uint256
) internal virtual override {
require(
from == address(0) || to == address(0),
"Err: token is SOUL BOUND"
);
super._beforeTokenTransfers(from, to, tokenId, 1);
}
// set
function setClaimStart(bool _state) public onlyOwner {
claimStart = _state;
}
function setIndividual(bool bool_) public onlyOwner {
individual = bool_;
}
function setBaseURI(string calldata _uri) public onlyOwner {
_baseTokenURI = _uri;
}
function setUnificationURI(uint256 _characterType, string memory _uri)
public
onlyOwner
{
_unificationURI[_characterType] = _uri;
}
// NTP Contract
function getOwnerOfNTP(uint256 _tokenId) public view returns (address) {
address holder = ContractNTP(ContractAddressNTP).ownerOf(_tokenId);
return holder;
}
function getWalletOfOwnerNTP(address _address)
public
view
returns (uint256[] memory)
{
uint256[] memory walletOfOwner = ContractNTP(ContractAddressNTP)
.walletOfOwner(_address);
return walletOfOwner;
}
// Stake Contract
function getWalletOfStakeToken(address _address)
public
view
returns (uint256[] memory)
{
uint256[] memory walletOfStake = ContractStake(ContractAddressStake)
.getUserStakedTokensNTP(_address);
return walletOfStake;
}
// Registory Contract
function getTBA(
address implementation,
uint256 chainId,
address tokenContract,
uint256 tokenId,
uint256 salt
) public view returns (address) {
address TBA = ContractRegistory(ContractAddressRegistory).account(
implementation,
chainId,
tokenContract,
tokenId,
salt
);
return TBA;
}
function getCreated(uint256 tokenId) public view returns (bool) {
bool created = ContractRegistory(ContractAddressRegistory).created(
tokenId
);
return created;
}
}
// Code by lettuce908// SPDX-License-Identifier: MIT /** ______ _____ _____ ______ ___ __ _ _ _ | ____| __ \ / ____|____ |__ \/_ | || || | | |__ | |__) | | / / ) || | \| |/ | | __| | _ /| | / / / / | |\_ _/ | |____| | \ \| |____ / / / /_ | | | | |______|_| \_\\_____|/_/ |____||_| |_| */ pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/[email protected]/utils/Address.sol"; import "@openzeppelin/contracts/utils/StorageSlot.sol"; import "solidity-bits/contracts/BitMaps.sol"; contract ERC721Psi is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; using BitMaps for BitMaps.BitMap; BitMaps.BitMap private _batchHead; string private _name; string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) internal _owners; uint256 internal _minted = 1; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint) { require(owner != address(0), "ERC721Psi: balance query for the zero address"); uint count; for( uint i = 1; i < _minted; ++i ){ if(_exists(i)){ if( owner == ownerOf(i)){ ++count; } } } return count; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { (address owner, ) = _ownerAndBatchHeadOf(tokenId); return owner; } function _ownerAndBatchHeadOf(uint256 tokenId) internal view returns (address owner, uint256 tokenIdBatchHead){ require(_exists(tokenId), "ERC721Psi: owner query for nonexistent token"); tokenIdBatchHead = _getBatchHead(tokenId); owner = _owners[tokenIdBatchHead]; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Psi: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); require(to != owner, "ERC721Psi: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721Psi: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require( _exists(tokenId), "ERC721Psi: approved query for nonexistent token" ); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721Psi: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721Psi: transfer caller is not owner nor approved" ); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721Psi: transfer caller is not owner nor approved" ); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require( _checkOnERC721Received(from, to, tokenId, 1,_data), "ERC721Psi: transfer to non ERC721Receiver implementer" ); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return tokenId < _minted; } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require( _exists(tokenId), "ERC721Psi: operator query for nonexistent token" ); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @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. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 quantity) internal virtual { _safeMint(to, quantity, ""); } function _safeMint( address to, uint256 quantity, bytes memory _data ) internal virtual { uint256 startTokenId = _minted; _mint(to, quantity); require( _checkOnERC721Received(address(0), to, startTokenId, quantity, _data), "ERC721Psi: transfer to non ERC721Receiver implementer" ); } function _mint( address to, uint256 quantity ) internal virtual { uint256 tokenIdBatchHead = _minted; require(quantity > 0, "ERC721Psi: quantity must be greater 0"); require(to != address(0), "ERC721Psi: mint to the zero address"); _beforeTokenTransfers(address(0), to, tokenIdBatchHead, quantity); _minted += quantity; _owners[tokenIdBatchHead] = to; _batchHead.set(tokenIdBatchHead); _afterTokenTransfers(address(0), to, tokenIdBatchHead, quantity); // Emit events for(uint256 tokenId=tokenIdBatchHead;tokenId < tokenIdBatchHead + quantity; tokenId++){ emit Transfer(address(0), to, tokenId); } } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { (address owner, uint256 tokenIdBatchHead) = _ownerAndBatchHeadOf(tokenId); require( owner == from, "ERC721Psi: transfer of token that is not own" ); require(to != address(0), "ERC721Psi: transfer to the zero address"); _beforeTokenTransfers(from, to, tokenId, 1); // Clear approvals from the previous owner _approve(address(0), tokenId); uint256 nextTokenId = tokenId + 1; if(!_batchHead.get(nextTokenId) && nextTokenId < _minted ) { _owners[nextTokenId] = from; _batchHead.set(nextTokenId); } _owners[tokenId] = to; if(tokenId != tokenIdBatchHead) { _batchHead.set(tokenId); } emit Transfer(from, to, tokenId); _afterTokenTransfers(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param startTokenId uint256 the first ID of the tokens to be transferred * @param quantity uint256 amount of the tokens to be transfered. * @param _data bytes optional data to send along with the call * @return r bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 startTokenId, uint256 quantity, bytes memory _data ) private returns (bool r) { if (to.isContract()) { r = true; for(uint256 tokenId = startTokenId; tokenId < startTokenId + quantity; tokenId++){ try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { r = r && retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721Psi: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } return r; } else { return true; } } function _getBatchHead(uint256 tokenId) internal view returns (uint256 tokenIdBatchHead) { tokenIdBatchHead = _batchHead.scanForward(tokenId); } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _minted - 1; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256 tokenId) { require(index < totalSupply(), "ERC721Psi: global index out of bounds"); uint count; for(uint i = 1; i < _minted; i++){ if(_exists(i)){ if(count == index) return i; else count++; } } } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256 tokenId) { uint count; for(uint i = 1; i < _minted; i++){ if(_exists(i) && owner == ownerOf(i)){ if(count == index) return i; else count++; } } revert("ERC721Psi: owner index out of bounds"); } /** * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting. * * 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`. */ 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. * * 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` and `to` are never both zero. */ function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity ) internal virtual {} }
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), 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 Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
/**
_____ ___ ___ __ ____ _ __
/ ___/____ / (_)___/ (_) /___ __ / __ )(_) /______
\__ \/ __ \/ / / __ / / __/ / / / / __ / / __/ ___/
___/ / /_/ / / / /_/ / / /_/ /_/ / / /_/ / / /_(__ )
/____/\____/_/_/\__,_/_/\__/\__, / /_____/_/\__/____/
/____/
- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits
*/
pragma solidity ^0.8.0;
import "./BitScan.sol";
import "./Popcount.sol";
/**
* @dev This Library is a modified version of Openzeppelin's BitMaps library with extra features.
*
* 1. Functions of finding the index of the closest set bit from a given index are added.
* The indexing of each bucket is modifed to count from the MSB to the LSB instead of from the LSB to the MSB.
* The modification of indexing makes finding the closest previous set bit more efficient in gas usage.
* 2. Setting and unsetting the bitmap consecutively.
* 3. Accounting number of set bits within a given range.
*
*/
/**
* @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential.
* Largelly inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
*/
library BitMaps {
using BitScan for uint256;
uint256 private constant MASK_INDEX_ZERO = (1 << 255);
uint256 private constant MASK_FULL = type(uint256).max;
struct BitMap {
mapping(uint256 => uint256) _data;
}
/**
* @dev Returns whether the bit at `index` is set.
*/
function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {
uint256 bucket = index >> 8;
uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
return bitmap._data[bucket] & mask != 0;
}
/**
* @dev Sets the bit at `index` to the boolean `value`.
*/
function setTo(
BitMap storage bitmap,
uint256 index,
bool value
) internal {
if (value) {
set(bitmap, index);
} else {
unset(bitmap, index);
}
}
/**
* @dev Sets the bit at `index`.
*/
function set(BitMap storage bitmap, uint256 index) internal {
uint256 bucket = index >> 8;
uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
bitmap._data[bucket] |= mask;
}
/**
* @dev Unsets the bit at `index`.
*/
function unset(BitMap storage bitmap, uint256 index) internal {
uint256 bucket = index >> 8;
uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
bitmap._data[bucket] &= ~mask;
}
/**
* @dev Consecutively sets `amount` of bits starting from the bit at `startIndex`.
*/
function setBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
uint256 bucket = startIndex >> 8;
uint256 bucketStartIndex = (startIndex & 0xff);
unchecked {
if(bucketStartIndex + amount < 256) {
bitmap._data[bucket] |= MASK_FULL << (256 - amount) >> bucketStartIndex;
} else {
bitmap._data[bucket] |= MASK_FULL >> bucketStartIndex;
amount -= (256 - bucketStartIndex);
bucket++;
while(amount > 256) {
bitmap._data[bucket] = MASK_FULL;
amount -= 256;
bucket++;
}
bitmap._data[bucket] |= MASK_FULL << (256 - amount);
}
}
}
/**
* @dev Consecutively unsets `amount` of bits starting from the bit at `startIndex`.
*/
function unsetBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
uint256 bucket = startIndex >> 8;
uint256 bucketStartIndex = (startIndex & 0xff);
unchecked {
if(bucketStartIndex + amount < 256) {
bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount) >> bucketStartIndex);
} else {
bitmap._data[bucket] &= ~(MASK_FULL >> bucketStartIndex);
amount -= (256 - bucketStartIndex);
bucket++;
while(amount > 256) {
bitmap._data[bucket] = 0;
amount -= 256;
bucket++;
}
bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount));
}
}
}
/**
* @dev Returns number of set bits within a range.
*/
function popcountA(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal view returns(uint256 count) {
uint256 bucket = startIndex >> 8;
uint256 bucketStartIndex = (startIndex & 0xff);
unchecked {
if(bucketStartIndex + amount < 256) {
count += Popcount.popcount256A(
bitmap._data[bucket] & (MASK_FULL << (256 - amount) >> bucketStartIndex)
);
} else {
count += Popcount.popcount256A(
bitmap._data[bucket] & (MASK_FULL >> bucketStartIndex)
);
amount -= (256 - bucketStartIndex);
bucket++;
while(amount > 256) {
count += Popcount.popcount256A(bitmap._data[bucket]);
amount -= 256;
bucket++;
}
count += Popcount.popcount256A(
bitmap._data[bucket] & (MASK_FULL << (256 - amount))
);
}
}
}
/**
* @dev Returns number of set bits within a range.
*/
function popcountB(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal view returns(uint256 count) {
uint256 bucket = startIndex >> 8;
uint256 bucketStartIndex = (startIndex & 0xff);
unchecked {
if(bucketStartIndex + amount < 256) {
count += Popcount.popcount256B(
bitmap._data[bucket] & (MASK_FULL << (256 - amount) >> bucketStartIndex)
);
} else {
count += Popcount.popcount256B(
bitmap._data[bucket] & (MASK_FULL >> bucketStartIndex)
);
amount -= (256 - bucketStartIndex);
bucket++;
while(amount > 256) {
count += Popcount.popcount256B(bitmap._data[bucket]);
amount -= 256;
bucket++;
}
count += Popcount.popcount256B(
bitmap._data[bucket] & (MASK_FULL << (256 - amount))
);
}
}
}
/**
* @dev Find the closest index of the set bit before `index`.
*/
function scanForward(BitMap storage bitmap, uint256 index) internal view returns (uint256 setBitIndex) {
uint256 bucket = index >> 8;
// index within the bucket
uint256 bucketIndex = (index & 0xff);
// load a bitboard from the bitmap.
uint256 bb = bitmap._data[bucket];
// offset the bitboard to scan from `bucketIndex`.
bb = bb >> (0xff ^ bucketIndex); // bb >> (255 - bucketIndex)
if(bb > 0) {
unchecked {
setBitIndex = (bucket << 8) | (bucketIndex - bb.bitScanForward256());
}
} else {
while(true) {
require(bucket > 0, "BitMaps: The set bit before the index doesn't exist.");
unchecked {
bucket--;
}
// No offset. Always scan from the least significiant bit now.
bb = bitmap._data[bucket];
if(bb > 0) {
unchecked {
setBitIndex = (bucket << 8) | (255 - bb.bitScanForward256());
break;
}
}
}
}
}
function getBucket(BitMap storage bitmap, uint256 bucket) internal view returns (uint256) {
return bitmap._data[bucket];
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.20;
import {IERC721} from "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.20;
import {IERC721} from "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.20;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be
* reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
* {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the address zero.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
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 overflow flag.
*/
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.
*/
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.
*/
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.
*/
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.
*/
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 largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds 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.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = 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^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 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^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @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;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @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;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
/**
_____ ___ ___ __ ____ _ __
/ ___/____ / (_)___/ (_) /___ __ / __ )(_) /______
\__ \/ __ \/ / / __ / / __/ / / / / __ / / __/ ___/
___/ / /_/ / / / /_/ / / /_/ /_/ / / /_/ / / /_(__ )
/____/\____/_/_/\__,_/_/\__/\__, / /_____/_/\__/____/
/____/
- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits
*/
pragma solidity ^0.8.0;
library Popcount {
uint256 private constant m1 = 0x5555555555555555555555555555555555555555555555555555555555555555;
uint256 private constant m2 = 0x3333333333333333333333333333333333333333333333333333333333333333;
uint256 private constant m4 = 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f;
uint256 private constant h01 = 0x0101010101010101010101010101010101010101010101010101010101010101;
function popcount256A(uint256 x) internal pure returns (uint256 count) {
unchecked{
for (count=0; x!=0; count++)
x &= x - 1;
}
}
function popcount256B(uint256 x) internal pure returns (uint256) {
if (x == type(uint256).max) {
return 256;
}
unchecked {
x -= (x >> 1) & m1; //put count of each 2 bits into those 2 bits
x = (x & m2) + ((x >> 2) & m2); //put count of each 4 bits into those 4 bits
x = (x + (x >> 4)) & m4; //put count of each 8 bits into those 8 bits
x = (x * h01) >> 248; //returns left 8 bits of x + (x<<8) + (x<<16) + (x<<24) + ...
}
return x;
}
}// SPDX-License-Identifier: MIT
/**
_____ ___ ___ __ ____ _ __
/ ___/____ / (_)___/ (_) /___ __ / __ )(_) /______
\__ \/ __ \/ / / __ / / __/ / / / / __ / / __/ ___/
___/ / /_/ / / / /_/ / / /_/ /_/ / / /_/ / / /_(__ )
/____/\____/_/_/\__,_/_/\__/\__, / /_____/_/\__/____/
/____/
- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits
*/
pragma solidity ^0.8.0;
library BitScan {
uint256 constant private DEBRUIJN_256 = 0x818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff;
bytes constant private LOOKUP_TABLE_256 = hex"0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8";
/**
@dev Isolate the least significant set bit.
*/
function isolateLS1B256(uint256 bb) pure internal returns (uint256) {
require(bb > 0);
unchecked {
return bb & (0 - bb);
}
}
/**
@dev Isolate the most significant set bit.
*/
function isolateMS1B256(uint256 bb) pure internal returns (uint256) {
require(bb > 0);
unchecked {
bb |= bb >> 128;
bb |= bb >> 64;
bb |= bb >> 32;
bb |= bb >> 16;
bb |= bb >> 8;
bb |= bb >> 4;
bb |= bb >> 2;
bb |= bb >> 1;
return (bb >> 1) + 1;
}
}
/**
@dev Find the index of the lest significant set bit. (trailing zero count)
*/
function bitScanForward256(uint256 bb) pure internal returns (uint8) {
unchecked {
return uint8(LOOKUP_TABLE_256[(isolateLS1B256(bb) * DEBRUIJN_256) >> 248]);
}
}
/**
@dev Find the index of the most significant set bit.
*/
function bitScanReverse256(uint256 bb) pure internal returns (uint8) {
unchecked {
return 255 - uint8(LOOKUP_TABLE_256[((isolateMS1B256(bb) * DEBRUIJN_256) >> 248)]);
}
}
function log2(uint256 bb) pure internal returns (uint8) {
unchecked {
return uint8(LOOKUP_TABLE_256[(isolateMS1B256(bb) * DEBRUIJN_256) >> 248]);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"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"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"character","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_NTPid","type":"uint256"},{"internalType":"uint256","name":"_characterType","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimStart","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getCreated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getHoldNTP","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getOwnerOfNTP","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"tokenContract","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salt","type":"uint256"}],"name":"getTBA","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getWalletOfOwnerNTP","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getWalletOfStakeToken","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"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":[],"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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"setClaimStart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"bool_","type":"bool"}],"name":"setIndividual","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_characterType","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"setUnificationURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405260016004556009805460ff19169055600e805474a65ba71d653f62c64d97099b58d25a955eb374a0016001600160a81b0319909116179055600f80546001600160a01b031990811673493ed2537be3a2aa380d63f943220616f27b6a7817909155601080548216739eb8788bea8beeb00427b3cbfa826048c0b4b3431790556011805490911673b032ca260b1cabd144f47825c6ae32fb3026f12c1790553480156100ad575f80fd5b5033604051806040016040528060078152602001664e45572041474560c81b815250604051806040016040528060028152602001614e4160f01b81525081600190816100f991906102ce565b50600261010682826102ce565b5050506001600160a01b03811661013757604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61014081610193565b50600160088190555061016b5f604051806080016040528060428152602001612bef604291396101e4565b61018e6001604051806080016040528060428152602001612bad604291396101e4565b61038d565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6101ec610208565b5f828152600b6020526040902061020382826102ce565b505050565b6007546001600160a01b031633146102355760405163118cdaa760e01b815233600482015260240161012e565b565b634e487b7160e01b5f52604160045260245ffd5b600181811c9082168061025f57607f821691505b60208210810361027d57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561020357805f5260205f20601f840160051c810160208510156102a85750805b601f840160051c820191505b818110156102c7575f81556001016102b4565b5050505050565b81516001600160401b038111156102e7576102e7610237565b6102fb816102f5845461024b565b84610283565b602080601f83116001811461032e575f84156103175750858301515b5f19600386901b1c1916600185901b178555610385565b5f85815260208120601f198616915b8281101561035c5788860151825594840194600190910190840161033d565b508582101561037957878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b6128138061039a5f395ff3fe608060405234801561000f575f80fd5b50600436106101f2575f3560e01c8063715018a611610114578063b78aece3116100a9578063dbe7e3bd11610079578063dbe7e3bd1461043f578063e985e9c514610461578063f04d688f1461049c578063f2fde38b146104a9578063ffb39076146104bc575f80fd5b8063b78aece3146103f3578063b88d4fde14610406578063c349026314610419578063c87b56dd1461042c575f80fd5b80639cb2b69b116100e45780639cb2b69b146103a7578063a0da6955146103ba578063a22cb465146103cd578063a7ab14c2146103e0575f80fd5b8063715018a6146103735780638da5cb5b1461037b578063920caa971461038c57806395d89b411461039f575f80fd5b80632f745c591161018a5780634f6ccce71161015a5780634f6ccce71461032757806355f804b31461033a5780636352211e1461034d57806370a0823114610360575f80fd5b80632f745c59146102cf5780633d722c59146102e257806342842e0e146102f5578063468f25b014610308575f80fd5b80630a34a739116101c55780630a34a73914610273578063172dfcd81461029357806318160ddd146102a657806323b872dd146102bc575f80fd5b806301ffc9a7146101f657806306fdde031461021e578063081812fc14610233578063095ea7b31461025e575b5f80fd5b610209610204366004611e3f565b6104cf565b60405190151581526020015b60405180910390f35b61022661053b565b6040516102159190611e88565b610246610241366004611e9a565b6105cb565b6040516001600160a01b039091168152602001610215565b61027161026c366004611ec5565b61065b565b005b610286610281366004611eef565b610771565b6040516102159190611f0a565b6102716102a1366004611fe7565b6108a1565b6102ae6108c0565b604051908152602001610215565b6102716102ca36600461203e565b6108d5565b6102ae6102dd366004611ec5565b610906565b6102866102f0366004611eef565b6109c5565b61027161030336600461203e565b610a3f565b6102ae610316366004611e9a565b600a6020525f908152604090205481565b6102ae610335366004611e9a565b610a59565b61027161034836600461207c565b610b07565b61024661035b366004611e9a565b610b1c565b6102ae61036e366004611eef565b610b2f565b610271610bf6565b6007546001600160a01b0316610246565b61028661039a366004611eef565b610c09565b610226610c45565b6102096103b5366004611e9a565b610c54565b6102716103c83660046120f5565b610cc3565b6102716103db366004612110565b610cde565b6102716103ee3660046120f5565b610da1565b610246610401366004612147565b610dbc565b610271610414366004612195565b610e55565b610271610427366004612210565b610e8d565b61022661043a366004611e9a565b610faa565b61020961044d366004611e9a565b600d6020525f908152604090205460ff1681565b61020961046f366004612230565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e546102099060ff1681565b6102716104b7366004611eef565b611095565b6102466104ca366004611e9a565b6110d2565b5f6001600160e01b031982166380ac58cd60e01b14806104ff57506001600160e01b03198216635b5e139f60e01b145b8061051a57506001600160e01b0319821663780e9d6360e01b145b8061053557506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606001805461054a9061225c565b80601f01602080910402602001604051908101604052809291908181526020018280546105769061225c565b80156105c15780601f10610598576101008083540402835291602001916105c1565b820191905f5260205f20905b8154815290600101906020018083116105a457829003601f168201915b5050505050905090565b5f6105d7826004541190565b6106405760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084015b60405180910390fd5b505f908152600560205260409020546001600160a01b031690565b5f61066582610b1c565b9050806001600160a01b0316836001600160a01b0316036106d45760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610637565b336001600160a01b03821614806106f057506106f0813361046f565b6107625760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610637565b61076c8383611145565b505050565b60605f61077d83610c09565b90505f610789846109c5565b90505f8151835161079a91906122a8565b67ffffffffffffffff8111156107b2576107b2611f4d565b6040519080825280602002602001820160405280156107db578160200160208202803683370190505b5090505f805b8451811015610836578481815181106107fc576107fc6122bb565b6020026020010151838381518110610816576108166122bb565b60209081029190910101528161082b816122cf565b9250506001016107e1565b505f5b835181101561088e57838181518110610854576108546122bb565b602002602001015183838151811061086e5761086e6122bb565b602090810291909101015281610883816122cf565b925050600101610839565b50610898826111b2565b50949350505050565b6108a9611296565b5f828152600b6020526040902061076c8282612332565b5f60016004546108d091906123ee565b905090565b6108df33826112c3565b6108fb5760405162461bcd60e51b815260040161063790612401565b61076c8383836113af565b5f8060015b60045481101561097057610920816004541190565b8015610945575061093081610b1c565b6001600160a01b0316856001600160a01b0316145b156109685783820361095a5791506105359050565b81610964816122cf565b9250505b60010161090b565b5060405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a206f776e657220696e646578206f7574206f6620626f604482015263756e647360e01b6064820152608401610637565b600f54604051634b152ed960e01b81526001600160a01b0383811660048301526060925f92911690634b152ed9906024015b5f60405180830381865afa158015610a11573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610a389190810190612455565b9392505050565b61076c83838360405180602001604052805f815250610e55565b5f610a626108c0565b8210610abe5760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a20676c6f62616c20696e646578206f7574206f6620626044820152646f756e647360d81b6064820152608401610637565b5f60015b600454811015610b0057610ad7816004541190565b15610af857838203610aea579392505050565b81610af4816122cf565b9250505b600101610ac2565b5050919050565b610b0f611296565b600c61076c8284836124f6565b5f80610b27836115a2565b509392505050565b5f6001600160a01b038216610b9c5760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610637565b5f60015b600454811015610bef57610bb5816004541190565b15610be757610bc381610b1c565b6001600160a01b0316846001600160a01b031603610be757610be4826122cf565b91505b600101610ba0565b5092915050565b610bfe611296565b610c075f611639565b565b600e5460405162438b6360e81b81526001600160a01b0383811660048301526060925f926101009091049091169063438b6300906024016109f7565b60606002805461054a9061225c565b601054604051634165b5b960e11b8152600481018390525f9182916001600160a01b03909116906382cb6b7290602401602060405180830381865afa158015610c9f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a3891906125b0565b610ccb611296565b6009805460ff1916911515919091179055565b336001600160a01b03831603610d365760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c6572000000006044820152606401610637565b335f8181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610da9611296565b600e805460ff1916911515919091179055565b601054604051632f4de29b60e11b81526001600160a01b03878116600483015260248201879052858116604483015260648201859052608482018490525f928392911690635e9bc5369060a401602060405180830381865afa158015610e24573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e4891906125cb565b9150505b95945050505050565b610e5f33836112c3565b610e7b5760405162461bcd60e51b815260040161063790612401565b610e878484848461168a565b50505050565b610e956116bf565b5f828152600d6020526040812054601154600e5460ff9092169291610ed1916001600160a01b0390811691600191610100909104168785610dbc565b600e5490915060ff16610f165760405162461bcd60e51b815260206004820152600d60248201526c2132b337b932903132b3b4b71760991b6044820152606401610637565b8115610f5d5760405162461bcd60e51b815260206004820152601660248201527513951408125108185b1c9958591e4818db185a5b595960521b6044820152606401610637565b610f68816001611718565b5f610f716108c0565b5f908152600a60209081526040808320879055878352600d9091529020805460ff1916600117905550610fa691506117319050565b5050565b60095460609060ff1615610fe757610fc182611738565b604051602001610fd191906125fd565b6040516020818303038152906040529050919050565b5f828152600a6020908152604080832054808452600b909252822080549192916110109061225c565b80601f016020809104026020016040519081016040528092919081815260200182805461103c9061225c565b80156110875780601f1061105e57610100808354040283529160200191611087565b820191905f5260205f20905b81548152906001019060200180831161106a57829003601f168201915b509398975050505050505050565b61109d611296565b6001600160a01b0381166110c657604051631e4fbdf760e01b81525f6004820152602401610637565b6110cf81611639565b50565b600e546040516331a9108f60e11b8152600481018390525f9182916101009091046001600160a01b031690636352211e90602401602060405180830381865afa158015611121573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a3891906125cb565b5f81815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061117982610b1c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b5f5b8151811015610fa6575f6111c98260016122a8565b90505b825181101561128d578281815181106111e7576111e76122bb565b6020026020010151838381518110611201576112016122bb565b60200260200101511115611285575f838381518110611222576112226122bb565b6020026020010151905083828151811061123e5761123e6122bb565b6020026020010151848481518110611258576112586122bb565b60200260200101818152505080848381518110611277576112776122bb565b602002602001018181525050505b6001016111cc565b506001016111b4565b6007546001600160a01b03163314610c075760405163118cdaa760e01b8152336004820152602401610637565b5f6112cf826004541190565b6113335760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610637565b5f61133d83610b1c565b9050806001600160a01b0316846001600160a01b031614806113785750836001600160a01b031661136d846105cb565b6001600160a01b0316145b806113a757506001600160a01b038082165f9081526006602090815260408083209388168352929052205460ff165b949350505050565b5f806113ba836115a2565b91509150846001600160a01b0316826001600160a01b0316146114345760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610637565b6001600160a01b03841661149a5760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610637565b6114a785858560016117fc565b6114b15f84611145565b5f6114bd8460016122a8565b600881901c5f90815260208190526040902054909150600160ff1b60ff83161c161580156114ec575060045481105b15611521575f81815260036020526040812080546001600160a01b0319166001600160a01b038916179055611521908261186a565b5f84815260036020526040902080546001600160a01b0319166001600160a01b038716179055818414611558576115585f8561186a565b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b5f806115af836004541190565b6116105760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610637565b61161983611895565b5f818152600360205260409020546001600160a01b031694909350915050565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6116958484846113af565b6116a38484846001856118a0565b610e875760405162461bcd60e51b81526004016106379061261d565b6002600854036117115760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610637565b6002600855565b610fa6828260405180602001604052805f8152506119c4565b6001600855565b6060611745826004541190565b6117a45760405162461bcd60e51b815260206004820152602a60248201527f4552433732315073693a2055524920717565727920666f72206e6f6e657869736044820152693a32b73a103a37b5b2b760b11b6064820152608401610637565b5f6117ad6119de565b90505f8151116117cb5760405180602001604052805f815250610a38565b806117d5846119ed565b6040516020016117e6929190612672565b6040516020818303038152906040529392505050565b6001600160a01b038416158061181957506001600160a01b038316155b6118655760405162461bcd60e51b815260206004820152601860248201527f4572723a20746f6b656e20697320534f554c20424f554e4400000000000000006044820152606401610637565b610e87565b600881901c5f90815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b5f6105358183611a7d565b5f6001600160a01b0385163b156119bc57506001835b6118c084866122a8565b8110156119b657604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906118f99033908b9086908990600401612686565b6020604051808303815f875af1925050508015611933575060408051601f3d908101601f19168201909252611930918101906126c2565b60015b61198e573d808015611960576040519150601f19603f3d011682016040523d82523d5f602084013e611965565b606091505b5080515f036119865760405162461bcd60e51b81526004016106379061261d565b805181602001fd5b8280156119ab57506001600160e01b03198116630a85bd0160e11b145b9250506001016118b6565b50610e4c565b506001610e4c565b6004546119d18484611b71565b6116a35f858386866118a0565b6060600c805461054a9061225c565b60605f6119f983611cd5565b60010190505f8167ffffffffffffffff811115611a1857611a18611f4d565b6040519080825280601f01601f191660200182016040528015611a42576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611a4c57509392505050565b600881901c5f8181526020849052604081205490919060ff808516919082181c8015611abe57611aac81611dac565b60ff168203600884901b179350611b68565b5f8311611b2a5760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610637565b505f199091015f818152602086905260409020549091908015611b6357611b5081611dac565b60ff0360ff16600884901b179350611b68565b611abe565b50505092915050565b60045481611bcf5760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610637565b6001600160a01b038316611c315760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610637565b611c3d5f8483856117fc565b8160045f828254611c4e91906122a8565b90915550505f81815260036020526040812080546001600160a01b0319166001600160a01b038616179055611c83908261186a565b805b611c8f83836122a8565b811015610e875760405181906001600160a01b038616905f907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4600101611c85565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611d135772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611d3f576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611d5d57662386f26fc10000830492506010015b6305f5e1008310611d75576305f5e100830492506008015b6127108310611d8957612710830492506004015b60648310611d9b576064830492506002015b600a83106105355760010192915050565b5f60405180610120016040528061010081526020016126de610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff611df485611e15565b02901c81518110611e0757611e076122bb565b016020015160f81c92915050565b5f808211611e21575f80fd5b505f8190031690565b6001600160e01b0319811681146110cf575f80fd5b5f60208284031215611e4f575f80fd5b8135610a3881611e2a565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f610a386020830184611e5a565b5f60208284031215611eaa575f80fd5b5035919050565b6001600160a01b03811681146110cf575f80fd5b5f8060408385031215611ed6575f80fd5b8235611ee181611eb1565b946020939093013593505050565b5f60208284031215611eff575f80fd5b8135610a3881611eb1565b602080825282518282018190525f9190848201906040850190845b81811015611f4157835183529284019291840191600101611f25565b50909695505050505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611f8a57611f8a611f4d565b604052919050565b5f67ffffffffffffffff831115611fab57611fab611f4d565b611fbe601f8401601f1916602001611f61565b9050828152838383011115611fd1575f80fd5b828260208301375f602084830101529392505050565b5f8060408385031215611ff8575f80fd5b82359150602083013567ffffffffffffffff811115612015575f80fd5b8301601f81018513612025575f80fd5b61203485823560208401611f92565b9150509250929050565b5f805f60608486031215612050575f80fd5b833561205b81611eb1565b9250602084013561206b81611eb1565b929592945050506040919091013590565b5f806020838503121561208d575f80fd5b823567ffffffffffffffff808211156120a4575f80fd5b818501915085601f8301126120b7575f80fd5b8135818111156120c5575f80fd5b8660208285010111156120d6575f80fd5b60209290920196919550909350505050565b80151581146110cf575f80fd5b5f60208284031215612105575f80fd5b8135610a38816120e8565b5f8060408385031215612121575f80fd5b823561212c81611eb1565b9150602083013561213c816120e8565b809150509250929050565b5f805f805f60a0868803121561215b575f80fd5b853561216681611eb1565b945060208601359350604086013561217d81611eb1565b94979396509394606081013594506080013592915050565b5f805f80608085870312156121a8575f80fd5b84356121b381611eb1565b935060208501356121c381611eb1565b925060408501359150606085013567ffffffffffffffff8111156121e5575f80fd5b8501601f810187136121f5575f80fd5b61220487823560208401611f92565b91505092959194509250565b5f8060408385031215612221575f80fd5b50508035926020909101359150565b5f8060408385031215612241575f80fd5b823561224c81611eb1565b9150602083013561213c81611eb1565b600181811c9082168061227057607f821691505b60208210810361228e57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561053557610535612294565b634e487b7160e01b5f52603260045260245ffd5b5f600182016122e0576122e0612294565b5060010190565b601f82111561076c57805f5260205f20601f840160051c8101602085101561230c5750805b601f840160051c820191505b8181101561232b575f8155600101612318565b5050505050565b815167ffffffffffffffff81111561234c5761234c611f4d565b6123608161235a845461225c565b846122e7565b602080601f831160018114612393575f841561237c5750858301515b5f19600386901b1c1916600185901b17855561159a565b5f85815260208120601f198616915b828110156123c1578886015182559484019460019091019084016123a2565b50858210156123de57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b8181038181111561053557610535612294565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b5f6020808385031215612466575f80fd5b825167ffffffffffffffff8082111561247d575f80fd5b818501915085601f830112612490575f80fd5b8151818111156124a2576124a2611f4d565b8060051b91506124b3848301611f61565b81815291830184019184810190888411156124cc575f80fd5b938501935b838510156124ea578451825293850193908501906124d1565b98975050505050505050565b67ffffffffffffffff83111561250e5761250e611f4d565b6125228361251c835461225c565b836122e7565b5f601f841160018114612553575f851561253c5750838201355b5f19600387901b1c1916600186901b17835561232b565b5f83815260208120601f198716915b828110156125825786850135825560209485019460019092019101612562565b508682101561259e575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f602082840312156125c0575f80fd5b8151610a38816120e8565b5f602082840312156125db575f80fd5b8151610a3881611eb1565b5f81518060208401855e5f93019283525090919050565b5f61260882846125e6565b64173539b7b760d91b81526005019392505050565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b5f6113a761268083866125e6565b846125e6565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906126b890830184611e5a565b9695505050505050565b5f602082840312156126d2575f80fd5b8151610a3881611e2a56fe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212203701e00964c8b8bebce8fb80e526d7aceb5a00d3f3a257cdc0ed7bbc4eca4bd064736f6c63430008190033697066733a2f2f6261666b726569647373666879746b356e366c6b6c6266736932786e6869776532346c34657277326d6b75727672696a796a36337468377668796d697066733a2f2f6261666b72656961616f7565367475366b6166747070746a6172766633706a373275376c33377137636768626b7063687371373765367a61776265
Deployed Bytecode
0x608060405234801561000f575f80fd5b50600436106101f2575f3560e01c8063715018a611610114578063b78aece3116100a9578063dbe7e3bd11610079578063dbe7e3bd1461043f578063e985e9c514610461578063f04d688f1461049c578063f2fde38b146104a9578063ffb39076146104bc575f80fd5b8063b78aece3146103f3578063b88d4fde14610406578063c349026314610419578063c87b56dd1461042c575f80fd5b80639cb2b69b116100e45780639cb2b69b146103a7578063a0da6955146103ba578063a22cb465146103cd578063a7ab14c2146103e0575f80fd5b8063715018a6146103735780638da5cb5b1461037b578063920caa971461038c57806395d89b411461039f575f80fd5b80632f745c591161018a5780634f6ccce71161015a5780634f6ccce71461032757806355f804b31461033a5780636352211e1461034d57806370a0823114610360575f80fd5b80632f745c59146102cf5780633d722c59146102e257806342842e0e146102f5578063468f25b014610308575f80fd5b80630a34a739116101c55780630a34a73914610273578063172dfcd81461029357806318160ddd146102a657806323b872dd146102bc575f80fd5b806301ffc9a7146101f657806306fdde031461021e578063081812fc14610233578063095ea7b31461025e575b5f80fd5b610209610204366004611e3f565b6104cf565b60405190151581526020015b60405180910390f35b61022661053b565b6040516102159190611e88565b610246610241366004611e9a565b6105cb565b6040516001600160a01b039091168152602001610215565b61027161026c366004611ec5565b61065b565b005b610286610281366004611eef565b610771565b6040516102159190611f0a565b6102716102a1366004611fe7565b6108a1565b6102ae6108c0565b604051908152602001610215565b6102716102ca36600461203e565b6108d5565b6102ae6102dd366004611ec5565b610906565b6102866102f0366004611eef565b6109c5565b61027161030336600461203e565b610a3f565b6102ae610316366004611e9a565b600a6020525f908152604090205481565b6102ae610335366004611e9a565b610a59565b61027161034836600461207c565b610b07565b61024661035b366004611e9a565b610b1c565b6102ae61036e366004611eef565b610b2f565b610271610bf6565b6007546001600160a01b0316610246565b61028661039a366004611eef565b610c09565b610226610c45565b6102096103b5366004611e9a565b610c54565b6102716103c83660046120f5565b610cc3565b6102716103db366004612110565b610cde565b6102716103ee3660046120f5565b610da1565b610246610401366004612147565b610dbc565b610271610414366004612195565b610e55565b610271610427366004612210565b610e8d565b61022661043a366004611e9a565b610faa565b61020961044d366004611e9a565b600d6020525f908152604090205460ff1681565b61020961046f366004612230565b6001600160a01b039182165f90815260066020908152604080832093909416825291909152205460ff1690565b600e546102099060ff1681565b6102716104b7366004611eef565b611095565b6102466104ca366004611e9a565b6110d2565b5f6001600160e01b031982166380ac58cd60e01b14806104ff57506001600160e01b03198216635b5e139f60e01b145b8061051a57506001600160e01b0319821663780e9d6360e01b145b8061053557506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606001805461054a9061225c565b80601f01602080910402602001604051908101604052809291908181526020018280546105769061225c565b80156105c15780601f10610598576101008083540402835291602001916105c1565b820191905f5260205f20905b8154815290600101906020018083116105a457829003601f168201915b5050505050905090565b5f6105d7826004541190565b6106405760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b60648201526084015b60405180910390fd5b505f908152600560205260409020546001600160a01b031690565b5f61066582610b1c565b9050806001600160a01b0316836001600160a01b0316036106d45760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610637565b336001600160a01b03821614806106f057506106f0813361046f565b6107625760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610637565b61076c8383611145565b505050565b60605f61077d83610c09565b90505f610789846109c5565b90505f8151835161079a91906122a8565b67ffffffffffffffff8111156107b2576107b2611f4d565b6040519080825280602002602001820160405280156107db578160200160208202803683370190505b5090505f805b8451811015610836578481815181106107fc576107fc6122bb565b6020026020010151838381518110610816576108166122bb565b60209081029190910101528161082b816122cf565b9250506001016107e1565b505f5b835181101561088e57838181518110610854576108546122bb565b602002602001015183838151811061086e5761086e6122bb565b602090810291909101015281610883816122cf565b925050600101610839565b50610898826111b2565b50949350505050565b6108a9611296565b5f828152600b6020526040902061076c8282612332565b5f60016004546108d091906123ee565b905090565b6108df33826112c3565b6108fb5760405162461bcd60e51b815260040161063790612401565b61076c8383836113af565b5f8060015b60045481101561097057610920816004541190565b8015610945575061093081610b1c565b6001600160a01b0316856001600160a01b0316145b156109685783820361095a5791506105359050565b81610964816122cf565b9250505b60010161090b565b5060405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a206f776e657220696e646578206f7574206f6620626f604482015263756e647360e01b6064820152608401610637565b600f54604051634b152ed960e01b81526001600160a01b0383811660048301526060925f92911690634b152ed9906024015b5f60405180830381865afa158015610a11573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052610a389190810190612455565b9392505050565b61076c83838360405180602001604052805f815250610e55565b5f610a626108c0565b8210610abe5760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a20676c6f62616c20696e646578206f7574206f6620626044820152646f756e647360d81b6064820152608401610637565b5f60015b600454811015610b0057610ad7816004541190565b15610af857838203610aea579392505050565b81610af4816122cf565b9250505b600101610ac2565b5050919050565b610b0f611296565b600c61076c8284836124f6565b5f80610b27836115a2565b509392505050565b5f6001600160a01b038216610b9c5760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610637565b5f60015b600454811015610bef57610bb5816004541190565b15610be757610bc381610b1c565b6001600160a01b0316846001600160a01b031603610be757610be4826122cf565b91505b600101610ba0565b5092915050565b610bfe611296565b610c075f611639565b565b600e5460405162438b6360e81b81526001600160a01b0383811660048301526060925f926101009091049091169063438b6300906024016109f7565b60606002805461054a9061225c565b601054604051634165b5b960e11b8152600481018390525f9182916001600160a01b03909116906382cb6b7290602401602060405180830381865afa158015610c9f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a3891906125b0565b610ccb611296565b6009805460ff1916911515919091179055565b336001600160a01b03831603610d365760405162461bcd60e51b815260206004820152601c60248201527f4552433732315073693a20617070726f766520746f2063616c6c6572000000006044820152606401610637565b335f8181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610da9611296565b600e805460ff1916911515919091179055565b601054604051632f4de29b60e11b81526001600160a01b03878116600483015260248201879052858116604483015260648201859052608482018490525f928392911690635e9bc5369060a401602060405180830381865afa158015610e24573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610e4891906125cb565b9150505b95945050505050565b610e5f33836112c3565b610e7b5760405162461bcd60e51b815260040161063790612401565b610e878484848461168a565b50505050565b610e956116bf565b5f828152600d6020526040812054601154600e5460ff9092169291610ed1916001600160a01b0390811691600191610100909104168785610dbc565b600e5490915060ff16610f165760405162461bcd60e51b815260206004820152600d60248201526c2132b337b932903132b3b4b71760991b6044820152606401610637565b8115610f5d5760405162461bcd60e51b815260206004820152601660248201527513951408125108185b1c9958591e4818db185a5b595960521b6044820152606401610637565b610f68816001611718565b5f610f716108c0565b5f908152600a60209081526040808320879055878352600d9091529020805460ff1916600117905550610fa691506117319050565b5050565b60095460609060ff1615610fe757610fc182611738565b604051602001610fd191906125fd565b6040516020818303038152906040529050919050565b5f828152600a6020908152604080832054808452600b909252822080549192916110109061225c565b80601f016020809104026020016040519081016040528092919081815260200182805461103c9061225c565b80156110875780601f1061105e57610100808354040283529160200191611087565b820191905f5260205f20905b81548152906001019060200180831161106a57829003601f168201915b509398975050505050505050565b61109d611296565b6001600160a01b0381166110c657604051631e4fbdf760e01b81525f6004820152602401610637565b6110cf81611639565b50565b600e546040516331a9108f60e11b8152600481018390525f9182916101009091046001600160a01b031690636352211e90602401602060405180830381865afa158015611121573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a3891906125cb565b5f81815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061117982610b1c565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b5f5b8151811015610fa6575f6111c98260016122a8565b90505b825181101561128d578281815181106111e7576111e76122bb565b6020026020010151838381518110611201576112016122bb565b60200260200101511115611285575f838381518110611222576112226122bb565b6020026020010151905083828151811061123e5761123e6122bb565b6020026020010151848481518110611258576112586122bb565b60200260200101818152505080848381518110611277576112776122bb565b602002602001018181525050505b6001016111cc565b506001016111b4565b6007546001600160a01b03163314610c075760405163118cdaa760e01b8152336004820152602401610637565b5f6112cf826004541190565b6113335760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610637565b5f61133d83610b1c565b9050806001600160a01b0316846001600160a01b031614806113785750836001600160a01b031661136d846105cb565b6001600160a01b0316145b806113a757506001600160a01b038082165f9081526006602090815260408083209388168352929052205460ff165b949350505050565b5f806113ba836115a2565b91509150846001600160a01b0316826001600160a01b0316146114345760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610637565b6001600160a01b03841661149a5760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610637565b6114a785858560016117fc565b6114b15f84611145565b5f6114bd8460016122a8565b600881901c5f90815260208190526040902054909150600160ff1b60ff83161c161580156114ec575060045481105b15611521575f81815260036020526040812080546001600160a01b0319166001600160a01b038916179055611521908261186a565b5f84815260036020526040902080546001600160a01b0319166001600160a01b038716179055818414611558576115585f8561186a565b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b5f806115af836004541190565b6116105760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610637565b61161983611895565b5f818152600360205260409020546001600160a01b031694909350915050565b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6116958484846113af565b6116a38484846001856118a0565b610e875760405162461bcd60e51b81526004016106379061261d565b6002600854036117115760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610637565b6002600855565b610fa6828260405180602001604052805f8152506119c4565b6001600855565b6060611745826004541190565b6117a45760405162461bcd60e51b815260206004820152602a60248201527f4552433732315073693a2055524920717565727920666f72206e6f6e657869736044820152693a32b73a103a37b5b2b760b11b6064820152608401610637565b5f6117ad6119de565b90505f8151116117cb5760405180602001604052805f815250610a38565b806117d5846119ed565b6040516020016117e6929190612672565b6040516020818303038152906040529392505050565b6001600160a01b038416158061181957506001600160a01b038316155b6118655760405162461bcd60e51b815260206004820152601860248201527f4572723a20746f6b656e20697320534f554c20424f554e4400000000000000006044820152606401610637565b610e87565b600881901c5f90815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b5f6105358183611a7d565b5f6001600160a01b0385163b156119bc57506001835b6118c084866122a8565b8110156119b657604051630a85bd0160e11b81526001600160a01b0387169063150b7a02906118f99033908b9086908990600401612686565b6020604051808303815f875af1925050508015611933575060408051601f3d908101601f19168201909252611930918101906126c2565b60015b61198e573d808015611960576040519150601f19603f3d011682016040523d82523d5f602084013e611965565b606091505b5080515f036119865760405162461bcd60e51b81526004016106379061261d565b805181602001fd5b8280156119ab57506001600160e01b03198116630a85bd0160e11b145b9250506001016118b6565b50610e4c565b506001610e4c565b6004546119d18484611b71565b6116a35f858386866118a0565b6060600c805461054a9061225c565b60605f6119f983611cd5565b60010190505f8167ffffffffffffffff811115611a1857611a18611f4d565b6040519080825280601f01601f191660200182016040528015611a42576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611a4c57509392505050565b600881901c5f8181526020849052604081205490919060ff808516919082181c8015611abe57611aac81611dac565b60ff168203600884901b179350611b68565b5f8311611b2a5760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610637565b505f199091015f818152602086905260409020549091908015611b6357611b5081611dac565b60ff0360ff16600884901b179350611b68565b611abe565b50505092915050565b60045481611bcf5760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610637565b6001600160a01b038316611c315760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610637565b611c3d5f8483856117fc565b8160045f828254611c4e91906122a8565b90915550505f81815260036020526040812080546001600160a01b0319166001600160a01b038616179055611c83908261186a565b805b611c8f83836122a8565b811015610e875760405181906001600160a01b038616905f907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4600101611c85565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611d135772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611d3f576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611d5d57662386f26fc10000830492506010015b6305f5e1008310611d75576305f5e100830492506008015b6127108310611d8957612710830492506004015b60648310611d9b576064830492506002015b600a83106105355760010192915050565b5f60405180610120016040528061010081526020016126de610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff611df485611e15565b02901c81518110611e0757611e076122bb565b016020015160f81c92915050565b5f808211611e21575f80fd5b505f8190031690565b6001600160e01b0319811681146110cf575f80fd5b5f60208284031215611e4f575f80fd5b8135610a3881611e2a565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f610a386020830184611e5a565b5f60208284031215611eaa575f80fd5b5035919050565b6001600160a01b03811681146110cf575f80fd5b5f8060408385031215611ed6575f80fd5b8235611ee181611eb1565b946020939093013593505050565b5f60208284031215611eff575f80fd5b8135610a3881611eb1565b602080825282518282018190525f9190848201906040850190845b81811015611f4157835183529284019291840191600101611f25565b50909695505050505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611f8a57611f8a611f4d565b604052919050565b5f67ffffffffffffffff831115611fab57611fab611f4d565b611fbe601f8401601f1916602001611f61565b9050828152838383011115611fd1575f80fd5b828260208301375f602084830101529392505050565b5f8060408385031215611ff8575f80fd5b82359150602083013567ffffffffffffffff811115612015575f80fd5b8301601f81018513612025575f80fd5b61203485823560208401611f92565b9150509250929050565b5f805f60608486031215612050575f80fd5b833561205b81611eb1565b9250602084013561206b81611eb1565b929592945050506040919091013590565b5f806020838503121561208d575f80fd5b823567ffffffffffffffff808211156120a4575f80fd5b818501915085601f8301126120b7575f80fd5b8135818111156120c5575f80fd5b8660208285010111156120d6575f80fd5b60209290920196919550909350505050565b80151581146110cf575f80fd5b5f60208284031215612105575f80fd5b8135610a38816120e8565b5f8060408385031215612121575f80fd5b823561212c81611eb1565b9150602083013561213c816120e8565b809150509250929050565b5f805f805f60a0868803121561215b575f80fd5b853561216681611eb1565b945060208601359350604086013561217d81611eb1565b94979396509394606081013594506080013592915050565b5f805f80608085870312156121a8575f80fd5b84356121b381611eb1565b935060208501356121c381611eb1565b925060408501359150606085013567ffffffffffffffff8111156121e5575f80fd5b8501601f810187136121f5575f80fd5b61220487823560208401611f92565b91505092959194509250565b5f8060408385031215612221575f80fd5b50508035926020909101359150565b5f8060408385031215612241575f80fd5b823561224c81611eb1565b9150602083013561213c81611eb1565b600181811c9082168061227057607f821691505b60208210810361228e57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8082018082111561053557610535612294565b634e487b7160e01b5f52603260045260245ffd5b5f600182016122e0576122e0612294565b5060010190565b601f82111561076c57805f5260205f20601f840160051c8101602085101561230c5750805b601f840160051c820191505b8181101561232b575f8155600101612318565b5050505050565b815167ffffffffffffffff81111561234c5761234c611f4d565b6123608161235a845461225c565b846122e7565b602080601f831160018114612393575f841561237c5750858301515b5f19600386901b1c1916600185901b17855561159a565b5f85815260208120601f198616915b828110156123c1578886015182559484019460019091019084016123a2565b50858210156123de57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b8181038181111561053557610535612294565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b5f6020808385031215612466575f80fd5b825167ffffffffffffffff8082111561247d575f80fd5b818501915085601f830112612490575f80fd5b8151818111156124a2576124a2611f4d565b8060051b91506124b3848301611f61565b81815291830184019184810190888411156124cc575f80fd5b938501935b838510156124ea578451825293850193908501906124d1565b98975050505050505050565b67ffffffffffffffff83111561250e5761250e611f4d565b6125228361251c835461225c565b836122e7565b5f601f841160018114612553575f851561253c5750838201355b5f19600387901b1c1916600186901b17835561232b565b5f83815260208120601f198716915b828110156125825786850135825560209485019460019092019101612562565b508682101561259e575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f602082840312156125c0575f80fd5b8151610a38816120e8565b5f602082840312156125db575f80fd5b8151610a3881611eb1565b5f81518060208401855e5f93019283525090919050565b5f61260882846125e6565b64173539b7b760d91b81526005019392505050565b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b5f6113a761268083866125e6565b846125e6565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906126b890830184611e5a565b9695505050505050565b5f602082840312156126d2575f80fd5b8151610a3881611e2a56fe0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212203701e00964c8b8bebce8fb80e526d7aceb5a00d3f3a257cdc0ed7bbc4eca4bd064736f6c63430008190033
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
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.