Overview
TokenID
8064
Transfers
-
0
Market
Onchain Market Cap
-
Circulating Supply Market Cap
-
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
| # | Exchange | Pair | Price | 24H Volume | % Volume |
|---|
Contract Name:
ScapeExtensions
Compiler Version
v0.8.16+commit.07a7930e
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import {ERC721ChildMulti} from "./ERC721ChildMulti.sol";
/// @title ScapeExtensions
/// @author akuti.eth | scapes.eth
/// @notice Child tokens following the Scapes.
/// @dev Child tokens following the parent contract.
contract ScapeExtensions is ERC721ChildMulti {
constructor(address parent_)
ERC721ChildMulti("ScapeExtensions", "SCAPEXT", parent_)
{}
/// @notice Adds a new child token by baseURI before the parent contract minted any token.
/// @param baseURI The base URI for the new child token.
function addBaseURIBeforeMint(string memory baseURI) external onlyOwner {
if (_baseURIs.length >= MAX_CHILD_COLLECTIONS)
revert ERC721Child__MaxChildContractsReached();
_baseURIs.push(baseURI);
}
/// @notice Adds a new child token by baseURI after the parent contract minted tokens.
/// @param baseURI The base URI for the new child token.
/// @param tokenOwners The owners of the parent NFTs.
function addBaseURIAfterMint(
string memory baseURI,
address[] calldata tokenOwners
) external onlyOwner {
if (_baseURIs.length >= MAX_CHILD_COLLECTIONS)
revert ERC721Child__MaxChildContractsReached();
_init_using_tokenOwners(baseURI, tokenOwners);
}
/// @notice Update an existing baseURI by index.
/// @param baseURI The new baseURI for an existing child token.
/// @param index The the index of the child token to update.
function updateBaseURI(string memory baseURI, uint256 index)
external
onlyOwner
{
if (index >= _baseURIs.length) revert ERC721Child__InvalidArgument();
_baseURIs[index] = baseURI;
}
/// @notice Update the baseURI for merge tokens.
/// @param baseURI The new baseURI for the merge tokens.
function updateMergeBaseURI(string memory baseURI) external onlyOwner {
_mergeBaseURI = baseURI;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../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.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol)
pragma solidity ^0.8.0;
import "./Ownable.sol";
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() external {
address sender = _msgSender();
require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
_transferOwnership(sender);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../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 v4.8.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
// Based on OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)
// Modified by Akuti (Scapes.Studio)
pragma solidity ^0.8.16;
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {IERC721Metadata} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {ERC165, IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {IERC721Child} from "./IERC721Child.sol";
interface IERC721WithMergeBalance is IERC721 {
function balanceOfMerges(address account)
external
view
returns (uint256 balance);
}
/**
* @title ERC721ChildMulti
* @author akuti.eth | scapes.eth
* @notice Child collection that is attached to a parent ERC721 contract.
* @dev Modification based on ERC721, including the Metadata and custom Child
* extension which supports multiple sub-collections. This one is modified for Scapes
* and allows 10 child collections following normal Scapes + one collection following merges.
* Transfers and approvals are disabled as token ownership is managed by the parent.
*/
contract ERC721ChildMulti is
ERC165,
IERC721,
IERC721Metadata,
IERC721Child,
Ownable2Step
{
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Parent NFT
IERC721WithMergeBalance internal _parent;
address internal _parentAddress;
string[] internal _baseURIs;
string internal _mergeBaseURI;
uint256 internal constant FIRST_TOKEN_ID = 1;
uint256 internal constant LAST_TOKEN_ID = 10_000;
uint256 internal constant MAX_CHILD_COLLECTIONS = 10;
// Token ids larger than this value will be for merges
uint256 internal constant MAX_NORMAL_TOKEN_ID =
LAST_TOKEN_ID * MAX_CHILD_COLLECTIONS;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(
string memory name_,
string memory symbol_,
address parent_
) {
_name = name_;
_symbol = symbol_;
_parent = IERC721WithMergeBalance(parent_);
_parentAddress = parent_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
interfaceId == type(IERC721Child).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner)
public
view
virtual
override
returns (uint256)
{
uint256 totalBalance = _parent.balanceOf(owner);
try _parent.balanceOfMerges(owner) returns (uint256 mergeBalance) {
return
((totalBalance - mergeBalance) * _nrCollections()) +
mergeBalance;
} catch {
return totalBalance * _nrCollections();
}
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId)
public
view
virtual
override
returns (address)
{
if (!_exists(tokenId)) revert ERC721Child__NonExistentToken();
return _parent.ownerOf(_parentTokenId(tokenId));
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev The address of the parent collection.
*/
function parent() public view virtual override returns (address) {
return _parentAddress;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
if (!_exists(tokenId)) revert ERC721Child__NonExistentToken();
string memory baseURI;
if (tokenId <= MAX_NORMAL_TOKEN_ID) {
baseURI = _baseURIs[(tokenId - 1) / 10_000]; // -1 since the tokenId is counting from 1
} else baseURI = _mergeBaseURI;
return string.concat(baseURI, _parentTokenId(tokenId).toString());
}
/**
* @dev The number of normal child collections (max 10).
*/
function _nrCollections() internal view returns (uint256) {
return _baseURIs.length;
}
/**
* @dev Get the parent token id the child token id maps to.
*/
function _parentTokenId(uint256 tokenId)
internal
view
virtual
returns (uint256)
{
if (tokenId > MAX_NORMAL_TOKEN_ID) return tokenId;
uint256 collectionIdx = (tokenId - 1) / LAST_TOKEN_ID;
if (collectionIdx < _nrCollections())
return ((tokenId - 1) % LAST_TOKEN_ID) + 1; // extra -+ 1 since the tokenId is counting from 1
revert ERC721Child__NonExistentToken();
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address, uint256) public virtual override {
revert ERC721Child__ApprovalNotSupported();
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256)
public
view
virtual
override
returns (address)
{
return address(0);
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address, bool) public virtual override {
revert ERC721Child__ApprovalNotSupported();
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address, address)
public
view
virtual
override
returns (bool)
{
return false;
}
/**
* @dev Initialize token ownership, used when adding more child collections
* after the parent contract minted.
* @param baseURI The URI for the token metadata of the child collection.
* @param tokenOwners The list of token owners of the parent collection.
* The xth position the list will be the xth token ID of the parent contract.
*
* Emits a {Transfer} event from ZeroAddress to current owner per token.
*/
function _init_using_tokenOwners(
string memory baseURI,
address[] memory tokenOwners
) internal virtual {
_baseURIs.push(baseURI);
uint256 baseURIIndex = _baseURIs.length - 1;
uint256 length = tokenOwners.length;
unchecked {
for (uint256 i = 0; i < length; ) {
emit Transfer(
address(0),
tokenOwners[i],
(LAST_TOKEN_ID * baseURIIndex) + FIRST_TOKEN_ID + i
);
i++;
}
}
}
/**
* @dev See {IERC721Child-update}.
*/
function update(
address from,
address to,
uint256 tokenId
) public virtual override {
if (msg.sender != _parentAddress) revert ERC721Child__InvalidCaller();
if (tokenId > MAX_NORMAL_TOKEN_ID) {
emit Transfer(from, to, tokenId);
return;
}
uint256 length = _baseURIs.length;
unchecked {
for (uint256 i = 0; i < length; ) {
uint256 childTokenId = tokenId + (LAST_TOKEN_ID * i);
emit Transfer(from, to, childTokenId);
i++;
}
}
}
/**
* @notice Manually update a token ownership.
* @dev Manually update token ownership by emitting a transfer event.
* @param from sender of token
* @param childTokenId child token id to update
*/
function manualUpdate(address from, uint256 childTokenId)
public
virtual
onlyOwner
{
emit Transfer(from, ownerOf(childTokenId), childTokenId);
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address,
address,
uint256
) public virtual override {
revert ERC721Child__TransferNotSupported();
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address,
address,
uint256
) public virtual override {
revert ERC721Child__TransferNotSupported();
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address,
address,
uint256,
bytes memory
) public virtual override {
revert ERC721Child__TransferNotSupported();
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens are managed by the parent contract.
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
uint256 parentTokenId = _parentTokenId(tokenId);
try _parent.ownerOf(parentTokenId) returns (address) {
return true;
} catch {
return false;
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional child extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*
* A child token does not store it's own token balances and does not support
* minting, transfer, approval. All view methods are passed along to the
* parent contract.
*/
interface IERC721Child is IERC721 {
error ERC721Child__InvalidCaller();
error ERC721Child__InvalidArgument();
error ERC721Child__NonExistentToken();
error ERC721Child__ApprovalNotSupported();
error ERC721Child__TransferNotSupported();
error ERC721Child__MaxChildContractsReached();
/**
* @dev Returns the parent collection.
*/
function parent() external view returns (address);
/**
* @dev Update token ownership from by calling it from the parent contract.
*
* Emits a {Transfer} event.
*/
function update(
address from,
address to,
uint256 tokenId
) external;
}{
"optimizer": {
"enabled": true,
"runs": 1000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"parent_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ERC721Child__ApprovalNotSupported","type":"error"},{"inputs":[],"name":"ERC721Child__InvalidArgument","type":"error"},{"inputs":[],"name":"ERC721Child__InvalidCaller","type":"error"},{"inputs":[],"name":"ERC721Child__MaxChildContractsReached","type":"error"},{"inputs":[],"name":"ERC721Child__NonExistentToken","type":"error"},{"inputs":[],"name":"ERC721Child__TransferNotSupported","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"address[]","name":"tokenOwners","type":"address[]"}],"name":"addBaseURIAfterMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"addBaseURIBeforeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"childTokenId","type":"uint256"}],"name":"manualUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"parent","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"update","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"updateBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"updateMergeBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b5060405162001ad238038062001ad2833981016040819052620000349162000167565b6040518060400160405280600f81526020016e5363617065457874656e73696f6e7360881b8152506040518060400160405280600781526020016614d0d05411561560ca1b815250826200009762000091620000e960201b60201c565b620000ed565b6002620000a584826200023e565b506003620000b483826200023e565b50600480546001600160a01b039092166001600160a01b0319928316811790915560058054909216179055506200030a915050565b3390565b600180546001600160a01b0319169055620001148162000117602090811b62000cf217901c565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156200017a57600080fd5b81516001600160a01b03811681146200019257600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001c457607f821691505b602082108103620001e557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200023957600081815260208120601f850160051c81016020861015620002145750805b601f850160051c820191505b81811015620002355782815560010162000220565b5050505b505050565b81516001600160401b038111156200025a576200025a62000199565b62000272816200026b8454620001af565b84620001eb565b602080601f831160018114620002aa5760008415620002915750858301515b600019600386901b1c1916600185901b17855562000235565b600085815260208120601f198616915b82811015620002db57888601518255948401946001909101908401620002ba565b5085821015620002fa5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6117b8806200031a6000396000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c806379ba5097116100ee578063a85c79f711610097578063de15f1dd11610071578063de15f1dd14610335578063e30c397814610348578063e985e9c514610359578063f2fde38b1461036f57600080fd5b8063a85c79f714610301578063b88d4fde14610314578063c87b56dd1461032257600080fd5b806395d89b41116100c857806395d89b41146102d8578063a22cb465146102e0578063a83225c0146102ee57600080fd5b806379ba5097146102ac5780638ce516da146102b45780638da5cb5b146102c757600080fd5b80634310fe7d116101505780636352211e1161012a5780636352211e1461027057806370a0823114610283578063715018a6146102a457600080fd5b80634310fe7d14610239578063567c904e1461024c57806360f96a8f1461025f57600080fd5b8063095ea7b311610181578063095ea7b31461021157806323b872dd1461022657806342842e0e1461022657600080fd5b806301ffc9a7146101a857806306fdde03146101d0578063081812fc146101e5575b600080fd5b6101bb6101b6366004611147565b610382565b60405190151581526020015b60405180910390f35b6101d8610453565b6040516101c79190611195565b6101f96101f33660046111c8565b50600090565b6040516001600160a01b0390911681526020016101c7565b61022461021f3660046111f6565b6104e5565b005b610224610234366004611222565b610517565b6102246102473660046111f6565b610549565b61022461025a36600461130f565b61059e565b6005546001600160a01b03166101f9565b6101f961027e3660046111c8565b6105b6565b610296610291366004611344565b610657565b6040519081526020016101c7565b6102246107b5565b6102246107c9565b6102246102c2366004611222565b61085c565b6000546001600160a01b03166101f9565b6101d861095b565b61022461021f366004611361565b6102246102fc36600461130f565b61096a565b61022461030f36600461139f565b6109d1565b6102246102343660046113e4565b6101d86103303660046111c8565b610a43565b610224610343366004611464565b610c0c565b6001546001600160a01b03166101f9565b6101bb6103673660046114fe565b600092915050565b61022461037d366004611344565b610c74565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806103e557506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061041957506001600160e01b031982167fec1c7c5500000000000000000000000000000000000000000000000000000000145b8061044d57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b6060600280546104629061152c565b80601f016020809104026020016040519081016040528092919081815260200182805461048e9061152c565b80156104db5780601f106104b0576101008083540402835291602001916104db565b820191906000526020600020905b8154815290600101906020018083116104be57829003601f168201915b5050505050905090565b6040517fddda210e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f1739cd1b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610551610d4f565b8061055b826105b6565b6001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b6105a6610d4f565b60076105b282826115ae565b5050565b60006105c182610da9565b6105de57604051630f81ffef60e21b815260040160405180910390fd5b6004546001600160a01b0316636352211e6105f884610e52565b6040518263ffffffff1660e01b815260040161061691815260200190565b602060405180830381865afa158015610633573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044d919061166e565b600480546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811693820193909352600092839216906370a0823190602401602060405180830381865afa1580156106c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e4919061168b565b600480546040517fe0e037f60000000000000000000000000000000000000000000000000000000081526001600160a01b0387811693820193909352929350169063e0e037f690602401602060405180830381865afa925050508015610767575060408051601f3d908101601f191682019092526107649181019061168b565b60015b61077f5760065461077890826116ba565b9392505050565b8061078960065490565b61079383856116d9565b61079d91906116ba565b6107a791906116ec565b949350505050565b50919050565b6107bd610d4f565b6107c76000610ed4565b565b60015433906001600160a01b031681146108505760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61085981610ed4565b50565b6005546001600160a01b031633146108a0576040517f0a9aa24500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108ad600a6127106116ba565b8111156108fa5780826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b60065460005b8181101561095457604051612710820284019081906001600160a01b0380881691908916907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90600090a450600101610900565b5050505050565b6060600380546104629061152c565b610972610d4f565b600654600a116109955760405163d70d190f60e01b815260040160405180910390fd5b600680546001810182556000919091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f016105b282826115ae565b6109d9610d4f565b6006548110610a14576040517f4b19284f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160068281548110610a2857610a286116ff565b906000526020600020019081610a3e91906115ae565b505050565b6060610a4e82610da9565b610a6b57604051630f81ffef60e21b815260040160405180910390fd5b6060610a7a600a6127106116ba565b8311610b44576006612710610a906001866116d9565b610a9a919061172b565b81548110610aaa57610aaa6116ff565b906000526020600020018054610abf9061152c565b80601f0160208091040260200160405190810160405280929190818152602001828054610aeb9061152c565b8015610b385780601f10610b0d57610100808354040283529160200191610b38565b820191906000526020600020905b815481529060010190602001808311610b1b57829003601f168201915b50505050509050610bd2565b60078054610b519061152c565b80601f0160208091040260200160405190810160405280929190818152602001828054610b7d9061152c565b8015610bca5780601f10610b9f57610100808354040283529160200191610bca565b820191906000526020600020905b815481529060010190602001808311610bad57829003601f168201915b505050505090505b80610be4610bdf85610e52565b610efa565b604051602001610bf592919061173f565b604051602081830303815290604052915050919050565b610c14610d4f565b600654600a11610c375760405163d70d190f60e01b815260040160405180910390fd5b610a3e83838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610f9a92505050565b610c7c610d4f565b600180546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff199091168117909155610cba6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146107c75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610847565b600080610db583610e52565b600480546040517f6352211e0000000000000000000000000000000000000000000000000000000081529293506001600160a01b031691636352211e91610e029185910190815260200190565b602060405180830381865afa925050508015610e3b575060408051601f3d908101601f19168201909252610e389181019061166e565b60015b610e485750600092915050565b5060019392505050565b6000610e61600a6127106116ba565b821115610e6c575090565b6000612710610e7c6001856116d9565b610e86919061172b565b9050610e9160065490565b811015610ebb57612710610ea66001856116d9565b610eb0919061176e565b6107789060016116ec565b604051630f81ffef60e21b815260040160405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916905561085981610cf2565b60606000610f0783611065565b600101905060008167ffffffffffffffff811115610f2757610f27611263565b6040519080825280601f01601f191660200182016040528015610f51576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084610f5b57509392505050565b600680546001810182556000919091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01610fd683826115ae565b50600654600090610fe9906001906116d9565b825190915060005b818110156109545780600184612710020101848281518110611015576110156116ff565b60200260200101516001600160a01b031660006001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4600101610ff1565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106110ae577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106110da576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106110f857662386f26fc10000830492506010015b6305f5e1008310611110576305f5e100830492506008015b612710831061112457612710830492506004015b60648310611136576064830492506002015b600a831061044d5760010192915050565b60006020828403121561115957600080fd5b81356001600160e01b03198116811461077857600080fd5b60005b8381101561118c578181015183820152602001611174565b50506000910152565b60208152600082518060208401526111b4816040850160208701611171565b601f01601f19169190910160400192915050565b6000602082840312156111da57600080fd5b5035919050565b6001600160a01b038116811461085957600080fd5b6000806040838503121561120957600080fd5b8235611214816111e1565b946020939093013593505050565b60008060006060848603121561123757600080fd5b8335611242816111e1565b92506020840135611252816111e1565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561129457611294611263565b604051601f8501601f19908116603f011681019082821181831017156112bc576112bc611263565b816040528093508581528686860111156112d557600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261130057600080fd5b61077883833560208501611279565b60006020828403121561132157600080fd5b813567ffffffffffffffff81111561133857600080fd5b6107a7848285016112ef565b60006020828403121561135657600080fd5b8135610778816111e1565b6000806040838503121561137457600080fd5b823561137f816111e1565b91506020830135801515811461139457600080fd5b809150509250929050565b600080604083850312156113b257600080fd5b823567ffffffffffffffff8111156113c957600080fd5b6113d5858286016112ef565b95602094909401359450505050565b600080600080608085870312156113fa57600080fd5b8435611405816111e1565b93506020850135611415816111e1565b925060408501359150606085013567ffffffffffffffff81111561143857600080fd5b8501601f8101871361144957600080fd5b61145887823560208401611279565b91505092959194509250565b60008060006040848603121561147957600080fd5b833567ffffffffffffffff8082111561149157600080fd5b61149d878388016112ef565b945060208601359150808211156114b357600080fd5b818601915086601f8301126114c757600080fd5b8135818111156114d657600080fd5b8760208260051b85010111156114eb57600080fd5b6020830194508093505050509250925092565b6000806040838503121561151157600080fd5b823561151c816111e1565b91506020830135611394816111e1565b600181811c9082168061154057607f821691505b6020821081036107af57634e487b7160e01b600052602260045260246000fd5b601f821115610a3e57600081815260208120601f850160051c810160208610156115875750805b601f850160051c820191505b818110156115a657828155600101611593565b505050505050565b815167ffffffffffffffff8111156115c8576115c8611263565b6115dc816115d6845461152c565b84611560565b602080601f83116001811461161157600084156115f95750858301515b600019600386901b1c1916600185901b1785556115a6565b600085815260208120601f198616915b8281101561164057888601518255948401946001909101908401611621565b508582101561165e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121561168057600080fd5b8151610778816111e1565b60006020828403121561169d57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156116d4576116d46116a4565b500290565b8181038181111561044d5761044d6116a4565b8082018082111561044d5761044d6116a4565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261173a5761173a611715565b500490565b60008351611751818460208801611171565b835190830190611765818360208801611171565b01949350505050565b60008261177d5761177d611715565b50069056fea264697066735822122040a6b05be914d80717a4accc47d66cd6bd0f31042aa33150bf7aa83d3b793e7964736f6c63430008100033000000000000000000000000b7def63a9040ad5dc431aff79045617922f4023a
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101a35760003560e01c806379ba5097116100ee578063a85c79f711610097578063de15f1dd11610071578063de15f1dd14610335578063e30c397814610348578063e985e9c514610359578063f2fde38b1461036f57600080fd5b8063a85c79f714610301578063b88d4fde14610314578063c87b56dd1461032257600080fd5b806395d89b41116100c857806395d89b41146102d8578063a22cb465146102e0578063a83225c0146102ee57600080fd5b806379ba5097146102ac5780638ce516da146102b45780638da5cb5b146102c757600080fd5b80634310fe7d116101505780636352211e1161012a5780636352211e1461027057806370a0823114610283578063715018a6146102a457600080fd5b80634310fe7d14610239578063567c904e1461024c57806360f96a8f1461025f57600080fd5b8063095ea7b311610181578063095ea7b31461021157806323b872dd1461022657806342842e0e1461022657600080fd5b806301ffc9a7146101a857806306fdde03146101d0578063081812fc146101e5575b600080fd5b6101bb6101b6366004611147565b610382565b60405190151581526020015b60405180910390f35b6101d8610453565b6040516101c79190611195565b6101f96101f33660046111c8565b50600090565b6040516001600160a01b0390911681526020016101c7565b61022461021f3660046111f6565b6104e5565b005b610224610234366004611222565b610517565b6102246102473660046111f6565b610549565b61022461025a36600461130f565b61059e565b6005546001600160a01b03166101f9565b6101f961027e3660046111c8565b6105b6565b610296610291366004611344565b610657565b6040519081526020016101c7565b6102246107b5565b6102246107c9565b6102246102c2366004611222565b61085c565b6000546001600160a01b03166101f9565b6101d861095b565b61022461021f366004611361565b6102246102fc36600461130f565b61096a565b61022461030f36600461139f565b6109d1565b6102246102343660046113e4565b6101d86103303660046111c8565b610a43565b610224610343366004611464565b610c0c565b6001546001600160a01b03166101f9565b6101bb6103673660046114fe565b600092915050565b61022461037d366004611344565b610c74565b60006001600160e01b031982167f80ac58cd0000000000000000000000000000000000000000000000000000000014806103e557506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061041957506001600160e01b031982167fec1c7c5500000000000000000000000000000000000000000000000000000000145b8061044d57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b6060600280546104629061152c565b80601f016020809104026020016040519081016040528092919081815260200182805461048e9061152c565b80156104db5780601f106104b0576101008083540402835291602001916104db565b820191906000526020600020905b8154815290600101906020018083116104be57829003601f168201915b5050505050905090565b6040517fddda210e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f1739cd1b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610551610d4f565b8061055b826105b6565b6001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b6105a6610d4f565b60076105b282826115ae565b5050565b60006105c182610da9565b6105de57604051630f81ffef60e21b815260040160405180910390fd5b6004546001600160a01b0316636352211e6105f884610e52565b6040518263ffffffff1660e01b815260040161061691815260200190565b602060405180830381865afa158015610633573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044d919061166e565b600480546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0384811693820193909352600092839216906370a0823190602401602060405180830381865afa1580156106c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e4919061168b565b600480546040517fe0e037f60000000000000000000000000000000000000000000000000000000081526001600160a01b0387811693820193909352929350169063e0e037f690602401602060405180830381865afa925050508015610767575060408051601f3d908101601f191682019092526107649181019061168b565b60015b61077f5760065461077890826116ba565b9392505050565b8061078960065490565b61079383856116d9565b61079d91906116ba565b6107a791906116ec565b949350505050565b50919050565b6107bd610d4f565b6107c76000610ed4565b565b60015433906001600160a01b031681146108505760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61085981610ed4565b50565b6005546001600160a01b031633146108a0576040517f0a9aa24500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108ad600a6127106116ba565b8111156108fa5780826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b60065460005b8181101561095457604051612710820284019081906001600160a01b0380881691908916907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90600090a450600101610900565b5050505050565b6060600380546104629061152c565b610972610d4f565b600654600a116109955760405163d70d190f60e01b815260040160405180910390fd5b600680546001810182556000919091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f016105b282826115ae565b6109d9610d4f565b6006548110610a14576040517f4b19284f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160068281548110610a2857610a286116ff565b906000526020600020019081610a3e91906115ae565b505050565b6060610a4e82610da9565b610a6b57604051630f81ffef60e21b815260040160405180910390fd5b6060610a7a600a6127106116ba565b8311610b44576006612710610a906001866116d9565b610a9a919061172b565b81548110610aaa57610aaa6116ff565b906000526020600020018054610abf9061152c565b80601f0160208091040260200160405190810160405280929190818152602001828054610aeb9061152c565b8015610b385780601f10610b0d57610100808354040283529160200191610b38565b820191906000526020600020905b815481529060010190602001808311610b1b57829003601f168201915b50505050509050610bd2565b60078054610b519061152c565b80601f0160208091040260200160405190810160405280929190818152602001828054610b7d9061152c565b8015610bca5780601f10610b9f57610100808354040283529160200191610bca565b820191906000526020600020905b815481529060010190602001808311610bad57829003601f168201915b505050505090505b80610be4610bdf85610e52565b610efa565b604051602001610bf592919061173f565b604051602081830303815290604052915050919050565b610c14610d4f565b600654600a11610c375760405163d70d190f60e01b815260040160405180910390fd5b610a3e83838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610f9a92505050565b610c7c610d4f565b600180546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff199091168117909155610cba6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146107c75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610847565b600080610db583610e52565b600480546040517f6352211e0000000000000000000000000000000000000000000000000000000081529293506001600160a01b031691636352211e91610e029185910190815260200190565b602060405180830381865afa925050508015610e3b575060408051601f3d908101601f19168201909252610e389181019061166e565b60015b610e485750600092915050565b5060019392505050565b6000610e61600a6127106116ba565b821115610e6c575090565b6000612710610e7c6001856116d9565b610e86919061172b565b9050610e9160065490565b811015610ebb57612710610ea66001856116d9565b610eb0919061176e565b6107789060016116ec565b604051630f81ffef60e21b815260040160405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916905561085981610cf2565b60606000610f0783611065565b600101905060008167ffffffffffffffff811115610f2757610f27611263565b6040519080825280601f01601f191660200182016040528015610f51576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8504945084610f5b57509392505050565b600680546001810182556000919091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01610fd683826115ae565b50600654600090610fe9906001906116d9565b825190915060005b818110156109545780600184612710020101848281518110611015576110156116ff565b60200260200101516001600160a01b031660006001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4600101610ff1565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106110ae577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef810000000083106110da576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106110f857662386f26fc10000830492506010015b6305f5e1008310611110576305f5e100830492506008015b612710831061112457612710830492506004015b60648310611136576064830492506002015b600a831061044d5760010192915050565b60006020828403121561115957600080fd5b81356001600160e01b03198116811461077857600080fd5b60005b8381101561118c578181015183820152602001611174565b50506000910152565b60208152600082518060208401526111b4816040850160208701611171565b601f01601f19169190910160400192915050565b6000602082840312156111da57600080fd5b5035919050565b6001600160a01b038116811461085957600080fd5b6000806040838503121561120957600080fd5b8235611214816111e1565b946020939093013593505050565b60008060006060848603121561123757600080fd5b8335611242816111e1565b92506020840135611252816111e1565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561129457611294611263565b604051601f8501601f19908116603f011681019082821181831017156112bc576112bc611263565b816040528093508581528686860111156112d557600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261130057600080fd5b61077883833560208501611279565b60006020828403121561132157600080fd5b813567ffffffffffffffff81111561133857600080fd5b6107a7848285016112ef565b60006020828403121561135657600080fd5b8135610778816111e1565b6000806040838503121561137457600080fd5b823561137f816111e1565b91506020830135801515811461139457600080fd5b809150509250929050565b600080604083850312156113b257600080fd5b823567ffffffffffffffff8111156113c957600080fd5b6113d5858286016112ef565b95602094909401359450505050565b600080600080608085870312156113fa57600080fd5b8435611405816111e1565b93506020850135611415816111e1565b925060408501359150606085013567ffffffffffffffff81111561143857600080fd5b8501601f8101871361144957600080fd5b61145887823560208401611279565b91505092959194509250565b60008060006040848603121561147957600080fd5b833567ffffffffffffffff8082111561149157600080fd5b61149d878388016112ef565b945060208601359150808211156114b357600080fd5b818601915086601f8301126114c757600080fd5b8135818111156114d657600080fd5b8760208260051b85010111156114eb57600080fd5b6020830194508093505050509250925092565b6000806040838503121561151157600080fd5b823561151c816111e1565b91506020830135611394816111e1565b600181811c9082168061154057607f821691505b6020821081036107af57634e487b7160e01b600052602260045260246000fd5b601f821115610a3e57600081815260208120601f850160051c810160208610156115875750805b601f850160051c820191505b818110156115a657828155600101611593565b505050505050565b815167ffffffffffffffff8111156115c8576115c8611263565b6115dc816115d6845461152c565b84611560565b602080601f83116001811461161157600084156115f95750858301515b600019600386901b1c1916600185901b1785556115a6565b600085815260208120601f198616915b8281101561164057888601518255948401946001909101908401611621565b508582101561165e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006020828403121561168057600080fd5b8151610778816111e1565b60006020828403121561169d57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156116d4576116d46116a4565b500290565b8181038181111561044d5761044d6116a4565b8082018082111561044d5761044d6116a4565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261173a5761173a611715565b500490565b60008351611751818460208801611171565b835190830190611765818360208801611171565b01949350505050565b60008261177d5761177d611715565b50069056fea264697066735822122040a6b05be914d80717a4accc47d66cd6bd0f31042aa33150bf7aa83d3b793e7964736f6c63430008100033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b7def63a9040ad5dc431aff79045617922f4023a
-----Decoded View---------------
Arg [0] : parent_ (address): 0xb7def63A9040ad5dC431afF79045617922f4023A
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000b7def63a9040ad5dc431aff79045617922f4023a
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.