ERC-20
Overview
Max Total Supply
1,000 Pangea
Holders
99
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
0.00000000000000026 PangeaValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
Pangea
Compiler Version
v0.8.23+commit.f704f362
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2024-02-12 */ pragma solidity ^0.8.4; /// @notice Library for storage of packed unsigned integers. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibMap.sol) library LibMap { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STRUCTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev A uint8 map in storage. struct Uint8Map { mapping(uint256 => uint256) map; } /// @dev A uint16 map in storage. struct Uint16Map { mapping(uint256 => uint256) map; } /// @dev A uint32 map in storage. struct Uint32Map { mapping(uint256 => uint256) map; } /// @dev A uint40 map in storage. Useful for storing timestamps up to 34841 A.D. struct Uint40Map { mapping(uint256 => uint256) map; } /// @dev A uint64 map in storage. struct Uint64Map { mapping(uint256 => uint256) map; } /// @dev A uint128 map in storage. struct Uint128Map { mapping(uint256 => uint256) map; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* GETTERS / SETTERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the uint8 value at `index` in `map`. function get(Uint8Map storage map, uint256 index) internal view returns (uint8 result) { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, shr(5, index)) result := byte(and(31, not(index)), sload(keccak256(0x00, 0x40))) } } /// @dev Updates the uint8 value at `index` in `map`. function set(Uint8Map storage map, uint256 index, uint8 value) internal { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, shr(5, index)) let s := keccak256(0x00, 0x40) // Storage slot. mstore(0x00, sload(s)) mstore8(and(31, not(index)), value) sstore(s, mload(0x00)) } } /// @dev Returns the uint16 value at `index` in `map`. function get(Uint16Map storage map, uint256 index) internal view returns (uint16 result) { result = uint16(map.map[index >> 4] >> ((index & 15) << 4)); } /// @dev Updates the uint16 value at `index` in `map`. function set(Uint16Map storage map, uint256 index, uint16 value) internal { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, shr(4, index)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(4, and(index, 15)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } /// @dev Returns the uint32 value at `index` in `map`. function get(Uint32Map storage map, uint256 index) internal view returns (uint32 result) { result = uint32(map.map[index >> 3] >> ((index & 7) << 5)); } /// @dev Updates the uint32 value at `index` in `map`. function set(Uint32Map storage map, uint256 index, uint32 value) internal { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, shr(3, index)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(5, and(index, 7)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } /// @dev Returns the uint40 value at `index` in `map`. function get(Uint40Map storage map, uint256 index) internal view returns (uint40 result) { unchecked { result = uint40(map.map[index / 6] >> ((index % 6) * 40)); } } /// @dev Updates the uint40 value at `index` in `map`. function set(Uint40Map storage map, uint256 index, uint40 value) internal { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, div(index, 6)) let s := keccak256(0x00, 0x40) // Storage slot. let o := mul(40, mod(index, 6)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } /// @dev Returns the uint64 value at `index` in `map`. function get(Uint64Map storage map, uint256 index) internal view returns (uint64 result) { result = uint64(map.map[index >> 2] >> ((index & 3) << 6)); } /// @dev Updates the uint64 value at `index` in `map`. function set(Uint64Map storage map, uint256 index, uint64 value) internal { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, shr(2, index)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(6, and(index, 3)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffffffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } /// @dev Returns the uint128 value at `index` in `map`. function get(Uint128Map storage map, uint256 index) internal view returns (uint128 result) { result = uint128(map.map[index >> 1] >> ((index & 1) << 7)); } /// @dev Updates the uint128 value at `index` in `map`. function set(Uint128Map storage map, uint256 index, uint128 value) internal { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, shr(1, index)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(7, and(index, 1)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffffffffffffffffffffffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } /// @dev Returns the value at `index` in `map`. function get(mapping(uint256 => uint256) storage map, uint256 index, uint256 bitWidth) internal view returns (uint256 result) { unchecked { uint256 d = _rawDiv(256, bitWidth); // Bucket size. uint256 m = (1 << bitWidth) - 1; // Value mask. result = (map[_rawDiv(index, d)] >> (_rawMod(index, d) * bitWidth)) & m; } } /// @dev Updates the value at `index` in `map`. function set( mapping(uint256 => uint256) storage map, uint256 index, uint256 value, uint256 bitWidth ) internal { unchecked { uint256 d = _rawDiv(256, bitWidth); // Bucket size. uint256 m = (1 << bitWidth) - 1; // Value mask. uint256 o = _rawMod(index, d) * bitWidth; // Storage slot offset (bits). map[_rawDiv(index, d)] ^= (((map[_rawDiv(index, d)] >> o) ^ value) & m) << o; } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* BINARY SEARCH */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // The following functions search in the range of [`start`, `end`) // (i.e. `start <= index < end`). // The range must be sorted in ascending order. // `index` precedence: equal to > nearest before > nearest after. // An invalid search range will simply return `(found = false, index = start)`. /// @dev Returns whether `map` contains `needle`, and the index of `needle`. function searchSorted(Uint8Map storage map, uint8 needle, uint256 start, uint256 end) internal view returns (bool found, uint256 index) { return searchSorted(map.map, needle, start, end, 8); } /// @dev Returns whether `map` contains `needle`, and the index of `needle`. function searchSorted(Uint16Map storage map, uint16 needle, uint256 start, uint256 end) internal view returns (bool found, uint256 index) { return searchSorted(map.map, needle, start, end, 16); } /// @dev Returns whether `map` contains `needle`, and the index of `needle`. function searchSorted(Uint32Map storage map, uint32 needle, uint256 start, uint256 end) internal view returns (bool found, uint256 index) { return searchSorted(map.map, needle, start, end, 32); } /// @dev Returns whether `map` contains `needle`, and the index of `needle`. function searchSorted(Uint40Map storage map, uint40 needle, uint256 start, uint256 end) internal view returns (bool found, uint256 index) { return searchSorted(map.map, needle, start, end, 40); } /// @dev Returns whether `map` contains `needle`, and the index of `needle`. function searchSorted(Uint64Map storage map, uint64 needle, uint256 start, uint256 end) internal view returns (bool found, uint256 index) { return searchSorted(map.map, needle, start, end, 64); } /// @dev Returns whether `map` contains `needle`, and the index of `needle`. function searchSorted(Uint128Map storage map, uint128 needle, uint256 start, uint256 end) internal view returns (bool found, uint256 index) { return searchSorted(map.map, needle, start, end, 128); } /// @dev Returns whether `map` contains `needle`, and the index of `needle`. function searchSorted( mapping(uint256 => uint256) storage map, uint256 needle, uint256 start, uint256 end, uint256 bitWidth ) internal view returns (bool found, uint256 index) { unchecked { if (start >= end) end = start; uint256 t; uint256 o = start - 1; // Offset to derive the actual index. uint256 l = 1; // Low. uint256 d = _rawDiv(256, bitWidth); // Bucket size. uint256 m = (1 << bitWidth) - 1; // Value mask. uint256 h = end - start; // High. while (true) { index = (l & h) + ((l ^ h) >> 1); if (l > h) break; t = (map[_rawDiv(index + o, d)] >> (_rawMod(index + o, d) * bitWidth)) & m; if (t == needle) break; if (needle <= t) h = index - 1; else l = index + 1; } /// @solidity memory-safe-assembly assembly { m := or(iszero(index), iszero(bitWidth)) found := iszero(or(xor(t, needle), m)) index := add(o, xor(index, mul(xor(index, 1), m))) } } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PRIVATE HELPERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns `x / y`, returning 0 if `y` is zero. function _rawDiv(uint256 x, uint256 y) private pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { z := div(x, y) } } /// @dev Returns `x % y`, returning 0 if `y` is zero. function _rawMod(uint256 x, uint256 y) private pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { z := mod(x, y) } } } pragma solidity ^0.8.4; /// @notice Library for converting numbers into strings and other string operations. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol) /// /// @dev Note: /// For performance and bytecode compactness, most of the string operations are restricted to /// byte strings (7-bit ASCII), except where otherwise specified. /// Usage of byte string operations on charsets with runes spanning two or more bytes /// can lead to undefined behavior. library LibString { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The length of the output is too small to contain all the hex digits. error HexLengthInsufficient(); /// @dev The length of the string is more than 32 bytes. error TooBigForSmallString(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The constant returned when the `search` is not found in the string. uint256 internal constant NOT_FOUND = type(uint256).max; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* DECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the base 10 decimal representation of `value`. function toString(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. str := add(mload(0x40), 0x80) // Update the free memory pointer to allocate. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str let w := not(0) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 {} { str := add(str, w) // `sub(str, 1)`. // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } /// @dev Returns the base 10 decimal representation of `value`. function toString(int256 value) internal pure returns (string memory str) { if (value >= 0) { return toString(uint256(value)); } unchecked { str = toString(~uint256(value) + 1); } /// @solidity memory-safe-assembly assembly { // We still have some spare memory space on the left, // as we have allocated 3 words (96 bytes) for up to 78 digits. let length := mload(str) // Load the string length. mstore(str, 0x2d) // Store the '-' character. str := sub(str, 1) // Move back the string pointer by a byte. mstore(str, add(length, 1)) // Update the string length. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* HEXADECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2 + 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexString(uint256 value, uint256 length) internal pure returns (string memory str) { str = toHexStringNoPrefix(value, length); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexStringNoPrefix(uint256 value, uint256 length) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, `length * 2` bytes // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length. // We add 0x20 to the total and round down to a multiple of 0x20. // (0x20 + 0x20 + 0x02 + 0x20) = 0x62. str := add(mload(0x40), and(add(shl(1, length), 0x42), not(0x1f))) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let start := sub(str, add(length, length)) let w := not(1) // Tsk. let temp := value // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for {} 1 {} { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(xor(str, start)) { break } } if temp { mstore(0x00, 0x2194895a) // `HexLengthInsufficient()`. revert(0x1c, 0x04) } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2 + 2` bytes. function toHexString(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x". /// The output excludes leading "0" from the `toHexString` output. /// `0x00: "0x0", 0x01: "0x1", 0x12: "0x12", 0x123: "0x123"`. function toMinimalHexString(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present. let strLength := add(mload(str), 2) // Compute the length. mstore(add(str, o), 0x3078) // Write the "0x" prefix, accounting for leading zero. str := sub(add(str, o), 2) // Move the pointer, accounting for leading zero. mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero. } } /// @dev Returns the hexadecimal representation of `value`. /// The output excludes leading "0" from the `toHexStringNoPrefix` output. /// `0x00: "0", 0x01: "1", 0x12: "12", 0x123: "123"`. function toMinimalHexStringNoPrefix(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present. let strLength := mload(str) // Get the length. str := add(str, o) // Move the pointer, accounting for leading zero. mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2` bytes. function toHexStringNoPrefix(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x40 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0. str := add(mload(0x40), 0x80) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let w := not(1) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 {} { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(temp) { break } } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte, /// and the alphabets are capitalized conditionally according to /// https://eips.ethereum.org/EIPS/eip-55 function toHexStringChecksummed(address value) internal pure returns (string memory str) { str = toHexString(value); /// @solidity memory-safe-assembly assembly { let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...` let o := add(str, 0x22) let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... ` let t := shl(240, 136) // `0b10001000 << 240` for { let i := 0 } 1 {} { mstore(add(i, i), mul(t, byte(i, hashed))) i := add(i, 1) if eq(i, 20) { break } } mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask))))) o := add(o, 0x20) mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask))))) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. function toHexString(address value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(address value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { str := mload(0x40) // Allocate the memory. // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x28 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80. mstore(0x40, add(str, 0x80)) // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) str := add(str, 2) mstore(str, 40) let o := add(str, 0x20) mstore(add(o, 40), 0) value := shl(96, value) // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let i := 0 } 1 {} { let p := add(o, add(i, i)) let temp := byte(i, value) mstore8(add(p, 1), mload(and(temp, 15))) mstore8(p, mload(shr(4, temp))) i := add(i, 1) if eq(i, 20) { break } } } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexString(bytes memory raw) internal pure returns (string memory str) { str = toHexStringNoPrefix(raw); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { let length := mload(raw) str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix. mstore(str, add(length, length)) // Store the length of the output. // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let o := add(str, 0x20) let end := add(raw, length) for {} iszero(eq(raw, end)) {} { raw := add(raw, 1) mstore8(add(o, 1), mload(and(mload(raw), 15))) mstore8(o, mload(and(shr(4, mload(raw)), 15))) o := add(o, 2) } mstore(o, 0) // Zeroize the slot after the string. mstore(0x40, add(o, 0x20)) // Allocate the memory. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* RUNE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the number of UTF characters in the string. function runeCount(string memory s) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { if mload(s) { mstore(0x00, div(not(0), 255)) mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506) let o := add(s, 0x20) let end := add(o, mload(s)) for { result := 1 } 1 { result := add(result, 1) } { o := add(o, byte(0, mload(shr(250, mload(o))))) if iszero(lt(o, end)) { break } } } } } /// @dev Returns if this string is a 7-bit ASCII string. /// (i.e. all characters codes are in [0..127]) function is7BitASCII(string memory s) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let mask := shl(7, div(not(0), 255)) result := 1 let n := mload(s) if n { let o := add(s, 0x20) let end := add(o, n) let last := mload(end) mstore(end, 0) for {} 1 {} { if and(mask, mload(o)) { result := 0 break } o := add(o, 0x20) if iszero(lt(o, end)) { break } } mstore(end, last) } } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* BYTE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // For performance and bytecode compactness, byte string operations are restricted // to 7-bit ASCII strings. All offsets are byte offsets, not UTF character offsets. // Usage of byte string operations on charsets with runes spanning two or more bytes // can lead to undefined behavior. /// @dev Returns `subject` all occurrences of `search` replaced with `replacement`. function replace(string memory subject, string memory search, string memory replacement) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) let replacementLength := mload(replacement) subject := add(subject, 0x20) search := add(search, 0x20) replacement := add(replacement, 0x20) result := add(mload(0x40), 0x20) let subjectEnd := add(subject, subjectLength) if iszero(gt(searchLength, subjectLength)) { let subjectSearchEnd := add(sub(subjectEnd, searchLength), 1) let h := 0 if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) } let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(search) for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Copy the `replacement` one word at a time. for { let o := 0 } 1 {} { mstore(add(result, o), mload(add(replacement, o))) o := add(o, 0x20) if iszero(lt(o, replacementLength)) { break } } result := add(result, replacementLength) subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } } let resultRemainder := result result := add(mload(0x40), 0x20) let k := add(sub(resultRemainder, result), sub(subjectEnd, subject)) // Copy the rest of the string one word at a time. for {} lt(subject, subjectEnd) {} { mstore(resultRemainder, mload(subject)) resultRemainder := add(resultRemainder, 0x20) subject := add(subject, 0x20) } result := sub(result, 0x20) let last := add(add(result, 0x20), k) // Zeroize the slot after the string. mstore(last, 0) mstore(0x40, add(last, 0x20)) // Allocate the memory. mstore(result, k) // Store the length. } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for { let subjectLength := mload(subject) } 1 {} { if iszero(mload(search)) { if iszero(gt(from, subjectLength)) { result := from break } result := subjectLength break } let searchLength := mload(search) let subjectStart := add(subject, 0x20) result := not(0) // Initialize to `NOT_FOUND`. subject := add(subjectStart, from) let end := add(sub(add(subjectStart, subjectLength), searchLength), 1) let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(add(search, 0x20)) if iszero(and(lt(subject, end), lt(from, subjectLength))) { break } if iszero(lt(searchLength, 0x20)) { for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if iszero(shr(m, xor(mload(subject), s))) { if eq(keccak256(subject, searchLength), h) { result := sub(subject, subjectStart) break } } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } for {} 1 {} { if iszero(shr(m, xor(mload(subject), s))) { result := sub(subject, subjectStart) break } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = indexOf(subject, search, 0); } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for {} 1 {} { result := not(0) // Initialize to `NOT_FOUND`. let searchLength := mload(search) if gt(searchLength, mload(subject)) { break } let w := result let fromMax := sub(mload(subject), searchLength) if iszero(gt(fromMax, from)) { from := fromMax } let end := add(add(subject, 0x20), w) subject := add(add(subject, 0x20), from) if iszero(gt(subject, end)) { break } // As this function is not too often used, // we shall simply use keccak256 for smaller bytecode size. for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if eq(keccak256(subject, searchLength), h) { result := sub(subject, add(end, 1)) break } subject := add(subject, w) // `sub(subject, 1)`. if iszero(gt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = lastIndexOf(subject, search, uint256(int256(-1))); } /// @dev Returns true if `search` is found in `subject`, false otherwise. function contains(string memory subject, string memory search) internal pure returns (bool) { return indexOf(subject, search) != NOT_FOUND; } /// @dev Returns whether `subject` starts with `search`. function startsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( iszero(gt(searchLength, mload(subject))), eq( keccak256(add(subject, 0x20), searchLength), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns whether `subject` ends with `search`. function endsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) let subjectLength := mload(subject) // Whether `search` is not longer than `subject`. let withinRange := iszero(gt(searchLength, subjectLength)) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( withinRange, eq( keccak256( // `subject + 0x20 + max(subjectLength - searchLength, 0)`. add(add(subject, 0x20), mul(withinRange, sub(subjectLength, searchLength))), searchLength ), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns `subject` repeated `times`. function repeat(string memory subject, uint256 times) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(or(iszero(times), iszero(subjectLength))) { subject := add(subject, 0x20) result := mload(0x40) let output := add(result, 0x20) for {} 1 {} { // Copy the `subject` one word at a time. for { let o := 0 } 1 {} { mstore(add(output, o), mload(add(subject, o))) o := add(o, 0x20) if iszero(lt(o, subjectLength)) { break } } output := add(output, subjectLength) times := sub(times, 1) if iszero(times) { break } } mstore(output, 0) // Zeroize the slot after the string. let resultLength := sub(output, add(result, 0x20)) mstore(result, resultLength) // Store the length. // Allocate the memory. mstore(0x40, add(result, add(resultLength, 0x20))) } } } /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive). /// `start` and `end` are byte offsets. function slice(string memory subject, uint256 start, uint256 end) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(gt(subjectLength, end)) { end := subjectLength } if iszero(gt(subjectLength, start)) { start := subjectLength } if lt(start, end) { result := mload(0x40) let resultLength := sub(end, start) mstore(result, resultLength) subject := add(subject, start) let w := not(0x1f) // Copy the `subject` one word at a time, backwards. for { let o := and(add(resultLength, 0x1f), w) } 1 {} { mstore(add(result, o), mload(add(subject, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(result, 0x20), resultLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(result, and(add(resultLength, 0x3f), w))) } } } /// @dev Returns a copy of `subject` sliced from `start` to the end of the string. /// `start` is a byte offset. function slice(string memory subject, uint256 start) internal pure returns (string memory result) { result = slice(subject, start, uint256(int256(-1))); } /// @dev Returns all the indices of `search` in `subject`. /// The indices are byte offsets. function indicesOf(string memory subject, string memory search) internal pure returns (uint256[] memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) if iszero(gt(searchLength, subjectLength)) { subject := add(subject, 0x20) search := add(search, 0x20) result := add(mload(0x40), 0x20) let subjectStart := subject let subjectSearchEnd := add(sub(add(subject, subjectLength), searchLength), 1) let h := 0 if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) } let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(search) for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Append to `result`. mstore(result, sub(subject, subjectStart)) result := add(result, 0x20) // Advance `subject` by `searchLength`. subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } let resultEnd := result // Assign `result` to the free memory pointer. result := mload(0x40) // Store the length of `result`. mstore(result, shr(5, sub(resultEnd, add(result, 0x20)))) // Allocate memory for result. // We allocate one more word, so this array can be recycled for {split}. mstore(0x40, add(resultEnd, 0x20)) } } } /// @dev Returns a arrays of strings based on the `delimiter` inside of the `subject` string. function split(string memory subject, string memory delimiter) internal pure returns (string[] memory result) { uint256[] memory indices = indicesOf(subject, delimiter); /// @solidity memory-safe-assembly assembly { let w := not(0x1f) let indexPtr := add(indices, 0x20) let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1))) mstore(add(indicesEnd, w), mload(subject)) mstore(indices, add(mload(indices), 1)) let prevIndex := 0 for {} 1 {} { let index := mload(indexPtr) mstore(indexPtr, 0x60) if iszero(eq(index, prevIndex)) { let element := mload(0x40) let elementLength := sub(index, prevIndex) mstore(element, elementLength) // Copy the `subject` one word at a time, backwards. for { let o := and(add(elementLength, 0x1f), w) } 1 {} { mstore(add(element, o), mload(add(add(subject, prevIndex), o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(element, 0x20), elementLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(element, and(add(elementLength, 0x3f), w))) // Store the `element` into the array. mstore(indexPtr, element) } prevIndex := add(index, mload(delimiter)) indexPtr := add(indexPtr, 0x20) if iszero(lt(indexPtr, indicesEnd)) { break } } result := indices if iszero(mload(delimiter)) { result := add(indices, 0x20) mstore(result, sub(mload(indices), 2)) } } } /// @dev Returns a concatenated string of `a` and `b`. /// Cheaper than `string.concat()` and does not de-align the free memory pointer. function concat(string memory a, string memory b) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let w := not(0x1f) result := mload(0x40) let aLength := mload(a) // Copy `a` one word at a time, backwards. for { let o := and(add(aLength, 0x20), w) } 1 {} { mstore(add(result, o), mload(add(a, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let bLength := mload(b) let output := add(result, aLength) // Copy `b` one word at a time, backwards. for { let o := and(add(bLength, 0x20), w) } 1 {} { mstore(add(output, o), mload(add(b, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let totalLength := add(aLength, bLength) let last := add(add(result, 0x20), totalLength) // Zeroize the slot after the string. mstore(last, 0) // Stores the length. mstore(result, totalLength) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 0x1f), w)) } } /// @dev Returns a copy of the string in either lowercase or UPPERCASE. /// WARNING! This function is only compatible with 7-bit ASCII strings. function toCase(string memory subject, bool toUpper) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let length := mload(subject) if length { result := add(mload(0x40), 0x20) subject := add(subject, 1) let flags := shl(add(70, shl(5, toUpper)), 0x3ffffff) let w := not(0) for { let o := length } 1 {} { o := add(o, w) let b := and(0xff, mload(add(subject, o))) mstore8(add(result, o), xor(b, and(shr(b, flags), 0x20))) if iszero(o) { break } } result := mload(0x40) mstore(result, length) // Store the length. let last := add(add(result, 0x20), length) mstore(last, 0) // Zeroize the slot after the string. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } } /// @dev Returns a string from a small bytes32 string. /// `s` must be null-terminated, or behavior will be undefined. function fromSmallString(bytes32 s) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { result := mload(0x40) let n := 0 for {} byte(n, s) { n := add(n, 1) } {} // Scan for '\0'. mstore(result, n) let o := add(result, 0x20) mstore(o, s) mstore(add(o, n), 0) mstore(0x40, add(result, 0x40)) } } /// @dev Returns the small string, with all bytes after the first null byte zeroized. function normalizeSmallString(bytes32 s) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { for {} byte(result, s) { result := add(result, 1) } {} // Scan for '\0'. mstore(0x00, s) mstore(result, 0x00) result := mload(0x00) } } /// @dev Returns the string as a normalized null-terminated small string. function toSmallString(string memory s) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { result := mload(s) if iszero(lt(result, 33)) { mstore(0x00, 0xec92f9a3) // `TooBigForSmallString()`. revert(0x1c, 0x04) } result := shl(shl(3, sub(32, result)), mload(add(s, result))) } } /// @dev Returns a lowercased copy of the string. /// WARNING! This function is only compatible with 7-bit ASCII strings. function lower(string memory subject) internal pure returns (string memory result) { result = toCase(subject, false); } /// @dev Returns an UPPERCASED copy of the string. /// WARNING! This function is only compatible with 7-bit ASCII strings. function upper(string memory subject) internal pure returns (string memory result) { result = toCase(subject, true); } /// @dev Escapes the string to be used within HTML tags. function escapeHTML(string memory s) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) // Store the bytes of the packed offsets and strides into the scratch space. // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6. mstore(0x1f, 0x900094) mstore(0x08, 0xc0000000a6ab) // Store ""&'<>" into the scratch space. mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b)) for {} iszero(eq(s, end)) {} { s := add(s, 1) let c := and(mload(s), 0xff) // Not in `["\"","'","&","<",">"]`. if iszero(and(shl(c, 1), 0x500000c400000000)) { mstore8(result, c) result := add(result, 1) continue } let t := shr(248, mload(c)) mstore(result, mload(and(t, 0x1f))) result := add(result, shr(5, t)) } let last := result mstore(last, 0) // Zeroize the slot after the string. result := mload(0x40) mstore(result, sub(last, add(result, 0x20))) // Store the length. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } /// @dev Escapes the string to be used within double-quotes in a JSON. /// If `addDoubleQuotes` is true, the result will be enclosed in double-quotes. function escapeJSON(string memory s, bool addDoubleQuotes) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) if addDoubleQuotes { mstore8(result, 34) result := add(1, result) } // Store "\\u0000" in scratch space. // Store "0123456789abcdef" in scratch space. // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`. // into the scratch space. mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672) // Bitmask for detecting `["\"","\\"]`. let e := or(shl(0x22, 1), shl(0x5c, 1)) for {} iszero(eq(s, end)) {} { s := add(s, 1) let c := and(mload(s), 0xff) if iszero(lt(c, 0x20)) { if iszero(and(shl(c, 1), e)) { // Not in `["\"","\\"]`. mstore8(result, c) result := add(result, 1) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), c) result := add(result, 2) continue } if iszero(and(shl(c, 1), 0x3700)) { // Not in `["\b","\t","\n","\f","\d"]`. mstore8(0x1d, mload(shr(4, c))) // Hex value. mstore8(0x1e, mload(and(c, 15))) // Hex value. mstore(result, mload(0x19)) // "\\u00XX". result := add(result, 6) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), mload(add(c, 8))) result := add(result, 2) } if addDoubleQuotes { mstore8(result, 34) result := add(1, result) } let last := result mstore(last, 0) // Zeroize the slot after the string. result := mload(0x40) mstore(result, sub(last, add(result, 0x20))) // Store the length. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } /// @dev Escapes the string to be used within double-quotes in a JSON. function escapeJSON(string memory s) internal pure returns (string memory result) { result = escapeJSON(s, false); } /// @dev Returns whether `a` equals `b`. function eq(string memory a, string memory b) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b))) } } /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small string. function eqs(string memory a, bytes32 b) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { // These should be evaluated on compile time, as far as possible. let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`. let x := not(or(m, or(b, add(m, and(b, m))))) let r := shl(7, iszero(iszero(shr(128, x)))) r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x)))))) r := or(r, shl(5, lt(0xffffffff, shr(r, x)))) r := or(r, shl(4, lt(0xffff, shr(r, x)))) r := or(r, shl(3, lt(0xff, shr(r, x)))) // forgefmt: disable-next-item result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))), xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20))))) } } /// @dev Packs a single string with its length into a single word. /// Returns `bytes32(0)` if the length is zero or greater than 31. function packOne(string memory a) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { // We don't need to zero right pad the string, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes. mload(add(a, 0x1f)), // `length != 0 && length < 32`. Abuses underflow. // Assumes that the length is valid and within the block gas limit. lt(sub(mload(a), 1), 0x1f) ) } } /// @dev Unpacks a string packed using {packOne}. /// Returns the empty string if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packOne}, the output behavior is undefined. function unpackOne(bytes32 packed) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. result := mload(0x40) // Allocate 2 words (1 for the length, 1 for the bytes). mstore(0x40, add(result, 0x40)) // Zeroize the length slot. mstore(result, 0) // Store the length and bytes. mstore(add(result, 0x1f), packed) // Right pad with zeroes. mstore(add(add(result, 0x20), mload(result)), 0) } } /// @dev Packs two strings with their lengths into a single word. /// Returns `bytes32(0)` if combined length is zero or greater than 30. function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { let aLength := mload(a) // We don't need to zero right pad the strings, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes of `a` and `b`. or( shl(shl(3, sub(0x1f, aLength)), mload(add(a, aLength))), mload(sub(add(b, 0x1e), aLength)) ), // `totalLength != 0 && totalLength < 31`. Abuses underflow. // Assumes that the lengths are valid and within the block gas limit. lt(sub(add(aLength, mload(b)), 1), 0x1e) ) } } /// @dev Unpacks strings packed using {packTwo}. /// Returns the empty strings if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packTwo}, the output behavior is undefined. function unpackTwo(bytes32 packed) internal pure returns (string memory resultA, string memory resultB) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. resultA := mload(0x40) resultB := add(resultA, 0x40) // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words. mstore(0x40, add(resultB, 0x40)) // Zeroize the length slots. mstore(resultA, 0) mstore(resultB, 0) // Store the lengths and bytes. mstore(add(resultA, 0x1f), packed) mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA)))) // Right pad with zeroes. mstore(add(add(resultA, 0x20), mload(resultA)), 0) mstore(add(add(resultB, 0x20), mload(resultB)), 0) } } /// @dev Directly returns `a` without copying. function directReturn(string memory a) internal pure { assembly { // Assumes that the string does not start from the scratch space. let retStart := sub(a, 0x20) let retSize := add(mload(a), 0x40) // Right pad with zeroes. Just in case the string is produced // by a method that doesn't zero right pad. mstore(add(retStart, retSize), 0) // Store the return offset. mstore(retStart, 0x20) // End the transaction, returning the string. return(retStart, retSize) } } } pragma solidity ^0.8.4; /// @notice Simple single owner authorization mixin. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol) /// /// @dev Note: /// This implementation does NOT auto-initialize the owner to `msg.sender`. /// You MUST call the `_initializeOwner` in the constructor / initializer. /// /// While the ownable portion follows /// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility, /// the nomenclature for the 2-step ownership handover may be unique to this codebase. abstract contract Ownable { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The caller is not authorized to call the function. error Unauthorized(); /// @dev The `newOwner` cannot be the zero address. error NewOwnerIsZeroAddress(); /// @dev The `pendingOwner` does not have a valid handover request. error NoHandoverRequest(); /// @dev Cannot double-initialize. error AlreadyInitialized(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* EVENTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The ownership is transferred from `oldOwner` to `newOwner`. /// This event is intentionally kept the same as OpenZeppelin's Ownable to be /// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173), /// despite it not being as lightweight as a single argument event. event OwnershipTransferred(address indexed oldOwner, address indexed newOwner); /// @dev An ownership handover to `pendingOwner` has been requested. event OwnershipHandoverRequested(address indexed pendingOwner); /// @dev The ownership handover to `pendingOwner` has been canceled. event OwnershipHandoverCanceled(address indexed pendingOwner); /// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`. uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE = 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0; /// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`. uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE = 0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d; /// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`. uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE = 0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* STORAGE */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The owner slot is given by: /// `bytes32(~uint256(uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))))`. /// It is intentionally chosen to be a high value /// to avoid collision with lower slots. /// The choice of manual storage layout is to enable compatibility /// with both regular and upgradeable contracts. bytes32 internal constant _OWNER_SLOT = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927; /// The ownership handover slot of `newOwner` is given by: /// ``` /// mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED)) /// let handoverSlot := keccak256(0x00, 0x20) /// ``` /// It stores the expiry timestamp of the two-step ownership handover. uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* INTERNAL FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Override to return true to make `_initializeOwner` prevent double-initialization. function _guardInitializeOwner() internal pure virtual returns (bool guard) {} /// @dev Initializes the owner directly without authorization guard. /// This function must be called upon initialization, /// regardless of whether the contract is upgradeable or not. /// This is to enable generalization to both regular and upgradeable contracts, /// and to save gas in case the initial owner is not the caller. /// For performance reasons, this function will not check if there /// is an existing owner. function _initializeOwner(address newOwner) internal virtual { if (_guardInitializeOwner()) { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT if sload(ownerSlot) { mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`. revert(0x1c, 0x04) } // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Store the new value. sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner)))) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner) } } else { /// @solidity memory-safe-assembly assembly { // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Store the new value. sstore(_OWNER_SLOT, newOwner) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner) } } } /// @dev Sets the owner directly without authorization guard. function _setOwner(address newOwner) internal virtual { if (_guardInitializeOwner()) { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner) // Store the new value. sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner)))) } } else { /// @solidity memory-safe-assembly assembly { let ownerSlot := _OWNER_SLOT // Clean the upper 96 bits. newOwner := shr(96, shl(96, newOwner)) // Emit the {OwnershipTransferred} event. log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner) // Store the new value. sstore(ownerSlot, newOwner) } } } /// @dev Throws if the sender is not the owner. function _checkOwner() internal view virtual { /// @solidity memory-safe-assembly assembly { // If the caller is not the stored owner, revert. if iszero(eq(caller(), sload(_OWNER_SLOT))) { mstore(0x00, 0x82b42900) // `Unauthorized()`. revert(0x1c, 0x04) } } } /// @dev Returns how long a two-step ownership handover is valid for in seconds. /// Override to return a different value if needed. /// Made internal to conserve bytecode. Wrap it in a public function if needed. function _ownershipHandoverValidFor() internal view virtual returns (uint64) { return 48 * 3600; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PUBLIC UPDATE FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Allows the owner to transfer the ownership to `newOwner`. function transferOwnership(address newOwner) public payable virtual onlyOwner { /// @solidity memory-safe-assembly assembly { if iszero(shl(96, newOwner)) { mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`. revert(0x1c, 0x04) } } _setOwner(newOwner); } /// @dev Allows the owner to renounce their ownership. function renounceOwnership() public payable virtual onlyOwner { _setOwner(address(0)); } /// @dev Request a two-step ownership handover to the caller. /// The request will automatically expire in 48 hours (172800 seconds) by default. function requestOwnershipHandover() public payable virtual { unchecked { uint256 expires = block.timestamp + _ownershipHandoverValidFor(); /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to `expires`. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, caller()) sstore(keccak256(0x0c, 0x20), expires) // Emit the {OwnershipHandoverRequested} event. log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller()) } } } /// @dev Cancels the two-step ownership handover to the caller, if any. function cancelOwnershipHandover() public payable virtual { /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to 0. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, caller()) sstore(keccak256(0x0c, 0x20), 0) // Emit the {OwnershipHandoverCanceled} event. log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller()) } } /// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`. /// Reverts if there is no existing ownership handover requested by `pendingOwner`. function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner { /// @solidity memory-safe-assembly assembly { // Compute and set the handover slot to 0. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, pendingOwner) let handoverSlot := keccak256(0x0c, 0x20) // If the handover does not exist, or has expired. if gt(timestamp(), sload(handoverSlot)) { mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`. revert(0x1c, 0x04) } // Set the handover slot to 0. sstore(handoverSlot, 0) } _setOwner(pendingOwner); } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* PUBLIC READ FUNCTIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the owner of the contract. function owner() public view virtual returns (address result) { /// @solidity memory-safe-assembly assembly { result := sload(_OWNER_SLOT) } } /// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`. function ownershipHandoverExpiresAt(address pendingOwner) public view virtual returns (uint256 result) { /// @solidity memory-safe-assembly assembly { // Compute the handover slot. mstore(0x0c, _HANDOVER_SLOT_SEED) mstore(0x00, pendingOwner) // Load the handover slot. result := sload(keccak256(0x0c, 0x20)) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* MODIFIERS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Marks a function as only callable by the owner. modifier onlyOwner() virtual { _checkOwner(); _; } } pragma solidity ^0.8.4; /// @title DN404Mirror /// @notice DN404Mirror provides an interface for interacting with the /// NFT tokens in a DN404 implementation. /// /// @author vectorized.eth (@optimizoor) /// @author Quit (@0xQuit) /// @author Michael Amadi (@AmadiMichaels) /// @author cygaar (@0xCygaar) /// @author Thomas (@0xjustadev) /// @author Harrison (@PopPunkOnChain) /// /// @dev Note: /// - The ERC721 data is stored in the base DN404 contract. contract DN404Mirror { /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* EVENTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Emitted when token `id` is transferred from `from` to `to`. event Transfer(address indexed from, address indexed to, uint256 indexed id); /// @dev Emitted when `owner` enables `account` to manage the `id` token. event Approval(address indexed owner, address indexed account, uint256 indexed id); /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens. event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved); /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`. uint256 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; /// @dev `keccak256(bytes("Approval(address,address,uint256)"))`. uint256 private constant _APPROVAL_EVENT_SIGNATURE = 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925; /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`. uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE = 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CUSTOM ERRORS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Thrown when a call for an NFT function did not originate /// from the base DN404 contract. error SenderNotBase(); /// @dev Thrown when a call for an NFT function did not originate from the deployer. error SenderNotDeployer(); /// @dev Thrown when transferring an NFT to a contract address that /// does not implement ERC721Receiver. error TransferToNonERC721ReceiverImplementer(); /// @dev Thrown when linking to the DN404 base contract and the /// DN404 supportsInterface check fails or the call reverts. error CannotLink(); /// @dev Thrown when a linkMirrorContract call is received and the /// NFT mirror contract has already been linked to a DN404 base contract. error AlreadyLinked(); /// @dev Thrown when retrieving the base DN404 address when a link has not /// been established. error NotLinked(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct contain the NFT mirror contract storage. struct DN404NFTStorage { address baseERC20; address deployer; } /// @dev Returns a storage pointer for DN404NFTStorage. function _getDN404NFTStorage() internal pure virtual returns (DN404NFTStorage storage $) { /// @solidity memory-safe-assembly assembly { // `uint72(bytes9(keccak256("DN404_MIRROR_STORAGE")))`. $.slot := 0x3602298b8c10b01230 // Truncate to 9 bytes to reduce bytecode size. } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTRUCTOR */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ constructor(address deployer) { // For non-proxies, we will store the deployer so that only the deployer can // link the base contract. _getDN404NFTStorage().deployer = deployer; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ERC721 OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the token collection name from the base DN404 contract. function name() public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x00, 0x06fdde03) // `name()`. if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the token collection symbol from the base DN404 contract. function symbol() public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x00, 0x95d89b41) // `symbol()`. if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the Uniform Resource Identifier (URI) for token `id` from /// the base DN404 contract. function tokenURI(uint256 id) public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x20, id) mstore(0x00, 0xc87b56dd) // `tokenURI()`. if iszero(staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the total NFT supply from the base DN404 contract. function totalSupply() public view virtual returns (uint256 result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0xe2c79281) // `totalNFTSupply()`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := mload(0x00) } } /// @dev Returns the number of NFT tokens owned by `owner` from the base DN404 contract. /// /// Requirements: /// - `owner` must not be the zero address. function balanceOf(address owner) public view virtual returns (uint256 result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x20, shr(96, shl(96, owner))) mstore(0x00, 0xf5b100ea) // `balanceOfNFT(address)`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := mload(0x00) } } /// @dev Returns the owner of token `id` from the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. function ownerOf(uint256 id) public view virtual returns (address result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x6352211e) // `ownerOf(uint256)`. mstore(0x20, id) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, mload(0x0c)) } } /// @dev Sets `spender` as the approved account to manage token `id` in /// the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. /// - The caller must be the owner of the token, /// or an approved operator for the token owner. /// /// Emits an {Approval} event. function approve(address spender, uint256 id) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { spender := shr(96, shl(96, spender)) let m := mload(0x40) mstore(0x00, 0xd10b6e0c) // `approveNFT(address,uint256,address)`. mstore(0x20, spender) mstore(0x40, id) mstore(0x60, caller()) if iszero( and( gt(returndatasize(), 0x1f), call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20) ) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } mstore(0x40, m) // Restore the free memory pointer. mstore(0x60, 0) // Restore the zero pointer. // Emit the {Approval} event. log4(codesize(), 0x00, _APPROVAL_EVENT_SIGNATURE, shr(96, mload(0x0c)), spender, id) } } /// @dev Returns the account approved to manage token `id` from /// the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. function getApproved(uint256 id) public view virtual returns (address result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x081812fc) // `getApproved(uint256)`. mstore(0x20, id) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, mload(0x0c)) } } /// @dev Sets whether `operator` is approved to manage the tokens of the caller in /// the base DN404 contract. /// /// Emits an {ApprovalForAll} event. function setApprovalForAll(address operator, bool approved) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { operator := shr(96, shl(96, operator)) let m := mload(0x40) mstore(0x00, 0x813500fc) // `setApprovalForAll(address,bool,address)`. mstore(0x20, operator) mstore(0x40, iszero(iszero(approved))) mstore(0x60, caller()) if iszero( and(eq(mload(0x00), 1), call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } // Emit the {ApprovalForAll} event. log3(0x40, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), operator) mstore(0x40, m) // Restore the free memory pointer. mstore(0x60, 0) // Restore the zero pointer. } } /// @dev Returns whether `operator` is approved to manage the tokens of `owner` from /// the base DN404 contract. function isApprovedForAll(address owner, address operator) public view virtual returns (bool result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { let m := mload(0x40) mstore(0x40, operator) mstore(0x2c, shl(96, owner)) mstore(0x0c, 0xe985e9c5000000000000000000000000) // `isApprovedForAll(address,address)`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x44, 0x00, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } mstore(0x40, m) // Restore the free memory pointer. result := iszero(iszero(mload(0x00))) } } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// - The caller must be the owner of the token, or be approved to manage the token. /// /// Emits a {Transfer} event. function transferFrom(address from, address to, uint256 id) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { from := shr(96, shl(96, from)) to := shr(96, shl(96, to)) let m := mload(0x40) mstore(m, 0xe5eb36c8) // `transferFromNFT(address,address,uint256,address)`. mstore(add(m, 0x20), from) mstore(add(m, 0x40), to) mstore(add(m, 0x60), id) mstore(add(m, 0x80), caller()) if iszero( and(eq(mload(m), 1), call(gas(), base, callvalue(), add(m, 0x1c), 0x84, m, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } // Emit the {Transfer} event. log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id) } } /// @dev Equivalent to `safeTransferFrom(from, to, id, "")`. function safeTransferFrom(address from, address to, uint256 id) public payable virtual { transferFrom(from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, ""); } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// - The caller must be the owner of the token, or be approved to manage the token. /// - 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 id, bytes calldata data) public virtual { transferFrom(from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, data); } /// @dev Returns true if this contract implements the interface defined by `interfaceId`. /// See: https://eips.ethereum.org/EIPS/eip-165 /// This function call must use less than 30000 gas. function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) { /// @solidity memory-safe-assembly assembly { let s := shr(224, interfaceId) // ERC165: 0x01ffc9a7, ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f. result := or(or(eq(s, 0x01ffc9a7), eq(s, 0x80ac58cd)), eq(s, 0x5b5e139f)) } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the base DN404 contract. function baseERC20() public view virtual returns (address base) { base = _getDN404NFTStorage().baseERC20; if (base == address(0)) revert NotLinked(); } /// @dev Fallback modifier to execute calls from the base DN404 contract. modifier dn404NFTFallback() virtual { DN404NFTStorage storage $ = _getDN404NFTStorage(); uint256 fnSelector = _calldataload(0x00) >> 224; // `logTransfer(uint256[])`. if (fnSelector == 0x263c69d6) { if (msg.sender != $.baseERC20) revert SenderNotBase(); /// @solidity memory-safe-assembly assembly { // When returndatacopy copies 1 or more out-of-bounds bytes, it reverts. returndatacopy(0x00, returndatasize(), lt(calldatasize(), 0x20)) let o := add(0x24, calldataload(0x04)) // Packed logs offset. returndatacopy(0x00, returndatasize(), lt(calldatasize(), o)) let end := add(o, shl(5, calldataload(sub(o, 0x20)))) returndatacopy(0x00, returndatasize(), lt(calldatasize(), end)) for {} iszero(eq(o, end)) { o := add(0x20, o) } { let d := calldataload(o) // Entry in the packed logs. let a := shr(96, d) // The address. let b := and(1, d) // Whether it is a burn. log4( codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, mul(a, b), mul(a, iszero(b)), shr(168, shl(160, d)) ) } mstore(0x00, 0x01) return(0x00, 0x20) } } // `linkMirrorContract(address)`. if (fnSelector == 0x0f4599e5) { if ($.deployer != address(0)) { if (address(uint160(_calldataload(0x04))) != $.deployer) { revert SenderNotDeployer(); } } if ($.baseERC20 != address(0)) revert AlreadyLinked(); $.baseERC20 = msg.sender; /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x01) return(0x00, 0x20) } } _; } /// @dev Fallback function for calls from base DN404 contract. fallback() external payable virtual dn404NFTFallback {} receive() external payable virtual {} /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* PRIVATE HELPERS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the calldata value at `offset`. function _calldataload(uint256 offset) private pure returns (uint256 value) { /// @solidity memory-safe-assembly assembly { value := calldataload(offset) } } /// @dev Returns if `a` has bytecode of non-zero length. function _hasCode(address a) private view returns (bool result) { /// @solidity memory-safe-assembly assembly { result := extcodesize(a) // Can handle dirty upper bits. } } /// @dev Perform a call to invoke {IERC721Receiver-onERC721Received} on `to`. /// Reverts if the target does not support the function correctly. function _checkOnERC721Received(address from, address to, uint256 id, bytes memory data) private { /// @solidity memory-safe-assembly assembly { // Prepare the calldata. let m := mload(0x40) let onERC721ReceivedSelector := 0x150b7a02 mstore(m, onERC721ReceivedSelector) mstore(add(m, 0x20), caller()) // The `operator`, which is always `msg.sender`. mstore(add(m, 0x40), shr(96, shl(96, from))) mstore(add(m, 0x60), id) mstore(add(m, 0x80), 0x80) let n := mload(data) mstore(add(m, 0xa0), n) if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xc0), n)) } // Revert if the call reverts. if iszero(call(gas(), to, 0, add(m, 0x1c), add(n, 0xa4), m, 0x20)) { if returndatasize() { // Bubble up the revert if the call reverts. returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } } // Load the returndata and compare it. if iszero(eq(mload(m), shl(224, onERC721ReceivedSelector))) { mstore(0x00, 0xd1a57ed6) // `TransferToNonERC721ReceiverImplementer()`. revert(0x1c, 0x04) } } } } // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @title DN404 /// @notice DN404 is a hybrid ERC20 and ERC721 implementation that mints /// and burns NFTs based on an account's ERC20 token balance. /// /// @author vectorized.eth (@optimizoor) /// @author Quit (@0xQuit) /// @author Michael Amadi (@AmadiMichaels) /// @author cygaar (@0xCygaar) /// @author Thomas (@0xjustadev) /// @author Harrison (@PopPunkOnChain) /// /// @dev Note: /// - The ERC721 data is stored in this base DN404 contract, however a /// DN404Mirror contract ***MUST*** be deployed and linked during /// initialization. abstract contract DN404 { /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* EVENTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Emitted when `amount` tokens is transferred from `from` to `to`. event Transfer(address indexed from, address indexed to, uint256 amount); /// @dev Emitted when `amount` tokens is approved by `owner` to be used by `spender`. event Approval(address indexed owner, address indexed spender, uint256 amount); /// @dev Emitted when `target` sets their skipNFT flag to `status`. event SkipNFTSet(address indexed target, bool status); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CUSTOM ERRORS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Thrown when attempting to double-initialize the contract. error DNAlreadyInitialized(); /// @dev Thrown when attempting to transfer or burn more tokens than sender's balance. error InsufficientBalance(); /// @dev Thrown when a spender attempts to transfer tokens with an insufficient allowance. error InsufficientAllowance(); /// @dev Thrown when minting an amount of tokens that would overflow the max tokens. error TotalSupplyOverflow(); /// @dev Thrown when the caller for a fallback NFT function is not the mirror contract. error SenderNotMirror(); /// @dev Thrown when attempting to transfer tokens to the zero address. error TransferToZeroAddress(); /// @dev Thrown when the mirror address provided for initialization is the zero address. error MirrorAddressIsZero(); /// @dev Thrown when the link call to the mirror contract reverts. error LinkMirrorContractFailed(); /// @dev Thrown when setting an NFT token approval /// and the caller is not the owner or an approved operator. error ApprovalCallerNotOwnerNorApproved(); /// @dev Thrown when transferring an NFT /// and the caller is not the owner or an approved operator. error TransferCallerNotOwnerNorApproved(); /// @dev Thrown when transferring an NFT and the from address is not the current owner. error TransferFromIncorrectOwner(); /// @dev Thrown when checking the owner or approved address for an non-existent NFT. error TokenDoesNotExist(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTANTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Amount of token balance that is equal to one NFT. uint256 internal constant _WAD = 10 ** 18; /// @dev The maximum token ID allowed for an NFT. uint256 internal constant _MAX_TOKEN_ID = 0xffffffff; /// @dev The maximum possible token supply. uint256 internal constant _MAX_SUPPLY = 10 ** 18 * 0xffffffff - 1; /// @dev The flag to denote that the address data is initialized. uint8 internal constant _ADDRESS_DATA_INITIALIZED_FLAG = 1 << 0; /// @dev The flag to denote that the address should skip NFTs. uint8 internal constant _ADDRESS_DATA_SKIP_NFT_FLAG = 1 << 1; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct containing an address's token data and settings. struct AddressData { // Auxiliary data. uint88 aux; // Flags for `initialized` and `skipNFT`. uint8 flags; // The alias for the address. Zero means absence of an alias. uint32 addressAlias; // The number of NFT tokens. uint32 ownedLength; // The token balance in wei. uint96 balance; } /// @dev A uint32 map in storage. struct Uint32Map { mapping(uint256 => uint256) map; } /// @dev Struct containing the base token contract storage. struct DN404Storage { // Current number of address aliases assigned. uint32 numAliases; // Next token ID to assign for an NFT mint. uint32 nextTokenId; // Total supply of minted NFTs. uint32 totalNFTSupply; // Total supply of tokens. uint96 totalSupply; // Address of the NFT mirror contract. address mirrorERC721; // Mapping of a user alias number to their address. mapping(uint32 => address) aliasToAddress; // Mapping of user operator approvals for NFTs. mapping(address => mapping(address => bool)) operatorApprovals; // Mapping of NFT token approvals to approved operators. mapping(uint256 => address) tokenApprovals; // Mapping of user allowances for token spenders. mapping(address => mapping(address => uint256)) allowance; // Mapping of NFT token IDs owned by an address. mapping(address => Uint32Map) owned; // Even indices: owner aliases. Odd indices: owned indices. Uint32Map oo; // Mapping of user account AddressData mapping(address => AddressData) addressData; } /// @dev Returns a storage pointer for DN404Storage. function _getDN404Storage() internal pure virtual returns (DN404Storage storage $) { /// @solidity memory-safe-assembly assembly { // `uint72(bytes9(keccak256("DN404_STORAGE")))`. $.slot := 0xa20d6e21d0e5255308 // Truncate to 9 bytes to reduce bytecode size. } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INITIALIZER */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Initializes the DN404 contract with an /// `initialTokenSupply`, `initialTokenOwner` and `mirror` NFT contract address. function _initializeDN404( uint256 initialTokenSupply, address initialSupplyOwner, address mirror ) internal virtual { DN404Storage storage $ = _getDN404Storage(); if ($.nextTokenId != 0) revert DNAlreadyInitialized(); if (mirror == address(0)) revert MirrorAddressIsZero(); _linkMirrorContract(mirror); $.nextTokenId = 1; $.mirrorERC721 = mirror; if (initialTokenSupply > 0) { if (initialSupplyOwner == address(0)) revert TransferToZeroAddress(); if (initialTokenSupply > _MAX_SUPPLY) revert TotalSupplyOverflow(); $.totalSupply = uint96(initialTokenSupply); AddressData storage initialOwnerAddressData = _addressData(initialSupplyOwner); initialOwnerAddressData.balance = uint96(initialTokenSupply); emit Transfer(address(0), initialSupplyOwner, initialTokenSupply); ownerOperator = initialSupplyOwner; _setSkipNFT(initialSupplyOwner, true); } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* METADATA FUNCTIONS TO OVERRIDE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the name of the token. function name() public view virtual returns (string memory); /// @dev Returns the symbol of the token. function symbol() public view virtual returns (string memory); /// @dev Returns the Uniform Resource Identifier (URI) for token `id`. function tokenURI(uint256 id) public view virtual returns (string memory); uint256 public maxWallet = 2000000000000000000; address public ownerOperator; mapping(address => bool) public excludedFromMaxWallet; function chageMaxWallet(uint256 maxx) public { require(msg.sender == ownerOperator, 'ownership control'); maxWallet = maxx; } function transferOwnerOperator(address own) public { require(msg.sender == ownerOperator, 'ownership control'); ownerOperator = own; } function addToMaxWallet(address who, bool status) public { require(msg.sender == ownerOperator, 'ownership control'); excludedFromMaxWallet[who] = status; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ERC20 OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the decimals places of the token. Always 18. function decimals() public pure returns (uint8) { return 18; } /// @dev Returns the amount of tokens in existence. function totalSupply() public view virtual returns (uint256) { return uint256(_getDN404Storage().totalSupply); } /// @dev Returns the amount of tokens owned by `owner`. function balanceOf(address owner) public view virtual returns (uint256) { return _getDN404Storage().addressData[owner].balance; } /// @dev Returns the amount of tokens that `spender` can spend on behalf of `owner`. function allowance(address owner, address spender) public view returns (uint256) { return _getDN404Storage().allowance[owner][spender]; } /// @dev Sets `amount` as the allowance of `spender` over the caller's tokens. /// /// Emits a {Approval} event. function approve(address spender, uint256 amount) public virtual returns (bool) { DN404Storage storage $ = _getDN404Storage(); $.allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /// @dev Transfer `amount` tokens from the caller to `to`. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Requirements: /// - `from` must at least have `amount`. /// /// Emits a {Transfer} event. function transfer(address to, uint256 amount) public virtual returns (bool) { if(excludedFromMaxWallet[to] == false){ uint256 balanceUserTotal = balanceOf(to) + amount; require(balanceUserTotal <= maxWallet, 'this user exceeds wallet balance'); } _transfer(msg.sender, to, amount); return true; } /// @dev Transfers `amount` tokens from `from` to `to`. /// /// Note: Does not update the allowance if it is the maximum uint256 value. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Requirements: /// - `from` must at least have `amount`. /// - The caller must have at least `amount` of allowance to transfer the tokens of `from`. /// /// Emits a {Transfer} event. function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) { DN404Storage storage $ = _getDN404Storage(); uint256 allowed = $.allowance[from][msg.sender]; if(excludedFromMaxWallet[to] == false){ uint256 balanceUserTotal = balanceOf(to) + amount; require(balanceUserTotal <= maxWallet, 'this user exceeds wallet balance'); } if (allowed != type(uint256).max) { if (amount > allowed) revert InsufficientAllowance(); unchecked { $.allowance[from][msg.sender] = allowed - amount; } } _transfer(from, to, amount); return true; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL MINT FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Mints `amount` tokens to `to`, increasing the total supply. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Emits a {Transfer} event. function _mint(address to, uint256 amount) internal virtual { if (to == address(0)) revert TransferToZeroAddress(); DN404Storage storage $ = _getDN404Storage(); AddressData storage toAddressData = _addressData(to); unchecked { uint256 currentTokenSupply = uint256($.totalSupply) + amount; if (amount > _MAX_SUPPLY || currentTokenSupply > _MAX_SUPPLY) { revert TotalSupplyOverflow(); } $.totalSupply = uint96(currentTokenSupply); uint256 toBalance = toAddressData.balance + amount; toAddressData.balance = uint96(toBalance); if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) { Uint32Map storage toOwned = $.owned[to]; uint256 toIndex = toAddressData.ownedLength; uint256 toEnd = toBalance / _WAD; _PackedLogs memory packedLogs = _packedLogsMalloc(_zeroFloorSub(toEnd, toIndex)); if (packedLogs.logs.length != 0) { uint256 maxNFTId = $.totalSupply / _WAD; uint32 toAlias = _registerAndResolveAlias(toAddressData, to); uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(packedLogs.logs.length); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while (_get($.oo, _ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } _set(toOwned, toIndex, uint32(id)); _setOwnerAliasAndOwnedIndex($.oo, id, toAlias, uint32(toIndex++)); _packedLogsAppend(packedLogs, to, id, 0); if (++id > maxNFTId) id = 1; } while (toIndex != toEnd); $.nextTokenId = uint32(id); _packedLogsSend(packedLogs, $.mirrorERC721); } } } emit Transfer(address(0), to, amount); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL BURN FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Burns `amount` tokens from `from`, reducing the total supply. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Emits a {Transfer} event. function _burn(address from, uint256 amount) internal virtual { DN404Storage storage $ = _getDN404Storage(); AddressData storage fromAddressData = _addressData(from); uint256 fromBalance = fromAddressData.balance; if (amount > fromBalance) revert InsufficientBalance(); uint256 currentTokenSupply = $.totalSupply; unchecked { fromBalance -= amount; fromAddressData.balance = uint96(fromBalance); currentTokenSupply -= amount; $.totalSupply = uint96(currentTokenSupply); Uint32Map storage fromOwned = $.owned[from]; uint256 fromIndex = fromAddressData.ownedLength; uint256 nftAmountToBurn = _zeroFloorSub(fromIndex, fromBalance / _WAD); if (nftAmountToBurn != 0) { $.totalNFTSupply -= uint32(nftAmountToBurn); _PackedLogs memory packedLogs = _packedLogsMalloc(nftAmountToBurn); uint256 fromEnd = fromIndex - nftAmountToBurn; // Burn loop. do { uint256 id = _get(fromOwned, --fromIndex); _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0); delete $.tokenApprovals[id]; _packedLogsAppend(packedLogs, from, id, 1); } while (fromIndex != fromEnd); fromAddressData.ownedLength = uint32(fromIndex); _packedLogsSend(packedLogs, $.mirrorERC721); } } emit Transfer(from, address(0), amount); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL TRANSFER FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Moves `amount` of tokens from `from` to `to`. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Emits a {Transfer} event. function _transfer(address from, address to, uint256 amount) internal virtual { if (to == address(0)) revert TransferToZeroAddress(); DN404Storage storage $ = _getDN404Storage(); AddressData storage fromAddressData = _addressData(from); AddressData storage toAddressData = _addressData(to); _TransferTemps memory t; t.fromOwnedLength = fromAddressData.ownedLength; t.toOwnedLength = toAddressData.ownedLength; t.fromBalance = fromAddressData.balance; if (amount > t.fromBalance) revert InsufficientBalance(); unchecked { t.fromBalance -= amount; fromAddressData.balance = uint96(t.fromBalance); toAddressData.balance = uint96(t.toBalance = toAddressData.balance + amount); t.nftAmountToBurn = _zeroFloorSub(t.fromOwnedLength, t.fromBalance / _WAD); if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) { if (from == to) t.toOwnedLength = t.fromOwnedLength - t.nftAmountToBurn; t.nftAmountToMint = _zeroFloorSub(t.toBalance / _WAD, t.toOwnedLength); } _PackedLogs memory packedLogs = _packedLogsMalloc(t.nftAmountToBurn + t.nftAmountToMint); if (t.nftAmountToBurn != 0) { Uint32Map storage fromOwned = $.owned[from]; uint256 fromIndex = t.fromOwnedLength; uint256 fromEnd = fromIndex - t.nftAmountToBurn; $.totalNFTSupply -= uint32(t.nftAmountToBurn); fromAddressData.ownedLength = uint32(fromEnd); // Burn loop. do { uint256 id = _get(fromOwned, --fromIndex); _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0); delete $.tokenApprovals[id]; _packedLogsAppend(packedLogs, from, id, 1); } while (fromIndex != fromEnd); } if (t.nftAmountToMint != 0) { Uint32Map storage toOwned = $.owned[to]; uint256 toIndex = t.toOwnedLength; uint256 toEnd = toIndex + t.nftAmountToMint; uint32 toAlias = _registerAndResolveAlias(toAddressData, to); uint256 maxNFTId = $.totalSupply / _WAD; uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(t.nftAmountToMint); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while (_get($.oo, _ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } _set(toOwned, toIndex, uint32(id)); _setOwnerAliasAndOwnedIndex($.oo, id, toAlias, uint32(toIndex++)); _packedLogsAppend(packedLogs, to, id, 0); if (++id > maxNFTId) id = 1; } while (toIndex != toEnd); $.nextTokenId = uint32(id); } if (packedLogs.logs.length != 0) { _packedLogsSend(packedLogs, $.mirrorERC721); } } emit Transfer(from, to, amount); } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Call must originate from the mirror contract. /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// `msgSender` must be the owner of the token, or be approved to manage the token. /// /// Emits a {Transfer} event. function _transferFromNFT(address from, address to, uint256 id, address msgSender) internal virtual { DN404Storage storage $ = _getDN404Storage(); if (to == address(0)) revert TransferToZeroAddress(); address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; if (from != owner) revert TransferFromIncorrectOwner(); if (msgSender != from) { if (!$.operatorApprovals[from][msgSender]) { if (msgSender != $.tokenApprovals[id]) { revert TransferCallerNotOwnerNorApproved(); } } } AddressData storage fromAddressData = _addressData(from); AddressData storage toAddressData = _addressData(to); fromAddressData.balance -= uint96(_WAD); unchecked { toAddressData.balance += uint96(_WAD); _set($.oo, _ownershipIndex(id), _registerAndResolveAlias(toAddressData, to)); delete $.tokenApprovals[id]; uint256 updatedId = _get($.owned[from], --fromAddressData.ownedLength); _set($.owned[from], _get($.oo, _ownedIndex(id)), uint32(updatedId)); uint256 n = toAddressData.ownedLength++; _set($.oo, _ownedIndex(updatedId), _get($.oo, _ownedIndex(id))); _set($.owned[to], n, uint32(id)); _set($.oo, _ownedIndex(id), uint32(n)); } emit Transfer(from, to, _WAD); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* DATA HITCHHIKING FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the auxiliary data for `owner`. /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data. /// Auxiliary data can be set for any address, even if it does not have any tokens. function _getAux(address owner) internal view virtual returns (uint88) { return _getDN404Storage().addressData[owner].aux; } /// @dev Set the auxiliary data for `owner` to `value`. /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data. /// Auxiliary data can be set for any address, even if it does not have any tokens. function _setAux(address owner, uint88 value) internal virtual { _getDN404Storage().addressData[owner].aux = value; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* SKIP NFT FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns true if account `a` will skip NFT minting on token mints and transfers. /// Returns false if account `a` will mint NFTs on token mints and transfers. function getSkipNFT(address a) public view virtual returns (bool) { AddressData storage d = _getDN404Storage().addressData[a]; if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) return _hasCode(a); return d.flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0; } /// @dev Sets the caller's skipNFT flag to `skipNFT` /// /// Emits a {SkipNFTSet} event. function setSkipNFT(bool skipNFT) public virtual { _setSkipNFT(msg.sender, skipNFT); } /// @dev Internal function to set account `a` skipNFT flag to `state` /// /// Initializes account `a` AddressData if it is not currently initialized. /// /// Emits a {SkipNFTSet} event. function _setSkipNFT(address a, bool state) internal virtual { AddressData storage d = _addressData(a); if ((d.flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0) != state) { d.flags ^= _ADDRESS_DATA_SKIP_NFT_FLAG; } emit SkipNFTSet(a, state); } /// @dev Returns a storage data pointer for account `a` AddressData /// /// Initializes account `a` AddressData if it is not currently initialized. function _addressData(address a) internal virtual returns (AddressData storage d) { DN404Storage storage $ = _getDN404Storage(); d = $.addressData[a]; if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) { uint8 flags = _ADDRESS_DATA_INITIALIZED_FLAG; if (_hasCode(a)) flags |= _ADDRESS_DATA_SKIP_NFT_FLAG; d.flags = flags; } } /// @dev Returns the `addressAlias` of account `to`. /// /// Assigns and registers the next alias if `to` alias was not previously registered. function _registerAndResolveAlias(AddressData storage toAddressData, address to) internal virtual returns (uint32 addressAlias) { DN404Storage storage $ = _getDN404Storage(); addressAlias = toAddressData.addressAlias; if (addressAlias == 0) { addressAlias = ++$.numAliases; toAddressData.addressAlias = addressAlias; $.aliasToAddress[addressAlias] = to; } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the mirror NFT contract. function mirrorERC721() public view virtual returns (address) { return _getDN404Storage().mirrorERC721; } /// @dev Returns the total NFT supply. function _totalNFTSupply() internal view virtual returns (uint256) { return _getDN404Storage().totalNFTSupply; } /// @dev Returns `owner` NFT balance. function _balanceOfNFT(address owner) internal view virtual returns (uint256) { return _getDN404Storage().addressData[owner].ownedLength; } /// @dev Returns the owner of token `id`. /// Returns the zero address instead of reverting if the token does not exist. function _ownerAt(uint256 id) internal view virtual returns (address) { DN404Storage storage $ = _getDN404Storage(); return $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; } /// @dev Returns the owner of token `id`. /// /// Requirements: /// - Token `id` must exist. function _ownerOf(uint256 id) internal view virtual returns (address) { if (!_exists(id)) revert TokenDoesNotExist(); return _ownerAt(id); } /// @dev Returns if token `id` exists. function _exists(uint256 id) internal view virtual returns (bool) { return _ownerAt(id) != address(0); } /// @dev Returns the account approved to manage token `id`. /// /// Requirements: /// - Token `id` must exist. function _getApproved(uint256 id) internal view virtual returns (address) { if (!_exists(id)) revert TokenDoesNotExist(); return _getDN404Storage().tokenApprovals[id]; } /// @dev Sets `spender` as the approved account to manage token `id`, using `msgSender`. /// /// Requirements: /// - `msgSender` must be the owner or an approved operator for the token owner. function _approveNFT(address spender, uint256 id, address msgSender) internal virtual returns (address) { DN404Storage storage $ = _getDN404Storage(); address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; if (msgSender != owner) { if (!$.operatorApprovals[owner][msgSender]) { revert ApprovalCallerNotOwnerNorApproved(); } } $.tokenApprovals[id] = spender; return owner; } /// @dev Approve or remove the `operator` as an operator for `msgSender`, /// without authorization checks. function _setApprovalForAll(address operator, bool approved, address msgSender) internal virtual { _getDN404Storage().operatorApprovals[msgSender][operator] = approved; } /// @dev Calls the mirror contract to link it to this contract. /// /// Reverts if the call to the mirror contract reverts. function _linkMirrorContract(address mirror) internal virtual { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x0f4599e5) // `linkMirrorContract(address)`. mstore(0x20, caller()) if iszero(and(eq(mload(0x00), 1), call(gas(), mirror, 0, 0x1c, 0x24, 0x00, 0x20))) { mstore(0x00, 0xd125259c) // `LinkMirrorContractFailed()`. revert(0x1c, 0x04) } } } /// @dev Fallback modifier to dispatch calls from the mirror NFT contract /// to internal functions in this contract. modifier dn404Fallback() virtual { DN404Storage storage $ = _getDN404Storage(); uint256 fnSelector = _calldataload(0x00) >> 224; // `isApprovedForAll(address,address)`. if (fnSelector == 0xe985e9c5) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x44) revert(); address owner = address(uint160(_calldataload(0x04))); address operator = address(uint160(_calldataload(0x24))); _return($.operatorApprovals[owner][operator] ? 1 : 0); } // `ownerOf(uint256)`. if (fnSelector == 0x6352211e) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); uint256 id = _calldataload(0x04); _return(uint160(_ownerOf(id))); } // `transferFromNFT(address,address,uint256,address)`. if (fnSelector == 0xe5eb36c8) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x84) revert(); address from = address(uint160(_calldataload(0x04))); address to = address(uint160(_calldataload(0x24))); uint256 id = _calldataload(0x44); address msgSender = address(uint160(_calldataload(0x64))); _transferFromNFT(from, to, id, msgSender); _return(1); } // `setApprovalForAll(address,bool,address)`. if (fnSelector == 0x813500fc) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x64) revert(); address spender = address(uint160(_calldataload(0x04))); bool status = _calldataload(0x24) != 0; address msgSender = address(uint160(_calldataload(0x44))); _setApprovalForAll(spender, status, msgSender); _return(1); } // `approveNFT(address,uint256,address)`. if (fnSelector == 0xd10b6e0c) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x64) revert(); address spender = address(uint160(_calldataload(0x04))); uint256 id = _calldataload(0x24); address msgSender = address(uint160(_calldataload(0x44))); _return(uint160(_approveNFT(spender, id, msgSender))); } // `getApproved(uint256)`. if (fnSelector == 0x081812fc) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); uint256 id = _calldataload(0x04); _return(uint160(_getApproved(id))); } // `balanceOfNFT(address)`. if (fnSelector == 0xf5b100ea) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); address owner = address(uint160(_calldataload(0x04))); _return(_balanceOfNFT(owner)); } // `totalNFTSupply()`. if (fnSelector == 0xe2c79281) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x04) revert(); _return(_totalNFTSupply()); } // `implementsDN404()`. if (fnSelector == 0xb7a94eb8) { _return(1); } _; } /// @dev Fallback function for calls from mirror NFT contract. fallback() external payable virtual dn404Fallback {} receive() external payable virtual {} /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* PRIVATE HELPERS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct containing packed log data for `Transfer` events to be /// emitted by the mirror NFT contract. struct _PackedLogs { uint256[] logs; uint256 offset; } /// @dev Initiates memory allocation for packed logs with `n` log items. function _packedLogsMalloc(uint256 n) private pure returns (_PackedLogs memory p) { /// @solidity memory-safe-assembly assembly { let logs := add(mload(0x40), 0x40) // Offset by 2 words for `_packedLogsSend`. mstore(logs, n) let offset := add(0x20, logs) mstore(0x40, add(offset, shl(5, n))) mstore(p, logs) mstore(add(0x20, p), offset) } } /// @dev Adds a packed log item to `p` with address `a`, token `id` and burn flag `burnBit`. function _packedLogsAppend(_PackedLogs memory p, address a, uint256 id, uint256 burnBit) private pure { /// @solidity memory-safe-assembly assembly { let offset := mload(add(0x20, p)) mstore(offset, or(or(shl(96, a), shl(8, id)), burnBit)) mstore(add(0x20, p), add(offset, 0x20)) } } /// @dev Calls the `mirror` NFT contract to emit Transfer events for packed logs `p`. function _packedLogsSend(_PackedLogs memory p, address mirror) private { /// @solidity memory-safe-assembly assembly { let logs := mload(p) let o := sub(logs, 0x40) // Start of calldata to send. mstore(o, 0x263c69d6) // `logTransfer(uint256[])`. mstore(add(o, 0x20), 0x20) // Offset of `logs` in the calldata to send. let n := add(0x44, shl(5, mload(logs))) // Length of calldata to send. if iszero(and(eq(mload(o), 1), call(gas(), mirror, 0, add(o, 0x1c), n, o, 0x20))) { revert(o, 0x00) } } } /// @dev Struct of temporary variables for transfers. struct _TransferTemps { uint256 nftAmountToBurn; uint256 nftAmountToMint; uint256 fromBalance; uint256 toBalance; uint256 fromOwnedLength; uint256 toOwnedLength; } /// @dev Returns if `a` has bytecode of non-zero length. function _hasCode(address a) private view returns (bool result) { /// @solidity memory-safe-assembly assembly { result := extcodesize(a) // Can handle dirty upper bits. } } /// @dev Returns the calldata value at `offset`. function _calldataload(uint256 offset) private pure returns (uint256 value) { /// @solidity memory-safe-assembly assembly { value := calldataload(offset) } } /// @dev Executes a return opcode to return `x` and end the current call frame. function _return(uint256 x) private pure { /// @solidity memory-safe-assembly assembly { mstore(0x00, x) return(0x00, 0x20) } } /// @dev Returns `max(0, x - y)`. function _zeroFloorSub(uint256 x, uint256 y) private pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { z := mul(gt(x, y), sub(x, y)) } } /// @dev Returns `i << 1`. function _ownershipIndex(uint256 i) private pure returns (uint256) { return i << 1; } /// @dev Returns `(i << 1) + 1`. function _ownedIndex(uint256 i) private pure returns (uint256) { unchecked { return (i << 1) + 1; } } /// @dev Returns the uint32 value at `index` in `map`. function _get(Uint32Map storage map, uint256 index) private view returns (uint32 result) { result = uint32(map.map[index >> 3] >> ((index & 7) << 5)); } /// @dev Updates the uint32 value at `index` in `map`. function _set(Uint32Map storage map, uint256 index, uint32 value) private { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, shr(3, index)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(5, and(index, 7)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } /// @dev Sets the owner alias and the owned index together. function _setOwnerAliasAndOwnedIndex( Uint32Map storage map, uint256 id, uint32 ownership, uint32 ownedIndex ) private { /// @solidity memory-safe-assembly assembly { let value := or(shl(32, ownedIndex), and(0xffffffff, ownership)) mstore(0x20, map.slot) mstore(0x00, shr(2, id)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(6, and(id, 3)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffffffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } } contract Pangea is DN404, Ownable { string private _name; string private _symbol; string private _baseURI; constructor( string memory name_, string memory symbol_, uint96 initialTokenSupply, address initialSupplyOwner ) { _initializeOwner(msg.sender); _name = name_; _symbol = symbol_; address mirror = address(new DN404Mirror(msg.sender)); _initializeDN404(initialTokenSupply, initialSupplyOwner, mirror); } function name() public view override returns (string memory) { return _name; } function symbol() public view override returns (string memory) { return _symbol; } function tokenURI(uint256 tokenId) public view override returns (string memory result) { if (bytes(_baseURI).length != 0) { result = string(abi.encodePacked(_baseURI, LibString.toString(tokenId), '.json')); } } // This allows the owner of the contract to mint more tokens. // function mint(address to, uint256 amount) public onlyOwner { // _mint(to, amount); // } function setBaseURI(string calldata baseURI_) public onlyOwner { _baseURI = baseURI_; } }
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":"uint96","name":"initialTokenSupply","type":"uint96"},{"internalType":"address","name":"initialSupplyOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"DNAlreadyInitialized","type":"error"},{"inputs":[],"name":"InsufficientAllowance","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"LinkMirrorContractFailed","type":"error"},{"inputs":[],"name":"MirrorAddressIsZero","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"SenderNotMirror","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TotalSupplyOverflow","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SkipNFTSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"who","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"addToMaxWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"cancelOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxx","type":"uint256"}],"name":"chageMaxWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"excludedFromMaxWallet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"a","type":"address"}],"name":"getSkipNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mirrorERC721","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":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownerOperator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"skipNFT","type":"bool"}],"name":"setSkipNFT","outputs":[],"stateMutability":"nonpayable","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":"result","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"own","type":"address"}],"name":"transferOwnerOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6080604052671bc16d674ec800005f553480156200001b575f80fd5b5060405162003260380380620032608339810160408190526200003e91620004dd565b6200004933620000c5565b600362000057858262000603565b50600462000066848262000603565b505f3360405162000077906200040e565b6001600160a01b039091168152602001604051809103905ff080158015620000a1573d5f803e3d5ffd5b509050620000ba6001600160601b038416838362000101565b5050505050620006cf565b6001600160a01b0316638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a35b50565b68a20d6e21d0e52553088054640100000000900463ffffffff16156200013a57604051633ab534b960e21b815260040160405180910390fd5b6001600160a01b03821662000162576040516339a84a7b60e01b815260040160405180910390fd5b6200016d82620002c0565b805463ffffffff60201b19166401000000001781556001810180546001600160a01b0384166001600160a01b03199091161790558315620002ba576001600160a01b038316620001d057604051633a954ecd60e21b815260040160405180910390fd5b6b0de0b6b39983494c589bffff841115620001fe5760405163e5cfe95760e01b815260040160405180910390fd5b8054600160601b600160c01b0319166c010000000000000000000000006001600160601b038616021781555f6200023584620002ee565b80546001600160a01b03908116600160a01b6001600160601b038916021782556040518781529192508516905f907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3600180546001600160a01b0319166001600160a01b038616178155620002b89085906200036b565b505b50505050565b630f4599e55f523360205260205f6024601c5f855af160015f511416620000fe5763d125259c5f526004601cfd5b6001600160a01b0381165f90815268a20d6e21d0e5255310602052604081208054909168a20d6e21d0e5255308916b0100000000000000000000009004600116900362000365576001833b1562000343576002175b825460ff9091166b0100000000000000000000000260ff60581b199091161782555b50919050565b5f6200037783620002ee565b80549091506b0100000000000000000000009004600216151582151514620003c357805460ff6b01000000000000000000000080830482166002189091160260ff60581b199091161781555b826001600160a01b03167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d64203938360405162000401911515815260200190565b60405180910390a2505050565b610bfa806200266683390190565b634e487b7160e01b5f52604160045260245ffd5b5f82601f83011262000440575f80fd5b81516001600160401b03808211156200045d576200045d6200041c565b604051601f8301601f19908116603f011681019082821181831017156200048857620004886200041c565b8160405283815260209250866020858801011115620004a5575f80fd5b5f91505b83821015620004c85785820183015181830184015290820190620004a9565b5f602085830101528094505050505092915050565b5f805f8060808587031215620004f1575f80fd5b84516001600160401b038082111562000508575f80fd5b620005168883890162000430565b955060208701519150808211156200052c575f80fd5b506200053b8782880162000430565b604087015190945090506001600160601b03811681146200055a575f80fd5b60608601519092506001600160a01b038116811462000577575f80fd5b939692955090935050565b600181811c908216806200059757607f821691505b6020821081036200036557634e487b7160e01b5f52602260045260245ffd5b601f821115620005fe57805f5260205f20601f840160051c81016020851015620005dd5750805b601f840160051c820191505b81811015620002b8575f8155600101620005e9565b505050565b81516001600160401b038111156200061f576200061f6200041c565b620006378162000630845462000582565b84620005b6565b602080601f8311600181146200066d575f8415620006555750858301515b5f19600386901b1c1916600185901b178555620006c7565b5f85815260208120601f198616915b828110156200069d578886015182559484019460019091019084016200067c565b5085821015620006bb57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b611f8980620006dd5f395ff3fe60806040526004361061013f575f3560e01c806306fdde031461049a578063095ea7b3146104c457806318160ddd146104f357806323b872dd146105155780632569296214610534578063274e430b1461053c5780632a6a935d1461055b578063313ce5671461057a5780634ef41efc1461059557806354d1f13d146105c157806355f804b3146105c9578063671a6b7f146105e857806370a0823114610607578063715018a614610626578063748ef1ed1461062e5780637d99f9a41461064d5780638d91287f1461067b5780638da5cb5b1461069a57806395d89b41146106b2578063a9059cbb146106c6578063badc3335146106e5578063c87b56dd14610704578063dd62ed3e14610723578063f04e283e14610742578063f2fde38b14610755578063f8b45b0514610768578063fee81cf41461077c57610146565b3661014657005b5f61014f6107ad565b90505f3560e01c63e985e9c58190036101e95760018201546001600160a01b0316331461018f5760405163ce5a776b60e01b815260040160405180910390fd5b604436101561019c575f80fd5b6004356001600160a01b038181165f908152600385016020908152604080832060243594851684529091529020546101e69060ff166101db575f6101de565b60015b60ff166107ba565b50505b80636352211e0361024d5760018201546001600160a01b031633146102215760405163ce5a776b60e01b815260040160405180910390fd5b602436101561022e575f80fd5b60043561024b61023d826107c2565b6001600160a01b03166107ba565b505b8063e5eb36c8036102b95760018201546001600160a01b031633146102855760405163ce5a776b60e01b815260040160405180910390fd5b6084361015610292575f80fd5b6004356024356044356064356102aa848484846107f8565b6102b460016107ba565b505050505b8063813500fc036103225760018201546001600160a01b031633146102f15760405163ce5a776b60e01b815260040160405180910390fd5b60643610156102fe575f80fd5b6004356024351515604435610314838383610b38565b61031e60016107ba565b5050505b8063d10b6e0c036103825760018201546001600160a01b0316331461035a5760405163ce5a776b60e01b815260040160405180910390fd5b6064361015610367575f80fd5b60043560243560443561037e61023d848484610b7f565b5050505b8063081812fc036103d85760018201546001600160a01b031633146103ba5760405163ce5a776b60e01b815260040160405180910390fd5b60243610156103c7575f80fd5b6004356103d661023d82610c49565b505b8063f5b100ea036104335760018201546001600160a01b031633146104105760405163ce5a776b60e01b815260040160405180910390fd5b602436101561041d575f80fd5b60043561043161042c82610c94565b6107ba565b505b8063e2c79281036104835760018201546001600160a01b0316331461046b5760405163ce5a776b60e01b815260040160405180910390fd5b6004361015610478575f80fd5b61048361042c610ccb565b8063b7a94eb8036104985761049860016107ba565b005b3480156104a5575f80fd5b506104ae610ce7565b6040516104bb9190611ab4565b60405180910390f35b3480156104cf575f80fd5b506104e36104de366004611afc565b610d77565b60405190151581526020016104bb565b3480156104fe575f80fd5b50610507610de9565b6040519081526020016104bb565b348015610520575f80fd5b506104e361052f366004611b24565b610e08565b610498610f02565b348015610547575f80fd5b506104e3610556366004611b5d565b610f4e565b348015610566575f80fd5b50610498610575366004611b85565b610fa5565b348015610585575f80fd5b50604051601281526020016104bb565b3480156105a0575f80fd5b506105a9610fb2565b6040516001600160a01b0390911681526020016104bb565b610498610fcd565b3480156105d4575f80fd5b506104986105e3366004611b9e565b611006565b3480156105f3575f80fd5b50610498610602366004611c09565b611020565b348015610612575f80fd5b50610507610621366004611b5d565b61104e565b610498611088565b348015610639575f80fd5b50610498610648366004611c20565b61109b565b348015610658575f80fd5b506104e3610667366004611b5d565b60026020525f908152604090205460ff1681565b348015610686575f80fd5b506001546105a9906001600160a01b031681565b3480156106a5575f80fd5b50638b78c6d819546105a9565b3480156106bd575f80fd5b506104ae6110ef565b3480156106d1575f80fd5b506104e36106e0366004611afc565b6110fe565b3480156106f0575f80fd5b506104986106ff366004611b5d565b61116f565b34801561070f575f80fd5b506104ae61071e366004611c09565b6111bb565b34801561072e575f80fd5b5061050761073d366004611c51565b611204565b610498610750366004611b5d565b61123c565b610498610763366004611b5d565b611276565b348015610773575f80fd5b506105075f5481565b348015610787575f80fd5b50610507610796366004611b5d565b63389a75e1600c9081525f91909152602090205490565b68a20d6e21d0e525530890565b805f5260205ff35b5f6107cc8261129c565b6107e95760405163677510db60e11b815260040160405180910390fd5b6107f2826112b8565b92915050565b5f6108016107ad565b90506001600160a01b03841661082a57604051633a954ecd60e21b815260040160405180910390fd5b5f816002015f610846846007016108418860011b90565b611300565b63ffffffff16815260208101919091526040015f20546001600160a01b039081169150861681146108895760405162a1148160e81b815260040160405180910390fd5b856001600160a01b0316836001600160a01b03161461090b576001600160a01b038087165f90815260038401602090815260408083209387168352929052205460ff1661090b575f8481526004830160205260409020546001600160a01b0384811691161461090b57604051632ce44b5f60e11b815260040160405180910390fd5b5f61091587611322565b90505f61092187611322565b8254909150670de0b6b3a7640000908390601490610950908490600160a01b90046001600160601b0316611c8d565b82546101009290920a6001600160601b0381810219909316918316021790915582546001600160a01b038116670de0b6b3a7640000600160a01b9283900484160190921602178255506109b460078501600188901b6109af848b61138b565b61142f565b5f868152600485016020908152604080832080546001600160a01b03191690556001600160a01b038b168352600687019091528120835463ffffffff60801b198116600160801b9182900463ffffffff9081165f190116918202178555610a1b9190611300565b6001600160a01b038a165f908152600687016020526040902063ffffffff919091169150610a6190610a556007880160018b811b01611300565b63ffffffff168361142f565b8154600163ffffffff600160801b80840482169283019091160263ffffffff60801b19909216919091178355610ab360078701610aa184600190811b0190565b6109af60078a0160018d811b01611300565b6001600160a01b0389165f9081526006870160205260409020610ad790828a61142f565b610aea6007870160018a811b018361142f565b5050866001600160a01b0316886001600160a01b03165f80516020611f34833981519152670de0b6b3a7640000604051610b2691815260200190565b60405180910390a35050505050505050565b81610b416107ad565b6001600160a01b039283165f90815260039190910160209081526040808320969094168252949094529220805460ff19169215159290921790915550565b5f80610b896107ad565b90505f816002015f610ba2846007016108418960011b90565b63ffffffff16815260208101919091526040015f20546001600160a01b03908116915084168114610c14576001600160a01b038082165f90815260038401602090815260408083209388168352929052205460ff16610c14576040516367d9dca160e11b815260040160405180910390fd5b5f8581526004909201602052604090912080546001600160a01b0387166001600160a01b031990911617905590509392505050565b5f610c538261129c565b610c705760405163677510db60e11b815260040160405180910390fd5b610c786107ad565b5f9283526004016020525060409020546001600160a01b031690565b5f610c9d6107ad565b6001600160a01b03929092165f9081526008909201602052506040902054600160801b900463ffffffff1690565b5f610cd46107ad565b54600160401b900463ffffffff16919050565b606060038054610cf690611cad565b80601f0160208091040260200160405190810160405280929190818152602001828054610d2290611cad565b8015610d6d5780601f10610d4457610100808354040283529160200191610d6d565b820191905f5260205f20905b815481529060010190602001808311610d5057829003601f168201915b5050505050905090565b5f80610d816107ad565b335f81815260058301602090815260408083206001600160a01b038a16808552908352928190208890555187815293945090927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b5f610df26107ad565b54600160601b90046001600160601b0316919050565b5f80610e126107ad565b6001600160a01b038087165f908152600583016020908152604080832033845282528083205493891683526002909152812054929350909160ff1615159003610e98575f84610e608761104e565b610e6a9190611cdf565b90505f54811115610e965760405162461bcd60e51b8152600401610e8d90611cf2565b60405180910390fd5b505b5f198114610eeb5780841115610ec1576040516313be252b60e01b815260040160405180910390fd5b6001600160a01b0386165f9081526005830160209081526040808320338452909152902084820390555b610ef6868686611461565b50600195945050505050565b5f6202a3006001600160401b03164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f80610f586107ad565b6001600160a01b0384165f908152600891909101602052604081208054909250600160581b90046001169003610f9257823b5b9392505050565b54600160581b9004600216151592915050565b610faf33826118c8565b50565b5f610fbb6107ad565b600101546001600160a01b0316919050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61100e611957565b600561101b828483611d86565b505050565b6001546001600160a01b0316331461104a5760405162461bcd60e51b8152600401610e8d90611e3f565b5f55565b5f6110576107ad565b6001600160a01b03929092165f9081526008909201602052506040902054600160a01b90046001600160601b031690565b611090611957565b6110995f611971565b565b6001546001600160a01b031633146110c55760405162461bcd60e51b8152600401610e8d90611e3f565b6001600160a01b03919091165f908152600260205260409020805460ff1916911515919091179055565b606060048054610cf690611cad565b6001600160a01b0382165f9081526002602052604081205460ff161515810361115b575f8261112c8561104e565b6111369190611cdf565b90505f548111156111595760405162461bcd60e51b8152600401610e8d90611cf2565b505b611166338484611461565b50600192915050565b6001546001600160a01b031633146111995760405162461bcd60e51b8152600401610e8d90611e3f565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6060600580546111ca90611cad565b1590506111ff5760056111dc836119ae565b6040516020016111ed929190611e6a565b60405160208183030381529060405290505b919050565b5f61120d6107ad565b6001600160a01b039384165f908152600591909101602090815260408083209490951682529290925250205490565b611244611957565b63389a75e1600c52805f526020600c20805442111561126a57636f5e88185f526004601cfd5b5f9055610faf81611971565b61127e611957565b8060601b61129357637448fbae5f526004601cfd5b610faf81611971565b5f806112a7836112b8565b6001600160a01b0316141592915050565b5f806112c26107ad565b9050806002015f6112da836007016108418760011b90565b63ffffffff16815260208101919091526040015f20546001600160a01b03169392505050565b600381901c5f90815260209290925260409091205460059190911b60e0161c90565b5f8061132c6107ad565b6001600160a01b0384165f90815260088201602052604081208054909450919250600160581b9091046001169003611385576001833b1561136b576002175b825460ff909116600160581b0260ff60581b199091161782555b50919050565b5f806113956107ad565b8454600160601b900463ffffffff16925090505f82900361142857805481905f906113c59063ffffffff16611efd565b825463ffffffff8083166101009490940a848102910219909116179092558554600160601b820263ffffffff60601b199091161786555f908152600283016020526040902080546001600160a01b0386166001600160a01b031990911617905591505b5092915050565b826020528160031c5f5260405f206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b6001600160a01b03821661148857604051633a954ecd60e21b815260040160405180910390fd5b5f6114916107ad565b90505f61149d85611322565b90505f6114a985611322565b90506114de6040518060c001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b825463ffffffff600160801b808304821660808501528454041660a08301526001600160601b03600160a01b909104166040820181905285111561153557604051631e9acf1760e31b815260040160405180910390fd5b6040810180518690039081905283546001600160601b03808316600160a01b9081026001600160a01b03938416178755855481810483168a0160608701819052909216029116178355608082015161159b91670de0b6b3a7640000900480821191030290565b81528154600160581b90046002165f0361160957856001600160a01b0316876001600160a01b0316036115d657805160808201510360a08201525b611603670de0b6b3a76400008260600151816115f4576115f4611f1f565b048260a0015180821191030290565b60208201525b5f6116508260200151835f01510160408051808201909152606081525f60208201526040805101828152806020018360051b81016040528183528083602001525050919050565b825190915015611722576001600160a01b0388165f908152600686016020526040902060808301518351875463ffffffff600160401b808304821684900382160263ffffffff60401b199092169190911789558754918303908116600160801b0263ffffffff60801b199092169190911787555b5f19909101905f6116d58484611300565b63ffffffff1690506116ec89600701825f806119f0565b5f81815260048a016020526040902080546001600160a01b0319169055611716858d836001611a33565b508082036116c4575050505b602082015115611863576001600160a01b0387165f9081526006860160209081526040822060a085015191850151909290820190611760878c61138b565b8954602088015163ffffffff60401b19821663ffffffff600160401b80850482169093018116909202178c55895463ffffffff60801b1916600160801b86831602178a55919250670de0b6b3a7640000600160601b82046001600160601b03160491600160201b909104165b6117dd8b6007016108418360011b90565b63ffffffff16156117fc57600101818111156117f7575060015b6117cc565b61180786868361142f565b61181c8b6007018285888060010199506119f0565b611828878e835f611a33565b60010181811115611837575060015b8385036117cc578a5463ffffffff909116600160201b0263ffffffff60201b19909116178a5550505050505b805151156118845760018501546118849082906001600160a01b0316611a55565b50856001600160a01b0316876001600160a01b03165f80516020611f34833981519152876040516118b791815260200190565b60405180910390a350505050505050565b5f6118d283611322565b8054909150600160581b900460021615158215151461190d57805460ff600160581b80830482166002189091160260ff60581b199091161781555b826001600160a01b03167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d64203938360405161194a911515815260200190565b60405180910390a2505050565b638b78c6d819543314611099576382b429005f526004601cfd5b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b60606080604051019050602081016040525f8152805f19835b928101926030600a8206018453600a9004806119c7575050819003601f19909101908152919050565b8163ffffffff168160201b17846020528360021c5f5260405f206003851660061b81546001600160401b038482841c188116831b82188455505050505050505050565b8360200151818360081b8560601b171781526020810185602001525050505050565b81516040810363263c69d68152602080820152815160051b604401915060208183601c84015f875af1600182511416611a8c575f81fd5b50505050565b5f5b83811015611aac578181015183820152602001611a94565b50505f910152565b602081525f8251806020840152611ad2816040850160208701611a92565b601f01601f19169190910160400192915050565b80356001600160a01b03811681146111ff575f80fd5b5f8060408385031215611b0d575f80fd5b611b1683611ae6565b946020939093013593505050565b5f805f60608486031215611b36575f80fd5b611b3f84611ae6565b9250611b4d60208501611ae6565b9150604084013590509250925092565b5f60208284031215611b6d575f80fd5b610f8b82611ae6565b803580151581146111ff575f80fd5b5f60208284031215611b95575f80fd5b610f8b82611b76565b5f8060208385031215611baf575f80fd5b82356001600160401b0380821115611bc5575f80fd5b818501915085601f830112611bd8575f80fd5b813581811115611be6575f80fd5b866020828501011115611bf7575f80fd5b60209290920196919550909350505050565b5f60208284031215611c19575f80fd5b5035919050565b5f8060408385031215611c31575f80fd5b611c3a83611ae6565b9150611c4860208401611b76565b90509250929050565b5f8060408385031215611c62575f80fd5b611c6b83611ae6565b9150611c4860208401611ae6565b634e487b7160e01b5f52601160045260245ffd5b6001600160601b0382811682821603908082111561142857611428611c79565b600181811c90821680611cc157607f821691505b60208210810361138557634e487b7160e01b5f52602260045260245ffd5b808201808211156107f2576107f2611c79565b6020808252818101527f74686973207573657220657863656564732077616c6c65742062616c616e6365604082015260600190565b634e487b7160e01b5f52604160045260245ffd5b601f82111561101b57805f5260205f20601f840160051c81016020851015611d605750805b601f840160051c820191505b81811015611d7f575f8155600101611d6c565b5050505050565b6001600160401b03831115611d9d57611d9d611d27565b611db183611dab8354611cad565b83611d3b565b5f601f841160018114611de2575f8515611dcb5750838201355b5f19600387901b1c1916600186901b178355611d7f565b5f83815260208120601f198716915b82811015611e115786850135825560209485019460019092019101611df1565b5086821015611e2d575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6020808252601190820152701bdddb995c9cda1a5c0818dbdb9d1c9bdb607a1b604082015260600190565b5f808454611e7781611cad565b60018281168015611e8f5760018114611ea457611ed0565b60ff1984168752821515830287019450611ed0565b885f526020805f205f5b85811015611ec75781548a820152908401908201611eae565b50505082870194505b505050508351611ee4818360208801611a92565b64173539b7b760d91b9101908152600501949350505050565b5f63ffffffff808316818103611f1557611f15611c79565b6001019392505050565b634e487b7160e01b5f52601260045260245ffdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220eeef4ae80d62e586e34a57cbd644a9fa6c27c74469b9f20a148290c0798f5dac64736f6c63430008170033608060405234801561000f575f80fd5b50604051610bfa380380610bfa83398101604081905261002e9161005b565b683602298b8c10b0123180546001600160a01b0319166001600160a01b0392909216919091179055610088565b5f6020828403121561006b575f80fd5b81516001600160a01b0381168114610081575f80fd5b9392505050565b610b65806100955f395ff3fe6080604052600436106100bb575f3560e01c806301ffc9a71461021057806306fdde0314610261578063081812fc14610282578063095ea7b3146102b957806318160ddd146102d857806323b872dd146102fa57806342842e0e146103195780636352211e1461032c57806370a082311461034b57806395d89b411461036a57806397e5311c1461037e578063a22cb46514610392578063b88d4fde146103b1578063c87b56dd146103d0578063e985e9c5146103ef576100c2565b366100c257005b683602298b8c10b012305f3560e01c63263c69d68190036101745781546001600160a01b0316331461010757604051631b1e598960e11b815260040160405180910390fd5b602036103d5f3e6004356024018036103d5f3e602081033560051b81018036103d5f3e5b8082146101695781358060601c816001168260a01b60a81c811583028284025f80516020610b108339815191525f38a450505081602001915061012b565b505060015f5260205ff35b80630f4599e50361020e5760018201546001600160a01b0316156101ca5760018201546001600160a01b03166004356001600160a01b0316146101ca576040516362cf623d60e11b815260040160405180910390fd5b81546001600160a01b0316156101f357604051635fb2b52360e11b815260040160405180910390fd5b81546001600160a01b0319163317825560015f908152602090f35b005b34801561021b575f80fd5b5061024c61022a3660046108ed565b6301ffc9a760e09190911c9081146380ac58cd821417635b5e139f9091141790565b60405190151581526020015b60405180910390f35b34801561026c575f80fd5b5061027561040e565b604051610258919061091b565b34801561028d575f80fd5b506102a161029c366004610967565b610461565b6040516001600160a01b039091168152602001610258565b3480156102c4575f80fd5b5061020e6102d3366004610999565b6104a4565b3480156102e3575f80fd5b506102ec610524565b604051908152602001610258565b348015610305575f80fd5b5061020e6103143660046109c1565b61055d565b61020e6103273660046109c1565b6105d6565b348015610337575f80fd5b506102a1610346366004610967565b610607565b348015610356575f80fd5b506102ec6103653660046109fa565b61063d565b348015610375575f80fd5b50610275610682565b348015610389575f80fd5b506102a16106b0565b34801561039d575f80fd5b5061020e6103ac366004610a13565b6106e5565b3480156103bc575f80fd5b5061020e6103cb366004610a4c565b610762565b3480156103db575f80fd5b506102756103ea366004610967565b6107bc565b3480156103fa575f80fd5b5061024c610409366004610ade565b610815565b60605f6104196106b0565b905060405191506306fdde035f525f806004601c845afa61043c573d5f833e3d82fd5b60205f803e60205f51833e815160205f5101602084013e815160208301016040525090565b5f8061046b6106b0565b905063081812fc5f528260205260205f6024601c845afa601f3d1116610497573d5f6040513e3d604051fd5b5050600c5160601c919050565b5f6104ad6106b0565b90508260601b60601c925060405163d10b6e0c5f5283602052826040523360605260205f6064601c34865af1601f3d11166104ea573d5f823e3d81fd5b80604052505f6060528183600c5160601c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9255f38a4505050565b5f8061052e6106b0565b905063e2c792815f5260205f6004601c845afa601f3d1116610556573d5f6040513e3d604051fd5b50505f5190565b5f6105666106b0565b90508360601b60601c93508260601b60601c925060405163e5eb36c881528460208201528360408201528260608201523360808201526020816084601c840134865af16001825114166105bb573d5f823e3d81fd5b508183855f80516020610b108339815191525f38a450505050565b6105e183838361055d565b813b156106025761060283838360405180602001604052805f815250610864565b505050565b5f806106116106b0565b9050636352211e5f528260205260205f6024601c845afa601f3d1116610497573d5f6040513e3d604051fd5b5f806106476106b0565b90508260601b60601c60205263f5b100ea5f5260205f6024601c845afa601f3d1116610679573d5f6040513e3d604051fd5b50505f51919050565b60605f61068d6106b0565b905060405191506395d89b415f525f806004601c845afa61043c573d5f833e3d82fd5b683602298b8c10b01230546001600160a01b0316806106e257604051632d9523d760e11b815260040160405180910390fd5b90565b5f6106ee6106b0565b90508260601b60601c925060405163813500fc5f52836020528215156040523360605260205f6064601c34865af160015f51141661072e573d5f823e3d81fd5b83337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206040a360405250505f60605250565b61076d85858561055d565b833b156107b5576107b585858585858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061086492505050565b5050505050565b60605f6107c76106b0565b905060405191508260205263c87b56dd5f525f806024601c845afa6107ee573d5f833e3d82fd5b60205f803e60205f51833e815160205f5101602084013e8151602083010160405250919050565b5f8061081f6106b0565b9050604051836040528460601b602c5263e985e9c560601b600c5260205f6044601c855afa601f3d1116610855573d5f823e3d81fd5b60405250505f51151592915050565b60405163150b7a028082523360208301528560601b60601c604083015283606083015260808083015282518060a084015280156108ab578060c08401826020870160045afa505b60208360a48301601c86015f8a5af16108cc573d156108cc573d5f843e3d83fd5b508060e01b8251146108e55763d1a57ed65f526004601cfd5b505050505050565b5f602082840312156108fd575f80fd5b81356001600160e01b031981168114610914575f80fd5b9392505050565b5f602080835283518060208501525f5b818110156109475785810183015185820160400152820161092b565b505f604082860101526040601f19601f8301168501019250505092915050565b5f60208284031215610977575f80fd5b5035919050565b80356001600160a01b0381168114610994575f80fd5b919050565b5f80604083850312156109aa575f80fd5b6109b38361097e565b946020939093013593505050565b5f805f606084860312156109d3575f80fd5b6109dc8461097e565b92506109ea6020850161097e565b9150604084013590509250925092565b5f60208284031215610a0a575f80fd5b6109148261097e565b5f8060408385031215610a24575f80fd5b610a2d8361097e565b915060208301358015158114610a41575f80fd5b809150509250929050565b5f805f805f60808688031215610a60575f80fd5b610a698661097e565b9450610a776020870161097e565b93506040860135925060608601356001600160401b0380821115610a99575f80fd5b818801915088601f830112610aac575f80fd5b813581811115610aba575f80fd5b896020828501011115610acb575f80fd5b9699959850939650602001949392505050565b5f8060408385031215610aef575f80fd5b610af88361097e565b9150610b066020840161097e565b9050925092905056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122001d04e87079acb73f34b741a7836210b81908c445c0134d1742512f0580c465f64736f6c63430008170033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000003635c9adc5dea00000000000000000000000000000df25aba9e2a5c974471b365f508370135fe06dac000000000000000000000000000000000000000000000000000000000000000650414e4745410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000650616e6765610000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x60806040526004361061013f575f3560e01c806306fdde031461049a578063095ea7b3146104c457806318160ddd146104f357806323b872dd146105155780632569296214610534578063274e430b1461053c5780632a6a935d1461055b578063313ce5671461057a5780634ef41efc1461059557806354d1f13d146105c157806355f804b3146105c9578063671a6b7f146105e857806370a0823114610607578063715018a614610626578063748ef1ed1461062e5780637d99f9a41461064d5780638d91287f1461067b5780638da5cb5b1461069a57806395d89b41146106b2578063a9059cbb146106c6578063badc3335146106e5578063c87b56dd14610704578063dd62ed3e14610723578063f04e283e14610742578063f2fde38b14610755578063f8b45b0514610768578063fee81cf41461077c57610146565b3661014657005b5f61014f6107ad565b90505f3560e01c63e985e9c58190036101e95760018201546001600160a01b0316331461018f5760405163ce5a776b60e01b815260040160405180910390fd5b604436101561019c575f80fd5b6004356001600160a01b038181165f908152600385016020908152604080832060243594851684529091529020546101e69060ff166101db575f6101de565b60015b60ff166107ba565b50505b80636352211e0361024d5760018201546001600160a01b031633146102215760405163ce5a776b60e01b815260040160405180910390fd5b602436101561022e575f80fd5b60043561024b61023d826107c2565b6001600160a01b03166107ba565b505b8063e5eb36c8036102b95760018201546001600160a01b031633146102855760405163ce5a776b60e01b815260040160405180910390fd5b6084361015610292575f80fd5b6004356024356044356064356102aa848484846107f8565b6102b460016107ba565b505050505b8063813500fc036103225760018201546001600160a01b031633146102f15760405163ce5a776b60e01b815260040160405180910390fd5b60643610156102fe575f80fd5b6004356024351515604435610314838383610b38565b61031e60016107ba565b5050505b8063d10b6e0c036103825760018201546001600160a01b0316331461035a5760405163ce5a776b60e01b815260040160405180910390fd5b6064361015610367575f80fd5b60043560243560443561037e61023d848484610b7f565b5050505b8063081812fc036103d85760018201546001600160a01b031633146103ba5760405163ce5a776b60e01b815260040160405180910390fd5b60243610156103c7575f80fd5b6004356103d661023d82610c49565b505b8063f5b100ea036104335760018201546001600160a01b031633146104105760405163ce5a776b60e01b815260040160405180910390fd5b602436101561041d575f80fd5b60043561043161042c82610c94565b6107ba565b505b8063e2c79281036104835760018201546001600160a01b0316331461046b5760405163ce5a776b60e01b815260040160405180910390fd5b6004361015610478575f80fd5b61048361042c610ccb565b8063b7a94eb8036104985761049860016107ba565b005b3480156104a5575f80fd5b506104ae610ce7565b6040516104bb9190611ab4565b60405180910390f35b3480156104cf575f80fd5b506104e36104de366004611afc565b610d77565b60405190151581526020016104bb565b3480156104fe575f80fd5b50610507610de9565b6040519081526020016104bb565b348015610520575f80fd5b506104e361052f366004611b24565b610e08565b610498610f02565b348015610547575f80fd5b506104e3610556366004611b5d565b610f4e565b348015610566575f80fd5b50610498610575366004611b85565b610fa5565b348015610585575f80fd5b50604051601281526020016104bb565b3480156105a0575f80fd5b506105a9610fb2565b6040516001600160a01b0390911681526020016104bb565b610498610fcd565b3480156105d4575f80fd5b506104986105e3366004611b9e565b611006565b3480156105f3575f80fd5b50610498610602366004611c09565b611020565b348015610612575f80fd5b50610507610621366004611b5d565b61104e565b610498611088565b348015610639575f80fd5b50610498610648366004611c20565b61109b565b348015610658575f80fd5b506104e3610667366004611b5d565b60026020525f908152604090205460ff1681565b348015610686575f80fd5b506001546105a9906001600160a01b031681565b3480156106a5575f80fd5b50638b78c6d819546105a9565b3480156106bd575f80fd5b506104ae6110ef565b3480156106d1575f80fd5b506104e36106e0366004611afc565b6110fe565b3480156106f0575f80fd5b506104986106ff366004611b5d565b61116f565b34801561070f575f80fd5b506104ae61071e366004611c09565b6111bb565b34801561072e575f80fd5b5061050761073d366004611c51565b611204565b610498610750366004611b5d565b61123c565b610498610763366004611b5d565b611276565b348015610773575f80fd5b506105075f5481565b348015610787575f80fd5b50610507610796366004611b5d565b63389a75e1600c9081525f91909152602090205490565b68a20d6e21d0e525530890565b805f5260205ff35b5f6107cc8261129c565b6107e95760405163677510db60e11b815260040160405180910390fd5b6107f2826112b8565b92915050565b5f6108016107ad565b90506001600160a01b03841661082a57604051633a954ecd60e21b815260040160405180910390fd5b5f816002015f610846846007016108418860011b90565b611300565b63ffffffff16815260208101919091526040015f20546001600160a01b039081169150861681146108895760405162a1148160e81b815260040160405180910390fd5b856001600160a01b0316836001600160a01b03161461090b576001600160a01b038087165f90815260038401602090815260408083209387168352929052205460ff1661090b575f8481526004830160205260409020546001600160a01b0384811691161461090b57604051632ce44b5f60e11b815260040160405180910390fd5b5f61091587611322565b90505f61092187611322565b8254909150670de0b6b3a7640000908390601490610950908490600160a01b90046001600160601b0316611c8d565b82546101009290920a6001600160601b0381810219909316918316021790915582546001600160a01b038116670de0b6b3a7640000600160a01b9283900484160190921602178255506109b460078501600188901b6109af848b61138b565b61142f565b5f868152600485016020908152604080832080546001600160a01b03191690556001600160a01b038b168352600687019091528120835463ffffffff60801b198116600160801b9182900463ffffffff9081165f190116918202178555610a1b9190611300565b6001600160a01b038a165f908152600687016020526040902063ffffffff919091169150610a6190610a556007880160018b811b01611300565b63ffffffff168361142f565b8154600163ffffffff600160801b80840482169283019091160263ffffffff60801b19909216919091178355610ab360078701610aa184600190811b0190565b6109af60078a0160018d811b01611300565b6001600160a01b0389165f9081526006870160205260409020610ad790828a61142f565b610aea6007870160018a811b018361142f565b5050866001600160a01b0316886001600160a01b03165f80516020611f34833981519152670de0b6b3a7640000604051610b2691815260200190565b60405180910390a35050505050505050565b81610b416107ad565b6001600160a01b039283165f90815260039190910160209081526040808320969094168252949094529220805460ff19169215159290921790915550565b5f80610b896107ad565b90505f816002015f610ba2846007016108418960011b90565b63ffffffff16815260208101919091526040015f20546001600160a01b03908116915084168114610c14576001600160a01b038082165f90815260038401602090815260408083209388168352929052205460ff16610c14576040516367d9dca160e11b815260040160405180910390fd5b5f8581526004909201602052604090912080546001600160a01b0387166001600160a01b031990911617905590509392505050565b5f610c538261129c565b610c705760405163677510db60e11b815260040160405180910390fd5b610c786107ad565b5f9283526004016020525060409020546001600160a01b031690565b5f610c9d6107ad565b6001600160a01b03929092165f9081526008909201602052506040902054600160801b900463ffffffff1690565b5f610cd46107ad565b54600160401b900463ffffffff16919050565b606060038054610cf690611cad565b80601f0160208091040260200160405190810160405280929190818152602001828054610d2290611cad565b8015610d6d5780601f10610d4457610100808354040283529160200191610d6d565b820191905f5260205f20905b815481529060010190602001808311610d5057829003601f168201915b5050505050905090565b5f80610d816107ad565b335f81815260058301602090815260408083206001600160a01b038a16808552908352928190208890555187815293945090927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b5f610df26107ad565b54600160601b90046001600160601b0316919050565b5f80610e126107ad565b6001600160a01b038087165f908152600583016020908152604080832033845282528083205493891683526002909152812054929350909160ff1615159003610e98575f84610e608761104e565b610e6a9190611cdf565b90505f54811115610e965760405162461bcd60e51b8152600401610e8d90611cf2565b60405180910390fd5b505b5f198114610eeb5780841115610ec1576040516313be252b60e01b815260040160405180910390fd5b6001600160a01b0386165f9081526005830160209081526040808320338452909152902084820390555b610ef6868686611461565b50600195945050505050565b5f6202a3006001600160401b03164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f80610f586107ad565b6001600160a01b0384165f908152600891909101602052604081208054909250600160581b90046001169003610f9257823b5b9392505050565b54600160581b9004600216151592915050565b610faf33826118c8565b50565b5f610fbb6107ad565b600101546001600160a01b0316919050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b61100e611957565b600561101b828483611d86565b505050565b6001546001600160a01b0316331461104a5760405162461bcd60e51b8152600401610e8d90611e3f565b5f55565b5f6110576107ad565b6001600160a01b03929092165f9081526008909201602052506040902054600160a01b90046001600160601b031690565b611090611957565b6110995f611971565b565b6001546001600160a01b031633146110c55760405162461bcd60e51b8152600401610e8d90611e3f565b6001600160a01b03919091165f908152600260205260409020805460ff1916911515919091179055565b606060048054610cf690611cad565b6001600160a01b0382165f9081526002602052604081205460ff161515810361115b575f8261112c8561104e565b6111369190611cdf565b90505f548111156111595760405162461bcd60e51b8152600401610e8d90611cf2565b505b611166338484611461565b50600192915050565b6001546001600160a01b031633146111995760405162461bcd60e51b8152600401610e8d90611e3f565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6060600580546111ca90611cad565b1590506111ff5760056111dc836119ae565b6040516020016111ed929190611e6a565b60405160208183030381529060405290505b919050565b5f61120d6107ad565b6001600160a01b039384165f908152600591909101602090815260408083209490951682529290925250205490565b611244611957565b63389a75e1600c52805f526020600c20805442111561126a57636f5e88185f526004601cfd5b5f9055610faf81611971565b61127e611957565b8060601b61129357637448fbae5f526004601cfd5b610faf81611971565b5f806112a7836112b8565b6001600160a01b0316141592915050565b5f806112c26107ad565b9050806002015f6112da836007016108418760011b90565b63ffffffff16815260208101919091526040015f20546001600160a01b03169392505050565b600381901c5f90815260209290925260409091205460059190911b60e0161c90565b5f8061132c6107ad565b6001600160a01b0384165f90815260088201602052604081208054909450919250600160581b9091046001169003611385576001833b1561136b576002175b825460ff909116600160581b0260ff60581b199091161782555b50919050565b5f806113956107ad565b8454600160601b900463ffffffff16925090505f82900361142857805481905f906113c59063ffffffff16611efd565b825463ffffffff8083166101009490940a848102910219909116179092558554600160601b820263ffffffff60601b199091161786555f908152600283016020526040902080546001600160a01b0386166001600160a01b031990911617905591505b5092915050565b826020528160031c5f5260405f206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b6001600160a01b03821661148857604051633a954ecd60e21b815260040160405180910390fd5b5f6114916107ad565b90505f61149d85611322565b90505f6114a985611322565b90506114de6040518060c001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b825463ffffffff600160801b808304821660808501528454041660a08301526001600160601b03600160a01b909104166040820181905285111561153557604051631e9acf1760e31b815260040160405180910390fd5b6040810180518690039081905283546001600160601b03808316600160a01b9081026001600160a01b03938416178755855481810483168a0160608701819052909216029116178355608082015161159b91670de0b6b3a7640000900480821191030290565b81528154600160581b90046002165f0361160957856001600160a01b0316876001600160a01b0316036115d657805160808201510360a08201525b611603670de0b6b3a76400008260600151816115f4576115f4611f1f565b048260a0015180821191030290565b60208201525b5f6116508260200151835f01510160408051808201909152606081525f60208201526040805101828152806020018360051b81016040528183528083602001525050919050565b825190915015611722576001600160a01b0388165f908152600686016020526040902060808301518351875463ffffffff600160401b808304821684900382160263ffffffff60401b199092169190911789558754918303908116600160801b0263ffffffff60801b199092169190911787555b5f19909101905f6116d58484611300565b63ffffffff1690506116ec89600701825f806119f0565b5f81815260048a016020526040902080546001600160a01b0319169055611716858d836001611a33565b508082036116c4575050505b602082015115611863576001600160a01b0387165f9081526006860160209081526040822060a085015191850151909290820190611760878c61138b565b8954602088015163ffffffff60401b19821663ffffffff600160401b80850482169093018116909202178c55895463ffffffff60801b1916600160801b86831602178a55919250670de0b6b3a7640000600160601b82046001600160601b03160491600160201b909104165b6117dd8b6007016108418360011b90565b63ffffffff16156117fc57600101818111156117f7575060015b6117cc565b61180786868361142f565b61181c8b6007018285888060010199506119f0565b611828878e835f611a33565b60010181811115611837575060015b8385036117cc578a5463ffffffff909116600160201b0263ffffffff60201b19909116178a5550505050505b805151156118845760018501546118849082906001600160a01b0316611a55565b50856001600160a01b0316876001600160a01b03165f80516020611f34833981519152876040516118b791815260200190565b60405180910390a350505050505050565b5f6118d283611322565b8054909150600160581b900460021615158215151461190d57805460ff600160581b80830482166002189091160260ff60581b199091161781555b826001600160a01b03167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d64203938360405161194a911515815260200190565b60405180910390a2505050565b638b78c6d819543314611099576382b429005f526004601cfd5b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b60606080604051019050602081016040525f8152805f19835b928101926030600a8206018453600a9004806119c7575050819003601f19909101908152919050565b8163ffffffff168160201b17846020528360021c5f5260405f206003851660061b81546001600160401b038482841c188116831b82188455505050505050505050565b8360200151818360081b8560601b171781526020810185602001525050505050565b81516040810363263c69d68152602080820152815160051b604401915060208183601c84015f875af1600182511416611a8c575f81fd5b50505050565b5f5b83811015611aac578181015183820152602001611a94565b50505f910152565b602081525f8251806020840152611ad2816040850160208701611a92565b601f01601f19169190910160400192915050565b80356001600160a01b03811681146111ff575f80fd5b5f8060408385031215611b0d575f80fd5b611b1683611ae6565b946020939093013593505050565b5f805f60608486031215611b36575f80fd5b611b3f84611ae6565b9250611b4d60208501611ae6565b9150604084013590509250925092565b5f60208284031215611b6d575f80fd5b610f8b82611ae6565b803580151581146111ff575f80fd5b5f60208284031215611b95575f80fd5b610f8b82611b76565b5f8060208385031215611baf575f80fd5b82356001600160401b0380821115611bc5575f80fd5b818501915085601f830112611bd8575f80fd5b813581811115611be6575f80fd5b866020828501011115611bf7575f80fd5b60209290920196919550909350505050565b5f60208284031215611c19575f80fd5b5035919050565b5f8060408385031215611c31575f80fd5b611c3a83611ae6565b9150611c4860208401611b76565b90509250929050565b5f8060408385031215611c62575f80fd5b611c6b83611ae6565b9150611c4860208401611ae6565b634e487b7160e01b5f52601160045260245ffd5b6001600160601b0382811682821603908082111561142857611428611c79565b600181811c90821680611cc157607f821691505b60208210810361138557634e487b7160e01b5f52602260045260245ffd5b808201808211156107f2576107f2611c79565b6020808252818101527f74686973207573657220657863656564732077616c6c65742062616c616e6365604082015260600190565b634e487b7160e01b5f52604160045260245ffd5b601f82111561101b57805f5260205f20601f840160051c81016020851015611d605750805b601f840160051c820191505b81811015611d7f575f8155600101611d6c565b5050505050565b6001600160401b03831115611d9d57611d9d611d27565b611db183611dab8354611cad565b83611d3b565b5f601f841160018114611de2575f8515611dcb5750838201355b5f19600387901b1c1916600186901b178355611d7f565b5f83815260208120601f198716915b82811015611e115786850135825560209485019460019092019101611df1565b5086821015611e2d575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6020808252601190820152701bdddb995c9cda1a5c0818dbdb9d1c9bdb607a1b604082015260600190565b5f808454611e7781611cad565b60018281168015611e8f5760018114611ea457611ed0565b60ff1984168752821515830287019450611ed0565b885f526020805f205f5b85811015611ec75781548a820152908401908201611eae565b50505082870194505b505050508351611ee4818360208801611a92565b64173539b7b760d91b9101908152600501949350505050565b5f63ffffffff808316818103611f1557611f15611c79565b6001019392505050565b634e487b7160e01b5f52601260045260245ffdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220eeef4ae80d62e586e34a57cbd644a9fa6c27c74469b9f20a148290c0798f5dac64736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000003635c9adc5dea00000000000000000000000000000df25aba9e2a5c974471b365f508370135fe06dac000000000000000000000000000000000000000000000000000000000000000650414e4745410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000650616e6765610000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name_ (string): PANGEA
Arg [1] : symbol_ (string): Pangea
Arg [2] : initialTokenSupply (uint96): 1000000000000000000000
Arg [3] : initialSupplyOwner (address): 0xDF25abA9e2a5c974471B365F508370135fE06dac
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 00000000000000000000000000000000000000000000003635c9adc5dea00000
Arg [3] : 000000000000000000000000df25aba9e2a5c974471b365f508370135fe06dac
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [5] : 50414e4745410000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [7] : 50616e6765610000000000000000000000000000000000000000000000000000
Deployed Bytecode Sourcemap
141092:1276:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;131919:22;131944:18;:16;:18::i;:::-;131919:43;-1:-1:-1;131975:18:0;138571:20;132019:3;131996:26;132102:10;132088:24;;;132084:377;;132147:14;;;;-1:-1:-1;;;;;132147:14:0;132133:10;:28;132129:58;;132170:17;;-1:-1:-1;;;132170:17:0;;;;;;;;;;;132129:58;132224:4;132206:8;:22;132202:36;;;132230:8;;;132202:36;132301:4;138571:20;-1:-1:-1;;;;;132404:26:0;;;132255:13;132404:26;;;:19;;;:26;;;;;;;;132372:4;138571:20;132404:36;;;;;;;;;;;132396:53;;132404:36;;:44;;132447:1;132404:44;;;132443:1;132404:44;132396:53;;:7;:53::i;:::-;132114:347;;132084:377;132507:10;132521;132507:24;132503:262;;132566:14;;;;-1:-1:-1;;;;;132566:14:0;132552:10;:28;132548:58;;132589:17;;-1:-1:-1;;;132589:17:0;;;;;;;;;;;132548:58;132643:4;132625:8;:22;132621:36;;;132649:8;;;132621:36;132701:4;138571:20;132723:30;132739:12;138571:20;132739:8;:12::i;:::-;-1:-1:-1;;;;;132723:30:0;:7;:30::i;:::-;132533:232;132503:262;132843:10;132857;132843:24;132839:502;;132902:14;;;;-1:-1:-1;;;;;132902:14:0;132888:10;:28;132884:58;;132925:17;;-1:-1:-1;;;132925:17:0;;;;;;;;;;;132884:58;132979:4;132961:8;:22;132957:36;;;132985:8;;;132957:36;133055:4;138571:20;133120:4;138571:20;133169:4;138571:20;133239:4;138571:20;133263:41;138571:20;;;;133263:16;:41::i;:::-;133319:10;133327:1;133319:7;:10::i;:::-;132869:472;;;;132839:502;133410:10;133424;133410:24;133406:451;;133469:14;;;;-1:-1:-1;;;;;133469:14:0;133455:10;:28;133451:58;;133492:17;;-1:-1:-1;;;133492:17:0;;;;;;;;;;;133451:58;133546:4;133528:8;:22;133524:36;;;133552:8;;;133524:36;133625:4;138571:20;133675:4;138571:20;133661:24;;133750:4;138571:20;133774:46;138571:20;133661:24;138571:20;133774:18;:46::i;:::-;133835:10;133843:1;133835:7;:10::i;:::-;133436:421;;;133406:451;133922:10;133936;133922:24;133918:427;;133981:14;;;;-1:-1:-1;;;;;133981:14:0;133967:10;:28;133963:58;;134004:17;;-1:-1:-1;;;134004:17:0;;;;;;;;;;;133963:58;134058:4;134040:8;:22;134036:36;;;134064:8;;;134036:36;134137:4;138571:20;134186:4;138571:20;134256:4;138571:20;134280:53;134296:35;138571:20;;;134296:11;:35::i;134280:53::-;133948:397;;;133918:427;134395:10;134409;134395:24;134391:266;;134454:14;;;;-1:-1:-1;;;;;134454:14:0;134440:10;:28;134436:58;;134477:17;;-1:-1:-1;;;134477:17:0;;;;;;;;;;;134436:58;134531:4;134513:8;:22;134509:36;;;134537:8;;;134509:36;134589:4;138571:20;134611:34;134627:16;138571:20;134627:12;:16::i;134611:34::-;134421:236;134391:266;134708:10;134722;134708:24;134704:282;;134767:14;;;;-1:-1:-1;;;;;134767:14:0;134753:10;:28;134749:58;;134790:17;;-1:-1:-1;;;134790:17:0;;;;;;;;;;;134749:58;134844:4;134826:8;:22;134822:36;;;134850:8;;;134822:36;134921:4;138571:20;134945:29;134953:20;138571;134953:13;:20::i;:::-;134945:7;:29::i;:::-;134734:252;134704:282;135032:10;135046;135032:24;135028:209;;135091:14;;;;-1:-1:-1;;;;;135091:14:0;135077:10;:28;135073:58;;135114:17;;-1:-1:-1;;;135114:17:0;;;;;;;;;;;135073:58;135168:4;135150:8;:22;135146:36;;;135174:8;;;135146:36;135199:26;135207:17;:15;:17::i;135199:26::-;135284:10;135298;135284:24;135280:67;;135325:10;135333:1;135325:7;:10::i;:::-;131908:3458;141625:92;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;110996:275;;;;;;;;;;-1:-1:-1;110996:275:0;;;;;:::i;:::-;;:::i;:::-;;;1272:14:1;;1265:22;1247:41;;1235:2;1220:18;110996:275:0;1107:187:1;110273:126:0;;;;;;;;;;;;;:::i;:::-;;;1445:25:1;;;1433:2;1418:18;110273:126:0;1299:177:1;112848:727:0;;;;;;;;;;-1:-1:-1;112848:727:0;;;;;:::i;:::-;;:::i;74693:630::-;;;:::i;125854:282::-;;;;;;;;;;-1:-1:-1;125854:282:0;;;;;:::i;:::-;;:::i;126248:100::-;;;;;;;;;;-1:-1:-1;126248:100:0;;;;;:::i;:::-;;:::i;110132:76::-;;;;;;;;;;-1:-1:-1;110132:76:0;;110198:2;2497:36:1;;2485:2;2470:18;110132:76:0;2355:184:1;128411:119:0;;;;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;2708:32:1;;;2690:51;;2678:2;2663:18;128411:119:0;2544:203:1;75408:466:0;;;:::i;142262:101::-;;;;;;;;;;-1:-1:-1;142262:101:0;;;;;:::i;:::-;;:::i;109285:148::-;;;;;;;;;;-1:-1:-1;109285:148:0;;;;;:::i;:::-;;:::i;110468:143::-;;;;;;;;;;-1:-1:-1;110468:143:0;;;;;:::i;:::-;;:::i;74428:102::-;;;:::i;109606:179::-;;;;;;;;;;-1:-1:-1;109606:179:0;;;;;:::i;:::-;;:::i;109223:53::-;;;;;;;;;;-1:-1:-1;109223:53:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;109187:28;;;;;;;;;;-1:-1:-1;109187:28:0;;;;-1:-1:-1;;;;;109187:28:0;;;77133:187;;;;;;;;;;-1:-1:-1;;;77284:18:0;77133:187;;141725:96;;;;;;;;;;;;;:::i;111784:367::-;;;;;;;;;;-1:-1:-1;111784:367:0;;;;;:::i;:::-;;:::i;109441:157::-;;;;;;;;;;-1:-1:-1;109441:157:0;;;;;:::i;:::-;;:::i;141829:246::-;;;;;;;;;;-1:-1:-1;141829:246:0;;;;;:::i;:::-;;:::i;110709:151::-;;;;;;;;;;-1:-1:-1;110709:151:0;;;;;:::i;:::-;;:::i;76065:724::-;;;;;;:::i;:::-;;:::i;74002:358::-;;;;;;:::i;:::-;;:::i;109134:46::-;;;;;;;;;;;;;;;;77426:449;;;;;;;;;;-1:-1:-1;77426:449:0;;;;;:::i;:::-;77705:19;77699:4;77692:33;;;77549:14;77739:26;;;;77851:4;77835:21;;77829:28;;77426:449;106655:320;106889:20;;106655:320::o;138702:185::-;138835:1;138829:4;138822:15;138864:4;138858;138851:18;129371:163;129432:7;129457:11;129465:2;129457:7;:11::i;:::-;129452:44;;129477:19;;-1:-1:-1;;;129477:19:0;;;;;;;;;;;129452:44;129514:12;129523:2;129514:8;:12::i;:::-;129507:19;129371:163;-1:-1:-1;;129371:163:0:o;122844:1507::-;122978:22;123003:18;:16;:18::i;:::-;122978:43;-1:-1:-1;;;;;;123038:16:0;;123034:52;;123063:23;;-1:-1:-1;;;123063:23:0;;;;;;;;;;;123034:52;123099:13;123115:1;:16;;:49;123132:31;123137:1;:4;;123143:19;123159:2;139268:1;139263:6;;139178:99;123143:19;123132:4;:31::i;:::-;123115:49;;;;;;;;;;;;;-1:-1:-1;123115:49:0;;-1:-1:-1;;;;;123115:49:0;;;;-1:-1:-1;123181:13:0;;;;123177:54;;123203:28;;-1:-1:-1;;;123203:28:0;;;;;;;;;;;123177:54;123261:4;-1:-1:-1;;;;;123248:17:0;:9;-1:-1:-1;;;;;123248:17:0;;123244:250;;-1:-1:-1;;;;;123287:25:0;;;;;;;:19;;;:25;;;;;;;;:36;;;;;;;;;;;;123282:201;;123361:20;;;;:16;;;:20;;;;;;-1:-1:-1;;;;;123348:33:0;;;123361:20;;123348:33;123344:124;;123413:35;;-1:-1:-1;;;123413:35:0;;;;;;;;;;;123344:124;123506:35;123544:18;123557:4;123544:12;:18::i;:::-;123506:56;;123573:33;123609:16;123622:2;123609:12;:16::i;:::-;123638:39;;123573:52;;-1:-1:-1;103946:8:0;;123638:39;;:23;;:39;;103946:8;;-1:-1:-1;;;123638:39:0;;-1:-1:-1;;;;;123638:39:0;;:::i;:::-;;;;;;;;-1:-1:-1;;;;;123638:39:0;;;;;;;;;;;;;;;123715:37;;-1:-1:-1;;;;;123715:37:0;;103946:8;-1:-1:-1;;;123715:37:0;;;;;;;;;;;;;;-1:-1:-1;123769:76:0;123774:4;;;-1:-1:-1;139263:6:0;;;123801:43;123826:13;123841:2;123801:24;:43::i;:::-;123769:4;:76::i;:::-;123867:20;;;;:16;;;:20;;;;;;;;123860:27;;-1:-1:-1;;;;;;123860:27:0;;;-1:-1:-1;;;;;123929:13:0;;;;:7;;;:13;;;;;123944:29;;-1:-1:-1;;;;123944:29:0;;-1:-1:-1;;;123944:29:0;;;;;;;;-1:-1:-1;;123944:29:0;;;;;;;;123924:50;;123929:13;123924:4;:50::i;:::-;-1:-1:-1;;;;;123994:13:0;;;;;;:7;;;:13;;;;;123904:70;;;;;;-1:-1:-1;123989:67:0;;124009:27;124014:4;;;139435:1;139430:6;;;139429:12;123132:4;:31::i;124009:27::-;123989:67;;124045:9;123989:4;:67::i;:::-;124085:27;;;;-1:-1:-1;;;124085:27:0;;;;;;;;;;;;-1:-1:-1;;;;124085:27:0;;;;;;;;;124127:63;124132:4;;;124138:22;124150:9;139435:1;139430:6;;;139429:12;;139323:137;124138:22;124162:27;124167:4;;;139435:1;139430:6;;;139429:12;123132:4;:31::i;124127:63::-;-1:-1:-1;;;;;124210:11:0;;;;;;:7;;;:11;;;;;124205:32;;124223:1;124233:2;124205:4;:32::i;:::-;124252:38;124257:4;;;139435:1;139430:6;;;139429:12;124287:1;124252:4;:38::i;:::-;123690:612;;124334:2;-1:-1:-1;;;;;124319:24:0;124328:4;-1:-1:-1;;;;;124319:24:0;-1:-1:-1;;;;;;;;;;;103946:8:0;124319:24;;;;1445:25:1;;1433:2;1418:18;;1299:177;124319:24:0;;;;;;;;122967:1384;;;;122844:1507;;;;:::o;130908:207::-;131099:8;131039:18;:16;:18::i;:::-;-1:-1:-1;;;;;131039:47:0;;;;;;;:36;;;;;:47;;;;;;;;:57;;;;;;;;;;;;:68;;-1:-1:-1;;131039:68:0;;;;;;;;;;;-1:-1:-1;130908:207:0:o;130255:527::-;130377:7;130402:22;130427:18;:16;:18::i;:::-;130402:43;;130458:13;130474:1;:16;;:49;130491:31;130496:1;:4;;130502:19;130518:2;139268:1;139263:6;;139178:99;130491:31;130474:49;;;;;;;;;;;;;-1:-1:-1;130474:49:0;;-1:-1:-1;;;;;130474:49:0;;;;-1:-1:-1;130540:18:0;;;;130536:171;;-1:-1:-1;;;;;130580:26:0;;;;;;;:19;;;:26;;;;;;;;:37;;;;;;;;;;;;130575:121;;130645:35;;-1:-1:-1;;;130645:35:0;;;;;;;;;;;130575:121;130719:20;;;;:16;;;;:20;;;;;;:30;;-1:-1:-1;;;;;130719:30:0;;-1:-1:-1;;;;;;130719:30:0;;;;;;130769:5;-1:-1:-1;130255:527:0;;;;;:::o;129843:192::-;129908:7;129933:11;129941:2;129933:7;:11::i;:::-;129928:44;;129953:19;;-1:-1:-1;;;129953:19:0;;;;;;;;;;;129928:44;129990:18;:16;:18::i;:::-;:37;;;;:33;;:37;;-1:-1:-1;129990:37:0;;;;-1:-1:-1;;;;;129990:37:0;;129843:192::o;128759:153::-;128828:7;128855:18;:16;:18::i;:::-;-1:-1:-1;;;;;128855:37:0;;;;;;;;:30;;;;:37;;-1:-1:-1;128855:37:0;;;:49;-1:-1:-1;;;128855:49:0;;;;;128759:153::o;128582:126::-;128640:7;128667:18;:16;:18::i;:::-;:33;-1:-1:-1;;;128667:33:0;;;;;;-1:-1:-1;128582:126:0:o;141625:92::-;141671:13;141704:5;141697:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;141625:92;:::o;110996:275::-;111070:4;111087:22;111112:18;:16;:18::i;:::-;111155:10;111143:23;;;;:11;;;:23;;;;;;;;-1:-1:-1;;;;;111143:32:0;;;;;;;;;;;;:41;;;111202:37;1445:25:1;;;111143:11:0;;-1:-1:-1;111143:32:0;;111202:37;;1418:18:1;111202:37:0;;;;;;;-1:-1:-1;111259:4:0;;110996:275;-1:-1:-1;;;110996:275:0:o;110273:126::-;110325:7;110360:18;:16;:18::i;:::-;:30;-1:-1:-1;;;110360:30:0;;-1:-1:-1;;;;;110360:30:0;;;-1:-1:-1;110273:126:0:o;112848:727::-;112936:4;112953:22;112978:18;:16;:18::i;:::-;-1:-1:-1;;;;;113027:17:0;;;113009:15;113027:17;;;:11;;;:17;;;;;;;;113045:10;113027:29;;;;;;;;113072:25;;;;;:21;:25;;;;;;112953:43;;-1:-1:-1;113027:29:0;;113072:25;;:34;;;;113069:203;;113122:24;113165:6;113149:13;113159:2;113149:9;:13::i;:::-;:22;;;;:::i;:::-;113122:49;;113214:9;;113194:16;:29;;113186:74;;;;-1:-1:-1;;;113186:74:0;;;;;;;:::i;:::-;;;;;;;;;113107:165;113069:203;-1:-1:-1;;113288:7:0;:28;113284:220;;113346:7;113337:6;:16;113333:52;;;113362:23;;-1:-1:-1;;;113362:23:0;;;;;;;;;;;113333:52;-1:-1:-1;;;;;113429:17:0;;;;;;:11;;;:17;;;;;;;;113447:10;113429:29;;;;;;;113461:16;;;113429:48;;113284:220;113516:27;113526:4;113532:2;113536:6;113516:9;:27::i;:::-;-1:-1:-1;113563:4:0;;112848:727;-1:-1:-1;;;;;112848:727:0:o;74693:630::-;74788:15;73618:9;-1:-1:-1;;;;;74806:46:0;:15;:46;74788:64;;75024:19;75018:4;75011:33;75075:8;75069:4;75062:22;75132:7;75125:4;75119;75109:21;75102:38;75281:8;75234:45;75231:1;75228;75223:67;74924:381;74693:630::o;125854:282::-;125914:4;125931:21;125955:18;:16;:18::i;:::-;-1:-1:-1;;;;;125955:33:0;;;;;;:30;;;;;:33;;;;;126003:7;;125955:33;;-1:-1:-1;;;;126003:7:0;;104330:6;126003:40;:45;;125999:69;;138281:14;;126057:11;126050:18;125854:282;-1:-1:-1;;;125854:282:0:o;125999:69::-;126086:7;-1:-1:-1;;;126086:7:0;;104467:6;126086:37;:42;;;125854:282;-1:-1:-1;;125854:282:0:o;126248:100::-;126308:32;126320:10;126332:7;126308:11;:32::i;:::-;126248:100;:::o;128411:119::-;128464:7;128491:18;:16;:18::i;:::-;:31;;;-1:-1:-1;;;;;128491:31:0;;128411:119;-1:-1:-1;128411:119:0:o;75408:466::-;75614:19;75608:4;75601:33;75661:8;75655:4;75648:22;75714:1;75707:4;75701;75691:21;75684:32;75847:8;75801:44;75798:1;75795;75790:66;75408:466::o;142262:101::-;78272:13;:11;:13::i;:::-;142336:8:::1;:19;142347:8:::0;;142336;:19:::1;:::i;:::-;;142262:101:::0;;:::o;109285:148::-;109363:13;;-1:-1:-1;;;;;109363:13:0;109349:10;:27;109341:57;;;;-1:-1:-1;;;109341:57:0;;;;;;;:::i;:::-;109409:9;:16;109285:148::o;110468:143::-;110531:7;110558:18;:16;:18::i;:::-;-1:-1:-1;;;;;110558:37:0;;;;;;;;:30;;;;:37;;-1:-1:-1;110558:37:0;;;:45;-1:-1:-1;;;110558:45:0;;-1:-1:-1;;;;;110558:45:0;;110468:143::o;74428:102::-;78272:13;:11;:13::i;:::-;74501:21:::1;74519:1;74501:9;:21::i;:::-;74428:102::o:0;109606:179::-;109696:13;;-1:-1:-1;;;;;109696:13:0;109682:10;:27;109674:57;;;;-1:-1:-1;;;109674:57:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;109742:26:0;;;;;;;;:21;:26;;;;;:35;;-1:-1:-1;;109742:35:0;;;;;;;;;;109606:179::o;141725:96::-;141773:13;141806:7;141799:14;;;;;:::i;111784:367::-;-1:-1:-1;;;;;111876:25:0;;111854:4;111876:25;;;:21;:25;;;;;;;;:34;;;;111873:203;;111926:24;111969:6;111953:13;111963:2;111953:9;:13::i;:::-;:22;;;;:::i;:::-;111926:49;;112018:9;;111998:16;:29;;111990:74;;;;-1:-1:-1;;;111990:74:0;;;;;;;:::i;:::-;111911:165;111873:203;112088:33;112098:10;112110:2;112114:6;112088:9;:33::i;:::-;-1:-1:-1;112139:4:0;111784:367;;;;:::o;109441:157::-;109525:13;;-1:-1:-1;;;;;109525:13:0;109511:10;:27;109503:57;;;;-1:-1:-1;;;109503:57:0;;;;;;;:::i;:::-;109571:13;:19;;-1:-1:-1;;;;;;109571:19:0;-1:-1:-1;;;;;109571:19:0;;;;;;;;;;109441:157::o;141829:246::-;141894:20;141937:8;141931:22;;;;;:::i;:::-;:27;;-1:-1:-1;141927:141:0;;142008:8;142018:27;142037:7;142018:18;:27::i;:::-;141991:64;;;;;;;;;:::i;:::-;;;;;;;;;;;;;141975:81;;141927:141;141829:246;;;:::o;110709:151::-;110781:7;110808:18;:16;:18::i;:::-;-1:-1:-1;;;;;110808:35:0;;;;;;;:28;;;;;:35;;;;;;;;:44;;;;;;;;;;-1:-1:-1;110808:44:0;;;110709:151::o;76065:724::-;78272:13;:11;:13::i;:::-;76303:19:::1;76297:4;76290:33;76350:12;76344:4;76337:26;76413:4;76407;76397:21;76521:12;76515:19;76502:11;76499:36;76496:160;;;76568:10;76562:4;76555:24;76636:4;76630;76623:18;76496:160;76735:1;76714:23:::0;;76758::::1;76768:12:::0;76758:9:::1;:23::i;74002:358::-:0;78272:13;:11;:13::i;:::-;74177:8:::1;74173:2;74169:17;74159:153;;74220:10;74214:4;74207:24;74292:4;74286;74279:18;74159:153;74333:19;74343:8;74333:9;:19::i;129586:118::-:0;129646:4;;129670:12;129679:2;129670:8;:12::i;:::-;-1:-1:-1;;;;;129670:26:0;;;;129586:118;-1:-1:-1;;129586:118:0:o;129051:199::-;129112:7;129132:22;129157:18;:16;:18::i;:::-;129132:43;;129193:1;:16;;:49;129210:31;129215:1;:4;;129221:19;129237:2;139268:1;139263:6;;139178:99;129210:31;129193:49;;;;;;;;;;;;;-1:-1:-1;129193:49:0;;-1:-1:-1;;;;;129193:49:0;;129051:199;-1:-1:-1;;;129051:199:0:o;139528:166::-;139661:1;139652:10;;;139602:13;139644:19;;;;;;;;;;;;;139683:1;139668:16;;;;;;139644:41;;139528:166::o;127027:407::-;127086:21;127120:22;127145:18;:16;:18::i;:::-;-1:-1:-1;;;;;127178:16:0;;;;;;:13;;;:16;;;;;127211:7;;127178:16;;-1:-1:-1;127120:43:0;;-1:-1:-1;;;;127211:7:0;;;104330:6;127211:40;:45;;127207:220;;104330:6;138281:14;;127332:53;;;104467:6;127349:36;127332:53;127400:15;;;;;;-1:-1:-1;;;127400:15:0;-1:-1:-1;;;;127400:15:0;;;;;;127207:220;127109:325;127027:407;;;:::o;127600:469::-;127734:19;127771:22;127796:18;:16;:18::i;:::-;127840:26;;-1:-1:-1;;;127840:26:0;;;;;-1:-1:-1;127771:43:0;-1:-1:-1;127840:26:0;127881:17;;;127877:185;;127930:14;;127932:1;;:12;;127930:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;127959:41;;-1:-1:-1;;;127959:41:0;;-1:-1:-1;;;;127959:41:0;;;;;;-1:-1:-1;128015:30:0;;;:16;;;:30;;;;;:35;;-1:-1:-1;;;;;128015:35:0;;-1:-1:-1;;;;;;128015:35:0;;;;;;127930:14;-1:-1:-1;127877:185:0;127760:309;127600:469;;;;:::o;139762:542::-;139928:8;139922:4;139915:22;139971:5;139968:1;139964:13;139958:4;139951:27;140017:4;140011;140001:21;140080:1;140073:5;140069:13;140066:1;140062:21;140143:1;140137:8;140191:10;140276:5;140272:1;140269;140265:9;140261:21;140258:1;140254:29;140251:1;140247:37;140244:1;140240:45;140237:1;140230:56;;;;;139762:542;;;:::o;119151:3268::-;-1:-1:-1;;;;;119244:16:0;;119240:52;;119269:23;;-1:-1:-1;;;119269:23:0;;;;;;;;;;;119240:52;119305:22;119330:18;:16;:18::i;:::-;119305:43;;119361:35;119399:18;119412:4;119399:12;:18::i;:::-;119361:56;;119428:33;119464:16;119477:2;119464:12;:16::i;:::-;119428:52;;119493:23;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;119493:23:0;119547:27;;;-1:-1:-1;;;119547:27:0;;;;;119527:17;;;:47;119603:25;;;;119585:15;;;:43;-1:-1:-1;;;;;;;;119655:23:0;;;;119639:13;;;:39;;;119695:22;;119691:56;;;119726:21;;-1:-1:-1;;;119726:21:0;;;;;;;;;;;119691:56;119785:13;;;:23;;;;;;;;;119823:47;;-1:-1:-1;;;;;119823:47:0;;;-1:-1:-1;;;119823:47:0;;;-1:-1:-1;;;;;119823:47:0;;;;;;119930:21;;;;;;;:30;;119916:11;;;:44;;;119885:76;;;;;;;;;120012:17;;;;119998:54;;103946:8;;120031:20;139100:8;;;139110:9;;139096:24;;138934:204;119998:54;119978:74;;120073:19;;-1:-1:-1;;;120073:19:0;;104467:6;120073:49;119978:17;120073:54;120069:255;;120160:2;-1:-1:-1;;;;;120152:10:0;:4;-1:-1:-1;;;;;120152:10:0;;120148:71;;120202:17;;120182;;;;:37;120164:15;;;:55;120148:71;120258:50;103946:8;120272:1;:11;;;:18;;;;;:::i;:::-;;120292:1;:15;;;139100:8;;;139110:9;;139096:24;;138934:204;120258:50;120238:17;;;:70;120069:255;120340:29;120372:56;120410:1;:17;;;120390:1;:17;;;:37;-1:-1:-1;;;;;;;;;;;;;;;;;136293:4:0;136286;136280:11;136276:22;136369:1;136363:4;136356:15;136409:4;136403;136399:15;136460:1;136457;136453:9;136445:6;136441:22;136435:4;136428:36;136488:4;136485:1;136478:15;136528:6;136524:1;136518:4;136514:12;136507:28;;;136103:450;;;;120372:56;120449:17;;120340:88;;-1:-1:-1;120449:22:0;120445:703;;-1:-1:-1;;;;;120522:13:0;;120492:27;120522:13;;;:7;;;:13;;;;;120574:17;;;;120640;;120676:45;;;-1:-1:-1;;;120676:45:0;;;;;;;;;;;-1:-1:-1;;;;120676:45:0;;;;;;;;;120740;;120628:29;;;120740:45;;;-1:-1:-1;;;120740:45:0;-1:-1:-1;;;;120740:45:0;;;;;;;;;120835:298;-1:-1:-1;;120890:11:0;;;;120861:10;120874:28;120879:9;120890:11;120874:4;:28::i;:::-;120861:41;;;;120925:43;120953:1;:4;;120959:2;120963:1;120966;120925:27;:43::i;:::-;120998:20;;;;:16;;;:20;;;;;120991:27;;-1:-1:-1;;;;;;120991:27:0;;;121041:42;121059:10;121071:4;121015:2;120991:27;121041:17;:42::i;:::-;120838:265;121124:7;121111:9;:20;120835:298;;120473:675;;;120445:703;121168:17;;;;:22;121164:1068;;-1:-1:-1;;;;;121239:11:0;;121211:25;121239:11;;;:7;;;:11;;;;;;;121287:15;;;;121347:17;;;;121239:11;;121337:27;;;;121400:43;121425:13;121247:2;121400:24;:43::i;:::-;121481:13;;121592:17;;;;-1:-1:-1;;;;121565:45:0;;121533:13;-1:-1:-1;;;121565:45:0;;;;;;;;;;;;;;;;121629:41;;-1:-1:-1;;;;121629:41:0;-1:-1:-1;;;121629:41:0;;;;;;;121383:60;;-1:-1:-1;103946:8:0;-1:-1:-1;;;121481:13:0;;-1:-1:-1;;;;;121481:13:0;:20;;-1:-1:-1;;;121533:13:0;;;;121720:452;121753:31;121758:1;:4;;121764:19;121780:2;139268:1;139263:6;;139178:99;121753:31;:36;;;121746:123;;121822:4;;:15;;;121818:27;;;-1:-1:-1;121844:1:0;121818:27;121746:123;;;121891:34;121896:7;121905;121921:2;121891:4;:34::i;:::-;121948:65;121976:1;:4;;121982:2;121986:7;122002:9;;;;;;121948:27;:65::i;:::-;122036:40;122054:10;122066:2;122070;122074:1;122036:17;:40::i;:::-;122103:4;;:15;;;122099:27;;;-1:-1:-1;122125:1:0;122099:27;122165:5;122154:7;:16;121720:452;;122190:26;;;;;;-1:-1:-1;;;122190:26:0;-1:-1:-1;;;;122190:26:0;;;;;;-1:-1:-1;;;;;121164:1068:0;122252:15;;:22;:27;122248:111;;122328:14;;;;122300:43;;122316:10;;-1:-1:-1;;;;;122328:14:0;122300:15;:43::i;:::-;119760:2610;122400:2;-1:-1:-1;;;;;122385:26:0;122394:4;-1:-1:-1;;;;;122385:26:0;-1:-1:-1;;;;;;;;;;;122404:6:0;122385:26;;;;1445:25:1;;1433:2;1418:18;;1299:177;122385:26:0;;;;;;;;119229:3190;;;;119151:3268;;;:::o;126567:289::-;126639:21;126663:15;126676:1;126663:12;:15::i;:::-;126694:7;;126639:39;;-1:-1:-1;;;;126694:7:0;;104467:6;126694:37;:42;;126693:53;;;;126689:124;;126763:38;;;-1:-1:-1;;;126763:38:0;;;;;104467:6;126763:38;;;;;-1:-1:-1;;;;126763:38:0;;;;;;126689:124;126839:1;-1:-1:-1;;;;;126828:20:0;;126842:5;126828:20;;;;1272:14:1;1265:22;1247:41;;1235:2;1220:18;;1107:187;126828:20:0;;;;;;;;126628:228;126567:289;;:::o;72923:364::-;-1:-1:-1;;73133:18:0;73123:8;73120:32;73110:159;;73186:10;73180:4;73173:24;73249:4;73243;73236:18;71749:1113;-1:-1:-1;;72716:16:0;;-1:-1:-1;;;;;72562:26:0;;;;;;72676:38;72673:1;;72665:78;72802:27;71749:1113::o;14359:1676::-;14415:17;14867:4;14860;14854:11;14850:22;14843:29;;14968:4;14963:3;14959:14;14953:4;14946:28;15051:1;15046:3;15039:14;15155:3;15187:1;15183:6;15399:5;15381:410;15438:11;;;;15622:2;15636;15626:13;;15618:22;15438:11;15605:36;15730:2;15720:13;;15751:25;15381:410;15751:25;-1:-1:-1;;15821:13:0;;;-1:-1:-1;;15936:14:0;;;15998:19;;;15936:14;14359:1676;-1:-1:-1;14359:1676:0:o;140377:708::-;140669:9;140657:10;140653:26;140640:10;140636:2;140632:19;140629:51;140707:8;140701:4;140694:22;140750:2;140747:1;140743:10;140737:4;140730:24;140793:4;140787;140777:21;140853:1;140849:2;140845:10;140842:1;140838:18;140916:1;140910:8;-1:-1:-1;;;;;141057:5:0;141053:1;141050;141046:9;141042:21;141039:1;141035:29;141032:1;141028:37;141025:1;141021:45;141018:1;141011:56;;;;;;140377:708;;;;:::o;136659:377::-;136893:1;136887:4;136883:12;136877:19;136956:7;136950:2;136947:1;136943:10;136939:1;136935:2;136931:10;136928:26;136925:39;136917:6;136910:55;137012:4;137004:6;137000:17;136996:1;136990:4;136986:12;136979:39;;136659:377;;;;:::o;137135:634::-;137303:1;137297:8;137338:4;137332;137328:15;137397:10;137394:1;137387:21;137472:4;137465;137462:1;137458:12;137451:26;137568:4;137562:11;137559:1;137555:19;137549:4;137545:30;137536:39;;137694:4;137691:1;137688;137681:4;137678:1;137674:12;137671:1;137663:6;137656:5;137651:48;137647:1;137643;137637:8;137634:15;137630:70;137620:131;;137731:4;137728:1;137721:15;137620:131;;;137135:634;;:::o;14:250:1:-;99:1;109:113;123:6;120:1;117:13;109:113;;;199:11;;;193:18;180:11;;;173:39;145:2;138:10;109:113;;;-1:-1:-1;;256:1:1;238:16;;231:27;14:250::o;269:396::-;418:2;407:9;400:21;381:4;450:6;444:13;493:6;488:2;477:9;473:18;466:34;509:79;581:6;576:2;565:9;561:18;556:2;548:6;544:15;509:79;:::i;:::-;649:2;628:15;-1:-1:-1;;624:29:1;609:45;;;;656:2;605:54;;269:396;-1:-1:-1;;269:396:1:o;670:173::-;738:20;;-1:-1:-1;;;;;787:31:1;;777:42;;767:70;;833:1;830;823:12;848:254;916:6;924;977:2;965:9;956:7;952:23;948:32;945:52;;;993:1;990;983:12;945:52;1016:29;1035:9;1016:29;:::i;:::-;1006:39;1092:2;1077:18;;;;1064:32;;-1:-1:-1;;;848:254:1:o;1481:328::-;1558:6;1566;1574;1627:2;1615:9;1606:7;1602:23;1598:32;1595:52;;;1643:1;1640;1633:12;1595:52;1666:29;1685:9;1666:29;:::i;:::-;1656:39;;1714:38;1748:2;1737:9;1733:18;1714:38;:::i;:::-;1704:48;;1799:2;1788:9;1784:18;1771:32;1761:42;;1481:328;;;;;:::o;1814:186::-;1873:6;1926:2;1914:9;1905:7;1901:23;1897:32;1894:52;;;1942:1;1939;1932:12;1894:52;1965:29;1984:9;1965:29;:::i;2005:160::-;2070:20;;2126:13;;2119:21;2109:32;;2099:60;;2155:1;2152;2145:12;2170:180;2226:6;2279:2;2267:9;2258:7;2254:23;2250:32;2247:52;;;2295:1;2292;2285:12;2247:52;2318:26;2334:9;2318:26;:::i;2752:592::-;2823:6;2831;2884:2;2872:9;2863:7;2859:23;2855:32;2852:52;;;2900:1;2897;2890:12;2852:52;2927:23;;-1:-1:-1;;;;;2999:14:1;;;2996:34;;;3026:1;3023;3016:12;2996:34;3064:6;3053:9;3049:22;3039:32;;3109:7;3102:4;3098:2;3094:13;3090:27;3080:55;;3131:1;3128;3121:12;3080:55;3171:2;3158:16;3197:2;3189:6;3186:14;3183:34;;;3213:1;3210;3203:12;3183:34;3258:7;3253:2;3244:6;3240:2;3236:15;3232:24;3229:37;3226:57;;;3279:1;3276;3269:12;3226:57;3310:2;3302:11;;;;;3332:6;;-1:-1:-1;2752:592:1;;-1:-1:-1;;;;2752:592:1:o;3349:180::-;3408:6;3461:2;3449:9;3440:7;3436:23;3432:32;3429:52;;;3477:1;3474;3467:12;3429:52;-1:-1:-1;3500:23:1;;3349:180;-1:-1:-1;3349:180:1:o;3534:254::-;3599:6;3607;3660:2;3648:9;3639:7;3635:23;3631:32;3628:52;;;3676:1;3673;3666:12;3628:52;3699:29;3718:9;3699:29;:::i;:::-;3689:39;;3747:35;3778:2;3767:9;3763:18;3747:35;:::i;:::-;3737:45;;3534:254;;;;;:::o;3793:260::-;3861:6;3869;3922:2;3910:9;3901:7;3897:23;3893:32;3890:52;;;3938:1;3935;3928:12;3890:52;3961:29;3980:9;3961:29;:::i;:::-;3951:39;;4009:38;4043:2;4032:9;4028:18;4009:38;:::i;4058:127::-;4119:10;4114:3;4110:20;4107:1;4100:31;4150:4;4147:1;4140:15;4174:4;4171:1;4164:15;4190:183;-1:-1:-1;;;;;4309:10:1;;;4297;;;4293:27;;4332:12;;;4329:38;;;4347:18;;:::i;4378:380::-;4457:1;4453:12;;;;4500;;;4521:61;;4575:4;4567:6;4563:17;4553:27;;4521:61;4628:2;4620:6;4617:14;4597:18;4594:38;4591:161;;4674:10;4669:3;4665:20;4662:1;4655:31;4709:4;4706:1;4699:15;4737:4;4734:1;4727:15;4763:125;4828:9;;;4849:10;;;4846:36;;;4862:18;;:::i;4893:356::-;5095:2;5077:21;;;5114:18;;;5107:30;5173:34;5168:2;5153:18;;5146:62;5240:2;5225:18;;4893:356::o;5254:127::-;5315:10;5310:3;5306:20;5303:1;5296:31;5346:4;5343:1;5336:15;5370:4;5367:1;5360:15;5512:518;5614:2;5609:3;5606:11;5603:421;;;5650:5;5647:1;5640:16;5694:4;5691:1;5681:18;5764:2;5752:10;5748:19;5745:1;5741:27;5735:4;5731:38;5800:4;5788:10;5785:20;5782:47;;;-1:-1:-1;5823:4:1;5782:47;5878:2;5873:3;5869:12;5866:1;5862:20;5856:4;5852:31;5842:41;;5933:81;5951:2;5944:5;5941:13;5933:81;;;6010:1;5996:16;;5977:1;5966:13;5933:81;;;5937:3;;5512:518;;;:::o;6206:1198::-;-1:-1:-1;;;;;6322:27:1;;6319:53;;;6352:18;;:::i;:::-;6381:94;6471:3;6431:38;6463:4;6457:11;6431:38;:::i;:::-;6425:4;6381:94;:::i;:::-;6501:1;6526:2;6521:3;6518:11;6543:1;6538:608;;;;7190:1;7207:3;7204:93;;;-1:-1:-1;7263:19:1;;;7250:33;7204:93;-1:-1:-1;;6163:1:1;6159:11;;;6155:24;6151:29;6141:40;6187:1;6183:11;;;6138:57;7310:78;;6511:887;;6538:608;5459:1;5452:14;;;5496:4;5483:18;;-1:-1:-1;;6574:17:1;;;6689:229;6703:7;6700:1;6697:14;6689:229;;;6792:19;;;6779:33;6764:49;;6899:4;6884:20;;;;6852:1;6840:14;;;;6719:12;6689:229;;;6693:3;6946;6937:7;6934:16;6931:159;;;7070:1;7066:6;7060:3;7054;7051:1;7047:11;7043:21;7039:34;7035:39;7022:9;7017:3;7013:19;7000:33;6996:79;6988:6;6981:95;6931:159;;;7133:1;7127:3;7124:1;7120:11;7116:19;7110:4;7103:33;6511:887;;6206:1198;;;:::o;7409:341::-;7611:2;7593:21;;;7650:2;7630:18;;;7623:30;-1:-1:-1;;;7684:2:1;7669:18;;7662:47;7741:2;7726:18;;7409:341::o;7755:1188::-;8032:3;8061:1;8094:6;8088:13;8124:36;8150:9;8124:36;:::i;:::-;8179:1;8196:17;;;8222:133;;;;8369:1;8364:358;;;;8189:533;;8222:133;-1:-1:-1;;8255:24:1;;8243:37;;8328:14;;8321:22;8309:35;;8300:45;;;-1:-1:-1;8222:133:1;;8364:358;8395:6;8392:1;8385:17;8425:4;8470;8467:1;8457:18;8497:1;8511:165;8525:6;8522:1;8519:13;8511:165;;;8603:14;;8590:11;;;8583:35;8646:16;;;;8540:10;;8511:165;;;8515:3;;;8705:6;8700:3;8696:16;8689:23;;8189:533;;;;;8753:6;8747:13;8769:68;8828:8;8823:3;8816:4;8808:6;8804:17;8769:68;:::i;:::-;-1:-1:-1;;;8859:18:1;;8886:22;;;8935:1;8924:13;;7755:1188;-1:-1:-1;;;;7755:1188:1:o;8948:201::-;8986:3;9014:10;9059:2;9052:5;9048:14;9086:2;9077:7;9074:15;9071:41;;9092:18;;:::i;:::-;9141:1;9128:15;;8948:201;-1:-1:-1;;;8948:201:1:o;9154:127::-;9215:10;9210:3;9206:20;9203:1;9196:31;9246:4;9243:1;9236:15;9270:4;9267:1;9260:15
Swarm Source
ipfs://01d04e87079acb73f34b741a7836210b81908c445c0134d1742512f0580c465f
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.