Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 86 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Set Approval For... | 21707467 | 7 hrs ago | IN | 0 ETH | 0.00017378 | ||||
Safe Transfer Fr... | 21704562 | 16 hrs ago | IN | 0 ETH | 0.00019481 | ||||
Safe Transfer Fr... | 21704407 | 17 hrs ago | IN | 0 ETH | 0.00029086 | ||||
Safe Transfer Fr... | 21704396 | 17 hrs ago | IN | 0 ETH | 0.00025387 | ||||
Safe Transfer Fr... | 21704350 | 17 hrs ago | IN | 0 ETH | 0.0002209 | ||||
Safe Transfer Fr... | 21704344 | 17 hrs ago | IN | 0 ETH | 0.00029319 | ||||
Set Approval For... | 21702894 | 22 hrs ago | IN | 0 ETH | 0.00037197 | ||||
Safe Transfer Fr... | 21702131 | 25 hrs ago | IN | 0 ETH | 0.00046031 | ||||
Safe Transfer Fr... | 21701860 | 26 hrs ago | IN | 0 ETH | 0.00025608 | ||||
Safe Transfer Fr... | 21699780 | 32 hrs ago | IN | 0 ETH | 0.00027241 | ||||
Safe Transfer Fr... | 21698506 | 37 hrs ago | IN | 0 ETH | 0.00020852 | ||||
Safe Transfer Fr... | 21698503 | 37 hrs ago | IN | 0 ETH | 0.00033325 | ||||
Set Approval For... | 21698428 | 37 hrs ago | IN | 0 ETH | 0.00024915 | ||||
Set Approval For... | 21695289 | 2 days ago | IN | 0 ETH | 0.00102498 | ||||
Set Approval For... | 21695244 | 2 days ago | IN | 0 ETH | 0.00083269 | ||||
Set Approval For... | 21694524 | 2 days ago | IN | 0 ETH | 0.00085351 | ||||
Set Approval For... | 21692989 | 2 days ago | IN | 0 ETH | 0.00019706 | ||||
Safe Transfer Fr... | 21692292 | 2 days ago | IN | 0 ETH | 0.00020848 | ||||
Safe Transfer Fr... | 21692288 | 2 days ago | IN | 0 ETH | 0.00033253 | ||||
Set Approval For... | 21692090 | 2 days ago | IN | 0 ETH | 0.00022038 | ||||
Set Approval For... | 21691122 | 2 days ago | IN | 0 ETH | 0.0002485 | ||||
Set Approval For... | 21690616 | 2 days ago | IN | 0 ETH | 0.00028878 | ||||
Transfer From | 21690592 | 2 days ago | IN | 0 ETH | 0.00027721 | ||||
Transfer From | 21690590 | 2 days ago | IN | 0 ETH | 0.00026966 | ||||
Transfer From | 21690581 | 2 days ago | IN | 0 ETH | 0.00037358 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
DailyArtCollection
Compiler Version
v0.8.28+commit.7893614a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // Copyright (c) 2024 daily.xyz pragma solidity ^0.8.17; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; /// @title Token Base /// @notice Shared logic for token contracts contract DailyArtCollection is ERC721, Ownable { uint256 private immutable MAX_SUPPLY; address public royaltyReceiver; address public minter; address public metadataContract; uint256 public royaltyFraction; uint256 public royaltyDenominator = 100; /// @notice Count of valid NFTs tracked by this contract uint256 public totalSupply; /// @notice Return the baseURI used for computing `tokenURI` values string public baseURI; error OnlyMinter(); /// @dev This event emits when the metadata of a token is changed. Anyone aware of ERC-4906 can update cached /// attributes related to a given `tokenId`. event MetadataUpdate(uint256 tokenId); /// @dev This event emits when the metadata of a range of tokens is changed. Anyone aware of ERC-4906 can update /// cached attributes for tokens in the designated range. event BatchMetadataUpdate(uint256 fromTokenId, uint256 toTokenId); constructor( string memory name, string memory symbol, string memory baseURI_, uint256 maxSupply, address royaltyReceiver_, uint256 royaltyPercent ) ERC721(name, symbol) Ownable(msg.sender) { // CHECKS inputs require(maxSupply > 0, "Max supply must not be zero"); require(royaltyReceiver_ != address(0), "Royalty receiver must not be the zero address"); require(royaltyPercent <= 100, "Royalty fraction must not be greater than 100%"); // EFFECTS MAX_SUPPLY = maxSupply; baseURI = baseURI_; royaltyReceiver = royaltyReceiver_; royaltyFraction = royaltyPercent; } modifier onlyMinter() { if (msg.sender != minter) revert OnlyMinter(); _; } /// @inheritdoc Ownable function owner() public view virtual override(Ownable) returns (address) { return Ownable.owner(); } // MINTER FUNCTIONS /// @notice Mint an unclaimed token to the given address /// @dev Can only be called by the `minter` address /// @param to The new token owner that will receive the minted token /// @param tokenId The token being claimed. Reverts if invalid or already claimed. function mint(address to, uint256 tokenId) public onlyMinter { // CHECKS inputs require(tokenId > 0 && tokenId <= MAX_SUPPLY, "Invalid token ID"); // CHECKS + EFFECTS (not _safeMint, so no interactions) _mint(to, tokenId); // More EFFECTS unchecked { totalSupply++; } } function mintRange(address to, uint256 idStart, uint256 idEnd) external onlyMinter { require(idStart > 0 && idEnd <= MAX_SUPPLY, "Invalid token range"); require(idStart <= idEnd, "Start ID must be less than or equal to end ID"); for (uint256 tokenId = idStart; tokenId <= idEnd; tokenId++) { mint(to, tokenId); } } // OWNER FUNCTIONS /// @notice Set the `minter` address /// @dev Can only be called by the contract `owner` function setMinter(address minter_) external onlyOwner { minter = minter_; } /// @notice Set the `royaltyReceiver` address /// @dev Can only be called by the contract `owner` function setRoyaltyReceiver(address royaltyReceiver_) external onlyOwner { // CHECKS inputs require(royaltyReceiver_ != address(0), "Royalty receiver must not be the zero address"); // EFFECTS royaltyReceiver = royaltyReceiver_; } /// @notice Update the royalty fraction /// @dev Can only be called by the contract `owner` function setRoyaltyFraction(uint256 royaltyFraction_, uint256 royaltyDenominator_) external onlyOwner { // CHECKS inputss require(royaltyDenominator_ != 0, "Royalty denominator must not be zero"); require(royaltyFraction_ <= royaltyDenominator_, "Royalty fraction must not be greater than 100%"); // EFFECTS royaltyFraction = royaltyFraction_; royaltyDenominator = royaltyDenominator_; } /// @notice Update the baseURI for all metadata /// @dev Can only be called by the contract `owner`. Emits an ERC-4906 event. /// @param baseURI_ The new URI base. When specified, token URIs are created by concatenating the baseURI, /// token ID, and ".json". function updateBaseURI(string calldata baseURI_) external onlyOwner { // CHECKS inputs require(bytes(baseURI_).length > 0, "New base URI must be provided"); // EFFECTS baseURI = baseURI_; metadataContract = address(0); emit BatchMetadataUpdate(1, MAX_SUPPLY); } /// @notice Delegate all `tokenURI` calls to another contract /// @dev Can only be called by the contract `owner`. Emits an ERC-4906 event. /// @param delegate The contract that will handle `tokenURI` responses function delegateTokenURIs(address delegate) external onlyOwner { // CHECKS inputs require(delegate != address(0), "New metadata delegate must not be the zero address"); require(delegate.code.length > 0, "New metadata delegate must be a contract"); // EFFECTS baseURI = ""; metadataContract = delegate; emit BatchMetadataUpdate(1, MAX_SUPPLY); } // VIEW FUNCTIONS /// @notice The URI for the given token /// @dev Throws if `tokenId` is not valid or has not been minted function tokenURI(uint256 tokenId) public view override returns (string memory) { _requireOwned(tokenId); if (bytes(baseURI).length > 0) { return string(abi.encodePacked(baseURI, Strings.toString(tokenId), ".json")); } if (address(metadataContract) != address(0)) { return IERC721Metadata(metadataContract).tokenURI(tokenId); } revert("tokenURI not configured"); } /// @notice Calculate how much royalty is owed and to whom /// @param salePrice - the sale price of the NFT asset /// @return receiver - address of where the royalty payment should be sent /// @return royaltyAmount - the royalty payment amount for salePrice function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount) { receiver = royaltyReceiver; // Use OpenZeppelin math utils for full precision multiply and divide without overflow royaltyAmount = Math.mulDiv(salePrice, royaltyFraction, royaltyDenominator, Math.Rounding.Ceil); } /// @notice Query if a contract implements an interface /// @dev Interface identification is specified in ERC-165. This function uses less than 30,000 gas. /// @param interfaceId The interface identifier, as specified in ERC-165 /// @return `true` if the contract implements `interfaceID` and `interfaceID` is not 0xffffffff, `false` otherwise function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) { return interfaceId == 0x80ac58cd || // ERC-721 Non-Fungible Token Standard interfaceId == 0x5b5e139f || // ERC-721 Non-Fungible Token Standard - metadata extension interfaceId == 0x2a55205a || // ERC-2981 NFT Royalty Standard interfaceId == 0x49064906 || // ERC-4906 Metadata Update Extension interfaceId == 0x7f5828d0 || // ERC-173 Contract Ownership Standard interfaceId == 0x01ffc9a7; // ERC-165 Standard Interface Detection } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol) pragma solidity ^0.8.20; import {Panic} from "../Panic.sol"; import {SafeCast} from "./SafeCast.sol"; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an success flag (no overflow). */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow). */ function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow). */ function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a success flag (no division by zero). */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero). */ function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant. * * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone. * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute * one branch when needed, making this function more expensive. */ function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) { unchecked { // branchless ternary works because: // b ^ (a ^ b) == a // b ^ 0 == b return b ^ ((a ^ b) * SafeCast.toUint(condition)); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(a > b, a, b); } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return ternary(a < b, a, b); } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. Panic.panic(Panic.DIVISION_BY_ZERO); } // The following calculation ensures accurate ceiling division without overflow. // Since a is non-zero, (a - 1) / b will not overflow. // The largest possible result occurs when (a - 1) / b is type(uint256).max, // but the largest value we can obtain is type(uint256).max - 1, which happens // when a = type(uint256).max and b = 1. unchecked { return SafeCast.toUint(a > 0) * ((a - 1) / b + 1); } } /** * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2²⁵⁶ + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0. if (denominator <= prod1) { Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW)); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv ≡ 1 mod 2⁴. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2⁸ inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶ inverse *= 2 - denominator * inverse; // inverse mod 2³² inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴ inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸ inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶ // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @dev Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0); } /** * @dev Calculate the modular multiplicative inverse of a number in Z/nZ. * * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0. * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible. * * If the input value is not inversible, 0 is returned. * * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}. */ function invMod(uint256 a, uint256 n) internal pure returns (uint256) { unchecked { if (n == 0) return 0; // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version) // Used to compute integers x and y such that: ax + ny = gcd(a, n). // When the gcd is 1, then the inverse of a modulo n exists and it's x. // ax + ny = 1 // ax = 1 + (-y)n // ax ≡ 1 (mod n) # x is the inverse of a modulo n // If the remainder is 0 the gcd is n right away. uint256 remainder = a % n; uint256 gcd = n; // Therefore the initial coefficients are: // ax + ny = gcd(a, n) = n // 0a + 1n = n int256 x = 0; int256 y = 1; while (remainder != 0) { uint256 quotient = gcd / remainder; (gcd, remainder) = ( // The old remainder is the next gcd to try. remainder, // Compute the next remainder. // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd // where gcd is at most n (capped to type(uint256).max) gcd - remainder * quotient ); (x, y) = ( // Increment the coefficient of a. y, // Decrement the coefficient of n. // Can overflow, but the result is casted to uint256 so that the // next value of y is "wrapped around" to a value between 0 and n - 1. x - y * int256(quotient) ); } if (gcd != 1) return 0; // No inverse exists. return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative. } } /** * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`. * * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that * `a**(p-2)` is the modular multiplicative inverse of a in Fp. * * NOTE: this function does NOT check that `p` is a prime greater than `2`. */ function invModPrime(uint256 a, uint256 p) internal view returns (uint256) { unchecked { return Math.modExp(a, p - 2, p); } } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m) * * Requirements: * - modulus can't be zero * - underlying staticcall to precompile must succeed * * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make * sure the chain you're using it on supports the precompiled contract for modular exponentiation * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, * the underlying function will succeed given the lack of a revert, but the result may be incorrectly * interpreted as 0. */ function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) { (bool success, uint256 result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m). * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying * to operate modulo 0 or if the underlying precompile reverted. * * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack * of a revert, but the result may be incorrectly interpreted as 0. */ function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) { if (m == 0) return (false, 0); assembly ("memory-safe") { let ptr := mload(0x40) // | Offset | Content | Content (Hex) | // |-----------|------------|--------------------------------------------------------------------| // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 | // | 0x60:0x7f | value of b | 0x<.............................................................b> | // | 0x80:0x9f | value of e | 0x<.............................................................e> | // | 0xa0:0xbf | value of m | 0x<.............................................................m> | mstore(ptr, 0x20) mstore(add(ptr, 0x20), 0x20) mstore(add(ptr, 0x40), 0x20) mstore(add(ptr, 0x60), b) mstore(add(ptr, 0x80), e) mstore(add(ptr, 0xa0), m) // Given the result < m, it's guaranteed to fit in 32 bytes, // so we can use the memory scratch space located at offset 0. success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20) result := mload(0x00) } } /** * @dev Variant of {modExp} that supports inputs of arbitrary length. */ function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) { (bool success, bytes memory result) = tryModExp(b, e, m); if (!success) { Panic.panic(Panic.DIVISION_BY_ZERO); } return result; } /** * @dev Variant of {tryModExp} that supports inputs of arbitrary length. */ function tryModExp( bytes memory b, bytes memory e, bytes memory m ) internal view returns (bool success, bytes memory result) { if (_zeroBytes(m)) return (false, new bytes(0)); uint256 mLen = m.length; // Encode call args in result and move the free memory pointer result = abi.encodePacked(b.length, e.length, mLen, b, e, m); assembly ("memory-safe") { let dataPtr := add(result, 0x20) // Write result on top of args to avoid allocating extra memory. success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen) // Overwrite the length. // result.length > returndatasize() is guaranteed because returndatasize() == m.length mstore(result, mLen) // Set the memory pointer after the returned data. mstore(0x40, add(dataPtr, mLen)) } } /** * @dev Returns whether the provided byte array is zero. */ function _zeroBytes(bytes memory byteArray) private pure returns (bool) { for (uint256 i = 0; i < byteArray.length; ++i) { if (byteArray[i] != 0) { return false; } } return true; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * This method is based on Newton's method for computing square roots; the algorithm is restricted to only * using integer operations. */ function sqrt(uint256 a) internal pure returns (uint256) { unchecked { // Take care of easy edge cases when a == 0 or a == 1 if (a <= 1) { return a; } // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between // the current value as `ε_n = | x_n - sqrt(a) |`. // // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is // bigger than any uint256. // // By noticing that // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)` // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar // to the msb function. uint256 aa = a; uint256 xn = 1; if (aa >= (1 << 128)) { aa >>= 128; xn <<= 64; } if (aa >= (1 << 64)) { aa >>= 64; xn <<= 32; } if (aa >= (1 << 32)) { aa >>= 32; xn <<= 16; } if (aa >= (1 << 16)) { aa >>= 16; xn <<= 8; } if (aa >= (1 << 8)) { aa >>= 8; xn <<= 4; } if (aa >= (1 << 4)) { aa >>= 4; xn <<= 2; } if (aa >= (1 << 2)) { xn <<= 1; } // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1). // // We can refine our estimation by noticing that the middle of that interval minimizes the error. // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2). // This is going to be our x_0 (and ε_0) xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2) // From here, Newton's method give us: // x_{n+1} = (x_n + a / x_n) / 2 // // One should note that: // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a // = ((x_n² + a) / (2 * x_n))² - a // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²) // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²) // = (x_n² - a)² / (2 * x_n)² // = ((x_n² - a) / (2 * x_n))² // ≥ 0 // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n // // This gives us the proof of quadratic convergence of the sequence: // ε_{n+1} = | x_{n+1} - sqrt(a) | // = | (x_n + a / x_n) / 2 - sqrt(a) | // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) | // = | (x_n - sqrt(a))² / (2 * x_n) | // = | ε_n² / (2 * x_n) | // = ε_n² / | (2 * x_n) | // // For the first iteration, we have a special case where x_0 is known: // ε_1 = ε_0² / | (2 * x_0) | // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2))) // ≤ 2**(2*e-4) / (3 * 2**(e-1)) // ≤ 2**(e-3) / 3 // ≤ 2**(e-3-log2(3)) // ≤ 2**(e-4.5) // // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n: // ε_{n+1} = ε_n² / | (2 * x_n) | // ≤ (2**(e-k))² / (2 * 2**(e-1)) // ≤ 2**(2*e-2*k) / 2**e // ≤ 2**(e-2*k) xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5 xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9 xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18 xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36 xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72 // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either // sqrt(a) or sqrt(a) + 1. return xn - SafeCast.toUint(xn > a / xn); } } /** * @dev Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; uint256 exp; unchecked { exp = 128 * SafeCast.toUint(value > (1 << 128) - 1); value >>= exp; result += exp; exp = 64 * SafeCast.toUint(value > (1 << 64) - 1); value >>= exp; result += exp; exp = 32 * SafeCast.toUint(value > (1 << 32) - 1); value >>= exp; result += exp; exp = 16 * SafeCast.toUint(value > (1 << 16) - 1); value >>= exp; result += exp; exp = 8 * SafeCast.toUint(value > (1 << 8) - 1); value >>= exp; result += exp; exp = 4 * SafeCast.toUint(value > (1 << 4) - 1); value >>= exp; result += exp; exp = 2 * SafeCast.toUint(value > (1 << 2) - 1); value >>= exp; result += exp; result += SafeCast.toUint(value > 1); } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; uint256 isGt; unchecked { isGt = SafeCast.toUint(value > (1 << 128) - 1); value >>= isGt * 128; result += isGt * 16; isGt = SafeCast.toUint(value > (1 << 64) - 1); value >>= isGt * 64; result += isGt * 8; isGt = SafeCast.toUint(value > (1 << 32) - 1); value >>= isGt * 32; result += isGt * 4; isGt = SafeCast.toUint(value > (1 << 16) - 1); value >>= isGt * 16; result += isGt * 2; result += SafeCast.toUint(value > (1 << 8) - 1); } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.20; import {IERC721} from "./IERC721.sol"; import {IERC721Metadata} from "./extensions/IERC721Metadata.sol"; import {ERC721Utils} from "./utils/ERC721Utils.sol"; import {Context} from "../../utils/Context.sol"; import {Strings} from "../../utils/Strings.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; import {IERC721Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors { using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; mapping(uint256 tokenId => address) private _owners; mapping(address owner => uint256) private _balances; mapping(uint256 tokenId => address) private _tokenApprovals; mapping(address owner => mapping(address operator => 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 || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual returns (uint256) { if (owner == address(0)) { revert ERC721InvalidOwner(address(0)); } return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual returns (address) { return _requireOwned(tokenId); } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireOwned(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual { _approve(to, tokenId, _msgSender()); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual returns (address) { _requireOwned(tokenId); return _getApproved(tokenId); } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here. address previousOwner = _update(to, tokenId, _msgSender()); if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { transferFrom(from, to, tokenId); ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist * * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`. */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted. */ function _getApproved(uint256 tokenId) internal view virtual returns (address) { return _tokenApprovals[tokenId]; } /** * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in * particular (ignoring whether it is owned by `owner`). * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) { return spender != address(0) && (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender); } /** * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner. * Reverts if: * - `spender` does not have approval from `owner` for `tokenId`. * - `spender` does not have approval to manage all of `owner`'s assets. * * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this * assumption. */ function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual { if (!_isAuthorized(owner, spender, tokenId)) { if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } else { revert ERC721InsufficientApproval(spender, tokenId); } } } /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that * a uint256 would ever overflow from increments when these increments are bounded to uint128 values. * * WARNING: Increasing an account's balance using this function tends to be paired with an override of the * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership * remain consistent with one another. */ function _increaseBalance(address account, uint128 value) internal virtual { unchecked { _balances[account] += value; } } /** * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update. * * The `auth` argument is optional. If the value passed is non 0, then this function will check that * `auth` is either the owner of the token, or approved to operate on the token (by the owner). * * Emits a {Transfer} event. * * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}. */ function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) { address from = _ownerOf(tokenId); // Perform (optional) operator check if (auth != address(0)) { _checkAuthorized(from, auth, tokenId); } // Execute the update if (from != address(0)) { // Clear approval. No need to re-authorize or emit the Approval event _approve(address(0), tokenId, address(0), false); unchecked { _balances[from] -= 1; } } if (to != address(0)) { unchecked { _balances[to] += 1; } } _owners[tokenId] = to; emit Transfer(from, to, tokenId); return from; } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner != address(0)) { revert ERC721InvalidSender(address(0)); } } /** * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal { address previousOwner = _update(address(0), tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(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 { if (to == address(0)) { revert ERC721InvalidReceiver(address(0)); } address previousOwner = _update(to, tokenId, address(0)); if (previousOwner == address(0)) { revert ERC721NonexistentToken(tokenId); } else if (previousOwner != from) { revert ERC721IncorrectOwner(from, tokenId, previousOwner); } } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients * are aware of the ERC-721 standard 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 like {safeTransferFrom} in the sense that it invokes * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `tokenId` token must exist and be owned by `from`. * - `to` cannot be the zero address. * - `from` cannot be the zero address. * - 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) internal { _safeTransfer(from, to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data); } /** * @dev Approve `to` to operate on `tokenId` * * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is * either the owner of the token, or approved to operate on all tokens held by this owner. * * Emits an {Approval} event. * * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument. */ function _approve(address to, uint256 tokenId, address auth) internal { _approve(to, tokenId, auth, true); } /** * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not * emitted in the context of transfers. */ function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual { // Avoid reading the owner unless necessary if (emitEvent || auth != address(0)) { address owner = _requireOwned(tokenId); // We do not use _isAuthorized because single-token approvals should not be able to call approve if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) { revert ERC721InvalidApprover(auth); } if (emitEvent) { emit Approval(owner, to, tokenId); } } _tokenApprovals[tokenId] = to; } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Requirements: * - operator can't be the address zero. * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC721InvalidOperator(operator); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned). * Returns the owner. * * Overrides to ownership logic should be done to {_ownerOf}. */ function _requireOwned(uint256 tokenId) internal view returns (address) { address owner = _ownerOf(tokenId); if (owner == address(0)) { revert ERC721NonexistentToken(tokenId); } return owner; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol) // This file was procedurally generated from scripts/generate/templates/SafeCast.js. pragma solidity ^0.8.20; /** * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeCast { /** * @dev Value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value); /** * @dev An int value doesn't fit in an uint of `bits` size. */ error SafeCastOverflowedIntToUint(int256 value); /** * @dev Value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedIntDowncast(uint8 bits, int256 value); /** * @dev An uint value doesn't fit in an int of `bits` size. */ error SafeCastOverflowedUintToInt(uint256 value); /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits */ function toUint248(uint256 value) internal pure returns (uint248) { if (value > type(uint248).max) { revert SafeCastOverflowedUintDowncast(248, value); } return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits */ function toUint240(uint256 value) internal pure returns (uint240) { if (value > type(uint240).max) { revert SafeCastOverflowedUintDowncast(240, value); } return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits */ function toUint232(uint256 value) internal pure returns (uint232) { if (value > type(uint232).max) { revert SafeCastOverflowedUintDowncast(232, value); } return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { if (value > type(uint224).max) { revert SafeCastOverflowedUintDowncast(224, value); } return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits */ function toUint216(uint256 value) internal pure returns (uint216) { if (value > type(uint216).max) { revert SafeCastOverflowedUintDowncast(216, value); } return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits */ function toUint208(uint256 value) internal pure returns (uint208) { if (value > type(uint208).max) { revert SafeCastOverflowedUintDowncast(208, value); } return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits */ function toUint200(uint256 value) internal pure returns (uint200) { if (value > type(uint200).max) { revert SafeCastOverflowedUintDowncast(200, value); } return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits */ function toUint192(uint256 value) internal pure returns (uint192) { if (value > type(uint192).max) { revert SafeCastOverflowedUintDowncast(192, value); } return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits */ function toUint184(uint256 value) internal pure returns (uint184) { if (value > type(uint184).max) { revert SafeCastOverflowedUintDowncast(184, value); } return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits */ function toUint176(uint256 value) internal pure returns (uint176) { if (value > type(uint176).max) { revert SafeCastOverflowedUintDowncast(176, value); } return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits */ function toUint168(uint256 value) internal pure returns (uint168) { if (value > type(uint168).max) { revert SafeCastOverflowedUintDowncast(168, value); } return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits */ function toUint160(uint256 value) internal pure returns (uint160) { if (value > type(uint160).max) { revert SafeCastOverflowedUintDowncast(160, value); } return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits */ function toUint152(uint256 value) internal pure returns (uint152) { if (value > type(uint152).max) { revert SafeCastOverflowedUintDowncast(152, value); } return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits */ function toUint144(uint256 value) internal pure returns (uint144) { if (value > type(uint144).max) { revert SafeCastOverflowedUintDowncast(144, value); } return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits */ function toUint136(uint256 value) internal pure returns (uint136) { if (value > type(uint136).max) { revert SafeCastOverflowedUintDowncast(136, value); } return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { if (value > type(uint128).max) { revert SafeCastOverflowedUintDowncast(128, value); } return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits */ function toUint120(uint256 value) internal pure returns (uint120) { if (value > type(uint120).max) { revert SafeCastOverflowedUintDowncast(120, value); } return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits */ function toUint112(uint256 value) internal pure returns (uint112) { if (value > type(uint112).max) { revert SafeCastOverflowedUintDowncast(112, value); } return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits */ function toUint104(uint256 value) internal pure returns (uint104) { if (value > type(uint104).max) { revert SafeCastOverflowedUintDowncast(104, value); } return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { if (value > type(uint96).max) { revert SafeCastOverflowedUintDowncast(96, value); } return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint88` operator. * * Requirements: * * - input must fit into 88 bits */ function toUint88(uint256 value) internal pure returns (uint88) { if (value > type(uint88).max) { revert SafeCastOverflowedUintDowncast(88, value); } return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint80` operator. * * Requirements: * * - input must fit into 80 bits */ function toUint80(uint256 value) internal pure returns (uint80) { if (value > type(uint80).max) { revert SafeCastOverflowedUintDowncast(80, value); } return uint80(value); } /** * @dev Returns the downcasted uint72 from uint256, reverting on * overflow (when the input is greater than largest uint72). * * Counterpart to Solidity's `uint72` operator. * * Requirements: * * - input must fit into 72 bits */ function toUint72(uint256 value) internal pure returns (uint72) { if (value > type(uint72).max) { revert SafeCastOverflowedUintDowncast(72, value); } return uint72(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { revert SafeCastOverflowedUintDowncast(64, value); } return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits */ function toUint56(uint256 value) internal pure returns (uint56) { if (value > type(uint56).max) { revert SafeCastOverflowedUintDowncast(56, value); } return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits */ function toUint48(uint256 value) internal pure returns (uint48) { if (value > type(uint48).max) { revert SafeCastOverflowedUintDowncast(48, value); } return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits */ function toUint40(uint256 value) internal pure returns (uint40) { if (value > type(uint40).max) { revert SafeCastOverflowedUintDowncast(40, value); } return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { if (value > type(uint32).max) { revert SafeCastOverflowedUintDowncast(32, value); } return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits */ function toUint24(uint256 value) internal pure returns (uint24) { if (value > type(uint24).max) { revert SafeCastOverflowedUintDowncast(24, value); } return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { if (value > type(uint16).max) { revert SafeCastOverflowedUintDowncast(16, value); } return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits */ function toUint8(uint256 value) internal pure returns (uint8) { if (value > type(uint8).max) { revert SafeCastOverflowedUintDowncast(8, value); } return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { if (value < 0) { revert SafeCastOverflowedIntToUint(value); } return uint256(value); } /** * @dev Returns the downcasted int248 from int256, reverting on * overflow (when the input is less than smallest int248 or * greater than largest int248). * * Counterpart to Solidity's `int248` operator. * * Requirements: * * - input must fit into 248 bits */ function toInt248(int256 value) internal pure returns (int248 downcasted) { downcasted = int248(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(248, value); } } /** * @dev Returns the downcasted int240 from int256, reverting on * overflow (when the input is less than smallest int240 or * greater than largest int240). * * Counterpart to Solidity's `int240` operator. * * Requirements: * * - input must fit into 240 bits */ function toInt240(int256 value) internal pure returns (int240 downcasted) { downcasted = int240(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(240, value); } } /** * @dev Returns the downcasted int232 from int256, reverting on * overflow (when the input is less than smallest int232 or * greater than largest int232). * * Counterpart to Solidity's `int232` operator. * * Requirements: * * - input must fit into 232 bits */ function toInt232(int256 value) internal pure returns (int232 downcasted) { downcasted = int232(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(232, value); } } /** * @dev Returns the downcasted int224 from int256, reverting on * overflow (when the input is less than smallest int224 or * greater than largest int224). * * Counterpart to Solidity's `int224` operator. * * Requirements: * * - input must fit into 224 bits */ function toInt224(int256 value) internal pure returns (int224 downcasted) { downcasted = int224(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(224, value); } } /** * @dev Returns the downcasted int216 from int256, reverting on * overflow (when the input is less than smallest int216 or * greater than largest int216). * * Counterpart to Solidity's `int216` operator. * * Requirements: * * - input must fit into 216 bits */ function toInt216(int256 value) internal pure returns (int216 downcasted) { downcasted = int216(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(216, value); } } /** * @dev Returns the downcasted int208 from int256, reverting on * overflow (when the input is less than smallest int208 or * greater than largest int208). * * Counterpart to Solidity's `int208` operator. * * Requirements: * * - input must fit into 208 bits */ function toInt208(int256 value) internal pure returns (int208 downcasted) { downcasted = int208(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(208, value); } } /** * @dev Returns the downcasted int200 from int256, reverting on * overflow (when the input is less than smallest int200 or * greater than largest int200). * * Counterpart to Solidity's `int200` operator. * * Requirements: * * - input must fit into 200 bits */ function toInt200(int256 value) internal pure returns (int200 downcasted) { downcasted = int200(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(200, value); } } /** * @dev Returns the downcasted int192 from int256, reverting on * overflow (when the input is less than smallest int192 or * greater than largest int192). * * Counterpart to Solidity's `int192` operator. * * Requirements: * * - input must fit into 192 bits */ function toInt192(int256 value) internal pure returns (int192 downcasted) { downcasted = int192(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(192, value); } } /** * @dev Returns the downcasted int184 from int256, reverting on * overflow (when the input is less than smallest int184 or * greater than largest int184). * * Counterpart to Solidity's `int184` operator. * * Requirements: * * - input must fit into 184 bits */ function toInt184(int256 value) internal pure returns (int184 downcasted) { downcasted = int184(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(184, value); } } /** * @dev Returns the downcasted int176 from int256, reverting on * overflow (when the input is less than smallest int176 or * greater than largest int176). * * Counterpart to Solidity's `int176` operator. * * Requirements: * * - input must fit into 176 bits */ function toInt176(int256 value) internal pure returns (int176 downcasted) { downcasted = int176(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(176, value); } } /** * @dev Returns the downcasted int168 from int256, reverting on * overflow (when the input is less than smallest int168 or * greater than largest int168). * * Counterpart to Solidity's `int168` operator. * * Requirements: * * - input must fit into 168 bits */ function toInt168(int256 value) internal pure returns (int168 downcasted) { downcasted = int168(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(168, value); } } /** * @dev Returns the downcasted int160 from int256, reverting on * overflow (when the input is less than smallest int160 or * greater than largest int160). * * Counterpart to Solidity's `int160` operator. * * Requirements: * * - input must fit into 160 bits */ function toInt160(int256 value) internal pure returns (int160 downcasted) { downcasted = int160(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(160, value); } } /** * @dev Returns the downcasted int152 from int256, reverting on * overflow (when the input is less than smallest int152 or * greater than largest int152). * * Counterpart to Solidity's `int152` operator. * * Requirements: * * - input must fit into 152 bits */ function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(152, value); } } /** * @dev Returns the downcasted int144 from int256, reverting on * overflow (when the input is less than smallest int144 or * greater than largest int144). * * Counterpart to Solidity's `int144` operator. * * Requirements: * * - input must fit into 144 bits */ function toInt144(int256 value) internal pure returns (int144 downcasted) { downcasted = int144(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(144, value); } } /** * @dev Returns the downcasted int136 from int256, reverting on * overflow (when the input is less than smallest int136 or * greater than largest int136). * * Counterpart to Solidity's `int136` operator. * * Requirements: * * - input must fit into 136 bits */ function toInt136(int256 value) internal pure returns (int136 downcasted) { downcasted = int136(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(136, value); } } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits */ function toInt128(int256 value) internal pure returns (int128 downcasted) { downcasted = int128(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(128, value); } } /** * @dev Returns the downcasted int120 from int256, reverting on * overflow (when the input is less than smallest int120 or * greater than largest int120). * * Counterpart to Solidity's `int120` operator. * * Requirements: * * - input must fit into 120 bits */ function toInt120(int256 value) internal pure returns (int120 downcasted) { downcasted = int120(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(120, value); } } /** * @dev Returns the downcasted int112 from int256, reverting on * overflow (when the input is less than smallest int112 or * greater than largest int112). * * Counterpart to Solidity's `int112` operator. * * Requirements: * * - input must fit into 112 bits */ function toInt112(int256 value) internal pure returns (int112 downcasted) { downcasted = int112(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(112, value); } } /** * @dev Returns the downcasted int104 from int256, reverting on * overflow (when the input is less than smallest int104 or * greater than largest int104). * * Counterpart to Solidity's `int104` operator. * * Requirements: * * - input must fit into 104 bits */ function toInt104(int256 value) internal pure returns (int104 downcasted) { downcasted = int104(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(104, value); } } /** * @dev Returns the downcasted int96 from int256, reverting on * overflow (when the input is less than smallest int96 or * greater than largest int96). * * Counterpart to Solidity's `int96` operator. * * Requirements: * * - input must fit into 96 bits */ function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(96, value); } } /** * @dev Returns the downcasted int88 from int256, reverting on * overflow (when the input is less than smallest int88 or * greater than largest int88). * * Counterpart to Solidity's `int88` operator. * * Requirements: * * - input must fit into 88 bits */ function toInt88(int256 value) internal pure returns (int88 downcasted) { downcasted = int88(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(88, value); } } /** * @dev Returns the downcasted int80 from int256, reverting on * overflow (when the input is less than smallest int80 or * greater than largest int80). * * Counterpart to Solidity's `int80` operator. * * Requirements: * * - input must fit into 80 bits */ function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(80, value); } } /** * @dev Returns the downcasted int72 from int256, reverting on * overflow (when the input is less than smallest int72 or * greater than largest int72). * * Counterpart to Solidity's `int72` operator. * * Requirements: * * - input must fit into 72 bits */ function toInt72(int256 value) internal pure returns (int72 downcasted) { downcasted = int72(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(72, value); } } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits */ function toInt64(int256 value) internal pure returns (int64 downcasted) { downcasted = int64(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(64, value); } } /** * @dev Returns the downcasted int56 from int256, reverting on * overflow (when the input is less than smallest int56 or * greater than largest int56). * * Counterpart to Solidity's `int56` operator. * * Requirements: * * - input must fit into 56 bits */ function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(56, value); } } /** * @dev Returns the downcasted int48 from int256, reverting on * overflow (when the input is less than smallest int48 or * greater than largest int48). * * Counterpart to Solidity's `int48` operator. * * Requirements: * * - input must fit into 48 bits */ function toInt48(int256 value) internal pure returns (int48 downcasted) { downcasted = int48(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(48, value); } } /** * @dev Returns the downcasted int40 from int256, reverting on * overflow (when the input is less than smallest int40 or * greater than largest int40). * * Counterpart to Solidity's `int40` operator. * * Requirements: * * - input must fit into 40 bits */ function toInt40(int256 value) internal pure returns (int40 downcasted) { downcasted = int40(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(40, value); } } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits */ function toInt32(int256 value) internal pure returns (int32 downcasted) { downcasted = int32(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(32, value); } } /** * @dev Returns the downcasted int24 from int256, reverting on * overflow (when the input is less than smallest int24 or * greater than largest int24). * * Counterpart to Solidity's `int24` operator. * * Requirements: * * - input must fit into 24 bits */ function toInt24(int256 value) internal pure returns (int24 downcasted) { downcasted = int24(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(24, value); } } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits */ function toInt16(int256 value) internal pure returns (int16 downcasted) { downcasted = int16(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(16, value); } } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits */ function toInt8(int256 value) internal pure returns (int8 downcasted) { downcasted = int8(value); if (downcasted != value) { revert SafeCastOverflowedIntDowncast(8, value); } } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive if (value > uint256(type(int256).max)) { revert SafeCastOverflowedUintToInt(value); } return int256(value); } /** * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump. */ function toUint(bool b) internal pure returns (uint256 u) { assembly ("memory-safe") { u := iszero(iszero(b)) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol) pragma solidity ^0.8.20; /** * @dev Helper library for emitting standardized panic codes. * * ```solidity * contract Example { * using Panic for uint256; * * // Use any of the declared internal constants * function foo() { Panic.GENERIC.panic(); } * * // Alternatively * function foo() { Panic.panic(Panic.GENERIC); } * } * ``` * * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil]. * * _Available since v5.1._ */ // slither-disable-next-line unused-state library Panic { /// @dev generic / unspecified error uint256 internal constant GENERIC = 0x00; /// @dev used by the assert() builtin uint256 internal constant ASSERT = 0x01; /// @dev arithmetic underflow or overflow uint256 internal constant UNDER_OVERFLOW = 0x11; /// @dev division or modulo by zero uint256 internal constant DIVISION_BY_ZERO = 0x12; /// @dev enum conversion error uint256 internal constant ENUM_CONVERSION_ERROR = 0x21; /// @dev invalid encoding in storage uint256 internal constant STORAGE_ENCODING_ERROR = 0x22; /// @dev empty array pop uint256 internal constant EMPTY_ARRAY_POP = 0x31; /// @dev array out of bounds access uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32; /// @dev resource error (too large allocation or too large array) uint256 internal constant RESOURCE_ERROR = 0x41; /// @dev calling invalid internal function uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51; /// @dev Reverts with a panic code. Recommended to use with /// the internal constants with predefined codes. function panic(uint256 code) internal pure { assembly ("memory-safe") { mstore(0x00, 0x4e487b71) mstore(0x20, code) revert(0x1c, 0x24) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC-20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC-721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC-1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.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 ERC-165 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.2.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SafeCast} from "./math/SafeCast.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { using SafeCast for *; bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev The string being parsed contains characters that are not in scope of the given base. */ error StringsInvalidChar(); /** * @dev The string being parsed is not a properly formatted address. */ error StringsInvalidAddressFormat(); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; assembly ("memory-safe") { ptr := add(buffer, add(32, length)) } while (true) { ptr--; assembly ("memory-safe") { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal * representation, according to EIP-55. */ function toChecksumHexString(address addr) internal pure returns (string memory) { bytes memory buffer = bytes(toHexString(addr)); // hash the hex part of buffer (skip length + 2 bytes, length 40) uint256 hashValue; assembly ("memory-safe") { hashValue := shr(96, keccak256(add(buffer, 0x22), 40)) } for (uint256 i = 41; i > 1; --i) { // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f) if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) { // case shift by xoring with 0x20 buffer[i] ^= 0x20; } hashValue >>= 4; } return string(buffer); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } /** * @dev Parse a decimal string and returns the value as a `uint256`. * * Requirements: * - The string must be formatted as `[0-9]*` * - The result must fit into an `uint256` type */ function parseUint(string memory input) internal pure returns (uint256) { return parseUint(input, 0, bytes(input).length); } /** * @dev Variant of {parseUint} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `[0-9]*` * - The result must fit into an `uint256` type */ function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) { (bool success, uint256 value) = tryParseUint(input, begin, end); if (!success) revert StringsInvalidChar(); return value; } /** * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) { return _tryParseUintUncheckedBounds(input, 0, bytes(input).length); } /** * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid * character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseUint( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, uint256 value) { if (end > bytes(input).length || begin > end) return (false, 0); return _tryParseUintUncheckedBounds(input, begin, end); } /** * @dev Implementation of {tryParseUint} that does not check bounds. Caller should make sure that * `begin <= end <= input.length`. Other inputs would result in undefined behavior. */ function _tryParseUintUncheckedBounds( string memory input, uint256 begin, uint256 end ) private pure returns (bool success, uint256 value) { bytes memory buffer = bytes(input); uint256 result = 0; for (uint256 i = begin; i < end; ++i) { uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i))); if (chr > 9) return (false, 0); result *= 10; result += chr; } return (true, result); } /** * @dev Parse a decimal string and returns the value as a `int256`. * * Requirements: * - The string must be formatted as `[-+]?[0-9]*` * - The result must fit in an `int256` type. */ function parseInt(string memory input) internal pure returns (int256) { return parseInt(input, 0, bytes(input).length); } /** * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `[-+]?[0-9]*` * - The result must fit in an `int256` type. */ function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) { (bool success, int256 value) = tryParseInt(input, begin, end); if (!success) revert StringsInvalidChar(); return value; } /** * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if * the result does not fit in a `int256`. * * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`. */ function tryParseInt(string memory input) internal pure returns (bool success, int256 value) { return _tryParseIntUncheckedBounds(input, 0, bytes(input).length); } uint256 private constant ABS_MIN_INT256 = 2 ** 255; /** * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid * character or if the result does not fit in a `int256`. * * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`. */ function tryParseInt( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, int256 value) { if (end > bytes(input).length || begin > end) return (false, 0); return _tryParseIntUncheckedBounds(input, begin, end); } /** * @dev Implementation of {tryParseInt} that does not check bounds. Caller should make sure that * `begin <= end <= input.length`. Other inputs would result in undefined behavior. */ function _tryParseIntUncheckedBounds( string memory input, uint256 begin, uint256 end ) private pure returns (bool success, int256 value) { bytes memory buffer = bytes(input); // Check presence of a negative sign. bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty bool positiveSign = sign == bytes1("+"); bool negativeSign = sign == bytes1("-"); uint256 offset = (positiveSign || negativeSign).toUint(); (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end); if (absSuccess && absValue < ABS_MIN_INT256) { return (true, negativeSign ? -int256(absValue) : int256(absValue)); } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) { return (true, type(int256).min); } else return (false, 0); } /** * @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as a `uint256`. * * Requirements: * - The string must be formatted as `(0x)?[0-9a-fA-F]*` * - The result must fit in an `uint256` type. */ function parseHexUint(string memory input) internal pure returns (uint256) { return parseHexUint(input, 0, bytes(input).length); } /** * @dev Variant of {parseHexUint} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `(0x)?[0-9a-fA-F]*` * - The result must fit in an `uint256` type. */ function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) { (bool success, uint256 value) = tryParseHexUint(input, begin, end); if (!success) revert StringsInvalidChar(); return value; } /** * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) { return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length); } /** * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an * invalid character. * * NOTE: This function will revert if the result does not fit in a `uint256`. */ function tryParseHexUint( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, uint256 value) { if (end > bytes(input).length || begin > end) return (false, 0); return _tryParseHexUintUncheckedBounds(input, begin, end); } /** * @dev Implementation of {tryParseHexUint} that does not check bounds. Caller should make sure that * `begin <= end <= input.length`. Other inputs would result in undefined behavior. */ function _tryParseHexUintUncheckedBounds( string memory input, uint256 begin, uint256 end ) private pure returns (bool success, uint256 value) { bytes memory buffer = bytes(input); // skip 0x prefix if present bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty uint256 offset = hasPrefix.toUint() * 2; uint256 result = 0; for (uint256 i = begin + offset; i < end; ++i) { uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i))); if (chr > 15) return (false, 0); result *= 16; unchecked { // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check). // This guaratees that adding a value < 16 will not cause an overflow, hence the unchecked. result += chr; } } return (true, result); } /** * @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as an `address`. * * Requirements: * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}` */ function parseAddress(string memory input) internal pure returns (address) { return parseAddress(input, 0, bytes(input).length); } /** * @dev Variant of {parseAddress} that parses a substring of `input` located between position `begin` (included) and * `end` (excluded). * * Requirements: * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}` */ function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) { (bool success, address value) = tryParseAddress(input, begin, end); if (!success) revert StringsInvalidAddressFormat(); return value; } /** * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly * formatted address. See {parseAddress} requirements. */ function tryParseAddress(string memory input) internal pure returns (bool success, address value) { return tryParseAddress(input, 0, bytes(input).length); } /** * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly * formatted address. See {parseAddress} requirements. */ function tryParseAddress( string memory input, uint256 begin, uint256 end ) internal pure returns (bool success, address value) { if (end > bytes(input).length || begin > end) return (false, address(0)); bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty uint256 expectedLength = 40 + hasPrefix.toUint() * 2; // check that input is the correct length if (end - begin == expectedLength) { // length guarantees that this does not overflow, and value is at most type(uint160).max (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end); return (s, address(uint160(v))); } else { return (false, address(0)); } } function _tryParseChr(bytes1 chr) private pure returns (uint8) { uint8 value = uint8(chr); // Try to parse `chr`: // - Case 1: [0-9] // - Case 2: [a-f] // - Case 3: [A-F] // - otherwise not supported unchecked { if (value > 47 && value < 58) value -= 48; else if (value > 96 && value < 103) value -= 87; else if (value > 64 && value < 71) value -= 55; else return type(uint8).max; } return value; } /** * @dev Reads a bytes32 from a bytes array without bounds checking. * * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the * assembly block as such would prevent some optimizations. */ function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) { // This is not memory safe in the general case, but all calls to this private function are within bounds. assembly ("memory-safe") { value := mload(add(buffer, add(0x20, offset))) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol) pragma solidity ^0.8.20; import {IERC721Receiver} from "../IERC721Receiver.sol"; import {IERC721Errors} from "../../../interfaces/draft-IERC6093.sol"; /** * @dev Library that provide common ERC-721 utility functions. * * See https://eips.ethereum.org/EIPS/eip-721[ERC-721]. * * _Available since v5.1._ */ library ERC721Utils { /** * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received} * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`). * * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA). * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept * the transfer. */ function checkOnERC721Received( address operator, address from, address to, uint256 tokenId, bytes memory data ) internal { if (to.code.length > 0) { try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) { if (retval != IERC721Receiver.onERC721Received.selector) { // Token rejected revert IERC721Errors.ERC721InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { // non-IERC721Receiver implementer revert IERC721Errors.ERC721InvalidReceiver(to); } else { assembly ("memory-safe") { revert(add(32, reason), mload(reason)) } } } } } }
// 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.1.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC-721 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 ERC-721 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 ERC-721 * 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.1.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC-165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[ERC]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; import {SafeCast} from "./SafeCast.sol"; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant. * * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone. * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute * one branch when needed, making this function more expensive. */ function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) { unchecked { // branchless ternary works because: // b ^ (a ^ b) == a // b ^ 0 == b return b ^ ((a ^ b) * int256(SafeCast.toUint(condition))); } } /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return ternary(a > b, a, b); } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return ternary(a < b, a, b); } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson. // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift, // taking advantage of the most significant (or "sign" bit) in two's complement representation. // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result, // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative). int256 mask = n >> 255; // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it. return uint256((n + mask) ^ mask); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.20; /** * @title ERC-721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC-721 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); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "remappings": [] }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"baseURI_","type":"string"},{"internalType":"uint256","name":"maxSupply","type":"uint256"},{"internalType":"address","name":"royaltyReceiver_","type":"address"},{"internalType":"uint256","name":"royaltyPercent","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[],"name":"OnlyMinter","type":"error"},{"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":false,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"MetadataUpdate","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":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"delegate","type":"address"}],"name":"delegateTokenURIs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadataContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"idStart","type":"uint256"},{"internalType":"uint256","name":"idEnd","type":"uint256"}],"name":"mintRange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[],"name":"royaltyDenominator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyFraction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"address","name":"minter_","type":"address"}],"name":"setMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"royaltyFraction_","type":"uint256"},{"internalType":"uint256","name":"royaltyDenominator_","type":"uint256"}],"name":"setRoyaltyFraction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"royaltyReceiver_","type":"address"}],"name":"setRoyaltyReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"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"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"updateBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040526064600b55348015610014575f5ffd5b506040516123ad3803806123ad833981016040819052610033916102da565b3386865f6100418382610423565b50600161004e8282610423565b5050506001600160a01b03811661007f57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b610088816101ec565b505f83116100d85760405162461bcd60e51b815260206004820152601b60248201527f4d617820737570706c79206d757374206e6f74206265207a65726f00000000006044820152606401610076565b6001600160a01b0382166101445760405162461bcd60e51b815260206004820152602d60248201527f526f79616c7479207265636569766572206d757374206e6f742062652074686560448201526c207a65726f206164647265737360981b6064820152608401610076565b60648111156101ac5760405162461bcd60e51b815260206004820152602e60248201527f526f79616c7479206672616374696f6e206d757374206e6f742062652067726560448201526d61746572207468616e203130302560901b6064820152608401610076565b6080839052600d6101bd8582610423565b50600780546001600160a01b0319166001600160a01b039390931692909217909155600a55506104dd92505050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112610260575f5ffd5b81516001600160401b038111156102795761027961023d565b604051601f8201601f19908116603f011681016001600160401b03811182821017156102a7576102a761023d565b6040528181528382016020018510156102be575f5ffd5b8160208501602083015e5f918101602001919091529392505050565b5f5f5f5f5f5f60c087890312156102ef575f5ffd5b86516001600160401b03811115610304575f5ffd5b61031089828a01610251565b602089015190975090506001600160401b0381111561032d575f5ffd5b61033989828a01610251565b604089015190965090506001600160401b03811115610356575f5ffd5b61036289828a01610251565b606089015160808a0151919650945090506001600160a01b0381168114610387575f5ffd5b60a09790970151959894975092959194919391925050565b600181811c908216806103b357607f821691505b6020821081036103d157634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561041e57805f5260205f20601f840160051c810160208510156103fc5750805b601f840160051c820191505b8181101561041b575f8155600101610408565b50505b505050565b81516001600160401b0381111561043c5761043c61023d565b6104508161044a845461039f565b846103d7565b6020601f821160018114610482575f831561046b5750848201515b5f19600385901b1c1916600184901b17845561041b565b5f84815260208120601f198516915b828110156104b15787850151825560209485019460019092019101610491565b50848210156104ce57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b608051611ea361050a5f395f81816106d10152818161081101528181610ac20152610cc50152611ea35ff3fe608060405234801561000f575f5ffd5b50600436106101dc575f3560e01c8063715018a611610109578063c87b56dd1161009e578063ecededad1161006e578063ecededad146103ff578063f2fde38b14610412578063fca3b5aa14610425578063fd8d7ed314610438575f5ffd5b8063c87b56dd146103bd578063e7dee99f146103d0578063e985e9c5146103d9578063ea8876fa146103ec575f5ffd5b806395d89b41116100d957806395d89b411461037c5780639fbc871314610384578063a22cb46514610397578063b88d4fde146103aa575f5ffd5b8063715018a6146103465780638da5cb5b1461034e5780638dc251e314610356578063931688cb14610369575f5ffd5b806323b872dd1161017f57806342842e0e1161014f57806342842e0e146103055780636352211e146103185780636c0360eb1461032b57806370a0823114610333575f5ffd5b806323b872dd1461029a5780632a55205a146102ad57806335209821146102df57806340c10f19146102f2575f5ffd5b8063081812fc116101ba578063081812fc14610248578063095ea7b31461025b578063113b98e01461027057806318160ddd14610283575f5ffd5b806301ffc9a7146101e057806306fdde0314610208578063075461721461021d575b5f5ffd5b6101f36101ee36600461175a565b610441565b60405190151581526020015b60405180910390f35b6102106104e3565b6040516101ff91906117a3565b600854610230906001600160a01b031681565b6040516001600160a01b0390911681526020016101ff565b6102306102563660046117b5565b610572565b61026e6102693660046117e7565b610599565b005b61026e61027e36600461180f565b6105a8565b61028c600c5481565b6040519081526020016101ff565b61026e6102a8366004611828565b610723565b6102c06102bb366004611862565b6107ac565b604080516001600160a01b0390931683526020830191909152016101ff565b600954610230906001600160a01b031681565b61026e6103003660046117e7565b6107da565b61026e610313366004611828565b61088a565b6102306103263660046117b5565b6108a9565b6102106108b3565b61028c61034136600461180f565b61093f565b61026e610984565b610230610997565b61026e61036436600461180f565b6109af565b61026e610377366004611882565b610a45565b610210610b15565b600754610230906001600160a01b031681565b61026e6103a53660046118f0565b610b24565b61026e6103b8366004611995565b610b2f565b6102106103cb3660046117b5565b610b47565b61028c600a5481565b6101f36103e7366004611a39565b610c61565b61026e6103fa366004611a61565b610c8e565b61026e61040d366004611862565b610db5565b61026e61042036600461180f565b610e8a565b61026e61043336600461180f565b610ec7565b61028c600b5481565b5f6380ac58cd60e01b6001600160e01b0319831614806104715750635b5e139f60e01b6001600160e01b03198316145b8061048c575063152a902d60e11b6001600160e01b03198316145b806104a75750632483248360e11b6001600160e01b03198316145b806104c257506307f5828d60e41b6001600160e01b03198316145b806104dd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60605f80546104f190611a91565b80601f016020809104026020016040519081016040528092919081815260200182805461051d90611a91565b80156105685780601f1061053f57610100808354040283529160200191610568565b820191905f5260205f20905b81548152906001019060200180831161054b57829003601f168201915b5050505050905090565b5f61057c82610ef1565b505f828152600460205260409020546001600160a01b03166104dd565b6105a4828233610f29565b5050565b6105b0610f36565b6001600160a01b0381166106265760405162461bcd60e51b815260206004820152603260248201527f4e6577206d657461646174612064656c6567617465206d757374206e6f7420626044820152716520746865207a65726f206164647265737360701b60648201526084015b60405180910390fd5b5f816001600160a01b03163b116106905760405162461bcd60e51b815260206004820152602860248201527f4e6577206d657461646174612064656c6567617465206d75737420626520612060448201526718dbdb9d1c9858dd60c21b606482015260840161061d565b60408051602081019091525f8152600d906106ab9082611b0d565b50600980546001600160a01b0319166001600160a01b03831617905560408051600181527f000000000000000000000000000000000000000000000000000000000000000060208201527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a150565b6001600160a01b03821661074c57604051633250574960e11b81525f600482015260240161061d565b5f610758838333610f68565b9050836001600160a01b0316816001600160a01b0316146107a6576040516364283d7b60e01b81526001600160a01b038086166004830152602482018490528216604482015260640161061d565b50505050565b600754600a54600b546001600160a01b03909216915f916107d191859190600161105c565b90509250929050565b6008546001600160a01b0316331461080557604051639cdc2ed560e01b815260040160405180910390fd5b5f8111801561083457507f00000000000000000000000000000000000000000000000000000000000000008111155b6108735760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a59081d1bdad95b88125160821b604482015260640161061d565b61087d82826110a7565b5050600c80546001019055565b6108a483838360405180602001604052805f815250610b2f565b505050565b5f6104dd82610ef1565b600d80546108c090611a91565b80601f01602080910402602001604051908101604052809291908181526020018280546108ec90611a91565b80156109375780601f1061090e57610100808354040283529160200191610937565b820191905f5260205f20905b81548152906001019060200180831161091a57829003601f168201915b505050505081565b5f6001600160a01b038216610969576040516322718ad960e21b81525f600482015260240161061d565b506001600160a01b03165f9081526003602052604090205490565b61098c610f36565b6109955f611108565b565b5f6109aa6006546001600160a01b031690565b905090565b6109b7610f36565b6001600160a01b038116610a235760405162461bcd60e51b815260206004820152602d60248201527f526f79616c7479207265636569766572206d757374206e6f742062652074686560448201526c207a65726f206164647265737360981b606482015260840161061d565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b610a4d610f36565b80610a9a5760405162461bcd60e51b815260206004820152601d60248201527f4e6577206261736520555249206d7573742062652070726f7669646564000000604482015260640161061d565b600d610aa7828483611bc8565b50600980546001600160a01b031916905560408051600181527f000000000000000000000000000000000000000000000000000000000000000060208201527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a15050565b6060600180546104f190611a91565b6105a4338383611159565b610b3a848484610723565b6107a633858585856111f7565b6060610b5282610ef1565b505f600d8054610b6190611a91565b90501115610b9b57600d610b748361131f565b604051602001610b85929190611c82565b6040516020818303038152906040529050919050565b6009546001600160a01b031615610c195760095460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd906024015f60405180830381865afa158015610bf2573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526104dd9190810190611d0d565b60405162461bcd60e51b815260206004820152601760248201527f746f6b656e555249206e6f7420636f6e66696775726564000000000000000000604482015260640161061d565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b6008546001600160a01b03163314610cb957604051639cdc2ed560e01b815260040160405180910390fd5b5f82118015610ce857507f00000000000000000000000000000000000000000000000000000000000000008111155b610d2a5760405162461bcd60e51b8152602060048201526013602482015272496e76616c696420746f6b656e2072616e676560681b604482015260640161061d565b80821115610d905760405162461bcd60e51b815260206004820152602d60248201527f5374617274204944206d757374206265206c657373207468616e206f7220657160448201526c1d585b081d1bc8195b99081251609a1b606482015260840161061d565b815b8181116107a657610da384826107da565b80610dad81611d96565b915050610d92565b610dbd610f36565b805f03610e185760405162461bcd60e51b8152602060048201526024808201527f526f79616c74792064656e6f6d696e61746f72206d757374206e6f74206265206044820152637a65726f60e01b606482015260840161061d565b80821115610e7f5760405162461bcd60e51b815260206004820152602e60248201527f526f79616c7479206672616374696f6e206d757374206e6f742062652067726560448201526d61746572207468616e203130302560901b606482015260840161061d565b600a91909155600b55565b610e92610f36565b6001600160a01b038116610ebb57604051631e4fbdf760e01b81525f600482015260240161061d565b610ec481611108565b50565b610ecf610f36565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b5f818152600260205260408120546001600160a01b0316806104dd57604051637e27328960e01b81526004810184905260240161061d565b6108a483838360016113af565b33610f3f610997565b6001600160a01b0316146109955760405163118cdaa760e01b815233600482015260240161061d565b5f828152600260205260408120546001600160a01b0390811690831615610f9457610f948184866114b3565b6001600160a01b03811615610fce57610faf5f855f5f6113af565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b03851615610ffc576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a490505b9392505050565b5f61108961106983611517565b801561108457505f848061107f5761107f611dae565b868809115b151590565b611094868686611543565b61109e9190611dc2565b95945050505050565b6001600160a01b0382166110d057604051633250574960e11b81525f600482015260240161061d565b5f6110dc83835f610f68565b90506001600160a01b038116156108a4576040516339e3563760e11b81525f600482015260240161061d565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b03821661118b57604051630b61174360e31b81526001600160a01b038316600482015260240161061d565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b1561131857604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611239908890889087908790600401611dd5565b6020604051808303815f875af1925050508015611273575060408051601f3d908101601f1916820190925261127091810190611e11565b60015b6112da573d8080156112a0576040519150601f19603f3d011682016040523d82523d5f602084013e6112a5565b606091505b5080515f036112d257604051633250574960e11b81526001600160a01b038516600482015260240161061d565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461131657604051633250574960e11b81526001600160a01b038516600482015260240161061d565b505b5050505050565b60605f61132b836115f9565b60010190505f8167ffffffffffffffff81111561134a5761134a611929565b6040519080825280601f01601f191660200182016040528015611374576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461137e57509392505050565b80806113c357506001600160a01b03821615155b15611484575f6113d284610ef1565b90506001600160a01b038316158015906113fe5750826001600160a01b0316816001600160a01b031614155b8015611411575061140f8184610c61565b155b1561143a5760405163a9fbf51f60e01b81526001600160a01b038416600482015260240161061d565b81156114825783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6114be8383836116d0565b6108a4576001600160a01b0383166114ec57604051637e27328960e01b81526004810182905260240161061d565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440161061d565b5f600282600381111561152c5761152c611e2c565b6115369190611e40565b60ff166001149050919050565b5f838302815f1985870982811083820303915050805f036115775783828161156d5761156d611dae565b0492505050611055565b80841161158e5761158e6003851502601118611734565b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106116375772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611663576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061168157662386f26fc10000830492506010015b6305f5e1008310611699576305f5e100830492506008015b61271083106116ad57612710830492506004015b606483106116bf576064830492506002015b600a83106104dd5760010192915050565b5f6001600160a01b0383161580159061172c5750826001600160a01b0316846001600160a01b0316148061170957506117098484610c61565b8061172c57505f828152600460205260409020546001600160a01b038481169116145b949350505050565b634e487b715f52806020526024601cfd5b6001600160e01b031981168114610ec4575f5ffd5b5f6020828403121561176a575f5ffd5b813561105581611745565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f6110556020830184611775565b5f602082840312156117c5575f5ffd5b5035919050565b80356001600160a01b03811681146117e2575f5ffd5b919050565b5f5f604083850312156117f8575f5ffd5b611801836117cc565b946020939093013593505050565b5f6020828403121561181f575f5ffd5b611055826117cc565b5f5f5f6060848603121561183a575f5ffd5b611843846117cc565b9250611851602085016117cc565b929592945050506040919091013590565b5f5f60408385031215611873575f5ffd5b50508035926020909101359150565b5f5f60208385031215611893575f5ffd5b823567ffffffffffffffff8111156118a9575f5ffd5b8301601f810185136118b9575f5ffd5b803567ffffffffffffffff8111156118cf575f5ffd5b8560208284010111156118e0575f5ffd5b6020919091019590945092505050565b5f5f60408385031215611901575f5ffd5b61190a836117cc565b91506020830135801515811461191e575f5ffd5b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561196657611966611929565b604052919050565b5f67ffffffffffffffff82111561198757611987611929565b50601f01601f191660200190565b5f5f5f5f608085870312156119a8575f5ffd5b6119b1856117cc565b93506119bf602086016117cc565b925060408501359150606085013567ffffffffffffffff8111156119e1575f5ffd5b8501601f810187136119f1575f5ffd5b8035611a046119ff8261196e565b61193d565b818152886020838501011115611a18575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b5f5f60408385031215611a4a575f5ffd5b611a53836117cc565b91506107d1602084016117cc565b5f5f5f60608486031215611a73575f5ffd5b611a7c846117cc565b95602085013595506040909401359392505050565b600181811c90821680611aa557607f821691505b602082108103611ac357634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156108a457805f5260205f20601f840160051c81016020851015611aee5750805b601f840160051c820191505b81811015611318575f8155600101611afa565b815167ffffffffffffffff811115611b2757611b27611929565b611b3b81611b358454611a91565b84611ac9565b6020601f821160018114611b6d575f8315611b565750848201515b5f19600385901b1c1916600184901b178455611318565b5f84815260208120601f198516915b82811015611b9c5787850151825560209485019460019092019101611b7c565b5084821015611bb957868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b67ffffffffffffffff831115611be057611be0611929565b611bf483611bee8354611a91565b83611ac9565b5f601f841160018114611c25575f8515611c0e5750838201355b5f19600387901b1c1916600186901b178355611318565b5f83815260208120601f198716915b82811015611c545786850135825560209485019460019092019101611c34565b5086821015611c70575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f5f8454611c8f81611a91565b600182168015611ca65760018114611cbb57611ce8565b60ff1983168652811515820286019350611ce8565b875f5260205f205f5b83811015611ce057815488820152600190910190602001611cc4565b505081860193505b50505083518060208601835e64173539b7b760d91b9101908152600501949350505050565b5f60208284031215611d1d575f5ffd5b815167ffffffffffffffff811115611d33575f5ffd5b8201601f81018413611d43575f5ffd5b8051611d516119ff8261196e565b818152856020838501011115611d65575f5ffd5b8160208401602083015e5f91810160200191909152949350505050565b634e487b7160e01b5f52601160045260245ffd5b5f60018201611da757611da7611d82565b5060010190565b634e487b7160e01b5f52601260045260245ffd5b808201808211156104dd576104dd611d82565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90611e0790830184611775565b9695505050505050565b5f60208284031215611e21575f5ffd5b815161105581611745565b634e487b7160e01b5f52602160045260245ffd5b5f60ff831680611e5e57634e487b7160e01b5f52601260045260245ffd5b8060ff8416069150509291505056fea26469706673582212201e3f9e38393c14346a8f2eafa9915eaef0df8b747ca90e088acdeffb160240a364736f6c634300081c003300000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001f40000000000000000000000007a9cb9a8e8628fc168b594f47fd942cb10a6aada00000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000013456d70697265206279205368656c647269636b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006454d504952450000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e516d54474761484c6562566a4473624d507a7269396b705a4747724c764269315975644b655451727a5452784436000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561000f575f5ffd5b50600436106101dc575f3560e01c8063715018a611610109578063c87b56dd1161009e578063ecededad1161006e578063ecededad146103ff578063f2fde38b14610412578063fca3b5aa14610425578063fd8d7ed314610438575f5ffd5b8063c87b56dd146103bd578063e7dee99f146103d0578063e985e9c5146103d9578063ea8876fa146103ec575f5ffd5b806395d89b41116100d957806395d89b411461037c5780639fbc871314610384578063a22cb46514610397578063b88d4fde146103aa575f5ffd5b8063715018a6146103465780638da5cb5b1461034e5780638dc251e314610356578063931688cb14610369575f5ffd5b806323b872dd1161017f57806342842e0e1161014f57806342842e0e146103055780636352211e146103185780636c0360eb1461032b57806370a0823114610333575f5ffd5b806323b872dd1461029a5780632a55205a146102ad57806335209821146102df57806340c10f19146102f2575f5ffd5b8063081812fc116101ba578063081812fc14610248578063095ea7b31461025b578063113b98e01461027057806318160ddd14610283575f5ffd5b806301ffc9a7146101e057806306fdde0314610208578063075461721461021d575b5f5ffd5b6101f36101ee36600461175a565b610441565b60405190151581526020015b60405180910390f35b6102106104e3565b6040516101ff91906117a3565b600854610230906001600160a01b031681565b6040516001600160a01b0390911681526020016101ff565b6102306102563660046117b5565b610572565b61026e6102693660046117e7565b610599565b005b61026e61027e36600461180f565b6105a8565b61028c600c5481565b6040519081526020016101ff565b61026e6102a8366004611828565b610723565b6102c06102bb366004611862565b6107ac565b604080516001600160a01b0390931683526020830191909152016101ff565b600954610230906001600160a01b031681565b61026e6103003660046117e7565b6107da565b61026e610313366004611828565b61088a565b6102306103263660046117b5565b6108a9565b6102106108b3565b61028c61034136600461180f565b61093f565b61026e610984565b610230610997565b61026e61036436600461180f565b6109af565b61026e610377366004611882565b610a45565b610210610b15565b600754610230906001600160a01b031681565b61026e6103a53660046118f0565b610b24565b61026e6103b8366004611995565b610b2f565b6102106103cb3660046117b5565b610b47565b61028c600a5481565b6101f36103e7366004611a39565b610c61565b61026e6103fa366004611a61565b610c8e565b61026e61040d366004611862565b610db5565b61026e61042036600461180f565b610e8a565b61026e61043336600461180f565b610ec7565b61028c600b5481565b5f6380ac58cd60e01b6001600160e01b0319831614806104715750635b5e139f60e01b6001600160e01b03198316145b8061048c575063152a902d60e11b6001600160e01b03198316145b806104a75750632483248360e11b6001600160e01b03198316145b806104c257506307f5828d60e41b6001600160e01b03198316145b806104dd57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60605f80546104f190611a91565b80601f016020809104026020016040519081016040528092919081815260200182805461051d90611a91565b80156105685780601f1061053f57610100808354040283529160200191610568565b820191905f5260205f20905b81548152906001019060200180831161054b57829003601f168201915b5050505050905090565b5f61057c82610ef1565b505f828152600460205260409020546001600160a01b03166104dd565b6105a4828233610f29565b5050565b6105b0610f36565b6001600160a01b0381166106265760405162461bcd60e51b815260206004820152603260248201527f4e6577206d657461646174612064656c6567617465206d757374206e6f7420626044820152716520746865207a65726f206164647265737360701b60648201526084015b60405180910390fd5b5f816001600160a01b03163b116106905760405162461bcd60e51b815260206004820152602860248201527f4e6577206d657461646174612064656c6567617465206d75737420626520612060448201526718dbdb9d1c9858dd60c21b606482015260840161061d565b60408051602081019091525f8152600d906106ab9082611b0d565b50600980546001600160a01b0319166001600160a01b03831617905560408051600181527f00000000000000000000000000000000000000000000000000000000000001f460208201527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a150565b6001600160a01b03821661074c57604051633250574960e11b81525f600482015260240161061d565b5f610758838333610f68565b9050836001600160a01b0316816001600160a01b0316146107a6576040516364283d7b60e01b81526001600160a01b038086166004830152602482018490528216604482015260640161061d565b50505050565b600754600a54600b546001600160a01b03909216915f916107d191859190600161105c565b90509250929050565b6008546001600160a01b0316331461080557604051639cdc2ed560e01b815260040160405180910390fd5b5f8111801561083457507f00000000000000000000000000000000000000000000000000000000000001f48111155b6108735760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a59081d1bdad95b88125160821b604482015260640161061d565b61087d82826110a7565b5050600c80546001019055565b6108a483838360405180602001604052805f815250610b2f565b505050565b5f6104dd82610ef1565b600d80546108c090611a91565b80601f01602080910402602001604051908101604052809291908181526020018280546108ec90611a91565b80156109375780601f1061090e57610100808354040283529160200191610937565b820191905f5260205f20905b81548152906001019060200180831161091a57829003601f168201915b505050505081565b5f6001600160a01b038216610969576040516322718ad960e21b81525f600482015260240161061d565b506001600160a01b03165f9081526003602052604090205490565b61098c610f36565b6109955f611108565b565b5f6109aa6006546001600160a01b031690565b905090565b6109b7610f36565b6001600160a01b038116610a235760405162461bcd60e51b815260206004820152602d60248201527f526f79616c7479207265636569766572206d757374206e6f742062652074686560448201526c207a65726f206164647265737360981b606482015260840161061d565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b610a4d610f36565b80610a9a5760405162461bcd60e51b815260206004820152601d60248201527f4e6577206261736520555249206d7573742062652070726f7669646564000000604482015260640161061d565b600d610aa7828483611bc8565b50600980546001600160a01b031916905560408051600181527f00000000000000000000000000000000000000000000000000000000000001f460208201527f6bd5c950a8d8df17f772f5af37cb3655737899cbf903264b9795592da439661c910160405180910390a15050565b6060600180546104f190611a91565b6105a4338383611159565b610b3a848484610723565b6107a633858585856111f7565b6060610b5282610ef1565b505f600d8054610b6190611a91565b90501115610b9b57600d610b748361131f565b604051602001610b85929190611c82565b6040516020818303038152906040529050919050565b6009546001600160a01b031615610c195760095460405163c87b56dd60e01b8152600481018490526001600160a01b039091169063c87b56dd906024015f60405180830381865afa158015610bf2573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526104dd9190810190611d0d565b60405162461bcd60e51b815260206004820152601760248201527f746f6b656e555249206e6f7420636f6e66696775726564000000000000000000604482015260640161061d565b6001600160a01b039182165f90815260056020908152604080832093909416825291909152205460ff1690565b6008546001600160a01b03163314610cb957604051639cdc2ed560e01b815260040160405180910390fd5b5f82118015610ce857507f00000000000000000000000000000000000000000000000000000000000001f48111155b610d2a5760405162461bcd60e51b8152602060048201526013602482015272496e76616c696420746f6b656e2072616e676560681b604482015260640161061d565b80821115610d905760405162461bcd60e51b815260206004820152602d60248201527f5374617274204944206d757374206265206c657373207468616e206f7220657160448201526c1d585b081d1bc8195b99081251609a1b606482015260840161061d565b815b8181116107a657610da384826107da565b80610dad81611d96565b915050610d92565b610dbd610f36565b805f03610e185760405162461bcd60e51b8152602060048201526024808201527f526f79616c74792064656e6f6d696e61746f72206d757374206e6f74206265206044820152637a65726f60e01b606482015260840161061d565b80821115610e7f5760405162461bcd60e51b815260206004820152602e60248201527f526f79616c7479206672616374696f6e206d757374206e6f742062652067726560448201526d61746572207468616e203130302560901b606482015260840161061d565b600a91909155600b55565b610e92610f36565b6001600160a01b038116610ebb57604051631e4fbdf760e01b81525f600482015260240161061d565b610ec481611108565b50565b610ecf610f36565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b5f818152600260205260408120546001600160a01b0316806104dd57604051637e27328960e01b81526004810184905260240161061d565b6108a483838360016113af565b33610f3f610997565b6001600160a01b0316146109955760405163118cdaa760e01b815233600482015260240161061d565b5f828152600260205260408120546001600160a01b0390811690831615610f9457610f948184866114b3565b6001600160a01b03811615610fce57610faf5f855f5f6113af565b6001600160a01b0381165f90815260036020526040902080545f190190555b6001600160a01b03851615610ffc576001600160a01b0385165f908152600360205260409020805460010190555b5f8481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a490505b9392505050565b5f61108961106983611517565b801561108457505f848061107f5761107f611dae565b868809115b151590565b611094868686611543565b61109e9190611dc2565b95945050505050565b6001600160a01b0382166110d057604051633250574960e11b81525f600482015260240161061d565b5f6110dc83835f610f68565b90506001600160a01b038116156108a4576040516339e3563760e11b81525f600482015260240161061d565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6001600160a01b03821661118b57604051630b61174360e31b81526001600160a01b038316600482015260240161061d565b6001600160a01b038381165f81815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0383163b1561131857604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611239908890889087908790600401611dd5565b6020604051808303815f875af1925050508015611273575060408051601f3d908101601f1916820190925261127091810190611e11565b60015b6112da573d8080156112a0576040519150601f19603f3d011682016040523d82523d5f602084013e6112a5565b606091505b5080515f036112d257604051633250574960e11b81526001600160a01b038516600482015260240161061d565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461131657604051633250574960e11b81526001600160a01b038516600482015260240161061d565b505b5050505050565b60605f61132b836115f9565b60010190505f8167ffffffffffffffff81111561134a5761134a611929565b6040519080825280601f01601f191660200182016040528015611374576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461137e57509392505050565b80806113c357506001600160a01b03821615155b15611484575f6113d284610ef1565b90506001600160a01b038316158015906113fe5750826001600160a01b0316816001600160a01b031614155b8015611411575061140f8184610c61565b155b1561143a5760405163a9fbf51f60e01b81526001600160a01b038416600482015260240161061d565b81156114825783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b50505f90815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b6114be8383836116d0565b6108a4576001600160a01b0383166114ec57604051637e27328960e01b81526004810182905260240161061d565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440161061d565b5f600282600381111561152c5761152c611e2c565b6115369190611e40565b60ff166001149050919050565b5f838302815f1985870982811083820303915050805f036115775783828161156d5761156d611dae565b0492505050611055565b80841161158e5761158e6003851502601118611734565b5f848688095f868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106116375772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611663576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061168157662386f26fc10000830492506010015b6305f5e1008310611699576305f5e100830492506008015b61271083106116ad57612710830492506004015b606483106116bf576064830492506002015b600a83106104dd5760010192915050565b5f6001600160a01b0383161580159061172c5750826001600160a01b0316846001600160a01b0316148061170957506117098484610c61565b8061172c57505f828152600460205260409020546001600160a01b038481169116145b949350505050565b634e487b715f52806020526024601cfd5b6001600160e01b031981168114610ec4575f5ffd5b5f6020828403121561176a575f5ffd5b813561105581611745565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f6110556020830184611775565b5f602082840312156117c5575f5ffd5b5035919050565b80356001600160a01b03811681146117e2575f5ffd5b919050565b5f5f604083850312156117f8575f5ffd5b611801836117cc565b946020939093013593505050565b5f6020828403121561181f575f5ffd5b611055826117cc565b5f5f5f6060848603121561183a575f5ffd5b611843846117cc565b9250611851602085016117cc565b929592945050506040919091013590565b5f5f60408385031215611873575f5ffd5b50508035926020909101359150565b5f5f60208385031215611893575f5ffd5b823567ffffffffffffffff8111156118a9575f5ffd5b8301601f810185136118b9575f5ffd5b803567ffffffffffffffff8111156118cf575f5ffd5b8560208284010111156118e0575f5ffd5b6020919091019590945092505050565b5f5f60408385031215611901575f5ffd5b61190a836117cc565b91506020830135801515811461191e575f5ffd5b809150509250929050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561196657611966611929565b604052919050565b5f67ffffffffffffffff82111561198757611987611929565b50601f01601f191660200190565b5f5f5f5f608085870312156119a8575f5ffd5b6119b1856117cc565b93506119bf602086016117cc565b925060408501359150606085013567ffffffffffffffff8111156119e1575f5ffd5b8501601f810187136119f1575f5ffd5b8035611a046119ff8261196e565b61193d565b818152886020838501011115611a18575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b5f5f60408385031215611a4a575f5ffd5b611a53836117cc565b91506107d1602084016117cc565b5f5f5f60608486031215611a73575f5ffd5b611a7c846117cc565b95602085013595506040909401359392505050565b600181811c90821680611aa557607f821691505b602082108103611ac357634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156108a457805f5260205f20601f840160051c81016020851015611aee5750805b601f840160051c820191505b81811015611318575f8155600101611afa565b815167ffffffffffffffff811115611b2757611b27611929565b611b3b81611b358454611a91565b84611ac9565b6020601f821160018114611b6d575f8315611b565750848201515b5f19600385901b1c1916600184901b178455611318565b5f84815260208120601f198516915b82811015611b9c5787850151825560209485019460019092019101611b7c565b5084821015611bb957868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b67ffffffffffffffff831115611be057611be0611929565b611bf483611bee8354611a91565b83611ac9565b5f601f841160018114611c25575f8515611c0e5750838201355b5f19600387901b1c1916600186901b178355611318565b5f83815260208120601f198716915b82811015611c545786850135825560209485019460019092019101611c34565b5086821015611c70575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f5f8454611c8f81611a91565b600182168015611ca65760018114611cbb57611ce8565b60ff1983168652811515820286019350611ce8565b875f5260205f205f5b83811015611ce057815488820152600190910190602001611cc4565b505081860193505b50505083518060208601835e64173539b7b760d91b9101908152600501949350505050565b5f60208284031215611d1d575f5ffd5b815167ffffffffffffffff811115611d33575f5ffd5b8201601f81018413611d43575f5ffd5b8051611d516119ff8261196e565b818152856020838501011115611d65575f5ffd5b8160208401602083015e5f91810160200191909152949350505050565b634e487b7160e01b5f52601160045260245ffd5b5f60018201611da757611da7611d82565b5060010190565b634e487b7160e01b5f52601260045260245ffd5b808201808211156104dd576104dd611d82565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90611e0790830184611775565b9695505050505050565b5f60208284031215611e21575f5ffd5b815161105581611745565b634e487b7160e01b5f52602160045260245ffd5b5f60ff831680611e5e57634e487b7160e01b5f52601260045260245ffd5b8060ff8416069150509291505056fea26469706673582212201e3f9e38393c14346a8f2eafa9915eaef0df8b747ca90e088acdeffb160240a364736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001f40000000000000000000000007a9cb9a8e8628fc168b594f47fd942cb10a6aada00000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000013456d70697265206279205368656c647269636b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006454d504952450000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e516d54474761484c6562566a4473624d507a7269396b705a4747724c764269315975644b655451727a5452784436000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name (string): Empire by Sheldrick
Arg [1] : symbol (string): EMPIRE
Arg [2] : baseURI_ (string): QmTGGaHLebVjDsbMPzri9kpZGGrLvBi1YudKeTQrzTRxD6
Arg [3] : maxSupply (uint256): 500
Arg [4] : royaltyReceiver_ (address): 0x7a9Cb9a8e8628fC168b594F47fd942cB10A6aaDA
Arg [5] : royaltyPercent (uint256): 5
-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [3] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [4] : 0000000000000000000000007a9cb9a8e8628fc168b594f47fd942cb10a6aada
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000013
Arg [7] : 456d70697265206279205368656c647269636b00000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [9] : 454d504952450000000000000000000000000000000000000000000000000000
Arg [10] : 000000000000000000000000000000000000000000000000000000000000002e
Arg [11] : 516d54474761484c6562566a4473624d507a7269396b705a4747724c76426931
Arg [12] : 5975644b655451727a5452784436000000000000000000000000000000000000
Deployed Bytecode Sourcemap
325:7490:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7207:606;;;;;;:::i;:::-;;:::i;:::-;;;565:14:16;;558:22;540:41;;528:2;513:18;7207:606:0;;;;;;;;2364:89:3;;;:::i;:::-;;;;;;;:::i;457:21:0:-;;;;;-1:-1:-1;;;;;457:21:0;;;;;;-1:-1:-1;;;;;1275:32:16;;;1257:51;;1245:2;1230:18;457:21:0;1111:203:16;3496:154:3;;;;;;:::i;:::-;;:::i;3322:113::-;;;;;;:::i;:::-;;:::i;:::-;;5209:407:0;;;;;;:::i;:::-;;:::i;664:26::-;;;;;;;;;2370:25:16;;;2358:2;2343:18;664:26:0;2224:177:16;4142:578:3;;;;;;:::i;:::-;;:::i;6485:356:0:-;;;;;;:::i;:::-;;:::i;:::-;;;;-1:-1:-1;;;;;3328:32:16;;;3310:51;;3392:2;3377:18;;3370:34;;;;3283:18;6485:356:0;3136:274:16;484:31:0;;;;;-1:-1:-1;;;;;484:31:0;;;2531:341;;;;;;:::i;:::-;;:::i;4786:132:3:-;;;;;;:::i;:::-;;:::i;2184:118::-;;;;;;:::i;:::-;;:::i;769:21:0:-;;;:::i;1919:208:3:-;;;;;;:::i;:::-;;:::i;2293:101:1:-;;;:::i;2111:112:0:-;;;:::i;3571:266::-;;;;;;:::i;:::-;;:::i;4665:315::-;;;;;;:::i;:::-;;:::i;2517:93:3:-;;;:::i;421:30:0:-;;;;;-1:-1:-1;;;;;421:30:0;;;3717:144:3;;;;;;:::i;:::-;;:::i;4984:233::-;;;;;;:::i;:::-;;:::i;5758:443:0:-;;;;;;:::i;:::-;;:::i;522:30::-;;;;;;3927:153:3;;;;;;:::i;:::-;;:::i;2882:363:0:-;;;;;;:::i;:::-;;:::i;3943:439::-;;;;;;:::i;:::-;;:::i;2543:215:1:-;;;;;;:::i;:::-;;:::i;3371:88:0:-;;;;;;:::i;:::-;;:::i;558:39::-;;;;;;7207:606;7292:4;-1:-1:-1;;;;;;;;;7327:25:0;;;;:105;;-1:-1:-1;;;;;;;;;;7407:25:0;;;7327:105;:206;;;-1:-1:-1;;;;;;;;;;7508:25:0;;;7327:206;:280;;;-1:-1:-1;;;;;;;;;;7582:25:0;;;7327:280;:359;;;-1:-1:-1;;;;;;;;;;7661:25:0;;;7327:359;:439;;;-1:-1:-1;;;;;;;;;;7741:25:0;;;7327:439;7308:458;7207:606;-1:-1:-1;;7207:606:0:o;2364:89:3:-;2409:13;2441:5;2434:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2364:89;:::o;3496:154::-;3563:7;3582:22;3596:7;3582:13;:22::i;:::-;-1:-1:-1;6033:7:3;6059:24;;;:15;:24;;;;;;-1:-1:-1;;;;;6059:24:3;3622:21;5963:127;3322:113;3393:35;3402:2;3406:7;735:10:8;3393:8:3;:35::i;:::-;3322:113;;:::o;5209:407:0:-;1531:13:1;:11;:13::i;:::-;-1:-1:-1;;;;;5316:22:0;::::1;5308:85;;;::::0;-1:-1:-1;;;5308:85:0;;7202:2:16;5308:85:0::1;::::0;::::1;7184:21:16::0;7241:2;7221:18;;;7214:30;7280:34;7260:18;;;7253:62;-1:-1:-1;;;7331:18:16;;;7324:48;7389:19;;5308:85:0::1;;;;;;;;;5434:1;5411:8;-1:-1:-1::0;;;;;5411:20:0::1;;:24;5403:77;;;::::0;-1:-1:-1;;;5403:77:0;;7621:2:16;5403:77:0::1;::::0;::::1;7603:21:16::0;7660:2;7640:18;;;7633:30;7699:34;7679:18;;;7672:62;-1:-1:-1;;;7750:18:16;;;7743:38;7798:19;;5403:77:0::1;7419:404:16::0;5403:77:0::1;5510:12;::::0;;::::1;::::0;::::1;::::0;;;-1:-1:-1;5510:12:0;;:7:::1;::::0;:12:::1;::::0;:7;:12:::1;:::i;:::-;-1:-1:-1::0;5532:16:0::1;:27:::0;;-1:-1:-1;;;;;;5532:27:0::1;-1:-1:-1::0;;;;;5532:27:0;::::1;;::::0;;5575:34:::1;::::0;;-1:-1:-1;10134:25:16;;5598:10:0::1;10190:2:16::0;10175:18;;10168:34;5575::0::1;::::0;10107:18:16;5575:34:0::1;;;;;;;5209:407:::0;:::o;4142:578:3:-;-1:-1:-1;;;;;4236:16:3;;4232:87;;4275:33;;-1:-1:-1;;;4275:33:3;;4305:1;4275:33;;;1257:51:16;1230:18;;4275:33:3;1111:203:16;4232:87:3;4537:21;4561:34;4569:2;4573:7;735:10:8;4561:7:3;:34::i;:::-;4537:58;;4626:4;-1:-1:-1;;;;;4609:21:3;:13;-1:-1:-1;;;;;4609:21:3;;4605:109;;4653:50;;-1:-1:-1;;;4653:50:3;;-1:-1:-1;;;;;10433:32:16;;;4653:50:3;;;10415:51:16;10482:18;;;10475:34;;;10545:32;;10525:18;;;10518:60;10388:18;;4653:50:3;10213:371:16;4605:109:3;4222:498;4142:578;;;:::o;6485:356:0:-;6619:15;;6778;;6795:18;;-1:-1:-1;;;;;6619:15:0;;;;6557:16;;6755:79;;6767:9;;6778:15;6619;6755:11;:79::i;:::-;6739:95;;6485:356;;;;;:::o;2531:341::-;2032:6;;-1:-1:-1;;;;;2032:6:0;2018:10;:20;2014:45;;2047:12;;-1:-1:-1;;;2047:12:0;;;;;;;;;;;2014:45;2645:1:::1;2635:7;:11;:36;;;;;2661:10;2650:7;:21;;2635:36;2627:65;;;::::0;-1:-1:-1;;;2627:65:0;;10791:2:16;2627:65:0::1;::::0;::::1;10773:21:16::0;10830:2;10810:18;;;10803:30;-1:-1:-1;;;10849:18:16;;;10842:46;10905:18;;2627:65:0::1;10589:340:16::0;2627:65:0::1;2766:18;2772:2;2776:7;2766:5;:18::i;:::-;-1:-1:-1::0;;2842:11:0::1;:13:::0;;::::1;;::::0;;2531:341::o;4786:132:3:-;4872:39;4889:4;4895:2;4899:7;4872:39;;;;;;;;;;;;:16;:39::i;:::-;4786:132;;;:::o;2184:118::-;2247:7;2273:22;2287:7;2273:13;:22::i;769:21:0:-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1919:208:3:-;1982:7;-1:-1:-1;;;;;2005:19:3;;2001:87;;2047:30;;-1:-1:-1;;;2047:30:3;;2074:1;2047:30;;;1257:51:16;1230:18;;2047:30:3;1111:203:16;2001:87:3;-1:-1:-1;;;;;;2104:16:3;;;;;:9;:16;;;;;;;1919:208::o;2293:101:1:-;1531:13;:11;:13::i;:::-;2357:30:::1;2384:1;2357:18;:30::i;:::-;2293:101::o:0;2111:112:0:-;2175:7;2201:15;1710:6:1;;-1:-1:-1;;;;;1710:6:1;;1638:85;2201:15:0;2194:22;;2111:112;:::o;3571:266::-;1531:13:1;:11;:13::i;:::-;-1:-1:-1;;;;;3687:30:0;::::1;3679:88;;;::::0;-1:-1:-1;;;3679:88:0;;11136:2:16;3679:88:0::1;::::0;::::1;11118:21:16::0;11175:2;11155:18;;;11148:30;11214:34;11194:18;;;11187:62;-1:-1:-1;;;11265:18:16;;;11258:43;11318:19;;3679:88:0::1;10934:409:16::0;3679:88:0::1;3796:15;:34:::0;;-1:-1:-1;;;;;;3796:34:0::1;-1:-1:-1::0;;;;;3796:34:0;;;::::1;::::0;;;::::1;::::0;;3571:266::o;4665:315::-;1531:13:1;:11;:13::i;:::-;4776:26:0;4768:68:::1;;;::::0;-1:-1:-1;;;4768:68:0;;11550:2:16;4768:68:0::1;::::0;::::1;11532:21:16::0;11589:2;11569:18;;;11562:30;11628:31;11608:18;;;11601:59;11677:18;;4768:68:0::1;11348:353:16::0;4768:68:0::1;4866:7;:18;4876:8:::0;;4866:7;:18:::1;:::i;:::-;-1:-1:-1::0;4894:16:0::1;:29:::0;;-1:-1:-1;;;;;;4894:29:0::1;::::0;;4939:34:::1;::::0;;-1:-1:-1;10134:25:16;;4962:10:0::1;10190:2:16::0;10175:18;;10168:34;4939::0::1;::::0;10107:18:16;4939:34:0::1;;;;;;;4665:315:::0;;:::o;2517:93:3:-;2564:13;2596:7;2589:14;;;;;:::i;3717:144::-;3802:52;735:10:8;3835:8:3;3845;3802:18;:52::i;4984:233::-;5097:31;5110:4;5116:2;5120:7;5097:12;:31::i;:::-;5138:72;735:10:8;5186:4:3;5192:2;5196:7;5205:4;5138:33;:72::i;5758:443:0:-;5823:13;5848:22;5862:7;5848:13;:22::i;:::-;;5909:1;5891:7;5885:21;;;;;:::i;:::-;;;:25;5881:132;;;5957:7;5966:25;5983:7;5966:16;:25::i;:::-;5940:61;;;;;;;;;:::i;:::-;;;;;;;;;;;;;5926:76;;5758:443;;;:::o;5881:132::-;6035:16;;-1:-1:-1;;;;;6035:16:0;6027:39;6023:128;;6105:16;;6089:51;;-1:-1:-1;;;6089:51:0;;;;;2370:25:16;;;-1:-1:-1;;;;;6105:16:0;;;;6089:42;;2343:18:16;;6089:51:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6089:51:0;;;;;;;;;;;;:::i;6023:128::-;6161:33;;-1:-1:-1;;;6161:33:0;;14911:2:16;6161:33:0;;;14893:21:16;14950:2;14930:18;;;14923:30;14989:25;14969:18;;;14962:53;15032:18;;6161:33:0;14709:347:16;3927:153:3;-1:-1:-1;;;;;4038:25:3;;;4015:4;4038:25;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;;;3927:153::o;2882:363:0:-;2032:6;;-1:-1:-1;;;;;2032:6:0;2018:10;:20;2014:45;;2047:12;;-1:-1:-1;;;2047:12:0;;;;;;;;;;;2014:45;2993:1:::1;2983:7;:11;:34;;;;;3007:10;2998:5;:19;;2983:34;2975:66;;;::::0;-1:-1:-1;;;2975:66:0;;15263:2:16;2975:66:0::1;::::0;::::1;15245:21:16::0;15302:2;15282:18;;;15275:30;-1:-1:-1;;;15321:18:16;;;15314:49;15380:18;;2975:66:0::1;15061:343:16::0;2975:66:0::1;3070:5;3059:7;:16;;3051:74;;;::::0;-1:-1:-1;;;3051:74:0;;15611:2:16;3051:74:0::1;::::0;::::1;15593:21:16::0;15650:2;15630:18;;;15623:30;15689:34;15669:18;;;15662:62;-1:-1:-1;;;15740:18:16;;;15733:43;15793:19;;3051:74:0::1;15409:409:16::0;3051:74:0::1;3159:7:::0;3136:103:::1;3179:5;3168:7;:16;3136:103;;3211:17;3216:2;3220:7;3211:4;:17::i;:::-;3186:9:::0;::::1;::::0;::::1;:::i;:::-;;;;3136:103;;3943:439:::0;1531:13:1;:11;:13::i;:::-;4089:19:0::1;4112:1;4089:24:::0;4081:73:::1;;;::::0;-1:-1:-1;;;4081:73:0;;16297:2:16;4081:73:0::1;::::0;::::1;16279:21:16::0;16336:2;16316:18;;;16309:30;16375:34;16355:18;;;16348:62;-1:-1:-1;;;16426:18:16;;;16419:34;16470:19;;4081:73:0::1;16095:400:16::0;4081:73:0::1;4192:19;4172:16;:39;;4164:98;;;::::0;-1:-1:-1;;;4164:98:0;;16702:2:16;4164:98:0::1;::::0;::::1;16684:21:16::0;16741:2;16721:18;;;16714:30;16780:34;16760:18;;;16753:62;-1:-1:-1;;;16831:18:16;;;16824:44;16885:19;;4164:98:0::1;16500:410:16::0;4164:98:0::1;4291:15;:34:::0;;;;4335:18:::1;:40:::0;3943:439::o;2543:215:1:-;1531:13;:11;:13::i;:::-;-1:-1:-1;;;;;2627:22:1;::::1;2623:91;;2672:31;::::0;-1:-1:-1;;;2672:31:1;;2700:1:::1;2672:31;::::0;::::1;1257:51:16::0;1230:18;;2672:31:1::1;1111:203:16::0;2623:91:1::1;2723:28;2742:8;2723:18;:28::i;:::-;2543:215:::0;:::o;3371:88:0:-;1531:13:1;:11;:13::i;:::-;3436:6:0::1;:16:::0;;-1:-1:-1;;;;;;3436:16:0::1;-1:-1:-1::0;;;;;3436:16:0;;;::::1;::::0;;;::::1;::::0;;3371:88::o;16212:241:3:-;16275:7;5824:16;;;:7;:16;;;;;;-1:-1:-1;;;;;5824:16:3;;16337:88;;16383:31;;-1:-1:-1;;;16383:31:3;;;;;2370:25:16;;;2343:18;;16383:31:3;2224:177:16;14492:120:3;14572:33;14581:2;14585:7;14594:4;14600;14572:8;:33::i;1796:162:1:-;735:10:8;1855:7:1;:5;:7::i;:::-;-1:-1:-1;;;;;1855:23:1;;1851:101;;1901:40;;-1:-1:-1;;;1901:40:1;;735:10:8;1901:40:1;;;1257:51:16;1230:18;;1901:40:1;1111:203:16;8861:795:3;8947:7;5824:16;;;:7;:16;;;;;;-1:-1:-1;;;;;5824:16:3;;;;9058:18;;;9054:86;;9092:37;9109:4;9115;9121:7;9092:16;:37::i;:::-;-1:-1:-1;;;;;9184:18:3;;;9180:256;;9300:48;9317:1;9321:7;9338:1;9342:5;9300:8;:48::i;:::-;-1:-1:-1;;;;;9391:15:3;;;;;;:9;:15;;;;;:20;;-1:-1:-1;;9391:20:3;;;9180:256;-1:-1:-1;;;;;9450:16:3;;;9446:107;;-1:-1:-1;;;;;9510:13:3;;;;;;:9;:13;;;;;:18;;9527:1;9510:18;;;9446:107;9563:16;;;;:7;:16;;;;;;:21;;-1:-1:-1;;;;;;9563:21:3;-1:-1:-1;;;;;9563:21:3;;;;;;;;;9600:27;;9563:16;;9600:27;;;;;;;9645:4;-1:-1:-1;8861:795:3;;;;;;:::o;9351:238:13:-;9452:7;9506:76;9522:26;9539:8;9522:16;:26::i;:::-;:59;;;;;9580:1;9565:11;9552:25;;;;;:::i;:::-;9562:1;9559;9552:25;:29;9522:59;34914:9:14;34907:17;;34795:145;9506:76:13;9478:25;9485:1;9488;9491:11;9478:6;:25::i;:::-;:104;;;;:::i;:::-;9471:111;9351:238;-1:-1:-1;;;;;9351:238:13:o;9978:327:3:-;-1:-1:-1;;;;;10045:16:3;;10041:87;;10084:33;;-1:-1:-1;;;10084:33:3;;10114:1;10084:33;;;1257:51:16;1230:18;;10084:33:3;1111:203:16;10041:87:3;10137:21;10161:32;10169:2;10173:7;10190:1;10161:7;:32::i;:::-;10137:56;-1:-1:-1;;;;;;10207:27:3;;;10203:96;;10257:31;;-1:-1:-1;;;10257:31:3;;10285:1;10257:31;;;1257:51:16;1230:18;;10257:31:3;1111:203:16;2912:187:1;3004:6;;;-1:-1:-1;;;;;3020:17:1;;;-1:-1:-1;;;;;;3020:17:1;;;;;;;3052:40;;3004:6;;;3020:17;3004:6;;3052:40;;2985:16;;3052:40;2975:124;2912:187;:::o;15665:312:3:-;-1:-1:-1;;;;;15772:22:3;;15768:91;;15817:31;;-1:-1:-1;;;15817:31:3;;-1:-1:-1;;;;;1275:32:16;;15817:31:3;;;1257:51:16;1230:18;;15817:31:3;1111:203:16;15768:91:3;-1:-1:-1;;;;;15868:25:3;;;;;;;:18;:25;;;;;;;;:35;;;;;;;;;;;;;:46;;-1:-1:-1;;15868:46:3;;;;;;;;;;15929:41;;540::16;;;15929::3;;513:18:16;15929:41:3;;;;;;;15665:312;;;:::o;985:924:7:-;-1:-1:-1;;;;;1165:14:7;;;:18;1161:742;;1203:67;;-1:-1:-1;;;1203:67:7;;-1:-1:-1;;;;;1203:36:7;;;;;:67;;1240:8;;1250:4;;1256:7;;1265:4;;1203:67;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1203:67:7;;;;;;;;-1:-1:-1;;1203:67:7;;;;;;;;;;;;:::i;:::-;;;1199:694;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1560:6;:13;1577:1;1560:18;1556:323;;1664:39;;-1:-1:-1;;;1664:39:7;;-1:-1:-1;;;;;1275:32:16;;1664:39:7;;;1257:51:16;1230:18;;1664:39:7;1111:203:16;1556:323:7;1831:6;1825:13;1816:6;1812:2;1808:15;1801:38;1199:694;-1:-1:-1;;;;;;1317:51:7;;-1:-1:-1;;;1317:51:7;1313:182;;1437:39;;-1:-1:-1;;;1437:39:7;;-1:-1:-1;;;;;1275:32:16;;1437:39:7;;;1257:51:16;1230:18;;1437:39:7;1111:203:16;1313:182:7;1271:238;1199:694;985:924;;;;;:::o;987:632:10:-;1043:13;1092:14;1109:17;1120:5;1109:10;:17::i;:::-;1129:1;1109:21;1092:38;;1144:20;1178:6;1167:18;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1167:18:10;-1:-1:-1;1144:41:10;-1:-1:-1;1274:28:10;;;1290:2;1274:28;1329:247;-1:-1:-1;;1360:5:10;-1:-1:-1;;;1459:2:10;1448:14;;1443:32;1360:5;1430:46;1520:2;1511:11;;;-1:-1:-1;1540:21:10;1329:247;1540:21;-1:-1:-1;1596:6:10;987:632;-1:-1:-1;;;987:632:10:o;14794:662:3:-;14954:9;:31;;;-1:-1:-1;;;;;;14967:18:3;;;;14954:31;14950:460;;;15001:13;15017:22;15031:7;15017:13;:22::i;:::-;15001:38;-1:-1:-1;;;;;;15167:18:3;;;;;;:35;;;15198:4;-1:-1:-1;;;;;15189:13:3;:5;-1:-1:-1;;;;;15189:13:3;;;15167:35;:69;;;;;15207:29;15224:5;15231:4;15207:16;:29::i;:::-;15206:30;15167:69;15163:142;;;15263:27;;-1:-1:-1;;;15263:27:3;;-1:-1:-1;;;;;1275:32:16;;15263:27:3;;;1257:51:16;1230:18;;15263:27:3;1111:203:16;15163:142:3;15323:9;15319:81;;;15377:7;15373:2;-1:-1:-1;;;;;15357:28:3;15366:5;-1:-1:-1;;;;;15357:28:3;;;;;;;;;;;15319:81;14987:423;14950:460;-1:-1:-1;;15420:24:3;;;;:15;:24;;;;;:29;;-1:-1:-1;;;;;;15420:29:3;-1:-1:-1;;;;;15420:29:3;;;;;;;;;;14794:662::o;7105:368::-;7217:38;7231:5;7238:7;7247;7217:13;:38::i;:::-;7212:255;;-1:-1:-1;;;;;7275:19:3;;7271:186;;7321:31;;-1:-1:-1;;;7321:31:3;;;;;2370:25:16;;;2343:18;;7321:31:3;2224:177:16;7271:186:3;7398:44;;-1:-1:-1;;;7398:44:3;;-1:-1:-1;;;;;3328:32:16;;7398:44:3;;;3310:51:16;3377:18;;;3370:34;;;3283:18;;7398:44:3;3136:274:16;28183:122:13;28251:4;28292:1;28280:8;28274:15;;;;;;;;:::i;:::-;:19;;;;:::i;:::-;:24;;28297:1;28274:24;28267:31;;28183:122;;;:::o;4996:4226::-;5078:14;5449:5;;;5078:14;-1:-1:-1;;5453:1:13;5449;5621:20;5694:5;5690:2;5687:13;5679:5;5675:2;5671:14;5667:34;5658:43;;;5796:5;5805:1;5796:10;5792:368;;6134:11;6126:5;:19;;;;;:::i;:::-;;6119:26;;;;;;5792:368;6285:5;6270:11;:20;6266:143;;6310:84;3066:5;6330:16;;3065:36;940:4:9;3060:42:13;6310:11;:84::i;:::-;6664:17;6799:11;6796:1;6793;6786:25;7199:12;7229:15;;;7214:31;;7348:22;;;;;8094:1;8075;:15;;8074:21;;8327;;;8323:25;;8312:36;8397:21;;;8393:25;;8382:36;8469:21;;;8465:25;;8454:36;8540:21;;;8536:25;;8525:36;8613:21;;;8609:25;;8598:36;8687:21;;;8683:25;;;8672:36;7597:12;;;;7593:23;;;7618:1;7589:31;6913:20;;;6902:32;;;7709:12;;;;6960:21;;;;7446:16;;;;7700:21;;;;9163:15;;;;;-1:-1:-1;;4996:4226:13;;;;;:::o;25316:916::-;25369:7;;-1:-1:-1;;;25444:17:13;;25440:103;;-1:-1:-1;;;25481:17:13;;;-1:-1:-1;25526:2:13;25516:12;25440:103;25569:8;25560:5;:17;25556:103;;25606:8;25597:17;;;-1:-1:-1;25642:2:13;25632:12;25556:103;25685:8;25676:5;:17;25672:103;;25722:8;25713:17;;;-1:-1:-1;25758:2:13;25748:12;25672:103;25801:7;25792:5;:16;25788:100;;25837:7;25828:16;;;-1:-1:-1;25872:1:13;25862:11;25788:100;25914:7;25905:5;:16;25901:100;;25950:7;25941:16;;;-1:-1:-1;25985:1:13;25975:11;25901:100;26027:7;26018:5;:16;26014:100;;26063:7;26054:16;;;-1:-1:-1;26098:1:13;26088:11;26014:100;26140:7;26131:5;:16;26127:66;;26177:1;26167:11;26219:6;25316:916;-1:-1:-1;;25316:916:13:o;6401:272:3:-;6504:4;-1:-1:-1;;;;;6539:21:3;;;;;;:127;;;6586:7;-1:-1:-1;;;;;6577:16:3;:5;-1:-1:-1;;;;;6577:16:3;;:52;;;;6597:32;6614:5;6621:7;6597:16;:32::i;:::-;6577:88;;;-1:-1:-1;6033:7:3;6059:24;;;:15;:24;;;;;;-1:-1:-1;;;;;6633:32:3;;;6059:24;;6633:32;6577:88;6520:146;6401:272;-1:-1:-1;;;;6401:272:3:o;1776:194:9:-;1881:10;1875:4;1868:24;1918:4;1912;1905:18;1949:4;1943;1936:18;14:131:16;-1:-1:-1;;;;;;88:32:16;;78:43;;68:71;;135:1;132;125:12;150:245;208:6;261:2;249:9;240:7;236:23;232:32;229:52;;;277:1;274;267:12;229:52;316:9;303:23;335:30;359:5;335:30;:::i;592:289::-;634:3;672:5;666:12;699:6;694:3;687:19;755:6;748:4;741:5;737:16;730:4;725:3;721:14;715:47;807:1;800:4;791:6;786:3;782:16;778:27;771:38;870:4;863:2;859:7;854:2;846:6;842:15;838:29;833:3;829:39;825:50;818:57;;;592:289;;;;:::o;886:220::-;1035:2;1024:9;1017:21;998:4;1055:45;1096:2;1085:9;1081:18;1073:6;1055:45;:::i;1319:226::-;1378:6;1431:2;1419:9;1410:7;1406:23;1402:32;1399:52;;;1447:1;1444;1437:12;1399:52;-1:-1:-1;1492:23:16;;1319:226;-1:-1:-1;1319:226:16:o;1550:173::-;1618:20;;-1:-1:-1;;;;;1667:31:16;;1657:42;;1647:70;;1713:1;1710;1703:12;1647:70;1550:173;;;:::o;1728:300::-;1796:6;1804;1857:2;1845:9;1836:7;1832:23;1828:32;1825:52;;;1873:1;1870;1863:12;1825:52;1896:29;1915:9;1896:29;:::i;:::-;1886:39;1994:2;1979:18;;;;1966:32;;-1:-1:-1;;;1728:300:16:o;2033:186::-;2092:6;2145:2;2133:9;2124:7;2120:23;2116:32;2113:52;;;2161:1;2158;2151:12;2113:52;2184:29;2203:9;2184:29;:::i;2406:374::-;2483:6;2491;2499;2552:2;2540:9;2531:7;2527:23;2523:32;2520:52;;;2568:1;2565;2558:12;2520:52;2591:29;2610:9;2591:29;:::i;:::-;2581:39;;2639:38;2673:2;2662:9;2658:18;2639:38;:::i;:::-;2406:374;;2629:48;;-1:-1:-1;;;2746:2:16;2731:18;;;;2718:32;;2406:374::o;2785:346::-;2853:6;2861;2914:2;2902:9;2893:7;2889:23;2885:32;2882:52;;;2930:1;2927;2920:12;2882:52;-1:-1:-1;;2975:23:16;;;3095:2;3080:18;;;3067:32;;-1:-1:-1;2785:346:16:o;3415:587::-;3486:6;3494;3547:2;3535:9;3526:7;3522:23;3518:32;3515:52;;;3563:1;3560;3553:12;3515:52;3603:9;3590:23;3636:18;3628:6;3625:30;3622:50;;;3668:1;3665;3658:12;3622:50;3691:22;;3744:4;3736:13;;3732:27;-1:-1:-1;3722:55:16;;3773:1;3770;3763:12;3722:55;3813:2;3800:16;3839:18;3831:6;3828:30;3825:50;;;3871:1;3868;3861:12;3825:50;3916:7;3911:2;3902:6;3898:2;3894:15;3890:24;3887:37;3884:57;;;3937:1;3934;3927:12;3884:57;3968:2;3960:11;;;;;3990:6;;-1:-1:-1;3415:587:16;-1:-1:-1;;;3415:587:16:o;4007:347::-;4072:6;4080;4133:2;4121:9;4112:7;4108:23;4104:32;4101:52;;;4149:1;4146;4139:12;4101:52;4172:29;4191:9;4172:29;:::i;:::-;4162:39;;4251:2;4240:9;4236:18;4223:32;4298:5;4291:13;4284:21;4277:5;4274:32;4264:60;;4320:1;4317;4310:12;4264:60;4343:5;4333:15;;;4007:347;;;;;:::o;4359:127::-;4420:10;4415:3;4411:20;4408:1;4401:31;4451:4;4448:1;4441:15;4475:4;4472:1;4465:15;4491:275;4562:2;4556:9;4627:2;4608:13;;-1:-1:-1;;4604:27:16;4592:40;;4662:18;4647:34;;4683:22;;;4644:62;4641:88;;;4709:18;;:::i;:::-;4745:2;4738:22;4491:275;;-1:-1:-1;4491:275:16:o;4771:186::-;4819:4;4852:18;4844:6;4841:30;4838:56;;;4874:18;;:::i;:::-;-1:-1:-1;4940:2:16;4919:15;-1:-1:-1;;4915:29:16;4946:4;4911:40;;4771:186::o;4962:958::-;5057:6;5065;5073;5081;5134:3;5122:9;5113:7;5109:23;5105:33;5102:53;;;5151:1;5148;5141:12;5102:53;5174:29;5193:9;5174:29;:::i;:::-;5164:39;;5222:38;5256:2;5245:9;5241:18;5222:38;:::i;:::-;5212:48;-1:-1:-1;5329:2:16;5314:18;;5301:32;;-1:-1:-1;5408:2:16;5393:18;;5380:32;5435:18;5424:30;;5421:50;;;5467:1;5464;5457:12;5421:50;5490:22;;5543:4;5535:13;;5531:27;-1:-1:-1;5521:55:16;;5572:1;5569;5562:12;5521:55;5612:2;5599:16;5637:52;5653:35;5681:6;5653:35;:::i;:::-;5637:52;:::i;:::-;5712:6;5705:5;5698:21;5760:7;5755:2;5746:6;5742:2;5738:15;5734:24;5731:37;5728:57;;;5781:1;5778;5771:12;5728:57;5836:6;5831:2;5827;5823:11;5818:2;5811:5;5807:14;5794:49;5888:1;5883:2;5874:6;5867:5;5863:18;5859:27;5852:38;5909:5;5899:15;;;;;4962:958;;;;;;;:::o;5925:260::-;5993:6;6001;6054:2;6042:9;6033:7;6029:23;6025:32;6022:52;;;6070:1;6067;6060:12;6022:52;6093:29;6112:9;6093:29;:::i;:::-;6083:39;;6141:38;6175:2;6164:9;6160:18;6141:38;:::i;6190:420::-;6267:6;6275;6283;6336:2;6324:9;6315:7;6311:23;6307:32;6304:52;;;6352:1;6349;6342:12;6304:52;6375:29;6394:9;6375:29;:::i;:::-;6365:39;6473:2;6458:18;;6445:32;;-1:-1:-1;6574:2:16;6559:18;;;6546:32;;6190:420;-1:-1:-1;;;6190:420:16:o;6615:380::-;6694:1;6690:12;;;;6737;;;6758:61;;6812:4;6804:6;6800:17;6790:27;;6758:61;6865:2;6857:6;6854:14;6834:18;6831:38;6828:161;;6911:10;6906:3;6902:20;6899:1;6892:31;6946:4;6943:1;6936:15;6974:4;6971:1;6964:15;6828:161;;6615:380;;;:::o;7954:518::-;8056:2;8051:3;8048:11;8045:421;;;8092:5;8089:1;8082:16;8136:4;8133:1;8123:18;8206:2;8194:10;8190:19;8187:1;8183:27;8177:4;8173:38;8242:4;8230:10;8227:20;8224:47;;;-1:-1:-1;8265:4:16;8224:47;8320:2;8315:3;8311:12;8308:1;8304:20;8298:4;8294:31;8284:41;;8375:81;8393:2;8386:5;8383:13;8375:81;;;8452:1;8438:16;;8419:1;8408:13;8375:81;;8648:1299;8774:3;8768:10;8801:18;8793:6;8790:30;8787:56;;;8823:18;;:::i;:::-;8852:97;8942:6;8902:38;8934:4;8928:11;8902:38;:::i;:::-;8896:4;8852:97;:::i;:::-;8998:4;9029:2;9018:14;;9046:1;9041:649;;;;9734:1;9751:6;9748:89;;;-1:-1:-1;9803:19:16;;;9797:26;9748:89;-1:-1:-1;;8605:1:16;8601:11;;;8597:24;8593:29;8583:40;8629:1;8625:11;;;8580:57;9850:81;;9011:930;;9041:649;7901:1;7894:14;;;7938:4;7925:18;;-1:-1:-1;;9077:20:16;;;9195:222;9209:7;9206:1;9203:14;9195:222;;;9291:19;;;9285:26;9270:42;;9398:4;9383:20;;;;9351:1;9339:14;;;;9225:12;9195:222;;;9199:3;9445:6;9436:7;9433:19;9430:201;;;9506:19;;;9500:26;-1:-1:-1;;9589:1:16;9585:14;;;9601:3;9581:24;9577:37;9573:42;9558:58;9543:74;;9430:201;-1:-1:-1;;;;9677:1:16;9661:14;;;9657:22;9644:36;;-1:-1:-1;8648:1299:16:o;11706:1198::-;11830:18;11825:3;11822:27;11819:53;;;11852:18;;:::i;:::-;11881:94;11971:3;11931:38;11963:4;11957:11;11931:38;:::i;:::-;11925:4;11881:94;:::i;:::-;12001:1;12026:2;12021:3;12018:11;12043:1;12038:608;;;;12690:1;12707:3;12704:93;;;-1:-1:-1;12763:19:16;;;12750:33;12704:93;-1:-1:-1;;8605:1:16;8601:11;;;8597:24;8593:29;8583:40;8629:1;8625:11;;;8580:57;12810:78;;12011:887;;12038:608;7901:1;7894:14;;;7938:4;7925:18;;-1:-1:-1;;12074:17:16;;;12189:229;12203:7;12200:1;12197:14;12189:229;;;12292:19;;;12279:33;12264:49;;12399:4;12384:20;;;;12352:1;12340:14;;;;12219:12;12189:229;;;12193:3;12446;12437:7;12434:16;12431:159;;;12570:1;12566:6;12560:3;12554;12551:1;12547:11;12543:21;12539:34;12535:39;12522:9;12517:3;12513:19;12500:33;12496:79;12488:6;12481:95;12431:159;;;12633:1;12627:3;12624:1;12620:11;12616:19;12610:4;12603:33;12011:887;;11706:1198;;;:::o;12909:1104::-;13186:3;13215:1;13248:6;13242:13;13278:36;13304:9;13278:36;:::i;:::-;13345:1;13330:17;;13356:133;;;;13503:1;13498:332;;;;13323:507;;13356:133;-1:-1:-1;;13389:24:16;;13377:37;;13462:14;;13455:22;13443:35;;13434:45;;;-1:-1:-1;13356:133:16;;13498:332;13529:6;13526:1;13519:17;13577:4;13574:1;13564:18;13604:1;13618:166;13632:6;13629:1;13626:13;13618:166;;;13712:14;;13699:11;;;13692:35;13768:1;13755:15;;;;13654:4;13647:12;13618:166;;;13622:3;;13813:6;13808:3;13804:16;13797:23;;13323:507;;;;13861:6;13855:13;13907:8;13900:4;13892:6;13888:17;13883:3;13877:39;-1:-1:-1;;;13935:18:16;;13962:19;;;14005:1;13997:10;;12909:1104;-1:-1:-1;;;;12909:1104:16:o;14018:686::-;14098:6;14151:2;14139:9;14130:7;14126:23;14122:32;14119:52;;;14167:1;14164;14157:12;14119:52;14200:9;14194:16;14233:18;14225:6;14222:30;14219:50;;;14265:1;14262;14255:12;14219:50;14288:22;;14341:4;14333:13;;14329:27;-1:-1:-1;14319:55:16;;14370:1;14367;14360:12;14319:55;14403:2;14397:9;14428:52;14444:35;14472:6;14444:35;:::i;14428:52::-;14503:6;14496:5;14489:21;14551:7;14546:2;14537:6;14533:2;14529:15;14525:24;14522:37;14519:57;;;14572:1;14569;14562:12;14519:57;14620:6;14615:2;14611;14607:11;14602:2;14595:5;14591:14;14585:42;14672:1;14647:18;;;14667:2;14643:27;14636:38;;;;14651:5;14018:686;-1:-1:-1;;;;14018:686:16:o;15823:127::-;15884:10;15879:3;15875:20;15872:1;15865:31;15915:4;15912:1;15905:15;15939:4;15936:1;15929:15;15955:135;15994:3;16015:17;;;16012:43;;16035:18;;:::i;:::-;-1:-1:-1;16082:1:16;16071:13;;15955:135::o;16915:127::-;16976:10;16971:3;16967:20;16964:1;16957:31;17007:4;17004:1;16997:15;17031:4;17028:1;17021:15;17047:125;17112:9;;;17133:10;;;17130:36;;;17146:18;;:::i;17177:485::-;-1:-1:-1;;;;;17408:32:16;;;17390:51;;17477:32;;17472:2;17457:18;;17450:60;17541:2;17526:18;;17519:34;;;17589:3;17584:2;17569:18;;17562:31;;;-1:-1:-1;;17610:46:16;;17636:19;;17628:6;17610:46;:::i;:::-;17602:54;17177:485;-1:-1:-1;;;;;;17177:485:16:o;17667:249::-;17736:6;17789:2;17777:9;17768:7;17764:23;17760:32;17757:52;;;17805:1;17802;17795:12;17757:52;17837:9;17831:16;17856:30;17880:5;17856:30;:::i;17921:127::-;17982:10;17977:3;17973:20;17970:1;17963:31;18013:4;18010:1;18003:15;18037:4;18034:1;18027:15;18053:254;18083:1;18117:4;18114:1;18110:12;18141:3;18131:134;;18187:10;18182:3;18178:20;18175:1;18168:31;18222:4;18219:1;18212:15;18250:4;18247:1;18240:15;18131:134;18297:3;18290:4;18287:1;18283:12;18279:22;18274:27;;;18053:254;;;;:::o
Swarm Source
ipfs://1e3f9e38393c14346a8f2eafa9915eaef0df8b747ca90e088acdeffb160240a3
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.