Feature Tip: Add private address tag to any address under My Name Tag !
ERC-20
Overview
Max Total Supply
250 DN404K
Holders
81
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
0.000000000000000001 DN404KValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
DN404Keys
Compiler Version
v0.8.24+commit.e11b9ed9
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2024-02-12 */ // File: solady/utils/LibString.sol 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) } } } // File: solady/auth/Ownable.sol 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(); _; } } // File: DN404Mirror.sol pragma solidity ^0.8.0; /// @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 */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ event Approval(address indexed owner, address indexed spender, uint256 indexed id); event Transfer(address indexed from, address indexed to, uint256 indexed id); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`. uint256 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CUSTOM ERRORS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Thrown when a call for an NFT function did not originate /// from the base DN404 contract. error Unauthorized(); /// @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 rootERC20 address when a link has not /// been established. error NotLinked(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct contain the NFT mirror contract storage. struct DN404NFTStorage { address rootERC20; address deployer; } /// @dev Returns a storage pointer for DN404NFTStorage. function _getDN404NFTStorage() internal pure returns (DN404NFTStorage storage $) { /// @solidity memory-safe-assembly assembly { // keccak256(abi.encode(uint256(keccak256("dn404.nft")) - 1)) & ~bytes32(uint256(0xff)) $.slot := 0xe8cb618a1de8ad2a6a7b358523c369cb09f40cc15da64205134c7e55c6a86700 } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTRUCTOR */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ constructor(address deployer) { // For non-proxies, we will store the deployer so that only the deployer can // link the root 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 root = rootERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(result, 0x06fdde03) // `name()`. if iszero(staticcall(gas(), root, add(result, 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 root = rootERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(result, 0x95d89b41) // `symbol()`. if iszero(staticcall(gas(), root, add(result, 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 root = rootERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(result, 0xc87b56dd) // `tokenURI()`. mstore(add(result, 0x20), id) if iszero(staticcall(gas(), root, add(result, 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 returns (uint256 result) { address root = rootERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0xe2c79281) // `totalNFTSupply()`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), root, 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 root = rootERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0xf5b100ea) // `balanceOfNFT(address)`. mstore(0x20, shr(96, shl(96, owner))) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), root, 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 root = rootERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x6352211e) // `ownerOf(uint256)`. mstore(0x20, id) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), root, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, shl(96, mload(0x00))) } } /// @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 root = rootERC20(); address owner; /// @solidity memory-safe-assembly assembly { let m := mload(0x40) mstore(0x00, 0xd10b6e0c) // `approveNFT(address,uint256,address)`. mstore(0x20, shr(96, shl(96, spender))) mstore(0x40, id) mstore(0x60, caller()) if iszero( and( gt(returndatasize(), 0x1f), call(gas(), root, 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. owner := shr(96, shl(96, mload(0x00))) } emit Approval(owner, 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 root = rootERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x081812fc) // `getApproved(uint256)`. mstore(0x20, id) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), root, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, shl(96, mload(0x00))) } } /// @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 root = rootERC20(); /// @solidity memory-safe-assembly assembly { let m := mload(0x40) mstore(0x00, 0x813500fc) // `setApprovalForAll(address,bool,address)`. mstore(0x20, shr(96, shl(96, operator))) mstore(0x40, iszero(iszero(approved))) mstore(0x60, caller()) if iszero( and( and(eq(mload(0x00), 1), gt(returndatasize(), 0x1f)), call(gas(), root, 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 ApprovalForAll(msg.sender, operator, approved); } /// @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 root = rootERC20(); /// @solidity memory-safe-assembly assembly { let m := mload(0x40) mstore(0x00, 0xe985e9c5) // `isApprovedForAll(address,address)`. mstore(0x20, shr(96, shl(96, owner))) mstore(0x40, shr(96, shl(96, operator))) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), root, 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 root = rootERC20(); /// @solidity memory-safe-assembly assembly { let m := mload(0x40) mstore(m, 0xe5eb36c8) // `transferFromNFT(address,address,uint256,address)`. mstore(add(m, 0x20), shr(96, shl(96, from))) mstore(add(m, 0x40), shr(96, shl(96, to))) mstore(add(m, 0x60), id) mstore(add(m, 0x80), caller()) if iszero( and( and(eq(mload(0x00), 1), gt(returndatasize(), 0x1f)), call(gas(), root, callvalue(), add(m, 0x1c), 0x84, 0x00, 0x20) ) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } } emit Transfer(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)) } } /// @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) } } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the base DN404 contract. function rootERC20() public view returns (address root) { root = _getDN404NFTStorage().rootERC20; if (root == 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 != $.rootERC20) revert Unauthorized(); /// @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 Unauthorized(); } } if ($.rootERC20 != address(0)) revert AlreadyLinked(); $.rootERC20 = 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 {} /// @dev Returns the calldata value at `offset`. function _calldataload(uint256 offset) private pure returns (uint256 value) { /// @solidity memory-safe-assembly assembly { value := calldataload(offset) } } } // File: solady/utils/LibMap.sol 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) } } } // File: DN404.sol 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 { using LibMap for *; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* 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 attempt to initialize the contract when it has already been initialized. 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 InvalidTotalNFTSupply(); /// @dev Thrown when a call for an NFT function did not originate from the mirror contract. error UnauthorizedSender(); /// @dev Thrown when attempting to transfer tokens to the zero address. error TransferToZeroAddress(); /// @dev Thrown when initializing the contract and mirror address is provided as 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 NFT that does not exist. error TokenDoesNotExist(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTANTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Amount of token balance that is equal to one NFT. uint256 private constant _WAD = 1000000000000000000; /// @dev The maximum tokenId allowed for an NFT. uint256 private constant _MAX_TOKEN_ID = 0xffffffff; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct containing an address's token data and settings. struct AddressData { // Set true when address data storage has been initialized. bool initialized; // If the account should skip NFT minting. bool skipNFT; // 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 Struct containing the base token contract storage. struct DN404Storage { // Current number of address aliases assigned. uint32 numAliases; // Next tokenId to assign for an NFT mint. uint32 nextTokenId; // Total supply of minted NFTs. uint32 totalNFTSupply; // Total supply of tokens. uint96 totalTokenSupply; // 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 tokenIds owned by an address. mapping(address => LibMap.Uint32Map) owned; // Even indices: owner aliases. Odd indices: owned indices. LibMap.Uint32Map oo; // Mapping of user account AddressData mapping(address => AddressData) addressData; } /// @dev Returns a storage pointer for DN404Storage. function _getDN404Storage() internal pure returns (DN404Storage storage $) { /// @solidity memory-safe-assembly assembly { // keccak256(abi.encode(uint256(keccak256("dn404")) - 1)) & ~bytes32(uint256(0xff)) $.slot := 0x61dd0d320a11019af7688ced18637b1235059a4e8141ed71cfccbe9f2da16600 } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INITIALIZER */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Initializes the DN404 contract with an `initialTokenSupply`, `initialTokenOwner` and `mirror` NFT contract address. function _initializeDN404(uint96 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 / _WAD > _MAX_TOKEN_ID - 1) revert InvalidTotalNFTSupply(); $.totalTokenSupply = initialTokenSupply; AddressData storage initialOwnerAddressData = _addressData(initialSupplyOwner); initialOwnerAddressData.balance = initialTokenSupply; emit Transfer(address(0), initialSupplyOwner, initialTokenSupply); _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); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ERC20 OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the decimals places of the token. 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().totalTokenSupply); } /// @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) { _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 (allowed != type(uint256).max) { if (amount > allowed) revert InsufficientAllowance(); unchecked { $.allowance[from][msg.sender] = allowed - amount; } } _transfer(from, to, amount); return true; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* SHARED TRANSFER OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @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`, tokenId `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( and(eq(mload(0x00), 1), gt(returndatasize(), 0x1f)), call(gas(), mirror, 0, add(o, 0x1c), n, 0x00, 0x20) ) ) { revert(0x00, 0x00) } } } /// @dev Struct of temporary variables for transfers. struct _TransferTemps { uint256 nftAmountToBurn; uint256 nftAmountToMint; uint256 fromBalance; uint256 toBalance; uint256 fromOwnedLength; uint256 toOwnedLength; } /// @dev You can override to return a pseudorandom value to skip /// taking token IDs from the burned stack probabilistically. function _skipBurnedStack(uint256) internal pure virtual returns (bool) { return false; } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* 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 { if (to == address(0)) revert TransferToZeroAddress(); DN404Storage storage $ = _getDN404Storage(); AddressData storage toAddressData = _addressData(to); unchecked { uint256 currentTokenSupply = uint256($.totalTokenSupply) + amount; if (currentTokenSupply / _WAD > _MAX_TOKEN_ID - 1) revert InvalidTotalNFTSupply(); $.totalTokenSupply = uint96(currentTokenSupply); uint256 toBalance = toAddressData.balance + amount; toAddressData.balance = uint96(toBalance); if (!toAddressData.skipNFT) { LibMap.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 = $.totalTokenSupply / _WAD; uint32 toAlias = _registerAndResolveAlias(toAddressData, to); uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(packedLogs.logs.length); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while ($.oo.get(_ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } toOwned.set(toIndex, uint32(id)); $.oo.set(_ownershipIndex(id), toAlias); $.oo.set(_ownedIndex(id), 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 { DN404Storage storage $ = _getDN404Storage(); AddressData storage fromAddressData = _addressData(from); uint256 fromBalance = fromAddressData.balance; if (amount > fromBalance) revert InsufficientBalance(); uint256 currentTokenSupply = $.totalTokenSupply; unchecked { fromBalance -= amount; fromAddressData.balance = uint96(fromBalance); currentTokenSupply -= amount; $.totalTokenSupply = uint96(currentTokenSupply); LibMap.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 = fromOwned.get(--fromIndex); $.oo.set(_ownedIndex(id), 0); $.oo.set(_ownershipIndex(id), 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 { 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.skipNFT) { t.nftAmountToMint = _zeroFloorSub(t.toBalance / _WAD, t.toOwnedLength); } _PackedLogs memory packedLogs = _packedLogsMalloc(t.nftAmountToBurn + t.nftAmountToMint); if (t.nftAmountToBurn != 0) { LibMap.Uint32Map storage fromOwned = $.owned[from]; uint256 fromIndex = t.fromOwnedLength; uint256 fromEnd = fromIndex - t.nftAmountToBurn; $.totalNFTSupply -= uint32(t.nftAmountToBurn); // Burn loop. do { uint256 id = fromOwned.get(--fromIndex); $.oo.set(_ownedIndex(id), 0); $.oo.set(_ownershipIndex(id), 0); delete $.tokenApprovals[id]; _packedLogsAppend(packedLogs, from, id, 1); } while (fromIndex != fromEnd); fromAddressData.ownedLength = uint32(fromIndex); } if (t.nftAmountToMint != 0) { LibMap.Uint32Map storage toOwned = $.owned[to]; uint256 toIndex = t.toOwnedLength; uint256 toEnd = toIndex + t.nftAmountToMint; uint32 toAlias = _registerAndResolveAlias(toAddressData, to); uint256 maxNFTId = $.totalTokenSupply / _WAD; uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(t.nftAmountToMint); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while ($.oo.get(_ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } toOwned.set(toIndex, uint32(id)); $.oo.set(_ownershipIndex(id), toAlias); $.oo.set(_ownedIndex(id), 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[$.oo.get(_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); $.oo.set(_ownershipIndex(id), _registerAndResolveAlias(toAddressData, to)); delete $.tokenApprovals[id]; uint256 updatedId = $.owned[from].get(--fromAddressData.ownedLength); $.owned[from].set($.oo.get(_ownedIndex(id)), uint32(updatedId)); uint256 n = toAddressData.ownedLength++; $.oo.set(_ownedIndex(updatedId), $.oo.get(_ownedIndex(id))); $.owned[to].set(n, uint32(id)); $.oo.set(_ownedIndex(id), uint32(n)); } emit Transfer(from, to, _WAD); } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* 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]; return d.initialized ? d.skipNFT : _hasCode(a); } /// @dev Sets the caller's skipNFT flag to `skipNFT` /// /// Emits a {SkipNFTSet} event. function setSkipNFT(bool skipNFT) public { _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 { _addressData(a).skipNFT = state; 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 returns (AddressData storage d) { DN404Storage storage $ = _getDN404Storage(); d = $.addressData[a]; if (!d.initialized) { d.initialized = true; if (_hasCode(a)) d.skipNFT = true; } } /// @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 `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 returns (uint32 addressAlias) { DN404Storage storage $ = _getDN404Storage(); addressAlias = toAddressData.addressAlias; if (addressAlias == 0) { addressAlias = ++$.numAliases; toAddressData.addressAlias = addressAlias; $.aliasToAddress[addressAlias] = to; } } /// @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; } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the mirror NFT contract. function mirrorERC721() public view 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[$.oo.get(_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 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 returns (address) { DN404Storage storage $ = _getDN404Storage(); address owner = $.aliasToAddress[$.oo.get(_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 { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x0f4599e5) // `linkMirrorContract(address)`. mstore(0x20, caller()) if iszero( and( and(eq(mload(0x00), 1), eq(returndatasize(), 0x20)), 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 UnauthorizedSender(); 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 UnauthorizedSender(); 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 UnauthorizedSender(); 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 UnauthorizedSender(); 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 UnauthorizedSender(); 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 UnauthorizedSender(); if (msg.data.length < 0x24) revert(); uint256 id = _calldataload(0x04); _return(uint160(_getApproved(id))); } // `balanceOfNFT(address)`. if (fnSelector == 0xf5b100ea) { if (msg.sender != $.mirrorERC721) revert UnauthorizedSender(); if (msg.data.length < 0x24) revert(); address owner = address(uint160(_calldataload(0x04))); _return(_balanceOfNFT(owner)); } // `totalNFTSupply()`. if (fnSelector == 0xe2c79281) { if (msg.sender != $.mirrorERC721) revert UnauthorizedSender(); 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 {} /// @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) } } } // File: DN404Keys.sol /* ,--. ,--, ,--, ,---, ,--.'| ,--.'| ,----.. ,--.'| .' .' `\ ,--,: : | ,--, | : / / \ ,--, | : ,---.' \ ,`--.'`| ' :,---.'| : ' / . : ,---.'| : ' | | .`\ || : : | |; : | | ; . / ;. \; : | | ; : : | ' |: | \ | :| | : _' |. ; / ` ;| | : _' | | ' ' ; :| : ' '; |: : |.' |; | ; \ ; |: : |.' | ' | ; . |' ' ;. ;| ' ' ; :| : | ; | '| ' ' ; : | | : | '| | | \ |\ \ .'. |. | ' ' ' :\ \ .'. | ' : | / ; ' : | ; .' `---`: | '' ; \; / | `---`: | ' | | '` ,/ | | '`--' ' ; | \ \ ', / ' ; | ; : .' ' : | | : ; ; : / | : ; | ,.' ; |.' ' ,/ \ \ .' ' ,/ '---' '---' '--' `---` '--' 8 8 ,o. ,o. 8 8 d8o8azzzzzzzzd b d bzzzzzzzza8o8b `o' `o' 8 8 8 8 ,ooo. 8a8 8a8 oP ?b d888a888zzzzzzzzzzzzzzzzzzzz8 8b `""^""' ?o___oP' DN404 Keys One of the first tokens on the Divisible NFT standard DN404 82 101 118 101 97 108 32 97 110 100 32 115 111 99 105 97 108 115 32 116 111 32 99 111 109 101 32 115 111 111 110 44 32 115 116 97 121 32 116 117 110 101 100 32 102 111 114 32 109 97 103 105 99 97 108 32 116 104 105 110 103 115 33 */ pragma solidity ^0.8.0; contract DN404Keys is DN404, Ownable { string private _name; string private _symbol; string private _baseURI; DN404Mirror private _mirror; error TransferFailed(); constructor( string memory name_, string memory symbol_, uint96 initialTokenSupply, address initialSupplyOwner, address mirrorAddress ) { _initializeOwner(msg.sender); _name = name_; _symbol = symbol_; _initializeDN404(initialTokenSupply, initialSupplyOwner, address(mirrorAddress)); } function name() public view override returns (string memory) { return _name; } function symbol() public view override returns (string memory) { return _symbol; } function setBaseURI(string calldata baseURI_) public onlyOwner { _baseURI = baseURI_; } function tokenURI(uint256 tokenId) public view override returns (string memory) { return bytes(_baseURI).length != 0 ? string(abi.encodePacked(_baseURI, LibString.toString(tokenId))) : ""; } function setSkipNFTByOwner(address a, bool state) public onlyOwner { _setSkipNFT(a, state); } function withdraw() external onlyOwner { (bool success,) = msg.sender.call{value: address(this).balance}(""); if (!success) revert TransferFailed(); } }
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"},{"internalType":"address","name":"mirrorAddress","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":"InvalidTotalNFTSupply","type":"error"},{"inputs":[],"name":"LinkMirrorContractFailed","type":"error"},{"inputs":[],"name":"MirrorAddressIsZero","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"UnauthorizedSender","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":"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":"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":"a","type":"address"}],"name":"getSkipNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[{"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":[{"internalType":"address","name":"a","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"setSkipNFTByOwner","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":"","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":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801562000010575f80fd5b50604051620024f6380380620024f68339810160408190526200003391620004af565b6200003e3362000073565b5f6200004b8682620005da565b5060016200005a8582620005da565b5062000068838383620000af565b5050505050620006ec565b6001600160a01b0316638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a35b50565b7f61dd0d320a11019af7688ced18637b1235059a4e8141ed71cfccbe9f2da166008054640100000000900463ffffffff1615620000ff57604051633ab534b960e21b815260040160405180910390fd5b6001600160a01b03821662000127576040516339a84a7b60e01b815260040160405180910390fd5b6200013282620002a9565b805463ffffffff60201b19166401000000001781556001810180546001600160a01b0384166001600160a01b03199091161790556001600160601b03841615620002a3576001600160a01b0383166200019e57604051633a954ecd60e21b815260040160405180910390fd5b620001af600163ffffffff620006a6565b620001cc670de0b6b3a76400006001600160601b038716620006cc565b1115620001ec57604051632cfb9d3360e11b815260040160405180910390fd5b8054600160601b600160c01b0319166c010000000000000000000000006001600160601b038616021781555f6200022384620002dc565b8054600160501b600160b01b0319166a01000000000000000000006001600160601b0388169081029190911782556040519081529091506001600160a01b038516905f907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3620002a18460016200036c565b505b50505050565b630f4599e55f523360205260205f6024601c5f855af160203d1460015f51141616620000ac5763d125259c5f526004601cfd5b6001600160a01b0381165f9081527f61dd0d320a11019af7688ced18637b1235059a4e8141ed71cfccbe9f2da166086020526040902080547f61dd0d320a11019af7688ced18637b1235059a4e8141ed71cfccbe9f2da166009060ff166200036657815460ff1916600117825562000352833b90565b156200036657815461ff0019166101001782555b50919050565b806200037883620002dc565b80549115156101000261ff001990921691909117905560405181151581526001600160a01b038316907fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d64203939060200160405180910390a25050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112620003f6575f80fd5b81516001600160401b0380821115620004135762000413620003d2565b604051601f8301601f19908116603f011681019082821181831017156200043e576200043e620003d2565b81604052838152602092508660208588010111156200045b575f80fd5b5f91505b838210156200047e57858201830151818301840152908201906200045f565b5f602085830101528094505050505092915050565b80516001600160a01b0381168114620004aa575f80fd5b919050565b5f805f805f60a08688031215620004c4575f80fd5b85516001600160401b0380821115620004db575f80fd5b620004e989838a01620003e6565b96506020880151915080821115620004ff575f80fd5b506200050e88828901620003e6565b604088015190955090506001600160601b03811681146200052d575f80fd5b92506200053d6060870162000493565b91506200054d6080870162000493565b90509295509295909350565b600181811c908216806200056e57607f821691505b6020821081036200036657634e487b7160e01b5f52602260045260245ffd5b601f821115620005d557805f5260205f20601f840160051c81016020851015620005b45750805b601f840160051c820191505b81811015620002a1575f8155600101620005c0565b505050565b81516001600160401b03811115620005f657620005f6620003d2565b6200060e8162000607845462000559565b846200058d565b602080601f83116001811462000644575f84156200062c5750858301515b5f19600386901b1c1916600185901b1785556200069e565b5f85815260208120601f198616915b82811015620006745788860151825594840194600190910190840162000653565b50858210156200069257878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b81810381811115620006c657634e487b7160e01b5f52601160045260245ffd5b92915050565b5f82620006e757634e487b7160e01b5f52601260045260245ffd5b500490565b611dfc80620006fa5f395ff3fe608060405260043610610143575f3560e01c806355f804b3116100b5578063a9059cbb1161006e578063a9059cbb14610672578063c87b56dd14610691578063dd62ed3e146106b0578063f04e283e146106cf578063f2fde38b146106e2578063fee81cf4146106f55761014a565b806355f804b3146105e157806370a0823114610600578063715018a61461061f5780638a834744146106275780638da5cb5b1461064657806395d89b411461065e5761014a565b8063274e430b11610107578063274e430b146105405780632a6a935d1461055f578063313ce5671461057e5780633ccfd60b146105995780634ef41efc146105ad57806354d1f13d146105d95761014a565b806306fdde031461049e578063095ea7b3146104c857806318160ddd146104f757806323b872dd1461051957806325692962146105385761014a565b3661014a57005b5f610153610726565b90505f3560e01c63e985e9c58190036101ed5760018201546001600160a01b0316331461019357604051630101292160e31b815260040160405180910390fd5b60443610156101a0575f80fd5b6004356001600160a01b038181165f908152600385016020908152604080832060243594851684529091529020546101ea9060ff166101df575f6101e2565b60015b60ff1661074a565b50505b80636352211e036102515760018201546001600160a01b0316331461022557604051630101292160e31b815260040160405180910390fd5b6024361015610232575f80fd5b60043561024f61024182610752565b6001600160a01b031661074a565b505b8063e5eb36c8036102bd5760018201546001600160a01b0316331461028957604051630101292160e31b815260040160405180910390fd5b6084361015610296575f80fd5b6004356024356044356064356102ae84848484610788565b6102b8600161074a565b505050505b8063813500fc036103265760018201546001600160a01b031633146102f557604051630101292160e31b815260040160405180910390fd5b6064361015610302575f80fd5b6004356024351515604435610318838383610b3f565b610322600161074a565b5050505b8063d10b6e0c036103865760018201546001600160a01b0316331461035e57604051630101292160e31b815260040160405180910390fd5b606436101561036b575f80fd5b600435602435604435610382610241848484610b86565b5050505b8063081812fc036103dc5760018201546001600160a01b031633146103be57604051630101292160e31b815260040160405180910390fd5b60243610156103cb575f80fd5b6004356103da61024182610c4c565b505b8063f5b100ea036104375760018201546001600160a01b0316331461041457604051630101292160e31b815260040160405180910390fd5b6024361015610421575f80fd5b60043561043561043082610c97565b61074a565b505b8063e2c79281036104875760018201546001600160a01b0316331461046f57604051630101292160e31b815260040160405180910390fd5b600436101561047c575f80fd5b610487610430610cce565b8063b7a94eb80361049c5761049c600161074a565b005b3480156104a9575f80fd5b506104b2610cea565b6040516104bf91906119c3565b60405180910390f35b3480156104d3575f80fd5b506104e76104e2366004611a10565b610d79565b60405190151581526020016104bf565b348015610502575f80fd5b5061050b610deb565b6040519081526020016104bf565b348015610524575f80fd5b506104e7610533366004611a38565b610e0a565b61049c610ea6565b34801561054b575f80fd5b506104e761055a366004611a71565b610ef3565b34801561056a575f80fd5b5061049c610579366004611a99565b610f3d565b348015610589575f80fd5b50604051601281526020016104bf565b3480156105a4575f80fd5b5061049c610f4a565b3480156105b8575f80fd5b506105c1610fb8565b6040516001600160a01b0390911681526020016104bf565b61049c610fd3565b3480156105ec575f80fd5b5061049c6105fb366004611ab2565b61100c565b34801561060b575f80fd5b5061050b61061a366004611a71565b611026565b61049c611060565b348015610632575f80fd5b5061049c610641366004611b1e565b611073565b348015610651575f80fd5b50638b78c6d819546105c1565b348015610669575f80fd5b506104b2611089565b34801561067d575f80fd5b506104e761068c366004611a10565b611098565b34801561069c575f80fd5b506104b26106ab366004611b4f565b6110ad565b3480156106bb575f80fd5b5061050b6106ca366004611b66565b611109565b61049c6106dd366004611a71565b611141565b61049c6106f0366004611a71565b61117b565b348015610700575f80fd5b5061050b61070f366004611a71565b63389a75e1600c9081525f91909152602090205490565b7f61dd0d320a11019af7688ced18637b1235059a4e8141ed71cfccbe9f2da1660090565b805f5260205ff35b5f61075c826111a1565b6107795760405163677510db60e11b815260040160405180910390fd5b610782826111bd565b92915050565b5f610791610726565b90506001600160a01b0384166107ba57604051633a954ecd60e21b815260040160405180910390fd5b5f816002015f6107ef6107cd8760011b90565b600381901c5f90815260078701602052604090205460059190911b60e0161c90565b63ffffffff16815260208101919091526040015f20546001600160a01b039081169150861681146108325760405162a1148160e81b815260040160405180910390fd5b856001600160a01b0316836001600160a01b0316146108b4576001600160a01b038087165f90815260038401602090815260408083209387168352929052205460ff166108b4575f8481526004830160205260409020546001600160a01b038481169116146108b457604051632ce44b5f60e11b815260040160405180910390fd5b5f6108be87611245565b90505f6108ca87611245565b8254909150670de0b6b3a7640000908390600a906108f9908490600160501b90046001600160601b0316611ba2565b82546101009290920a6001600160601b0381810219909316918316021790915582546bffffffffffffffffffffffff60501b198116670de0b6b3a7640000600160501b928390048416019092160217825550610968600187901b61095d838a6112a3565b600787019190611344565b5f868152600485016020908152604080832080546001600160a01b0319169055845463ffffffff60301b198116600160301b9182900463ffffffff9081165f190181169283029190911787556001600160a01b038d168552600689019093529083206109d79290919061122316565b63ffffffff169050610a3b610a10600189811b01600381901c5f90815260078901602052604090205460e060059290921b919091161c90565b6001600160a01b038b165f90815260068801602052604090209063ffffffff90811690849061134416565b8154600163ffffffff600160301b80840482169283019091160263ffffffff60301b19909216919091178355610aa7610a7783600190811b0190565b60018a811b01600381901c5f90815260078a01602052604090205460059190911b60e0161c600789019190611344565b6001600160a01b0389165f9081526006870160205260409020610acb90828a611344565b610ade6007870160018a811b0183611344565b5050866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef670de0b6b3a7640000604051610b2d91815260200190565b60405180910390a35050505050505050565b81610b48610726565b6001600160a01b039283165f90815260039190910160209081526040808320969094168252949094529220805460ff19169215159290921790915550565b5f80610b90610726565b90505f816002015f610ba56107cd8860011b90565b63ffffffff16815260208101919091526040015f20546001600160a01b03908116915084168114610c17576001600160a01b038082165f90815260038401602090815260408083209388168352929052205460ff16610c17576040516367d9dca160e11b815260040160405180910390fd5b5f8581526004909201602052604090912080546001600160a01b0387166001600160a01b031990911617905590509392505050565b5f610c56826111a1565b610c735760405163677510db60e11b815260040160405180910390fd5b610c7b610726565b5f9283526004016020525060409020546001600160a01b031690565b5f610ca0610726565b6001600160a01b03929092165f9081526008909201602052506040902054600160301b900463ffffffff1690565b5f610cd7610726565b54600160401b900463ffffffff16919050565b60605f8054610cf890611bc2565b80601f0160208091040260200160405190810160405280929190818152602001828054610d2490611bc2565b8015610d6f5780601f10610d4657610100808354040283529160200191610d6f565b820191905f5260205f20905b815481529060010190602001808311610d5257829003601f168201915b5050505050905090565b5f80610d83610726565b335f81815260058301602090815260408083206001600160a01b038a16808552908352928190208890555187815293945090927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b5f610df4610726565b54600160601b90046001600160601b0316919050565b5f80610e14610726565b6001600160a01b0386165f90815260058201602090815260408083203384529091529020549091505f198114610e8f5780841115610e65576040516313be252b60e01b815260040160405180910390fd5b6001600160a01b0386165f9081526005830160209081526040808320338452909152902084820390555b610e9a868686611376565b50600195945050505050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f80610efd610726565b6001600160a01b0384165f90815260089190910160205260409020805490915060ff16610f2b57823b610f36565b8054610100900460ff165b9392505050565b610f473382611862565b50565b610f526118c6565b6040515f90339047908381818185875af1925050503d805f8114610f91576040519150601f19603f3d011682016040523d82523d5f602084013e610f96565b606091505b5050905080610f47576040516312171d8360e31b815260040160405180910390fd5b5f610fc1610726565b600101546001600160a01b0316919050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b6110146118c6565b6002611021828483611c53565b505050565b5f61102f610726565b6001600160a01b03929092165f9081526008909201602052506040902054600160501b90046001600160601b031690565b6110686118c6565b6110715f6118e0565b565b61107b6118c6565b6110858282611862565b5050565b606060018054610cf890611bc2565b5f6110a4338484611376565b50600192915050565b6060600280546110bc90611bc2565b90505f036110d85760405180602001604052805f815250610782565b60026110e38361191d565b6040516020016110f4929190611d0d565b60405160208183030381529060405292915050565b5f611112610726565b6001600160a01b039384165f908152600591909101602090815260408083209490951682529290925250205490565b6111496118c6565b63389a75e1600c52805f526020600c20805442111561116f57636f5e88185f526004601cfd5b5f9055610f47816118e0565b6111836118c6565b8060601b61119857637448fbae5f526004601cfd5b610f47816118e0565b5f806111ac836111bd565b6001600160a01b0316141592915050565b5f806111c7610726565b9050806002015f6111fd6111db8660011b90565b600381901c5f90815260078601602052604090205460059190911b60e0161c90565b63ffffffff16815260208101919091526040015f20546001600160a01b03169392505050565b600381901c5f90815260209290925260409091205460059190911b60e0161c90565b5f8061124f610726565b6001600160a01b0384165f9081526008820160205260409020805490935090915060ff1661129d57815460ff1916600117825561128a833b90565b1561129d57815461ff0019166101001782555b50919050565b5f806112ad610726565b845462010000900463ffffffff16925090505f82900361133d57805481905f906112dc9063ffffffff16611d90565b825463ffffffff8083166101009490940a84810291021990911617909255855462010000820265ffffffff0000199091161786555f908152600283016020526040902080546001600160a01b0386166001600160a01b031990911617905591505b5092915050565b826020528160031c5f5260405f206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b6001600160a01b03821661139d57604051633a954ecd60e21b815260040160405180910390fd5b5f6113a6610726565b90505f6113b285611245565b90505f6113be85611245565b90506113f36040518060c001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b825463ffffffff600160301b808304821660808501528454041660a08301526001600160601b03600160501b909104166040820181905285111561144a57604051631e9acf1760e31b815260040160405180910390fd5b6040810180518690039081905283546001600160601b03808316600160501b9081026bffffffffffffffffffffffff60501b19938416178755855481810483168a016060870181905290921602911617835560808201516114b991670de0b6b3a7640000900480821191030290565b81528154610100900460ff166114fc576114f6670de0b6b3a76400008260600151816114e7576114e7611db2565b048260a0015180821191030290565b60208201525b5f6115438260200151835f01510160408051808201909152606081525f60208201526040805101828152806020018360051b81016040528183528083602001525050919050565b82519091501561164f576001600160a01b0388165f908152600686016020526040902060808301518351875463ffffffff600160401b80830482168490039091160263ffffffff60401b1990911617885581035b5f1991909101600381901c5f9081526020849052604081205491929160e0600585901b161c63ffffffff1690506115df6115d482600190811b0190565b60078b01905f611344565b6115ec6115d48260011b90565b5f81815260048a016020908152604090912080546001600160a01b0319169055858101805160089390931b60608f901b176001178352910190528082036115975750855463ffffffff909116600160301b0263ffffffff60301b19909116178555505b6020820151156117ea576001600160a01b0387165f9081526006860160209081526040822060a08501519185015190929082019061168d878c6112a3565b8954602088015163ffffffff60401b19821663ffffffff600160401b80850482169093018116909202178c55895463ffffffff60301b1916600160301b86831602178a55919250670de0b6b3a7640000600160601b82046001600160601b03160491640100000000909104165b6117296117078260011b90565b600381901c5f90815260078e01602052604090205460059190911b60e0161c90565b63ffffffff16156117485760010181811115611743575060015b6116fa565b611753868683611344565b61176b6117608260011b90565b60078d019085611344565b611784600182811b01600187019660078e019190611344565b6117ad878e835f8360200151818360081b8560601b171781526020810185602001525050505050565b600101818111156117bc575060015b8385036116fa578a5463ffffffff9091166401000000000267ffffffff0000000019909116178a5550505050505b8051511561180b57600185015461180b9082906001600160a01b031661195f565b50856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405161185191815260200190565b60405180910390a350505050505050565b8061186c83611245565b80549115156101000261ff001990921691909117905560405181151581526001600160a01b038316907fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d64203939060200160405180910390a25050565b638b78c6d819543314611071576382b429005f526004601cfd5b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b60606080604051019050602081016040525f8152805f19835b928101926030600a8206018453600a900480611936575050819003601f19909101908152919050565b81516040810363263c69d68152602080820152815160051b604401915060205f83601c84015f875af1601f3d1160015f5114161661199b575f80fd5b50505050565b5f5b838110156119bb5781810151838201526020016119a3565b50505f910152565b602081525f82518060208401526119e18160408501602087016119a1565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114611a0b575f80fd5b919050565b5f8060408385031215611a21575f80fd5b611a2a836119f5565b946020939093013593505050565b5f805f60608486031215611a4a575f80fd5b611a53846119f5565b9250611a61602085016119f5565b9150604084013590509250925092565b5f60208284031215611a81575f80fd5b610f36826119f5565b80358015158114611a0b575f80fd5b5f60208284031215611aa9575f80fd5b610f3682611a8a565b5f8060208385031215611ac3575f80fd5b823567ffffffffffffffff80821115611ada575f80fd5b818501915085601f830112611aed575f80fd5b813581811115611afb575f80fd5b866020828501011115611b0c575f80fd5b60209290920196919550909350505050565b5f8060408385031215611b2f575f80fd5b611b38836119f5565b9150611b4660208401611a8a565b90509250929050565b5f60208284031215611b5f575f80fd5b5035919050565b5f8060408385031215611b77575f80fd5b611b80836119f5565b9150611b46602084016119f5565b634e487b7160e01b5f52601160045260245ffd5b6001600160601b0382811682821603908082111561133d5761133d611b8e565b600181811c90821680611bd657607f821691505b60208210810361129d57634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b601f82111561102157805f5260205f20601f840160051c81016020851015611c2d5750805b601f840160051c820191505b81811015611c4c575f8155600101611c39565b5050505050565b67ffffffffffffffff831115611c6b57611c6b611bf4565b611c7f83611c798354611bc2565b83611c08565b5f601f841160018114611cb0575f8515611c995750838201355b5f19600387901b1c1916600186901b178355611c4c565b5f83815260208120601f198716915b82811015611cdf5786850135825560209485019460019092019101611cbf565b5086821015611cfb575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f808454611d1a81611bc2565b60018281168015611d325760018114611d4757611d73565b60ff1984168752821515830287019450611d73565b885f526020805f205f5b85811015611d6a5781548a820152908401908201611d51565b50505082870194505b505050508351611d878183602088016119a1565b01949350505050565b5f63ffffffff808316818103611da857611da8611b8e565b6001019392505050565b634e487b7160e01b5f52601260045260245ffdfea2646970667358221220b03c90715bb0712fda3786c2b9d4831452f774e86cb3f4d4e13e96d1e10f1b3064736f6c6343000818003300000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000d8d726b7177a80000000000000000000000000000baa168f8f58d656b1fe38c30b037777bca1c3094000000000000000000000000bd0f034b9ae5362e4ec321d05bd8fc78c874a92a000000000000000000000000000000000000000000000000000000000000000a444e343034204b657973000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006444e3430344b0000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405260043610610143575f3560e01c806355f804b3116100b5578063a9059cbb1161006e578063a9059cbb14610672578063c87b56dd14610691578063dd62ed3e146106b0578063f04e283e146106cf578063f2fde38b146106e2578063fee81cf4146106f55761014a565b806355f804b3146105e157806370a0823114610600578063715018a61461061f5780638a834744146106275780638da5cb5b1461064657806395d89b411461065e5761014a565b8063274e430b11610107578063274e430b146105405780632a6a935d1461055f578063313ce5671461057e5780633ccfd60b146105995780634ef41efc146105ad57806354d1f13d146105d95761014a565b806306fdde031461049e578063095ea7b3146104c857806318160ddd146104f757806323b872dd1461051957806325692962146105385761014a565b3661014a57005b5f610153610726565b90505f3560e01c63e985e9c58190036101ed5760018201546001600160a01b0316331461019357604051630101292160e31b815260040160405180910390fd5b60443610156101a0575f80fd5b6004356001600160a01b038181165f908152600385016020908152604080832060243594851684529091529020546101ea9060ff166101df575f6101e2565b60015b60ff1661074a565b50505b80636352211e036102515760018201546001600160a01b0316331461022557604051630101292160e31b815260040160405180910390fd5b6024361015610232575f80fd5b60043561024f61024182610752565b6001600160a01b031661074a565b505b8063e5eb36c8036102bd5760018201546001600160a01b0316331461028957604051630101292160e31b815260040160405180910390fd5b6084361015610296575f80fd5b6004356024356044356064356102ae84848484610788565b6102b8600161074a565b505050505b8063813500fc036103265760018201546001600160a01b031633146102f557604051630101292160e31b815260040160405180910390fd5b6064361015610302575f80fd5b6004356024351515604435610318838383610b3f565b610322600161074a565b5050505b8063d10b6e0c036103865760018201546001600160a01b0316331461035e57604051630101292160e31b815260040160405180910390fd5b606436101561036b575f80fd5b600435602435604435610382610241848484610b86565b5050505b8063081812fc036103dc5760018201546001600160a01b031633146103be57604051630101292160e31b815260040160405180910390fd5b60243610156103cb575f80fd5b6004356103da61024182610c4c565b505b8063f5b100ea036104375760018201546001600160a01b0316331461041457604051630101292160e31b815260040160405180910390fd5b6024361015610421575f80fd5b60043561043561043082610c97565b61074a565b505b8063e2c79281036104875760018201546001600160a01b0316331461046f57604051630101292160e31b815260040160405180910390fd5b600436101561047c575f80fd5b610487610430610cce565b8063b7a94eb80361049c5761049c600161074a565b005b3480156104a9575f80fd5b506104b2610cea565b6040516104bf91906119c3565b60405180910390f35b3480156104d3575f80fd5b506104e76104e2366004611a10565b610d79565b60405190151581526020016104bf565b348015610502575f80fd5b5061050b610deb565b6040519081526020016104bf565b348015610524575f80fd5b506104e7610533366004611a38565b610e0a565b61049c610ea6565b34801561054b575f80fd5b506104e761055a366004611a71565b610ef3565b34801561056a575f80fd5b5061049c610579366004611a99565b610f3d565b348015610589575f80fd5b50604051601281526020016104bf565b3480156105a4575f80fd5b5061049c610f4a565b3480156105b8575f80fd5b506105c1610fb8565b6040516001600160a01b0390911681526020016104bf565b61049c610fd3565b3480156105ec575f80fd5b5061049c6105fb366004611ab2565b61100c565b34801561060b575f80fd5b5061050b61061a366004611a71565b611026565b61049c611060565b348015610632575f80fd5b5061049c610641366004611b1e565b611073565b348015610651575f80fd5b50638b78c6d819546105c1565b348015610669575f80fd5b506104b2611089565b34801561067d575f80fd5b506104e761068c366004611a10565b611098565b34801561069c575f80fd5b506104b26106ab366004611b4f565b6110ad565b3480156106bb575f80fd5b5061050b6106ca366004611b66565b611109565b61049c6106dd366004611a71565b611141565b61049c6106f0366004611a71565b61117b565b348015610700575f80fd5b5061050b61070f366004611a71565b63389a75e1600c9081525f91909152602090205490565b7f61dd0d320a11019af7688ced18637b1235059a4e8141ed71cfccbe9f2da1660090565b805f5260205ff35b5f61075c826111a1565b6107795760405163677510db60e11b815260040160405180910390fd5b610782826111bd565b92915050565b5f610791610726565b90506001600160a01b0384166107ba57604051633a954ecd60e21b815260040160405180910390fd5b5f816002015f6107ef6107cd8760011b90565b600381901c5f90815260078701602052604090205460059190911b60e0161c90565b63ffffffff16815260208101919091526040015f20546001600160a01b039081169150861681146108325760405162a1148160e81b815260040160405180910390fd5b856001600160a01b0316836001600160a01b0316146108b4576001600160a01b038087165f90815260038401602090815260408083209387168352929052205460ff166108b4575f8481526004830160205260409020546001600160a01b038481169116146108b457604051632ce44b5f60e11b815260040160405180910390fd5b5f6108be87611245565b90505f6108ca87611245565b8254909150670de0b6b3a7640000908390600a906108f9908490600160501b90046001600160601b0316611ba2565b82546101009290920a6001600160601b0381810219909316918316021790915582546bffffffffffffffffffffffff60501b198116670de0b6b3a7640000600160501b928390048416019092160217825550610968600187901b61095d838a6112a3565b600787019190611344565b5f868152600485016020908152604080832080546001600160a01b0319169055845463ffffffff60301b198116600160301b9182900463ffffffff9081165f190181169283029190911787556001600160a01b038d168552600689019093529083206109d79290919061122316565b63ffffffff169050610a3b610a10600189811b01600381901c5f90815260078901602052604090205460e060059290921b919091161c90565b6001600160a01b038b165f90815260068801602052604090209063ffffffff90811690849061134416565b8154600163ffffffff600160301b80840482169283019091160263ffffffff60301b19909216919091178355610aa7610a7783600190811b0190565b60018a811b01600381901c5f90815260078a01602052604090205460059190911b60e0161c600789019190611344565b6001600160a01b0389165f9081526006870160205260409020610acb90828a611344565b610ade6007870160018a811b0183611344565b5050866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef670de0b6b3a7640000604051610b2d91815260200190565b60405180910390a35050505050505050565b81610b48610726565b6001600160a01b039283165f90815260039190910160209081526040808320969094168252949094529220805460ff19169215159290921790915550565b5f80610b90610726565b90505f816002015f610ba56107cd8860011b90565b63ffffffff16815260208101919091526040015f20546001600160a01b03908116915084168114610c17576001600160a01b038082165f90815260038401602090815260408083209388168352929052205460ff16610c17576040516367d9dca160e11b815260040160405180910390fd5b5f8581526004909201602052604090912080546001600160a01b0387166001600160a01b031990911617905590509392505050565b5f610c56826111a1565b610c735760405163677510db60e11b815260040160405180910390fd5b610c7b610726565b5f9283526004016020525060409020546001600160a01b031690565b5f610ca0610726565b6001600160a01b03929092165f9081526008909201602052506040902054600160301b900463ffffffff1690565b5f610cd7610726565b54600160401b900463ffffffff16919050565b60605f8054610cf890611bc2565b80601f0160208091040260200160405190810160405280929190818152602001828054610d2490611bc2565b8015610d6f5780601f10610d4657610100808354040283529160200191610d6f565b820191905f5260205f20905b815481529060010190602001808311610d5257829003601f168201915b5050505050905090565b5f80610d83610726565b335f81815260058301602090815260408083206001600160a01b038a16808552908352928190208890555187815293945090927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b5f610df4610726565b54600160601b90046001600160601b0316919050565b5f80610e14610726565b6001600160a01b0386165f90815260058201602090815260408083203384529091529020549091505f198114610e8f5780841115610e65576040516313be252b60e01b815260040160405180910390fd5b6001600160a01b0386165f9081526005830160209081526040808320338452909152902084820390555b610e9a868686611376565b50600195945050505050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b5f80610efd610726565b6001600160a01b0384165f90815260089190910160205260409020805490915060ff16610f2b57823b610f36565b8054610100900460ff165b9392505050565b610f473382611862565b50565b610f526118c6565b6040515f90339047908381818185875af1925050503d805f8114610f91576040519150601f19603f3d011682016040523d82523d5f602084013e610f96565b606091505b5050905080610f47576040516312171d8360e31b815260040160405180910390fd5b5f610fc1610726565b600101546001600160a01b0316919050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b6110146118c6565b6002611021828483611c53565b505050565b5f61102f610726565b6001600160a01b03929092165f9081526008909201602052506040902054600160501b90046001600160601b031690565b6110686118c6565b6110715f6118e0565b565b61107b6118c6565b6110858282611862565b5050565b606060018054610cf890611bc2565b5f6110a4338484611376565b50600192915050565b6060600280546110bc90611bc2565b90505f036110d85760405180602001604052805f815250610782565b60026110e38361191d565b6040516020016110f4929190611d0d565b60405160208183030381529060405292915050565b5f611112610726565b6001600160a01b039384165f908152600591909101602090815260408083209490951682529290925250205490565b6111496118c6565b63389a75e1600c52805f526020600c20805442111561116f57636f5e88185f526004601cfd5b5f9055610f47816118e0565b6111836118c6565b8060601b61119857637448fbae5f526004601cfd5b610f47816118e0565b5f806111ac836111bd565b6001600160a01b0316141592915050565b5f806111c7610726565b9050806002015f6111fd6111db8660011b90565b600381901c5f90815260078601602052604090205460059190911b60e0161c90565b63ffffffff16815260208101919091526040015f20546001600160a01b03169392505050565b600381901c5f90815260209290925260409091205460059190911b60e0161c90565b5f8061124f610726565b6001600160a01b0384165f9081526008820160205260409020805490935090915060ff1661129d57815460ff1916600117825561128a833b90565b1561129d57815461ff0019166101001782555b50919050565b5f806112ad610726565b845462010000900463ffffffff16925090505f82900361133d57805481905f906112dc9063ffffffff16611d90565b825463ffffffff8083166101009490940a84810291021990911617909255855462010000820265ffffffff0000199091161786555f908152600283016020526040902080546001600160a01b0386166001600160a01b031990911617905591505b5092915050565b826020528160031c5f5260405f206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b6001600160a01b03821661139d57604051633a954ecd60e21b815260040160405180910390fd5b5f6113a6610726565b90505f6113b285611245565b90505f6113be85611245565b90506113f36040518060c001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b825463ffffffff600160301b808304821660808501528454041660a08301526001600160601b03600160501b909104166040820181905285111561144a57604051631e9acf1760e31b815260040160405180910390fd5b6040810180518690039081905283546001600160601b03808316600160501b9081026bffffffffffffffffffffffff60501b19938416178755855481810483168a016060870181905290921602911617835560808201516114b991670de0b6b3a7640000900480821191030290565b81528154610100900460ff166114fc576114f6670de0b6b3a76400008260600151816114e7576114e7611db2565b048260a0015180821191030290565b60208201525b5f6115438260200151835f01510160408051808201909152606081525f60208201526040805101828152806020018360051b81016040528183528083602001525050919050565b82519091501561164f576001600160a01b0388165f908152600686016020526040902060808301518351875463ffffffff600160401b80830482168490039091160263ffffffff60401b1990911617885581035b5f1991909101600381901c5f9081526020849052604081205491929160e0600585901b161c63ffffffff1690506115df6115d482600190811b0190565b60078b01905f611344565b6115ec6115d48260011b90565b5f81815260048a016020908152604090912080546001600160a01b0319169055858101805160089390931b60608f901b176001178352910190528082036115975750855463ffffffff909116600160301b0263ffffffff60301b19909116178555505b6020820151156117ea576001600160a01b0387165f9081526006860160209081526040822060a08501519185015190929082019061168d878c6112a3565b8954602088015163ffffffff60401b19821663ffffffff600160401b80850482169093018116909202178c55895463ffffffff60301b1916600160301b86831602178a55919250670de0b6b3a7640000600160601b82046001600160601b03160491640100000000909104165b6117296117078260011b90565b600381901c5f90815260078e01602052604090205460059190911b60e0161c90565b63ffffffff16156117485760010181811115611743575060015b6116fa565b611753868683611344565b61176b6117608260011b90565b60078d019085611344565b611784600182811b01600187019660078e019190611344565b6117ad878e835f8360200151818360081b8560601b171781526020810185602001525050505050565b600101818111156117bc575060015b8385036116fa578a5463ffffffff9091166401000000000267ffffffff0000000019909116178a5550505050505b8051511561180b57600185015461180b9082906001600160a01b031661195f565b50856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405161185191815260200190565b60405180910390a350505050505050565b8061186c83611245565b80549115156101000261ff001990921691909117905560405181151581526001600160a01b038316907fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d64203939060200160405180910390a25050565b638b78c6d819543314611071576382b429005f526004601cfd5b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b60606080604051019050602081016040525f8152805f19835b928101926030600a8206018453600a900480611936575050819003601f19909101908152919050565b81516040810363263c69d68152602080820152815160051b604401915060205f83601c84015f875af1601f3d1160015f5114161661199b575f80fd5b50505050565b5f5b838110156119bb5781810151838201526020016119a3565b50505f910152565b602081525f82518060208401526119e18160408501602087016119a1565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114611a0b575f80fd5b919050565b5f8060408385031215611a21575f80fd5b611a2a836119f5565b946020939093013593505050565b5f805f60608486031215611a4a575f80fd5b611a53846119f5565b9250611a61602085016119f5565b9150604084013590509250925092565b5f60208284031215611a81575f80fd5b610f36826119f5565b80358015158114611a0b575f80fd5b5f60208284031215611aa9575f80fd5b610f3682611a8a565b5f8060208385031215611ac3575f80fd5b823567ffffffffffffffff80821115611ada575f80fd5b818501915085601f830112611aed575f80fd5b813581811115611afb575f80fd5b866020828501011115611b0c575f80fd5b60209290920196919550909350505050565b5f8060408385031215611b2f575f80fd5b611b38836119f5565b9150611b4660208401611a8a565b90509250929050565b5f60208284031215611b5f575f80fd5b5035919050565b5f8060408385031215611b77575f80fd5b611b80836119f5565b9150611b46602084016119f5565b634e487b7160e01b5f52601160045260245ffd5b6001600160601b0382811682821603908082111561133d5761133d611b8e565b600181811c90821680611bd657607f821691505b60208210810361129d57634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b601f82111561102157805f5260205f20601f840160051c81016020851015611c2d5750805b601f840160051c820191505b81811015611c4c575f8155600101611c39565b5050505050565b67ffffffffffffffff831115611c6b57611c6b611bf4565b611c7f83611c798354611bc2565b83611c08565b5f601f841160018114611cb0575f8515611c995750838201355b5f19600387901b1c1916600186901b178355611c4c565b5f83815260208120601f198716915b82811015611cdf5786850135825560209485019460019092019101611cbf565b5086821015611cfb575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f808454611d1a81611bc2565b60018281168015611d325760018114611d4757611d73565b60ff1984168752821515830287019450611d73565b885f526020805f205f5b85811015611d6a5781548a820152908401908201611d51565b50505082870194505b505050508351611d878183602088016119a1565b01949350505050565b5f63ffffffff808316818103611da857611da8611b8e565b6001019392505050565b634e487b7160e01b5f52601260045260245ffdfea2646970667358221220b03c90715bb0712fda3786c2b9d4831452f774e86cb3f4d4e13e96d1e10f1b3064736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000d8d726b7177a80000000000000000000000000000baa168f8f58d656b1fe38c30b037777bca1c3094000000000000000000000000bd0f034b9ae5362e4ec321d05bd8fc78c874a92a000000000000000000000000000000000000000000000000000000000000000a444e343034204b657973000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006444e3430344b0000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name_ (string): DN404 Keys
Arg [1] : symbol_ (string): DN404K
Arg [2] : initialTokenSupply (uint96): 250000000000000000000
Arg [3] : initialSupplyOwner (address): 0xbAa168F8f58d656b1FE38C30B037777BCa1c3094
Arg [4] : mirrorAddress (address): 0xBd0F034b9Ae5362E4EC321d05Bd8fc78c874a92A
-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [2] : 00000000000000000000000000000000000000000000000d8d726b7177a80000
Arg [3] : 000000000000000000000000baa168f8f58d656b1fe38c30b037777bca1c3094
Arg [4] : 000000000000000000000000bd0f034b9ae5362e4ec321d05bd8fc78c874a92a
Arg [5] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [6] : 444e343034204b65797300000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [8] : 444e3430344b0000000000000000000000000000000000000000000000000000
Deployed Bytecode Sourcemap
137769:1427:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;131814:22;131839:18;:16;:18::i;:::-;131814:43;-1:-1:-1;131870:18:0;135684:20;131914:3;131891:26;131997:10;131983:24;;;131979:380;;132042:14;;;;-1:-1:-1;;;;;132042:14:0;132028:10;:28;132024:61;;132065:20;;-1:-1:-1;;;132065:20:0;;;;;;;;;;;132024:61;132122:4;132104:8;:22;132100:36;;;132128:8;;;132100:36;132199:4;135684:20;-1:-1:-1;;;;;132302:26:0;;;132153:13;132302:26;;;:19;;;:26;;;;;;;;132270:4;135684:20;132302:36;;;;;;;;;;;132294:53;;132302:36;;:44;;132345:1;132302:44;;;132341:1;132302:44;132294:53;;:7;:53::i;:::-;132009:350;;131979:380;132405:10;132419;132405:24;132401:265;;132464:14;;;;-1:-1:-1;;;;;132464:14:0;132450:10;:28;132446:61;;132487:20;;-1:-1:-1;;;132487:20:0;;;;;;;;;;;132446:61;132544:4;132526:8;:22;132522:36;;;132550:8;;;132522:36;132602:4;135684:20;132624:30;132640:12;135684:20;132640:8;:12::i;:::-;-1:-1:-1;;;;;132624:30:0;:7;:30::i;:::-;132431:235;132401:265;132744:10;132758;132744:24;132740:505;;132803:14;;;;-1:-1:-1;;;;;132803:14:0;132789:10;:28;132785:61;;132826:20;;-1:-1:-1;;;132826:20:0;;;;;;;;;;;132785:61;132883:4;132865:8;:22;132861:36;;;132889:8;;;132861:36;132959:4;135684:20;133024:4;135684:20;133073:4;135684:20;133143:4;135684:20;133167:41;135684:20;;;;133167:16;:41::i;:::-;133223:10;133231:1;133223:7;:10::i;:::-;132770:475;;;;132740:505;133314:10;133328;133314:24;133310:454;;133373:14;;;;-1:-1:-1;;;;;133373:14:0;133359:10;:28;133355:61;;133396:20;;-1:-1:-1;;;133396:20:0;;;;;;;;;;;133355:61;133453:4;133435:8;:22;133431:36;;;133459:8;;;133431:36;133532:4;135684:20;133582:4;135684:20;133568:24;;133657:4;135684:20;133681:46;135684:20;133568:24;135684:20;133681:18;:46::i;:::-;133742:10;133750:1;133742:7;:10::i;:::-;133340:424;;;133310:454;133829:10;133843;133829:24;133825:430;;133888:14;;;;-1:-1:-1;;;;;133888:14:0;133874:10;:28;133870:61;;133911:20;;-1:-1:-1;;;133911:20:0;;;;;;;;;;;133870:61;133968:4;133950:8;:22;133946:36;;;133974:8;;;133946:36;134047:4;135684:20;134096:4;135684:20;134166:4;135684:20;134190:53;134206:35;135684:20;;;134206:11;:35::i;134190:53::-;133855:400;;;133825:430;134305:10;134319;134305:24;134301:269;;134364:14;;;;-1:-1:-1;;;;;134364:14:0;134350:10;:28;134346:61;;134387:20;;-1:-1:-1;;;134387:20:0;;;;;;;;;;;134346:61;134444:4;134426:8;:22;134422:36;;;134450:8;;;134422:36;134502:4;135684:20;134524:34;134540:16;135684:20;134540:12;:16::i;134524:34::-;134331:239;134301:269;134621:10;134635;134621:24;134617:285;;134680:14;;;;-1:-1:-1;;;;;134680:14:0;134666:10;:28;134662:61;;134703:20;;-1:-1:-1;;;134703:20:0;;;;;;;;;;;134662:61;134760:4;134742:8;:22;134738:36;;;134766:8;;;134738:36;134837:4;135684:20;134861:29;134869:20;135684;134869:13;:20::i;:::-;134861:7;:29::i;:::-;134647:255;134617:285;134948:10;134962;134948:24;134944:212;;135007:14;;;;-1:-1:-1;;;;;135007:14:0;134993:10;:28;134989:61;;135030:20;;-1:-1:-1;;;135030:20:0;;;;;;;;;;;134989:61;135087:4;135069:8;:22;135065:36;;;135093:8;;;135065:36;135118:26;135126:17;:15;:17::i;135118:26::-;135203:10;135217;135203:24;135199:67;;135244:10;135252:1;135244:7;:10::i;:::-;131803:3482;138354:92;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;108905:275;;;;;;;;;;-1:-1:-1;108905:275:0;;;;;:::i;:::-;;:::i;:::-;;;1272:14:1;;1265:22;1247:41;;1235:2;1220:18;108905:275:0;1107:187:1;108177:131:0;;;;;;;;;;;;;:::i;:::-;;;1445:25:1;;;1433:2;1418:18;108177:131:0;1299:177:1;110540:512:0;;;;;;;;;;-1:-1:-1;110540:512:0;;;;;:::i;:::-;;:::i;62359:630::-;;;:::i;125179:199::-;;;;;;;;;;-1:-1:-1;125179:199:0;;;;;:::i;:::-;;:::i;125490:92::-;;;;;;;;;;-1:-1:-1;125490:92:0;;;;;:::i;:::-;;:::i;108036:76::-;;;;;;;;;;-1:-1:-1;108036:76:0;;108102:2;2497:36:1;;2485:2;2470:18;108036:76:0;2355:184:1;139020:173:0;;;;;;;;;;;;;:::i;128225:111::-;;;;;;;;;;;;;:::i;:::-;;;-1:-1:-1;;;;;2708:32:1;;;2690:51;;2678:2;2663:18;128225:111:0;2544:203:1;63074:466:0;;;:::i;138558:101::-;;;;;;;;;;-1:-1:-1;138558:101:0;;;;;:::i;:::-;;:::i;108377:143::-;;;;;;;;;;-1:-1:-1;108377:143:0;;;;;:::i;:::-;;:::i;62094:102::-;;;:::i;138905:107::-;;;;;;;;;;-1:-1:-1;138905:107:0;;;;;:::i;:::-;;:::i;64799:187::-;;;;;;;;;;-1:-1:-1;;;64950:18:0;64799:187;;138454:96;;;;;;;;;;;;;:::i;109693:150::-;;;;;;;;;;-1:-1:-1;109693:150:0;;;;;:::i;:::-;;:::i;138667:230::-;;;;;;;;;;-1:-1:-1;138667:230:0;;;;;:::i;:::-;;:::i;108618:151::-;;;;;;;;;;-1:-1:-1;108618:151:0;;;;;:::i;:::-;;:::i;63731:724::-;;;;;;:::i;:::-;;:::i;61668:358::-;;;;;;:::i;:::-;;:::i;65092:449::-;;;;;;;;;;-1:-1:-1;65092:449:0;;;;;:::i;:::-;65371:19;65365:4;65358:33;;;65215:14;65405:26;;;;65517:4;65501:21;;65495:28;;65092:449;105268:345;105529:66;;105268:345::o;135815:185::-;135948:1;135942:4;135935:15;135977:4;135971;135964:18;129175:163;129236:7;129261:11;129269:2;129261:7;:11::i;:::-;129256:44;;129281:19;;-1:-1:-1;;;129281:19:0;;;;;;;;;;;129256:44;129318:12;129327:2;129318:8;:12::i;:::-;129311:19;129175:163;-1:-1:-1;;129175:163:0:o;123218:1489::-;123352:22;123377:18;:16;:18::i;:::-;123352:43;-1:-1:-1;;;;;;123412:16:0;;123408:52;;123437:23;;-1:-1:-1;;;123437:23:0;;;;;;;;;;;123408:52;123473:13;123489:1;:16;;:47;123506:29;123515:19;123531:2;127691:1;127686:6;;127601:99;123515:19;90337:1;90328:10;;;90278:13;90320:19;;;123506:4;;;90320:19;;;;;;90359:1;90344:16;;;;;;90320:41;;90204:166;123506:29;123489:47;;;;;;;;;;;;;-1:-1:-1;123489:47:0;;-1:-1:-1;;;;;123489:47:0;;;;-1:-1:-1;123553:13:0;;;;123549:54;;123575:28;;-1:-1:-1;;;123575:28:0;;;;;;;;;;;123549:54;123633:4;-1:-1:-1;;;;;123620:17:0;:9;-1:-1:-1;;;;;123620:17:0;;123616:250;;-1:-1:-1;;;;;123659:25:0;;;;;;;:19;;;:25;;;;;;;;:36;;;;;;;;;;;;123654:201;;123733:20;;;;:16;;;:20;;;;;;-1:-1:-1;;;;;123720:33:0;;;123733:20;;123720:33;123716:124;;123785:35;;-1:-1:-1;;;123785:35:0;;;;;;;;;;;123716:124;123878:35;123916:18;123929:4;123916:12;:18::i;:::-;123878:56;;123945:33;123981:16;123994:2;123981:12;:16::i;:::-;124010:39;;123945:52;;-1:-1:-1;103001:19:0;;124010:39;;:23;;:39;;103001:19;;-1:-1:-1;;;124010:39:0;;-1:-1:-1;;;;;124010:39:0;;:::i;:::-;;;;;;;;-1:-1:-1;;;;;124010:39:0;;;;;;;;;;;;;;;124087:37;;-1:-1:-1;;;;124087:37:0;;103001:19;-1:-1:-1;;;124087:37:0;;;;;;;;;;;;;;-1:-1:-1;124141:74:0;-1:-1:-1;127686:6:0;;;124171:43;124196:13;124211:2;124171:24;:43::i;:::-;124141:4;;;;:74;:8;:74::i;:::-;124237:20;;;;:16;;;:20;;;;;;;;124230:27;;-1:-1:-1;;;;;;124230:27:0;;;124312:29;;-1:-1:-1;;;;124312:29:0;;-1:-1:-1;;;124312:29:0;;;;;;;;-1:-1:-1;;124312:29:0;;;;;;;;;;;;-1:-1:-1;;;;;124294:13:0;;;;124314:27;124294:7;;:13;;;;;;:48;;:13;;124312:29;124294:17;:48;:::i;:::-;124274:68;;;-1:-1:-1;124357:63:0;124375:25;127858:1;127853:6;;;127852:12;90337:1;90328:10;;;90278:13;90320:19;;;124375:4;;;90320:19;;;;;;90344:16;90359:1;90344:16;;;;;;;;90320:41;;90204:166;124375:25;-1:-1:-1;;;;;124357:13:0;;;;;;:7;;;:13;;;;;;:63;;;;;124409:9;;124357:17;:63;:::i;:::-;124449:27;;;;-1:-1:-1;;;124449:27:0;;;;;;;;;;;;-1:-1:-1;;;;124449:27:0;;;;;;;;;124491:59;124500:22;124512:9;127858:1;127853:6;;;127852:12;;127746:137;124500:22;127858:1;127853:6;;;127852:12;90337:1;90328:10;;;90278:13;90320:19;;;124524:4;;;90320:19;;;;;;90359:1;90344:16;;;;;;90320:41;124491:4;;;;:59;:8;:59::i;:::-;-1:-1:-1;;;;;124565:11:0;;;;;;:7;;;:11;;;;;:30;;124581:1;124591:2;124565:15;:30::i;:::-;124610:36;:4;;;127858:1;127853:6;;;127852:12;124643:1;124610:8;:36::i;:::-;124062:596;;124690:2;-1:-1:-1;;;;;124675:24:0;124684:4;-1:-1:-1;;;;;124675:24:0;;103001:19;124675:24;;;;1445:25:1;;1433:2;1418:18;;1299:177;124675:24:0;;;;;;;;123341:1366;;;;123218:1489;;;;:::o;130685:207::-;130876:8;130816:18;:16;:18::i;:::-;-1:-1:-1;;;;;130816:47:0;;;;;;;:36;;;;;:47;;;;;;;;:57;;;;;;;;;;;;:68;;-1:-1:-1;;130816:68:0;;;;;;;;;;;-1:-1:-1;130685:207:0:o;130051:508::-;130156:7;130181:22;130206:18;:16;:18::i;:::-;130181:43;;130237:13;130253:1;:16;;:47;130270:29;130279:19;130295:2;127691:1;127686:6;;127601:99;130270:29;130253:47;;;;;;;;;;;;;-1:-1:-1;130253:47:0;;-1:-1:-1;;;;;130253:47:0;;;;-1:-1:-1;130317:18:0;;;;130313:171;;-1:-1:-1;;;;;130357:26:0;;;;;;;:19;;;:26;;;;;;;;:37;;;;;;;;;;;;130352:121;;130422:35;;-1:-1:-1;;;130422:35:0;;;;;;;;;;;130352:121;130496:20;;;;:16;;;;:20;;;;;;:30;;-1:-1:-1;;;;;130496:30:0;;-1:-1:-1;;;;;;130496:30:0;;;;;;130546:5;-1:-1:-1;130051:508:0;;;;;:::o;129647:184::-;129704:7;129729:11;129737:2;129729:7;:11::i;:::-;129724:44;;129749:19;;-1:-1:-1;;;129749:19:0;;;;;;;;;;;129724:44;129786:18;:16;:18::i;:::-;:37;;;;:33;;:37;;-1:-1:-1;129786:37:0;;;;-1:-1:-1;;;;;129786:37:0;;129647:184::o;128565:153::-;128634:7;128661:18;:16;:18::i;:::-;-1:-1:-1;;;;;128661:37:0;;;;;;;;:30;;;;:37;;-1:-1:-1;128661:37:0;;;:49;-1:-1:-1;;;128661:49:0;;;;;128565:153::o;128388:126::-;128446:7;128473:18;:16;:18::i;:::-;:33;-1:-1:-1;;;128473:33:0;;;;;;-1:-1:-1;128388:126:0:o;138354:92::-;138400:13;138433:5;138426:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;138354:92;:::o;108905:275::-;108979:4;108996:22;109021:18;:16;:18::i;:::-;109064:10;109052:23;;;;:11;;;:23;;;;;;;;-1:-1:-1;;;;;109052:32:0;;;;;;;;;;;;:41;;;109111:37;1445:25:1;;;109052:11:0;;-1:-1:-1;109052:32:0;;109111:37;;1418:18:1;109111:37:0;;;;;;;-1:-1:-1;109168:4:0;;108905:275;-1:-1:-1;;;108905:275:0:o;108177:131::-;108229:7;108264:18;:16;:18::i;:::-;:35;-1:-1:-1;;;108264:35:0;;-1:-1:-1;;;;;108264:35:0;;;-1:-1:-1;108177:131:0:o;110540:512::-;110628:4;110645:22;110670:18;:16;:18::i;:::-;-1:-1:-1;;;;;110719:17:0;;110701:15;110719:17;;;:11;;;:17;;;;;;;;110737:10;110719:29;;;;;;;;110645:43;;-1:-1:-1;;;110765:28:0;;110761:220;;110823:7;110814:6;:16;110810:52;;;110839:23;;-1:-1:-1;;;110839:23:0;;;;;;;;;;;110810:52;-1:-1:-1;;;;;110906:17:0;;;;;;:11;;;:17;;;;;;;;110924:10;110906:29;;;;;;;110938:16;;;110906:48;;110761:220;110993:27;111003:4;111009:2;111013:6;110993:9;:27::i;:::-;-1:-1:-1;111040:4:0;;110540:512;-1:-1:-1;;;;;110540:512:0:o;62359:630::-;62454:15;61284:9;62472:46;;:15;:46;62454:64;;62690:19;62684:4;62677:33;62741:8;62735:4;62728:22;62798:7;62791:4;62785;62775:21;62768:38;62947:8;62900:45;62897:1;62894;62889:67;62590:381;62359:630::o;125179:199::-;125239:4;125256:21;125280:18;:16;:18::i;:::-;-1:-1:-1;;;;;125280:33:0;;;;;;:30;;;;;:33;;;;;125331:13;;125280:33;;-1:-1:-1;125331:13:0;;:39;;126628:14;;125331:39;;;125347:9;;;;;;;125331:39;125324:46;125179:199;-1:-1:-1;;;125179:199:0:o;125490:92::-;125542:32;125554:10;125566:7;125542:11;:32::i;:::-;125490:92;:::o;139020:173::-;65938:13;:11;:13::i;:::-;139088:49:::1;::::0;139071:12:::1;::::0;139088:10:::1;::::0;139111:21:::1;::::0;139071:12;139088:49;139071:12;139088:49;139111:21;139088:10;:49:::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;139070:67;;;139153:7;139148:37;;139169:16;;-1:-1:-1::0;;;139169:16:0::1;;;;;;;;;;;128225:111:::0;128270:7;128297:18;:16;:18::i;:::-;:31;;;-1:-1:-1;;;;;128297:31:0;;128225:111;-1:-1:-1;128225:111:0:o;63074:466::-;63280:19;63274:4;63267:33;63327:8;63321:4;63314:22;63380:1;63373:4;63367;63357:21;63350:32;63513:8;63467:44;63464:1;63461;63456:66;63074:466::o;138558:101::-;65938:13;:11;:13::i;:::-;138632:8:::1;:19;138643:8:::0;;138632;:19:::1;:::i;:::-;;138558:101:::0;;:::o;108377:143::-;108440:7;108467:18;:16;:18::i;:::-;-1:-1:-1;;;;;108467:37:0;;;;;;;;:30;;;;:37;;-1:-1:-1;108467:37:0;;;:45;-1:-1:-1;;;108467:45:0;;-1:-1:-1;;;;;108467:45:0;;108377:143::o;62094:102::-;65938:13;:11;:13::i;:::-;62167:21:::1;62185:1;62167:9;:21::i;:::-;62094:102::o:0;138905:107::-;65938:13;:11;:13::i;:::-;138983:21:::1;138995:1;138998:5;138983:11;:21::i;:::-;138905:107:::0;;:::o;138454:96::-;138502:13;138535:7;138528:14;;;;;:::i;109693:150::-;109763:4;109780:33;109790:10;109802:2;109806:6;109780:9;:33::i;:::-;-1:-1:-1;109831:4:0;109693:150;;;;:::o;138667:230::-;138732:13;138771:8;138765:22;;;;;:::i;:::-;;;138791:1;138765:27;:124;;;;;;;;;;;;;;;;;138832:8;138842:27;138861:7;138842:18;:27::i;:::-;138815:55;;;;;;;;;:::i;:::-;;;;;;;;;;;;;138758:131;138667:230;-1:-1:-1;;138667:230:0:o;108618:151::-;108690:7;108717:18;:16;:18::i;:::-;-1:-1:-1;;;;;108717:35:0;;;;;;;:28;;;;;:35;;;;;;;;:44;;;;;;;;;;-1:-1:-1;108717:44:0;;;108618:151::o;63731:724::-;65938:13;:11;:13::i;:::-;63969:19:::1;63963:4;63956:33;64016:12;64010:4;64003:26;64079:4;64073;64063:21;64187:12;64181:19;64168:11;64165:36;64162:160;;;64234:10;64228:4;64221:24;64302:4;64296;64289:18;64162:160;64401:1;64380:23:::0;;64424::::1;64434:12:::0;64424:9:::1;:23::i;61668:358::-:0;65938:13;:11;:13::i;:::-;61843:8:::1;61839:2;61835:17;61825:153;;61886:10;61880:4;61873:24;61958:4;61952;61945:18;61825:153;61999:19;62009:8;61999:9;:19::i;129390:118::-:0;129450:4;;129474:12;129483:2;129474:8;:12::i;:::-;-1:-1:-1;;;;;129474:26:0;;;;129390:118;-1:-1:-1;;129390:118:0:o;128857:197::-;128918:7;128938:22;128963:18;:16;:18::i;:::-;128938:43;;128999:1;:16;;:47;129016:29;129025:19;129041:2;127691:1;127686:6;;127601:99;129025:19;90337:1;90328:10;;;90278:13;90320:19;;;129016:4;;;90320:19;;;;;;90359:1;90344:16;;;;;;90320:41;;90204:166;129016:29;128999:47;;;;;;;;;;;;;-1:-1:-1;128999:47:0;;-1:-1:-1;;;;;128999:47:0;;128857:197;-1:-1:-1;;;128857:197:0:o;90204:166::-;90337:1;90328:10;;;90278:13;90320:19;;;;;;;;;;;;;90359:1;90344:16;;;;;;90320:41;;90204:166::o;126111:294::-;126162:21;126196:22;126221:18;:16;:18::i;:::-;-1:-1:-1;;;;;126254:16:0;;;;;;:13;;;:16;;;;;126288:13;;126254:16;;-1:-1:-1;126196:43:0;;-1:-1:-1;126288:13:0;;126283:115;;126318:20;;-1:-1:-1;;126318:20:0;126334:4;126318:20;;;126357:11;126366:1;126628:14;;126475:217;126357:11;126353:33;;;126370:16;;-1:-1:-1;;126370:16:0;;;;;126353:33;126185:220;126111:294;;;:::o;126858:452::-;126975:19;127012:22;127037:18;:16;:18::i;:::-;127081:26;;;;;;;;-1:-1:-1;127012:43:0;-1:-1:-1;127081:26:0;127122:17;;;127118:185;;127171:14;;127173:1;;:12;;127171:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;127200:41;;;;;-1:-1:-1;;127200:41:0;;;;;;-1:-1:-1;127256:30:0;;;127200:26;127256:16;;:30;;;;;:35;;-1:-1:-1;;;;;127256:35:0;;-1:-1:-1;;;;;;127256:35:0;;;;;;127171:14;-1:-1:-1;127118:185:0;127001:309;126858:452;;;;:::o;90438:542::-;90604:8;90598:4;90591:22;90647:5;90644:1;90640:13;90634:4;90627:27;90693:4;90687;90677:21;90756:1;90749:5;90745:13;90742:1;90738:21;90819:1;90813:8;90867:10;90952:5;90948:1;90945;90941:9;90937:21;90934:1;90930:29;90927:1;90923:37;90920:1;90916:45;90913:1;90906:56;;;;;90438:542;;;:::o;119560:3233::-;-1:-1:-1;;;;;119645:16:0;;119641:52;;119670:23;;-1:-1:-1;;;119670:23:0;;;;;;;;;;;119641:52;119706:22;119731:18;:16;:18::i;:::-;119706:43;;119762:35;119800:18;119813:4;119800:12;:18::i;:::-;119762:56;;119829:33;119865:16;119878:2;119865:12;:16::i;:::-;119829:52;;119894:23;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;119894:23:0;119948:27;;;-1:-1:-1;;;119948:27:0;;;;;119928:17;;;:47;120004:25;;;;119986:15;;;:43;-1:-1:-1;;;;;;;;120056:23:0;;;;120040:13;;;:39;;;120096:22;;120092:56;;;120127:21;;-1:-1:-1;;;120127:21:0;;;;;;;;;;;120092:56;120186:13;;;:23;;;;;;;;;120224:47;;-1:-1:-1;;;;;120224:47:0;;;-1:-1:-1;;;120224:47:0;;;-1:-1:-1;;;;120224:47:0;;;;;;120331:21;;;;;;;:30;;120317:11;;;:44;;;120286:76;;;;;;;;;120413:17;;;;120399:54;;103001:19;;120432:20;127523:8;;;127533:9;;127519:24;;127357:204;120399:54;120379:74;;120475:21;;;;;;;120470:133;;120537:50;103001:19;120551:1;:11;;;:18;;;;;:::i;:::-;;120571:1;:15;;;127523:8;;;127533:9;;127519:24;;127357:204;120537:50;120517:17;;;:70;120470:133;120619:29;120651:56;120689:1;:17;;;120669:1;:17;;;:37;-1:-1:-1;;;;;;;;;;;;;;;;;111795:4:0;111788;111782:11;111778:22;111871:1;111865:4;111858:15;111911:4;111905;111901:15;111962:1;111959;111955:9;111947:6;111943:22;111937:4;111930:36;111990:4;111987:1;111980:15;112030:6;112026:1;112020:4;112016:12;112009:28;;;111605:450;;;;120651:56;120728:17;;120619:88;;-1:-1:-1;120728:22:0;120724:750;;-1:-1:-1;;;;;120808:13:0;;120771:34;120808:13;;;:7;;;:13;;;;;120860:17;;;;120926;;120962:45;;;-1:-1:-1;;;120962:45:0;;;;;;;;;;;;-1:-1:-1;;;;120962:45:0;;;;;;120914:29;;121057:336;-1:-1:-1;;121110:11:0;;;;90337:1;90328:10;;;121083;90320:19;;;;;;;;;;;121110:11;;;90344:16;90359:1;90344:16;;;;90320:41;121083:39;;;;121145:28;121154:15;121166:2;127858:1;127853:6;;;127852:12;;127746:137;121154:15;121145:4;;;;121171:1;121145:8;:28::i;:::-;121196:32;121205:19;121221:2;127691:1;127686:6;;127601:99;121196:32;121258:20;;;;:16;;;:20;;;;;;;;121251:27;;-1:-1:-1;;;;;;121251:27:0;;;112386:12;;;112380:19;;112450:1;112446:10;;;;112438:2;112434:10;;;112431:26;-1:-1:-1;112428:39:0;112413:55;;112503:17;;112482:39;;121371:20;;;121057:336;;-1:-1:-1;121411:47:0;;;;;;-1:-1:-1;;;121411:47:0;-1:-1:-1;;;;121411:47:0;;;;;;-1:-1:-1;120724:750:0;121494:17;;;;:22;121490:1116;;-1:-1:-1;;;;;121572:11:0;;121537:32;121572:11;;;:7;;;:11;;;;;;;121620:15;;;;121680:17;;;;121572:11;;121670:27;;;;121733:43;121758:13;121580:2;121733:24;:43::i;:::-;121814:18;;121930:17;;;;-1:-1:-1;;;;121903:45:0;;121871:13;-1:-1:-1;;;121903:45:0;;;;;;;;;;;;;;;;121967:41;;-1:-1:-1;;;;121967:41:0;-1:-1:-1;;;121967:41:0;;;;;;;121716:60;;-1:-1:-1;103001:19:0;-1:-1:-1;;;121814:18:0;;-1:-1:-1;;;;;121814:18:0;:25;;121871:13;;;;;122058:488;122091:29;122100:19;122116:2;127691:1;127686:6;;127601:99;122100:19;90337:1;90328:10;;;90278:13;90320:19;;;122091:4;;;90320:19;;;;;;90359:1;90344:16;;;;;;90320:41;;90204:166;122091:29;:34;;;122084:121;;122158:4;;:15;;;122154:27;;;-1:-1:-1;122180:1:0;122154:27;122084:121;;;122227:32;:7;122239;122255:2;122227:11;:32::i;:::-;122282:38;122291:19;122307:2;127691:1;127686:6;;127601:99;122291:19;122282:4;;;;122312:7;122282:8;:38::i;:::-;122343:44;127858:1;127853:6;;;127852:12;122376:9;;;;122343:4;;;;:44;:8;:44::i;:::-;122410:40;122428:10;122440:2;122444;122448:1;112396;112390:4;112386:12;112380:19;112459:7;112453:2;112450:1;112446:10;112442:1;112438:2;112434:10;112431:26;112428:39;112420:6;112413:55;112515:4;112507:6;112503:17;112499:1;112493:4;112489:12;112482:39;;112162:377;;;;;122410:40;122477:4;;:15;;;122473:27;;;-1:-1:-1;122499:1:0;122473:27;122539:5;122528:7;:16;122058:488;;122564:26;;;;;;;;-1:-1:-1;;122564:26:0;;;;;;-1:-1:-1;;;;;121490:1116:0;122626:15;;:22;:27;122622:111;;122702:14;;;;122674:43;;122690:10;;-1:-1:-1;;;;;122702:14:0;122674:15;:43::i;:::-;120161:2583;122774:2;-1:-1:-1;;;;;122759:26:0;122768:4;-1:-1:-1;;;;;122759:26:0;;122778:6;122759:26;;;;1445:25:1;;1433:2;1418:18;;1299:177;122759:26:0;;;;;;;;119630:3163;;;;119560:3233;;;:::o;125801:139::-;125891:5;125865:15;125878:1;125865:12;:15::i;:::-;:31;;;;;;;-1:-1:-1;;125865:31:0;;;;;;;;;125912:20;;1272:14:1;;1265:22;1247:41;;-1:-1:-1;;;;;125912:20:0;;;;;1235:2:1;1220:18;125912:20:0;;;;;;;125801:139;;:::o;60589:364::-;-1:-1:-1;;60799:18:0;60789:8;60786:32;60776:159;;60852:10;60846:4;60839:24;60915:4;60909;60902:18;59415:1113;-1:-1:-1;;60382:16:0;;-1:-1:-1;;;;;60228:26:0;;;;;;60342:38;60339:1;;60331:78;60468:27;59415:1113::o;1989:1676::-;2045:17;2497:4;2490;2484:11;2480:22;2473:29;;2598:4;2593:3;2589:14;2583:4;2576:28;2681:1;2676:3;2669:14;2785:3;2817:1;2813:6;3029:5;3011:410;3068:11;;;;3252:2;3266;3256:13;;3248:22;3068:11;3235:36;3360:2;3350:13;;3381:25;3011:410;3381:25;-1:-1:-1;;3451:13:0;;;-1:-1:-1;;3566:14:0;;;3628:19;;;3566:14;1989:1676;-1:-1:-1;1989:1676:0:o;112637:739::-;112805:1;112799:8;112840:4;112834;112830:15;112899:10;112896:1;112889:21;112974:4;112967;112964:1;112960:12;112953:26;113070:4;113064:11;113061:1;113057:19;113051:4;113047:30;113038:39;;113296:4;113290;113287:1;113280:4;113277:1;113273:12;113270:1;113262:6;113255:5;113250:51;113221:4;113203:16;113200:26;113196:1;113189:4;113183:11;113180:18;113176:51;113150:170;113122:236;;113351:4;113345;113338:18;113122:236;;;112637:739;;:::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;767:70;670:173;;;:::o;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;2940:9;2927:23;2969:18;3010:2;3002:6;2999:14;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:254::-;3414:6;3422;3475:2;3463:9;3454:7;3450:23;3446:32;3443:52;;;3491:1;3488;3481:12;3443:52;3514:29;3533:9;3514:29;:::i;:::-;3504:39;;3562:35;3593:2;3582:9;3578:18;3562:35;:::i;:::-;3552:45;;3349:254;;;;;:::o;3608:180::-;3667:6;3720:2;3708:9;3699:7;3695:23;3691:32;3688:52;;;3736:1;3733;3726:12;3688:52;-1:-1:-1;3759:23:1;;3608:180;-1:-1:-1;3608:180:1: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:191;-1:-1:-1;;;;;4317:10:1;;;4305;;;4301:27;;4340:12;;;4337:38;;;4355:18;;:::i;4386:380::-;4465:1;4461:12;;;;4508;;;4529:61;;4583:4;4575:6;4571:17;4561:27;;4529:61;4636:2;4628:6;4625:14;4605:18;4602:38;4599:161;;4682:10;4677:3;4673:20;4670:1;4663:31;4717:4;4714:1;4707:15;4745:4;4742:1;4735:15;4981:127;5042:10;5037:3;5033:20;5030:1;5023:31;5073:4;5070:1;5063:15;5097:4;5094:1;5087:15;5239:518;5341:2;5336:3;5333:11;5330:421;;;5377:5;5374:1;5367:16;5421:4;5418:1;5408:18;5491:2;5479:10;5475:19;5472:1;5468:27;5462:4;5458:38;5527:4;5515:10;5512:20;5509:47;;;-1:-1:-1;5550:4:1;5509:47;5605:2;5600:3;5596:12;5593:1;5589:20;5583:4;5579:31;5569:41;;5660:81;5678:2;5671:5;5668:13;5660:81;;;5737:1;5723:16;;5704:1;5693:13;5660:81;;;5664:3;;5239:518;;;:::o;5933:1198::-;6057:18;6052:3;6049:27;6046:53;;;6079:18;;:::i;:::-;6108:94;6198:3;6158:38;6190:4;6184:11;6158:38;:::i;:::-;6152:4;6108:94;:::i;:::-;6228:1;6253:2;6248:3;6245:11;6270:1;6265:608;;;;6917:1;6934:3;6931:93;;;-1:-1:-1;6990:19:1;;;6977:33;6931:93;-1:-1:-1;;5890:1:1;5886:11;;;5882:24;5878:29;5868:40;5914:1;5910:11;;;5865:57;7037:78;;6238:887;;6265:608;5186:1;5179:14;;;5223:4;5210:18;;-1:-1:-1;;6301:17:1;;;6416:229;6430:7;6427:1;6424:14;6416:229;;;6519:19;;;6506:33;6491:49;;6626:4;6611:20;;;;6579:1;6567:14;;;;6446:12;6416:229;;;6420:3;6673;6664:7;6661:16;6658:159;;;6797:1;6793:6;6787:3;6781;6778:1;6774:11;6770:21;6766:34;6762:39;6749:9;6744:3;6740:19;6727:33;6723:79;6715:6;6708:95;6658:159;;;6860:1;6854:3;6851:1;6847:11;6843:19;6837:4;6830:33;6238:887;;5933:1198;;;:::o;7136:1021::-;7312:3;7341:1;7374:6;7368:13;7404:36;7430:9;7404:36;:::i;:::-;7459:1;7476:17;;;7502:133;;;;7649:1;7644:358;;;;7469:533;;7502:133;-1:-1:-1;;7535:24:1;;7523:37;;7608:14;;7601:22;7589:35;;7580:45;;;-1:-1:-1;7502:133:1;;7644:358;7675:6;7672:1;7665:17;7705:4;7750;7747:1;7737:18;7777:1;7791:165;7805:6;7802:1;7799:13;7791:165;;;7883:14;;7870:11;;;7863:35;7926:16;;;;7820:10;;7791:165;;;7795:3;;;7985:6;7980:3;7976:16;7969:23;;7469:533;;;;;8033:6;8027:13;8049:68;8108:8;8103:3;8096:4;8088:6;8084:17;8049:68;:::i;:::-;8133:18;;7136:1021;-1:-1:-1;;;;7136:1021:1:o;8162:201::-;8200:3;8228:10;8273:2;8266:5;8262:14;8300:2;8291:7;8288:15;8285:41;;8306:18;;:::i;:::-;8355:1;8342:15;;8162:201;-1:-1:-1;;;8162:201:1:o;8368:127::-;8429:10;8424:3;8420:20;8417:1;8410:31;8460:4;8457:1;8450:15;8484:4;8481:1;8474:15
Swarm Source
ipfs://b03c90715bb0712fda3786c2b9d4831452f774e86cb3f4d4e13e96d1e10f1b30
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.