Feature Tip: Add private address tag to any address under My Name Tag !
ERC-20
Overview
Max Total Supply
1,000 TBS
Holders
80
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
3.432348071221748001 TBSValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
TallBits
Compiler Version
v0.8.24+commit.e11b9ed9
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2024-02-13 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /* https://twitter.com/Tallbits404 https://www.tallbits.xyz/ https://t.me/Tallbits */ // File: https://github.com/Vectorized/solady/blob/main/src/utils/SafeTransferLib.sol /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// /// @dev Note: /// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection. /// - For ERC20s, this implementation won't check that a token has code, /// responsibility is delegated to the caller. library SafeTransferLib { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The ETH transfer has failed. error ETHTransferFailed(); /// @dev The ERC20 `transferFrom` has failed. error TransferFromFailed(); /// @dev The ERC20 `transfer` has failed. error TransferFailed(); /// @dev The ERC20 `approve` has failed. error ApproveFailed(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Suggested gas stipend for contract receiving ETH that disallows any storage writes. uint256 internal constant GAS_STIPEND_NO_STORAGE_WRITES = 2300; /// @dev Suggested gas stipend for contract receiving ETH to perform a few /// storage reads and writes, but low enough to prevent griefing. uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ETH OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants. // // The regular variants: // - Forwards all remaining gas to the target. // - Reverts if the target reverts. // - Reverts if the current contract has insufficient balance. // // The force variants: // - Forwards with an optional gas stipend // (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases). // - If the target reverts, or if the gas stipend is exhausted, // creates a temporary contract to force send the ETH via `SELFDESTRUCT`. // Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758. // - Reverts if the current contract has insufficient balance. // // The try variants: // - Forwards with a mandatory gas stipend. // - Instead of reverting, returns whether the transfer succeeded. /// @dev Sends `amount` (in wei) ETH to `to`. function safeTransferETH(address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { if iszero(call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } } } /// @dev Sends all the ETH in the current contract to `to`. function safeTransferAllETH(address to) internal { /// @solidity memory-safe-assembly assembly { // Transfer all the ETH and check if it succeeded or not. if iszero(call(gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } } } /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`. function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal { /// @solidity memory-safe-assembly assembly { if lt(selfbalance(), amount) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } if iszero(call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`. function forceSafeTransferAllETH(address to, uint256 gasStipend) internal { /// @solidity memory-safe-assembly assembly { if iszero(call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`. function forceSafeTransferETH(address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { if lt(selfbalance(), amount) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } if iszero(call(GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`. function forceSafeTransferAllETH(address to) internal { /// @solidity memory-safe-assembly assembly { // forgefmt: disable-next-item if iszero(call(GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`. function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal returns (bool success) { /// @solidity memory-safe-assembly assembly { success := call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00) } } /// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`. function trySafeTransferAllETH(address to, uint256 gasStipend) internal returns (bool success) { /// @solidity memory-safe-assembly assembly { success := call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ERC20 OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Sends `amount` of ERC20 `token` from `from` to `to`. /// Reverts upon failure. /// /// The `from` account must have at least `amount` approved for /// the current contract to manage. function safeTransferFrom(address token, address from, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x60, amount) // Store the `amount` argument. mstore(0x40, to) // Store the `to` argument. mstore(0x2c, shl(96, from)) // Store the `from` argument. mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot to zero. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Sends all of ERC20 `token` from `from` to `to`. /// Reverts upon failure. /// /// The `from` account must have their entire balance approved for /// the current contract to manage. function safeTransferAllFrom(address token, address from, address to) internal returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x40, to) // Store the `to` argument. mstore(0x2c, shl(96, from)) // Store the `from` argument. mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`. // Read the balance, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`. amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot to zero. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Sends `amount` of ERC20 `token` from the current contract to `to`. /// Reverts upon failure. function safeTransfer(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sends all of ERC20 `token` from the current contract to `to`. /// Reverts upon failure. function safeTransferAll(address token, address to) internal returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`. mstore(0x20, address()) // Store the address of the current contract. // Read the balance, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x14, to) // Store the `to` argument. amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it. mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. /// Reverts upon failure. function safeApprove(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. // Perform the approval, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. /// If the initial attempt to approve fails, attempts to reset the approved amount to zero, /// then retries the approval again (some tokens, e.g. USDT, requires this). /// Reverts upon failure. function safeApproveWithRetry(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. // Perform the approval, retrying upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x34, 0) // Store 0 for the `amount`. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. pop(call(gas(), token, 0, 0x10, 0x44, codesize(), 0x00)) // Reset the approval. mstore(0x34, amount) // Store back the original `amount`. // Retry the approval, reverting upon failure. if iszero( and( or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`. revert(0x1c, 0x04) } } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Returns the amount of ERC20 `token` owned by `account`. /// Returns zero if the `token` does not exist. function balanceOf(address token, address account) internal view returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { mstore(0x14, account) // Store the `account` argument. mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`. amount := mul( mload(0x20), and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20) ) ) } } } // File: https://github.com/Vectorized/solady/blob/main/src/utils/LibString.sol /// @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: https://github.com/Vectorized/solady/blob/main/src/auth/Ownable.sol /// @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: https://github.com/Vectorized/dn404/blob/main/src/DN404Mirror.sol /// @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 is Ownable { /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* EVENTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Emitted when token `id` is transferred from `from` to `to`. event Transfer(address indexed from, address indexed to, uint256 indexed id); /// @dev Emitted when `owner` enables `account` to manage the `id` token. event Approval(address indexed owner, address indexed account, uint256 indexed id); /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens. event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved); /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`. uint256 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; /// @dev `keccak256(bytes("Approval(address,address,uint256)"))`. uint256 private constant _APPROVAL_EVENT_SIGNATURE = 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925; /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`. uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE = 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CUSTOM ERRORS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Thrown when a call for an NFT function did not originate /// from the base DN404 contract. error SenderNotBase(); /// @dev Thrown when a call for an NFT function did not originate from the deployer. error SenderNotDeployer(); /// @dev Thrown when transferring an NFT to a contract address that /// does not implement ERC721Receiver. error TransferToNonERC721ReceiverImplementer(); /// @dev Thrown when linking to the DN404 base contract and the /// DN404 supportsInterface check fails or the call reverts. error CannotLink(); /// @dev Thrown when a linkMirrorContract call is received and the /// NFT mirror contract has already been linked to a DN404 base contract. error AlreadyLinked(); /// @dev Thrown when retrieving the base DN404 address when a link has not /// been established. error NotLinked(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct contain the NFT mirror contract storage. struct DN404NFTStorage { address baseERC20; address deployer; } /// @dev Returns a storage pointer for DN404NFTStorage. function _getDN404NFTStorage() internal pure virtual returns (DN404NFTStorage storage $) { /// @solidity memory-safe-assembly assembly { // `uint72(bytes9(keccak256("DN404_MIRROR_STORAGE")))`. $.slot := 0x3602298b8c10b01230 // Truncate to 9 bytes to reduce bytecode size. } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTRUCTOR */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ constructor(address deployer) { // For non-proxies, we will store the deployer so that only the deployer can // link the base contract. _getDN404NFTStorage().deployer = deployer; _initializeOwner(deployer); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ERC721 OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the token collection name from the base DN404 contract. function name() public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x00, 0x06fdde03) // `name()`. if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the token collection symbol from the base DN404 contract. function symbol() public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x00, 0x95d89b41) // `symbol()`. if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the Uniform Resource Identifier (URI) for token `id` from /// the base DN404 contract. function tokenURI(uint256 id) public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x20, id) mstore(0x00, 0xc87b56dd) // `tokenURI()`. if iszero(staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the total NFT supply from the base DN404 contract. function totalSupply() public view virtual returns (uint256 result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0xe2c79281) // `totalNFTSupply()`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := mload(0x00) } } /// @dev Returns the number of NFT tokens owned by `owner` from the base DN404 contract. /// /// Requirements: /// - `owner` must not be the zero address. function balanceOf(address owner) public view virtual returns (uint256 result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x20, shr(96, shl(96, owner))) mstore(0x00, 0xf5b100ea) // `balanceOfNFT(address)`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := mload(0x00) } } /// @dev Returns the owner of token `id` from the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. function ownerOf(uint256 id) public view virtual returns (address result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x6352211e) // `ownerOf(uint256)`. mstore(0x20, id) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, mload(0x0c)) } } /// @dev Sets `spender` as the approved account to manage token `id` in /// the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. /// - The caller must be the owner of the token, /// or an approved operator for the token owner. /// /// Emits an {Approval} event. function approve(address spender, uint256 id) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { spender := shr(96, shl(96, spender)) let m := mload(0x40) mstore(0x00, 0xd10b6e0c) // `approveNFT(address,uint256,address)`. mstore(0x20, spender) mstore(0x40, id) mstore(0x60, caller()) if iszero( and( gt(returndatasize(), 0x1f), call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20) ) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } mstore(0x40, m) // Restore the free memory pointer. mstore(0x60, 0) // Restore the zero pointer. // Emit the {Approval} event. log4(codesize(), 0x00, _APPROVAL_EVENT_SIGNATURE, shr(96, mload(0x0c)), spender, id) } } /// @dev Returns the account approved to manage token `id` from /// the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. function getApproved(uint256 id) public view virtual returns (address result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x081812fc) // `getApproved(uint256)`. mstore(0x20, id) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, mload(0x0c)) } } /// @dev Sets whether `operator` is approved to manage the tokens of the caller in /// the base DN404 contract. /// /// Emits an {ApprovalForAll} event. function setApprovalForAll(address operator, bool approved) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { operator := shr(96, shl(96, operator)) let m := mload(0x40) mstore(0x00, 0x813500fc) // `setApprovalForAll(address,bool,address)`. mstore(0x20, operator) mstore(0x40, iszero(iszero(approved))) mstore(0x60, caller()) if iszero( and(eq(mload(0x00), 1), call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } // Emit the {ApprovalForAll} event. log3(0x40, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), operator) mstore(0x40, m) // Restore the free memory pointer. mstore(0x60, 0) // Restore the zero pointer. } } /// @dev Returns whether `operator` is approved to manage the tokens of `owner` from /// the base DN404 contract. function isApprovedForAll(address owner, address operator) public view virtual returns (bool result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { let m := mload(0x40) mstore(0x40, operator) mstore(0x2c, shl(96, owner)) mstore(0x0c, 0xe985e9c5000000000000000000000000) // `isApprovedForAll(address,address)`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x44, 0x00, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } mstore(0x40, m) // Restore the free memory pointer. result := iszero(iszero(mload(0x00))) } } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// - The caller must be the owner of the token, or be approved to manage the token. /// /// Emits a {Transfer} event. function transferFrom(address from, address to, uint256 id) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { from := shr(96, shl(96, from)) to := shr(96, shl(96, to)) let m := mload(0x40) mstore(m, 0xe5eb36c8) // `transferFromNFT(address,address,uint256,address)`. mstore(add(m, 0x20), from) mstore(add(m, 0x40), to) mstore(add(m, 0x60), id) mstore(add(m, 0x80), caller()) if iszero( and(eq(mload(m), 1), call(gas(), base, callvalue(), add(m, 0x1c), 0x84, m, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } // Emit the {Transfer} event. log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id) } } /// @dev Equivalent to `safeTransferFrom(from, to, id, "")`. function safeTransferFrom(address from, address to, uint256 id) public payable virtual { transferFrom(from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, ""); } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// - The caller must be the owner of the token, or be approved to manage the token. /// - If `to` refers to a smart contract, it must implement /// {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. /// /// Emits a {Transfer} event. function safeTransferFrom(address from, address to, uint256 id, bytes calldata data) public virtual { transferFrom(from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, data); } /// @dev Returns true if this contract implements the interface defined by `interfaceId`. /// See: https://eips.ethereum.org/EIPS/eip-165 /// This function call must use less than 30000 gas. function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) { /// @solidity memory-safe-assembly assembly { let s := shr(224, interfaceId) // ERC165: 0x01ffc9a7, ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f. result := or(or(eq(s, 0x01ffc9a7), eq(s, 0x80ac58cd)), eq(s, 0x5b5e139f)) } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the base DN404 contract. function baseERC20() public view virtual returns (address base) { base = _getDN404NFTStorage().baseERC20; if (base == address(0)) revert NotLinked(); } /// @dev Fallback modifier to execute calls from the base DN404 contract. modifier dn404NFTFallback() virtual { DN404NFTStorage storage $ = _getDN404NFTStorage(); uint256 fnSelector = _calldataload(0x00) >> 224; // `logTransfer(uint256[])`. if (fnSelector == 0x263c69d6) { if (msg.sender != $.baseERC20) revert SenderNotBase(); /// @solidity memory-safe-assembly assembly { // When returndatacopy copies 1 or more out-of-bounds bytes, it reverts. returndatacopy(0x00, returndatasize(), lt(calldatasize(), 0x20)) let o := add(0x24, calldataload(0x04)) // Packed logs offset. returndatacopy(0x00, returndatasize(), lt(calldatasize(), o)) let end := add(o, shl(5, calldataload(sub(o, 0x20)))) returndatacopy(0x00, returndatasize(), lt(calldatasize(), end)) for {} iszero(eq(o, end)) { o := add(0x20, o) } { let d := calldataload(o) // Entry in the packed logs. let a := shr(96, d) // The address. let b := and(1, d) // Whether it is a burn. log4( codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, mul(a, b), mul(a, iszero(b)), shr(168, shl(160, d)) ) } mstore(0x00, 0x01) return(0x00, 0x20) } } // `linkMirrorContract(address)`. if (fnSelector == 0x0f4599e5) { if ($.deployer != address(0)) { if (address(uint160(_calldataload(0x04))) != $.deployer) { revert SenderNotDeployer(); } } if ($.baseERC20 != address(0)) revert AlreadyLinked(); $.baseERC20 = msg.sender; /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x01) return(0x00, 0x20) } } _; } /// @dev Fallback function for calls from base DN404 contract. fallback() external payable virtual dn404NFTFallback {} receive() external payable virtual {} /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* PRIVATE HELPERS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the calldata value at `offset`. function _calldataload(uint256 offset) private pure returns (uint256 value) { /// @solidity memory-safe-assembly assembly { value := calldataload(offset) } } /// @dev Returns if `a` has bytecode of non-zero length. function _hasCode(address a) private view returns (bool result) { /// @solidity memory-safe-assembly assembly { result := extcodesize(a) // Can handle dirty upper bits. } } /// @dev Perform a call to invoke {IERC721Receiver-onERC721Received} on `to`. /// Reverts if the target does not support the function correctly. function _checkOnERC721Received(address from, address to, uint256 id, bytes memory data) private { /// @solidity memory-safe-assembly assembly { // Prepare the calldata. let m := mload(0x40) let onERC721ReceivedSelector := 0x150b7a02 mstore(m, onERC721ReceivedSelector) mstore(add(m, 0x20), caller()) // The `operator`, which is always `msg.sender`. mstore(add(m, 0x40), shr(96, shl(96, from))) mstore(add(m, 0x60), id) mstore(add(m, 0x80), 0x80) let n := mload(data) mstore(add(m, 0xa0), n) if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xc0), n)) } // Revert if the call reverts. if iszero(call(gas(), to, 0, add(m, 0x1c), add(n, 0xa4), m, 0x20)) { if returndatasize() { // Bubble up the revert if the call reverts. returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } } // Load the returndata and compare it. if iszero(eq(mload(m), shl(224, onERC721ReceivedSelector))) { mstore(0x00, 0xd1a57ed6) // `TransferToNonERC721ReceiverImplementer()`. revert(0x1c, 0x04) } } } } // File: https://github.com/Vectorized/dn404/blob/main/src/DN404.sol /// @title DN404 /// @notice DN404 is a hybrid ERC20 and ERC721 implementation that mints /// and burns NFTs based on an account's ERC20 token balance. /// /// @author vectorized.eth (@optimizoor) /// @author Quit (@0xQuit) /// @author Michael Amadi (@AmadiMichaels) /// @author cygaar (@0xCygaar) /// @author Thomas (@0xjustadev) /// @author Harrison (@PopPunkOnChain) /// /// @dev Note: /// - The ERC721 data is stored in this base DN404 contract, however a /// DN404Mirror contract ***MUST*** be deployed and linked during /// initialization. abstract contract DN404 { /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* EVENTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Emitted when `amount` tokens is transferred from `from` to `to`. event Transfer(address indexed from, address indexed to, uint256 amount); /// @dev Emitted when `amount` tokens is approved by `owner` to be used by `spender`. event Approval(address indexed owner, address indexed spender, uint256 amount); /// @dev Emitted when `target` sets their skipNFT flag to `status`. event SkipNFTSet(address indexed target, bool status); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CUSTOM ERRORS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Thrown when attempting to double-initialize the contract. error DNAlreadyInitialized(); /// @dev Thrown when attempting to transfer or burn more tokens than sender's balance. error InsufficientBalance(); /// @dev Thrown when a spender attempts to transfer tokens with an insufficient allowance. error InsufficientAllowance(); /// @dev Thrown when minting an amount of tokens that would overflow the max tokens. error TotalSupplyOverflow(); /// @dev Thrown when the caller for a fallback NFT function is not the mirror contract. error SenderNotMirror(); /// @dev Thrown when attempting to transfer tokens to the zero address. error TransferToZeroAddress(); /// @dev Thrown when the mirror address provided for initialization is the zero address. error MirrorAddressIsZero(); /// @dev Thrown when the link call to the mirror contract reverts. error LinkMirrorContractFailed(); /// @dev Thrown when setting an NFT token approval /// and the caller is not the owner or an approved operator. error ApprovalCallerNotOwnerNorApproved(); /// @dev Thrown when transferring an NFT /// and the caller is not the owner or an approved operator. error TransferCallerNotOwnerNorApproved(); /// @dev Thrown when transferring an NFT and the from address is not the current owner. error TransferFromIncorrectOwner(); /// @dev Thrown when checking the owner or approved address for an non-existent NFT. error TokenDoesNotExist(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTANTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Amount of token balance that is equal to one NFT. uint256 internal constant _WAD = 10 ** 18; /// @dev The maximum token ID allowed for an NFT. uint256 internal constant _MAX_TOKEN_ID = 0xffffffff; /// @dev The maximum possible token supply. uint256 internal constant _MAX_SUPPLY = 10 ** 18 * 0xffffffff - 1; /// @dev The flag to denote that the address data is initialized. uint8 internal constant _ADDRESS_DATA_INITIALIZED_FLAG = 1 << 0; /// @dev The flag to denote that the address should skip NFTs. uint8 internal constant _ADDRESS_DATA_SKIP_NFT_FLAG = 1 << 1; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct containing an address's token data and settings. struct AddressData { // Auxiliary data. uint88 aux; // Flags for `initialized` and `skipNFT`. uint8 flags; // The alias for the address. Zero means absence of an alias. uint32 addressAlias; // The number of NFT tokens. uint32 ownedLength; // The token balance in wei. uint96 balance; } /// @dev A uint32 map in storage. struct Uint32Map { mapping(uint256 => uint256) map; } /// @dev Struct containing the base token contract storage. struct DN404Storage { // Current number of address aliases assigned. uint32 numAliases; // Next token ID to assign for an NFT mint. uint32 nextTokenId; // Total supply of minted NFTs. uint32 totalNFTSupply; // Total supply of tokens. uint96 totalSupply; // Address of the NFT mirror contract. address mirrorERC721; // Mapping of a user alias number to their address. mapping(uint32 => address) aliasToAddress; // Mapping of user operator approvals for NFTs. mapping(address => mapping(address => bool)) operatorApprovals; // Mapping of NFT token approvals to approved operators. mapping(uint256 => address) tokenApprovals; // Mapping of user allowances for token spenders. mapping(address => mapping(address => uint256)) allowance; // Mapping of NFT token IDs owned by an address. mapping(address => Uint32Map) owned; // Even indices: owner aliases. Odd indices: owned indices. Uint32Map oo; // Mapping of user account AddressData mapping(address => AddressData) addressData; } /// @dev Returns a storage pointer for DN404Storage. function _getDN404Storage() internal pure virtual returns (DN404Storage storage $) { /// @solidity memory-safe-assembly assembly { // `uint72(bytes9(keccak256("DN404_STORAGE")))`. $.slot := 0xa20d6e21d0e5255308 // Truncate to 9 bytes to reduce bytecode size. } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INITIALIZER */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Initializes the DN404 contract with an /// `initialTokenSupply`, `initialTokenOwner` and `mirror` NFT contract address. function _initializeDN404( uint256 initialTokenSupply, address initialSupplyOwner, address mirror ) internal virtual { DN404Storage storage $ = _getDN404Storage(); if ($.nextTokenId != 0) revert DNAlreadyInitialized(); if (mirror == address(0)) revert MirrorAddressIsZero(); _linkMirrorContract(mirror); $.nextTokenId = 1; $.mirrorERC721 = mirror; if (initialTokenSupply > 0) { if (initialSupplyOwner == address(0)) revert TransferToZeroAddress(); if (initialTokenSupply > _MAX_SUPPLY) revert TotalSupplyOverflow(); $.totalSupply = uint96(initialTokenSupply); AddressData storage initialOwnerAddressData = _addressData(initialSupplyOwner); initialOwnerAddressData.balance = uint96(initialTokenSupply); emit Transfer(address(0), initialSupplyOwner, initialTokenSupply); _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. Always 18. function decimals() public pure returns (uint8) { return 18; } /// @dev Returns the amount of tokens in existence. function totalSupply() public view virtual returns (uint256) { return uint256(_getDN404Storage().totalSupply); } /// @dev Returns the amount of tokens owned by `owner`. function balanceOf(address owner) public view virtual returns (uint256) { return _getDN404Storage().addressData[owner].balance; } /// @dev Returns the amount of tokens that `spender` can spend on behalf of `owner`. function allowance(address owner, address spender) public view returns (uint256) { return _getDN404Storage().allowance[owner][spender]; } /// @dev Sets `amount` as the allowance of `spender` over the caller's tokens. /// /// Emits a {Approval} event. function approve(address spender, uint256 amount) public virtual returns (bool) { DN404Storage storage $ = _getDN404Storage(); $.allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /// @dev Transfer `amount` tokens from the caller to `to`. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Requirements: /// - `from` must at least have `amount`. /// /// Emits a {Transfer} event. function transfer(address to, uint256 amount) public virtual returns (bool) { _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; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL MINT FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Mints `amount` tokens to `to`, increasing the total supply. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Emits a {Transfer} event. function _mint(address to, uint256 amount) internal virtual { if (to == address(0)) revert TransferToZeroAddress(); DN404Storage storage $ = _getDN404Storage(); AddressData storage toAddressData = _addressData(to); unchecked { uint256 currentTokenSupply = uint256($.totalSupply) + amount; if (amount > _MAX_SUPPLY || currentTokenSupply > _MAX_SUPPLY) { revert TotalSupplyOverflow(); } $.totalSupply = uint96(currentTokenSupply); uint256 toBalance = toAddressData.balance + amount; toAddressData.balance = uint96(toBalance); if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) { Uint32Map storage toOwned = $.owned[to]; uint256 toIndex = toAddressData.ownedLength; uint256 toEnd = toBalance / _WAD; _PackedLogs memory packedLogs = _packedLogsMalloc(_zeroFloorSub(toEnd, toIndex)); if (packedLogs.logs.length != 0) { uint256 maxNFTId = $.totalSupply / _WAD; uint32 toAlias = _registerAndResolveAlias(toAddressData, to); uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(packedLogs.logs.length); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while (_get($.oo, _ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } _set(toOwned, toIndex, uint32(id)); _setOwnerAliasAndOwnedIndex($.oo, id, toAlias, uint32(toIndex++)); _packedLogsAppend(packedLogs, to, id, 0); if (++id > maxNFTId) id = 1; } while (toIndex != toEnd); $.nextTokenId = uint32(id); _packedLogsSend(packedLogs, $.mirrorERC721); } } } emit Transfer(address(0), to, amount); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL BURN FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Burns `amount` tokens from `from`, reducing the total supply. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Emits a {Transfer} event. function _burn(address from, uint256 amount) internal virtual { DN404Storage storage $ = _getDN404Storage(); AddressData storage fromAddressData = _addressData(from); uint256 fromBalance = fromAddressData.balance; if (amount > fromBalance) revert InsufficientBalance(); uint256 currentTokenSupply = $.totalSupply; unchecked { fromBalance -= amount; fromAddressData.balance = uint96(fromBalance); currentTokenSupply -= amount; $.totalSupply = uint96(currentTokenSupply); Uint32Map storage fromOwned = $.owned[from]; uint256 fromIndex = fromAddressData.ownedLength; uint256 nftAmountToBurn = _zeroFloorSub(fromIndex, fromBalance / _WAD); if (nftAmountToBurn != 0) { $.totalNFTSupply -= uint32(nftAmountToBurn); _PackedLogs memory packedLogs = _packedLogsMalloc(nftAmountToBurn); uint256 fromEnd = fromIndex - nftAmountToBurn; // Burn loop. do { uint256 id = _get(fromOwned, --fromIndex); _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0); delete $.tokenApprovals[id]; _packedLogsAppend(packedLogs, from, id, 1); } while (fromIndex != fromEnd); fromAddressData.ownedLength = uint32(fromIndex); _packedLogsSend(packedLogs, $.mirrorERC721); } } emit Transfer(from, address(0), amount); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL TRANSFER FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Moves `amount` of tokens from `from` to `to`. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Emits a {Transfer} event. function _transfer(address from, address to, uint256 amount) internal virtual { if (to == address(0)) revert TransferToZeroAddress(); DN404Storage storage $ = _getDN404Storage(); AddressData storage fromAddressData = _addressData(from); AddressData storage toAddressData = _addressData(to); _TransferTemps memory t; t.fromOwnedLength = fromAddressData.ownedLength; t.toOwnedLength = toAddressData.ownedLength; t.fromBalance = fromAddressData.balance; if (amount > t.fromBalance) revert InsufficientBalance(); unchecked { t.fromBalance -= amount; fromAddressData.balance = uint96(t.fromBalance); toAddressData.balance = uint96(t.toBalance = toAddressData.balance + amount); t.nftAmountToBurn = _zeroFloorSub(t.fromOwnedLength, t.fromBalance / _WAD); if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) { if (from == to) t.toOwnedLength = t.fromOwnedLength - t.nftAmountToBurn; t.nftAmountToMint = _zeroFloorSub(t.toBalance / _WAD, t.toOwnedLength); } _PackedLogs memory packedLogs = _packedLogsMalloc(t.nftAmountToBurn + t.nftAmountToMint); if (t.nftAmountToBurn != 0) { Uint32Map storage fromOwned = $.owned[from]; uint256 fromIndex = t.fromOwnedLength; uint256 fromEnd = fromIndex - t.nftAmountToBurn; $.totalNFTSupply -= uint32(t.nftAmountToBurn); fromAddressData.ownedLength = uint32(fromEnd); // Burn loop. do { uint256 id = _get(fromOwned, --fromIndex); _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0); delete $.tokenApprovals[id]; _packedLogsAppend(packedLogs, from, id, 1); } while (fromIndex != fromEnd); } if (t.nftAmountToMint != 0) { Uint32Map storage toOwned = $.owned[to]; uint256 toIndex = t.toOwnedLength; uint256 toEnd = toIndex + t.nftAmountToMint; uint32 toAlias = _registerAndResolveAlias(toAddressData, to); uint256 maxNFTId = $.totalSupply / _WAD; uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(t.nftAmountToMint); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while (_get($.oo, _ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } _set(toOwned, toIndex, uint32(id)); _setOwnerAliasAndOwnedIndex($.oo, id, toAlias, uint32(toIndex++)); _packedLogsAppend(packedLogs, to, id, 0); if (++id > maxNFTId) id = 1; } while (toIndex != toEnd); $.nextTokenId = uint32(id); } if (packedLogs.logs.length != 0) { _packedLogsSend(packedLogs, $.mirrorERC721); } } emit Transfer(from, to, amount); } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Call must originate from the mirror contract. /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// `msgSender` must be the owner of the token, or be approved to manage the token. /// /// Emits a {Transfer} event. function _transferFromNFT(address from, address to, uint256 id, address msgSender) internal virtual { DN404Storage storage $ = _getDN404Storage(); if (to == address(0)) revert TransferToZeroAddress(); address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; if (from != owner) revert TransferFromIncorrectOwner(); if (msgSender != from) { if (!$.operatorApprovals[from][msgSender]) { if (msgSender != $.tokenApprovals[id]) { revert TransferCallerNotOwnerNorApproved(); } } } AddressData storage fromAddressData = _addressData(from); AddressData storage toAddressData = _addressData(to); fromAddressData.balance -= uint96(_WAD); unchecked { toAddressData.balance += uint96(_WAD); _set($.oo, _ownershipIndex(id), _registerAndResolveAlias(toAddressData, to)); delete $.tokenApprovals[id]; uint256 updatedId = _get($.owned[from], --fromAddressData.ownedLength); _set($.owned[from], _get($.oo, _ownedIndex(id)), uint32(updatedId)); uint256 n = toAddressData.ownedLength++; _set($.oo, _ownedIndex(updatedId), _get($.oo, _ownedIndex(id))); _set($.owned[to], n, uint32(id)); _set($.oo, _ownedIndex(id), uint32(n)); } emit Transfer(from, to, _WAD); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* DATA HITCHHIKING FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the auxiliary data for `owner`. /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data. /// Auxiliary data can be set for any address, even if it does not have any tokens. function _getAux(address owner) internal view virtual returns (uint88) { return _getDN404Storage().addressData[owner].aux; } /// @dev Set the auxiliary data for `owner` to `value`. /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data. /// Auxiliary data can be set for any address, even if it does not have any tokens. function _setAux(address owner, uint88 value) internal virtual { _getDN404Storage().addressData[owner].aux = value; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* SKIP NFT FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns true if account `a` will skip NFT minting on token mints and transfers. /// Returns false if account `a` will mint NFTs on token mints and transfers. function getSkipNFT(address a) public view virtual returns (bool) { AddressData storage d = _getDN404Storage().addressData[a]; if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) return _hasCode(a); return d.flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0; } /// @dev Sets the caller's skipNFT flag to `skipNFT` /// /// Emits a {SkipNFTSet} event. function setSkipNFT(bool skipNFT) public virtual { _setSkipNFT(msg.sender, skipNFT); } /// @dev Internal function to set account `a` skipNFT flag to `state` /// /// Initializes account `a` AddressData if it is not currently initialized. /// /// Emits a {SkipNFTSet} event. function _setSkipNFT(address a, bool state) internal virtual { AddressData storage d = _addressData(a); if ((d.flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0) != state) { d.flags ^= _ADDRESS_DATA_SKIP_NFT_FLAG; } emit SkipNFTSet(a, state); } /// @dev Returns a storage data pointer for account `a` AddressData /// /// Initializes account `a` AddressData if it is not currently initialized. function _addressData(address a) internal virtual returns (AddressData storage d) { DN404Storage storage $ = _getDN404Storage(); d = $.addressData[a]; if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) { uint8 flags = _ADDRESS_DATA_INITIALIZED_FLAG; if (_hasCode(a)) flags |= _ADDRESS_DATA_SKIP_NFT_FLAG; d.flags = flags; } } /// @dev Returns the `addressAlias` of account `to`. /// /// Assigns and registers the next alias if `to` alias was not previously registered. function _registerAndResolveAlias(AddressData storage toAddressData, address to) internal virtual returns (uint32 addressAlias) { DN404Storage storage $ = _getDN404Storage(); addressAlias = toAddressData.addressAlias; if (addressAlias == 0) { addressAlias = ++$.numAliases; toAddressData.addressAlias = addressAlias; $.aliasToAddress[addressAlias] = to; } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the mirror NFT contract. function mirrorERC721() public view virtual returns (address) { return _getDN404Storage().mirrorERC721; } /// @dev Returns the total NFT supply. function _totalNFTSupply() internal view virtual returns (uint256) { return _getDN404Storage().totalNFTSupply; } /// @dev Returns `owner` NFT balance. function _balanceOfNFT(address owner) internal view virtual returns (uint256) { return _getDN404Storage().addressData[owner].ownedLength; } /// @dev Returns the owner of token `id`. /// Returns the zero address instead of reverting if the token does not exist. function _ownerAt(uint256 id) internal view virtual returns (address) { DN404Storage storage $ = _getDN404Storage(); return $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; } /// @dev Returns the owner of token `id`. /// /// Requirements: /// - Token `id` must exist. function _ownerOf(uint256 id) internal view virtual returns (address) { if (!_exists(id)) revert TokenDoesNotExist(); return _ownerAt(id); } /// @dev Returns if token `id` exists. function _exists(uint256 id) internal view virtual returns (bool) { return _ownerAt(id) != address(0); } /// @dev Returns the account approved to manage token `id`. /// /// Requirements: /// - Token `id` must exist. function _getApproved(uint256 id) internal view virtual returns (address) { if (!_exists(id)) revert TokenDoesNotExist(); return _getDN404Storage().tokenApprovals[id]; } /// @dev Sets `spender` as the approved account to manage token `id`, using `msgSender`. /// /// Requirements: /// - `msgSender` must be the owner or an approved operator for the token owner. function _approveNFT(address spender, uint256 id, address msgSender) internal virtual returns (address) { DN404Storage storage $ = _getDN404Storage(); address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; if (msgSender != owner) { if (!$.operatorApprovals[owner][msgSender]) { revert ApprovalCallerNotOwnerNorApproved(); } } $.tokenApprovals[id] = spender; return owner; } /// @dev Approve or remove the `operator` as an operator for `msgSender`, /// without authorization checks. function _setApprovalForAll(address operator, bool approved, address msgSender) internal virtual { _getDN404Storage().operatorApprovals[msgSender][operator] = approved; } /// @dev Calls the mirror contract to link it to this contract. /// /// Reverts if the call to the mirror contract reverts. function _linkMirrorContract(address mirror) internal virtual { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x0f4599e5) // `linkMirrorContract(address)`. mstore(0x20, caller()) if iszero(and(eq(mload(0x00), 1), call(gas(), mirror, 0, 0x1c, 0x24, 0x00, 0x20))) { mstore(0x00, 0xd125259c) // `LinkMirrorContractFailed()`. revert(0x1c, 0x04) } } } /// @dev Fallback modifier to dispatch calls from the mirror NFT contract /// to internal functions in this contract. modifier dn404Fallback() virtual { DN404Storage storage $ = _getDN404Storage(); uint256 fnSelector = _calldataload(0x00) >> 224; // `isApprovedForAll(address,address)`. if (fnSelector == 0xe985e9c5) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x44) revert(); address owner = address(uint160(_calldataload(0x04))); address operator = address(uint160(_calldataload(0x24))); _return($.operatorApprovals[owner][operator] ? 1 : 0); } // `ownerOf(uint256)`. if (fnSelector == 0x6352211e) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); uint256 id = _calldataload(0x04); _return(uint160(_ownerOf(id))); } // `transferFromNFT(address,address,uint256,address)`. if (fnSelector == 0xe5eb36c8) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x84) revert(); address from = address(uint160(_calldataload(0x04))); address to = address(uint160(_calldataload(0x24))); uint256 id = _calldataload(0x44); address msgSender = address(uint160(_calldataload(0x64))); _transferFromNFT(from, to, id, msgSender); _return(1); } // `setApprovalForAll(address,bool,address)`. if (fnSelector == 0x813500fc) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x64) revert(); address spender = address(uint160(_calldataload(0x04))); bool status = _calldataload(0x24) != 0; address msgSender = address(uint160(_calldataload(0x44))); _setApprovalForAll(spender, status, msgSender); _return(1); } // `approveNFT(address,uint256,address)`. if (fnSelector == 0xd10b6e0c) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x64) revert(); address spender = address(uint160(_calldataload(0x04))); uint256 id = _calldataload(0x24); address msgSender = address(uint160(_calldataload(0x44))); _return(uint160(_approveNFT(spender, id, msgSender))); } // `getApproved(uint256)`. if (fnSelector == 0x081812fc) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); uint256 id = _calldataload(0x04); _return(uint160(_getApproved(id))); } // `balanceOfNFT(address)`. if (fnSelector == 0xf5b100ea) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); address owner = address(uint160(_calldataload(0x04))); _return(_balanceOfNFT(owner)); } // `totalNFTSupply()`. if (fnSelector == 0xe2c79281) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x04) revert(); _return(_totalNFTSupply()); } // `implementsDN404()`. if (fnSelector == 0xb7a94eb8) { _return(1); } _; } /// @dev Fallback function for calls from mirror NFT contract. fallback() external payable virtual dn404Fallback {} receive() external payable virtual {} /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* PRIVATE HELPERS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct containing packed log data for `Transfer` events to be /// emitted by the mirror NFT contract. struct _PackedLogs { uint256[] logs; uint256 offset; } /// @dev Initiates memory allocation for packed logs with `n` log items. function _packedLogsMalloc(uint256 n) private pure returns (_PackedLogs memory p) { /// @solidity memory-safe-assembly assembly { let logs := add(mload(0x40), 0x40) // Offset by 2 words for `_packedLogsSend`. mstore(logs, n) let offset := add(0x20, logs) mstore(0x40, add(offset, shl(5, n))) mstore(p, logs) mstore(add(0x20, p), offset) } } /// @dev Adds a packed log item to `p` with address `a`, token `id` and burn flag `burnBit`. function _packedLogsAppend(_PackedLogs memory p, address a, uint256 id, uint256 burnBit) private pure { /// @solidity memory-safe-assembly assembly { let offset := mload(add(0x20, p)) mstore(offset, or(or(shl(96, a), shl(8, id)), burnBit)) mstore(add(0x20, p), add(offset, 0x20)) } } /// @dev Calls the `mirror` NFT contract to emit Transfer events for packed logs `p`. function _packedLogsSend(_PackedLogs memory p, address mirror) private { /// @solidity memory-safe-assembly assembly { let logs := mload(p) let o := sub(logs, 0x40) // Start of calldata to send. mstore(o, 0x263c69d6) // `logTransfer(uint256[])`. mstore(add(o, 0x20), 0x20) // Offset of `logs` in the calldata to send. let n := add(0x44, shl(5, mload(logs))) // Length of calldata to send. if iszero(and(eq(mload(o), 1), call(gas(), mirror, 0, add(o, 0x1c), n, o, 0x20))) { revert(o, 0x00) } } } /// @dev Struct of temporary variables for transfers. struct _TransferTemps { uint256 nftAmountToBurn; uint256 nftAmountToMint; uint256 fromBalance; uint256 toBalance; uint256 fromOwnedLength; uint256 toOwnedLength; } /// @dev Returns if `a` has bytecode of non-zero length. function _hasCode(address a) private view returns (bool result) { /// @solidity memory-safe-assembly assembly { result := extcodesize(a) // Can handle dirty upper bits. } } /// @dev Returns the calldata value at `offset`. function _calldataload(uint256 offset) private pure returns (uint256 value) { /// @solidity memory-safe-assembly assembly { value := calldataload(offset) } } /// @dev Executes a return opcode to return `x` and end the current call frame. function _return(uint256 x) private pure { /// @solidity memory-safe-assembly assembly { mstore(0x00, x) return(0x00, 0x20) } } /// @dev Returns `max(0, x - y)`. function _zeroFloorSub(uint256 x, uint256 y) private pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { z := mul(gt(x, y), sub(x, y)) } } /// @dev Returns `i << 1`. function _ownershipIndex(uint256 i) private pure returns (uint256) { return i << 1; } /// @dev Returns `(i << 1) + 1`. function _ownedIndex(uint256 i) private pure returns (uint256) { unchecked { return (i << 1) + 1; } } /// @dev Returns the uint32 value at `index` in `map`. function _get(Uint32Map storage map, uint256 index) private view returns (uint32 result) { result = uint32(map.map[index >> 3] >> ((index & 7) << 5)); } /// @dev Updates the uint32 value at `index` in `map`. function _set(Uint32Map storage map, uint256 index, uint32 value) private { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, shr(3, index)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(5, and(index, 7)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } /// @dev Sets the owner alias and the owned index together. function _setOwnerAliasAndOwnedIndex( Uint32Map storage map, uint256 id, uint32 ownership, uint32 ownedIndex ) private { /// @solidity memory-safe-assembly assembly { let value := or(shl(32, ownedIndex), and(0xffffffff, ownership)) mstore(0x20, map.slot) mstore(0x00, shr(2, id)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(6, and(id, 3)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffffffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } } contract TallBits is DN404, Ownable { string private _name; string private _symbol; string private _baseURI; constructor( string memory name_, string memory symbol_, uint96 initialTokenSupply, address initialSupplyOwner ) { _initializeOwner(msg.sender); _name = name_; _symbol = symbol_; address mirror = address(new DN404Mirror(msg.sender)); _initializeDN404(initialTokenSupply, initialSupplyOwner, mirror); } function name() public view override returns (string memory) { return _name; } function symbol() public view override returns (string memory) { return _symbol; } function tokenURI(uint256 tokenId) public view override returns (string memory result) { if (bytes(_baseURI).length != 0) { uint256 seed = uint256(keccak256(abi.encodePacked(tokenId, address(this)))); result = string(abi.encodePacked(_baseURI, LibString.toString(seed))); } } // This allows the owner of the contract to mint more tokens. function mint(address to, uint256 amount) public onlyOwner { _mint(to, amount); } function setBaseURI(string calldata baseURI_) public onlyOwner { _baseURI = baseURI_; } function withdraw() public onlyOwner { SafeTransferLib.safeTransferAllETH(msg.sender); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint96","name":"initialTokenSupply","type":"uint96"},{"internalType":"address","name":"initialSupplyOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"DNAlreadyInitialized","type":"error"},{"inputs":[],"name":"InsufficientAllowance","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"LinkMirrorContractFailed","type":"error"},{"inputs":[],"name":"MirrorAddressIsZero","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"SenderNotMirror","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TotalSupplyOverflow","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SkipNFTSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"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":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","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":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"result","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"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
608060405234801562000010575f80fd5b5060405162003585380380620035858339810160408190526200003391620004b6565b6200003e33620000b9565b5f6200004b8582620005dc565b5060016200005a8482620005dc565b505f336040516200006b90620003e7565b6001600160a01b039091168152602001604051809103905ff08015801562000095573d5f803e3d5ffd5b509050620000ae6001600160601b0384168383620000f5565b5050505050620006a8565b6001600160a01b0316638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a35b50565b68a20d6e21d0e52553088054640100000000900463ffffffff16156200012e57604051633ab534b960e21b815260040160405180910390fd5b6001600160a01b03821662000156576040516339a84a7b60e01b815260040160405180910390fd5b620001618262000299565b805463ffffffff60201b19166401000000001781556001810180546001600160a01b0384166001600160a01b0319909116179055831562000293576001600160a01b038316620001c457604051633a954ecd60e21b815260040160405180910390fd5b6b0de0b6b39983494c589bffff841115620001f25760405163e5cfe95760e01b815260040160405180910390fd5b8054600160601b600160c01b0319166c010000000000000000000000006001600160601b038616021781555f6200022984620002c7565b80546001600160a01b03908116600160a01b6001600160601b038916021782556040518781529192508516905f907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a36200029184600162000344565b505b50505050565b630f4599e55f523360205260205f6024601c5f855af160015f511416620000f25763d125259c5f526004601cfd5b6001600160a01b0381165f90815268a20d6e21d0e5255310602052604081208054909168a20d6e21d0e5255308916b010000000000000000000000900460011690036200033e576001833b156200031c576002175b825460ff9091166b0100000000000000000000000260ff60581b199091161782555b50919050565b5f6200035083620002c7565b80549091506b01000000000000000000000090046002161515821515146200039c57805460ff6b01000000000000000000000080830482166002189091160260ff60581b199091161781555b826001600160a01b03167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d642039383604051620003da911515815260200190565b60405180910390a2505050565b610e9880620026ed83390190565b634e487b7160e01b5f52604160045260245ffd5b5f82601f83011262000419575f80fd5b81516001600160401b0380821115620004365762000436620003f5565b604051601f8301601f19908116603f01168101908282118183101715620004615762000461620003f5565b81604052838152602092508660208588010111156200047e575f80fd5b5f91505b83821015620004a1578582018301518183018401529082019062000482565b5f602085830101528094505050505092915050565b5f805f8060808587031215620004ca575f80fd5b84516001600160401b0380821115620004e1575f80fd5b620004ef8883890162000409565b9550602087015191508082111562000505575f80fd5b50620005148782880162000409565b604087015190945090506001600160601b038116811462000533575f80fd5b60608601519092506001600160a01b038116811462000550575f80fd5b939692955090935050565b600181811c908216806200057057607f821691505b6020821081036200033e57634e487b7160e01b5f52602260045260245ffd5b601f821115620005d757805f5260205f20601f840160051c81016020851015620005b65750805b601f840160051c820191505b8181101562000291575f8155600101620005c2565b505050565b81516001600160401b03811115620005f857620005f8620003f5565b62000610816200060984546200055b565b846200058f565b602080601f83116001811462000646575f84156200062e5750858301515b5f19600386901b1c1916600185901b178555620006a0565b5f85815260208120601f198616915b82811015620006765788860151825594840194600190910190840162000655565b50858210156200069457878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b61203780620006b65f395ff3fe608060405260043610610143575f3560e01c806354d1f13d116100b5578063a9059cbb1161006e578063a9059cbb1461072f578063c87b56dd1461074e578063dd62ed3e1461076d578063f04e283e146107b9578063f2fde38b146107cc578063fee81cf4146107df5761014a565b806354d1f13d1461068857806355f804b31461069057806370a08231146106af578063715018a6146106fb5780638da5cb5b1461070357806395d89b411461071b5761014a565b8063274e430b11610107578063274e430b146105c35780632a6a935d146105e2578063313ce567146106015780633ccfd60b1461061c57806340c10f19146106305780634ef41efc1461064f5761014a565b806306fdde031461050d578063095ea7b31461053757806318160ddd1461056657806323b872dd1461059c57806325692962146105bb5761014a565b3661014a57005b68a20d6e21d0e52553085f3560e01c63e985e9c58190036101ec5760018201546001600160a01b031633146101925760405163ce5a776b60e01b815260040160405180910390fd5b604436101561019f575f80fd5b6004356001600160a01b038181165f908152600385016020908152604080832060243594851684529091529020546101e99060ff166101de575f6101e1565b60015b60ff16610810565b50505b80636352211e036102505760018201546001600160a01b031633146102245760405163ce5a776b60e01b815260040160405180910390fd5b6024361015610231575f80fd5b60043561024e61024082610818565b6001600160a01b0316610810565b505b8063e5eb36c8036102bc5760018201546001600160a01b031633146102885760405163ce5a776b60e01b815260040160405180910390fd5b6084361015610295575f80fd5b6004356024356044356064356102ad8484848461084e565b6102b76001610810565b505050505b8063813500fc036103545760018201546001600160a01b031633146102f45760405163ce5a776b60e01b815260040160405180910390fd5b6064361015610301575f80fd5b6001600160a01b036044358181165f90815268a20d6e21d0e525530b6020908152604080832060043595861684529091529020805460ff19166024351515908117909155906103506001610810565b5050505b8063d10b6e0c036103b45760018201546001600160a01b0316331461038c5760405163ce5a776b60e01b815260040160405180910390fd5b6064361015610399575f80fd5b6004356024356044356103b0610240848484610bd1565b5050505b8063081812fc0361040a5760018201546001600160a01b031633146103ec5760405163ce5a776b60e01b815260040160405180910390fd5b60243610156103f9575f80fd5b60043561040861024082610ca6565b505b8063f5b100ea036104905760018201546001600160a01b031633146104425760405163ce5a776b60e01b815260040160405180910390fd5b602436101561044f575f80fd5b60043561048e610489826001600160a01b03165f90815268a20d6e21d0e5255310602052604090205463ffffffff600160801b9091041690565b610810565b505b8063e2c79281036104f65760018201546001600160a01b031633146104c85760405163ce5a776b60e01b815260040160405180910390fd5b60043610156104d5575f80fd5b68a20d6e21d0e5255308546104f690600160401b900463ffffffff16610810565b8063b7a94eb80361050b5761050b6001610810565b005b348015610518575f80fd5b50610521610cf0565b60405161052e9190611c34565b60405180910390f35b348015610542575f80fd5b50610556610551366004611c7c565b610d7f565b604051901515815260200161052e565b348015610571575f80fd5b5068a20d6e21d0e525530854600160601b90046001600160601b03165b60405190815260200161052e565b3480156105a7575f80fd5b506105566105b6366004611ca4565b610df3565b61050b610e93565b3480156105ce575f80fd5b506105566105dd366004611cdd565b610ee0565b3480156105ed575f80fd5b5061050b6105fc366004611cf6565b610f2e565b34801561060c575f80fd5b506040516012815260200161052e565b348015610627575f80fd5b5061050b610f3b565b34801561063b575f80fd5b5061050b61064a366004611c7c565b610f4e565b34801561065a575f80fd5b5068a20d6e21d0e5255309546001600160a01b03165b6040516001600160a01b03909116815260200161052e565b61050b610f64565b34801561069b575f80fd5b5061050b6106aa366004611d15565b610f9d565b3480156106ba575f80fd5b5061058e6106c9366004611cdd565b6001600160a01b03165f90815268a20d6e21d0e52553106020526040902054600160a01b90046001600160601b031690565b61050b610fb7565b34801561070e575f80fd5b50638b78c6d81954610670565b348015610726575f80fd5b50610521610fc8565b34801561073a575f80fd5b50610556610749366004611c7c565b610fd7565b348015610759575f80fd5b50610521610768366004611d81565b610fec565b348015610778575f80fd5b5061058e610787366004611d98565b6001600160a01b039182165f90815268a20d6e21d0e525530d6020908152604080832093909416825291909152205490565b61050b6107c7366004611cdd565b61107f565b61050b6107da366004611cdd565b6110b9565b3480156107ea575f80fd5b5061058e6107f9366004611cdd565b63389a75e1600c9081525f91909152602090205490565b805f5260205ff35b5f610822826110df565b61083f5760405163677510db60e11b815260040160405180910390fd5b610848826110fb565b92915050565b68a20d6e21d0e52553086001600160a01b03841661087f57604051633a954ecd60e21b815260040160405180910390fd5b5f816002015f6108b8846007016108968860011b90565b600381901c5f90815260209290925260409091205460059190911b60e0161c90565b63ffffffff16815260208101919091526040015f20546001600160a01b039081169150861681146108fb5760405162a1148160e81b815260040160405180910390fd5b856001600160a01b0316836001600160a01b03161461097d576001600160a01b038087165f90815260038401602090815260408083209387168352929052205460ff1661097d575f8481526004830160205260409020546001600160a01b0384811691161461097d57604051632ce44b5f60e11b815260040160405180910390fd5b5f6109878761114e565b90505f6109938761114e565b8254909150670de0b6b3a76400009083906014906109c2908490600160a01b90046001600160601b0316611ddd565b82546101009290920a6001600160601b0381810219909316918316021790915582546001600160a01b038116670de0b6b3a7640000600160a01b928390048416019092160217825550610a2660078501600188901b610a21848b6111b9565b611259565b5f868152600485016020908152604080832080546001600160a01b03191690556001600160a01b038b168352600687018252808320855463ffffffff60801b198116600160801b9182900463ffffffff9081165f1901908116909202178755631fffffff600382901c168552925282205460059190911b60e0161c6001600160a01b038a165f908152600687016020526040902063ffffffff919091169150610ae790610adb6007880160018b811b01610896565b63ffffffff1683611259565b8154600163ffffffff600160801b80840482169283019091160263ffffffff60801b19909216919091178355610b3960078701610b2784600190811b0190565b610a2160078a0160018d811b01610896565b6001600160a01b0389165f9081526006870160205260409020610b5d90828a611259565b610b706007870160018a811b0183611259565b5050866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef670de0b6b3a7640000604051610bbf91815260200190565b60405180910390a35050505050505050565b5f68a20d6e21d0e52553088168a20d6e21d0e525530a81610bff68a20d6e21d0e525530f600189901b610896565b63ffffffff16815260208101919091526040015f20546001600160a01b03908116915084168114610c71576001600160a01b038082165f90815260038401602090815260408083209388168352929052205460ff16610c71576040516367d9dca160e11b815260040160405180910390fd5b5f8581526004909201602052604090912080546001600160a01b0387166001600160a01b031990911617905590509392505050565b5f610cb0826110df565b610ccd5760405163677510db60e11b815260040160405180910390fd5b505f90815268a20d6e21d0e525530c60205260409020546001600160a01b031690565b60605f8054610cfe90611dfd565b80601f0160208091040260200160405190810160405280929190818152602001828054610d2a90611dfd565b8015610d755780601f10610d4c57610100808354040283529160200191610d75565b820191905f5260205f20905b815481529060010190602001808311610d5857829003601f168201915b5050505050905090565b5f8068a20d6e21d0e5255308335f81815260058301602090815260408083206001600160a01b038a16808552908352928190208890555187815293945090927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b6001600160a01b0383165f90815268a20d6e21d0e525530d6020908152604080832033845290915281205468a20d6e21d0e5255308905f198114610e7c5780841115610e52576040516313be252b60e01b815260040160405180910390fd5b6001600160a01b0386165f9081526005830160209081526040808320338452909152902084820390555b610e8786868661128b565b50600195945050505050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b6001600160a01b0381165f90815268a20d6e21d0e5255310602052604081208054600160581b90046001168203610f1b57823b5b9392505050565b54600160581b9004600216151592915050565b610f383382611747565b50565b610f436117d6565b610f4c336117f0565b565b610f566117d6565b610f608282611809565b5050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610fa56117d6565b6002610fb2828483611e8e565b505050565b610fbf6117d6565b610f4c5f611b12565b606060018054610cfe90611dfd565b5f610fe333848461128b565b50600192915050565b606060028054610ffb90611dfd565b15905061107a575f823060405160200161103192919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b604051602081830303815290604052805190602001205f1c9050600261105682611b4f565b604051602001611067929190611f48565b6040516020818303038152906040529150505b919050565b6110876117d6565b63389a75e1600c52805f526020600c2080544211156110ad57636f5e88185f526004601cfd5b5f9055610f3881611b12565b6110c16117d6565b8060601b6110d657637448fbae5f526004601cfd5b610f3881611b12565b5f806110ea836110fb565b6001600160a01b0316141592915050565b5f68a20d6e21d0e525530868a20d6e21d0e525530a8261112868a20d6e21d0e525530f600187901b610896565b63ffffffff16815260208101919091526040015f20546001600160a01b03169392505050565b6001600160a01b0381165f90815268a20d6e21d0e5255310602052604081208054909168a20d6e21d0e525530891600160581b900460011690036111b3576001833b15611199576002175b825460ff909116600160581b0260ff60581b199091161782555b50919050565b8154600160601b900463ffffffff1668a20d6e21d0e52553085f82900361125257805481905f906111ef9063ffffffff16611fcb565b825463ffffffff8083166101009490940a848102910219909116179092558554600160601b820263ffffffff60601b199091161786555f908152600283016020526040902080546001600160a01b0386166001600160a01b031990911617905591505b5092915050565b826020528160031c5f5260405f206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b6001600160a01b0382166112b257604051633a954ecd60e21b815260040160405180910390fd5b68a20d6e21d0e52553085f6112c68561114e565b90505f6112d28561114e565b90506113076040518060c001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b825463ffffffff600160801b808304821660808501528454041660a08301526001600160601b03600160a01b909104166040820181905285111561135e57604051631e9acf1760e31b815260040160405180910390fd5b6040810180518690039081905283546001600160601b03808316600160a01b9081026001600160a01b03938416178755855481810483168a016060870181905290921602911617835560808201516113c491670de0b6b3a7640000900480821191030290565b81528154600160581b90046002165f0361143257856001600160a01b0316876001600160a01b0316036113ff57805160808201510360a08201525b61142c670de0b6b3a764000082606001518161141d5761141d611fed565b048260a0015180821191030290565b60208201525b5f6114798260200151835f01510160408051808201909152606081525f60208201526040805101828152806020018360051b81016040528183528083602001525050919050565b82519091501561156e576001600160a01b0388165f908152600686016020526040902060808301518351875463ffffffff600160401b808304821684900382160263ffffffff60401b199092169190911789558754918303908116600160801b0263ffffffff60801b199092169190911787555b5f1991909101600381901c5f90815260208490526040812054919291600584901b60e0161c63ffffffff16905061152989600701825f80611b91565b5f81815260048a016020908152604090912080546001600160a01b0319169055858101805160089390931b60608f901b176001178352910190528082036114ed575050505b6020820151156116cf576001600160a01b0387165f9081526006860160209081526040822060a0850151918501519092908201906115ac878c6111b9565b8954602088015163ffffffff60401b19821663ffffffff600160401b80850482169093018116909202178c55895463ffffffff60801b1916600160801b86831602178a55919250670de0b6b3a7640000600160601b82046001600160601b03160491640100000000909104165b61162a8b6007016108968360011b90565b63ffffffff16156116495760010181811115611644575060015b611619565b611654868683611259565b6116698b600701828588806001019950611b91565b611692878e835f8360200151818360081b8560601b171781526020810185602001525050505050565b600101818111156116a1575060015b838503611619578a5463ffffffff9091166401000000000267ffffffff0000000019909116178a5550505050505b805151156116f05760018501546116f09082906001600160a01b0316611bd5565b50856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405161173691815260200190565b60405180910390a350505050505050565b5f6117518361114e565b8054909150600160581b900460021615158215151461178c57805460ff600160581b80830482166002189091160260ff60581b199091161781555b826001600160a01b03167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d6420393836040516117c9911515815260200190565b60405180910390a2505050565b638b78c6d819543314610f4c576382b429005f526004601cfd5b5f385f3847855af1610f385763b12d13eb5f526004601cfd5b6001600160a01b03821661183057604051633a954ecd60e21b815260040160405180910390fd5b68a20d6e21d0e52553085f6118448461114e565b8254909150600160601b90046001600160601b031683016b0de0b6b39983494c589bffff84118061188057506b0de0b6b39983494c589bffff81115b1561189e5760405163e5cfe95760e01b815260040160405180910390fd5b82546001600160601b03808316600160601b026bffffffffffffffffffffffff60601b199092169190911784558254600160a01b80820483168701928316026001600160a01b0390911617808455600160581b90046002165f03611aca576001600160a01b0386165f908152600685016020526040812084549091600160801b90910463ffffffff1690670de0b6b3a7640000840490505f6119798383038484110260408051808201909152606081525f60208201526040805101828152806020018360051b81016040528183528083602001525050919050565b80515190915015611ac5578754670de0b6b3a7640000600160601b9091046001600160601b0316045f6119ac898d6111b9565b8a5484515163ffffffff60401b19821663ffffffff600160401b80850482169093018116909202178d558b5463ffffffff60801b1916600160801b88831602178c559192506401000000009004165b611a0c8b6007016108968360011b90565b63ffffffff1615611a2b5760010182811115611a26575060015b6119fb565b611a36878783611259565b611a4b8b600701828489806001019a50611b91565b611a74848e835f8360200151818360081b8560601b171781526020810185602001525050505050565b60010182811115611a83575060015b8486036119fb578a5467ffffffff00000000191664010000000063ffffffff831602178b5560018b0154611ac19085906001600160a01b0316611bd5565b5050505b505050505b50506040518381526001600160a01b038516905f907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350505050565b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b60606080604051019050602081016040525f8152805f19835b928101926030600a8206018453600a900480611b68575050819003601f19909101908152919050565b8163ffffffff168160201b17846020528360021c5f5260405f206003851660061b815467ffffffffffffffff8482841c188116831b82188455505050505050505050565b81516040810363263c69d68152602080820152815160051b604401915060208183601c84015f875af1600182511416611c0c575f81fd5b50505050565b5f5b83811015611c2c578181015183820152602001611c14565b50505f910152565b602081525f8251806020840152611c52816040850160208701611c12565b601f01601f19169190910160400192915050565b80356001600160a01b038116811461107a575f80fd5b5f8060408385031215611c8d575f80fd5b611c9683611c66565b946020939093013593505050565b5f805f60608486031215611cb6575f80fd5b611cbf84611c66565b9250611ccd60208501611c66565b9150604084013590509250925092565b5f60208284031215611ced575f80fd5b610f1482611c66565b5f60208284031215611d06575f80fd5b81358015158114610f14575f80fd5b5f8060208385031215611d26575f80fd5b823567ffffffffffffffff80821115611d3d575f80fd5b818501915085601f830112611d50575f80fd5b813581811115611d5e575f80fd5b866020828501011115611d6f575f80fd5b60209290920196919550909350505050565b5f60208284031215611d91575f80fd5b5035919050565b5f8060408385031215611da9575f80fd5b611db283611c66565b9150611dc060208401611c66565b90509250929050565b634e487b7160e01b5f52601160045260245ffd5b6001600160601b0382811682821603908082111561125257611252611dc9565b600181811c90821680611e1157607f821691505b6020821081036111b357634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b601f821115610fb257805f5260205f20601f840160051c81016020851015611e685750805b601f840160051c820191505b81811015611e87575f8155600101611e74565b5050505050565b67ffffffffffffffff831115611ea657611ea6611e2f565b611eba83611eb48354611dfd565b83611e43565b5f601f841160018114611eeb575f8515611ed45750838201355b5f19600387901b1c1916600186901b178355611e87565b5f83815260208120601f198716915b82811015611f1a5786850135825560209485019460019092019101611efa565b5086821015611f36575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f808454611f5581611dfd565b60018281168015611f6d5760018114611f8257611fae565b60ff1984168752821515830287019450611fae565b885f526020805f205f5b85811015611fa55781548a820152908401908201611f8c565b50505082870194505b505050508351611fc2818360208801611c12565b01949350505050565b5f63ffffffff808316818103611fe357611fe3611dc9565b6001019392505050565b634e487b7160e01b5f52601260045260245ffdfea2646970667358221220c340885ff8058a4b3bf0358f2e5af868c762d2dabd6a95b3785b78b54051283f64736f6c63430008180033608060405234801561000f575f80fd5b50604051610e98380380610e9883398101604081905261002e9161009b565b683602298b8c10b0123180546001600160a01b0319166001600160a01b03831617905561005a81610060565b506100c8565b6001600160a01b0316638b78c6d819819055805f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b5f602082840312156100ab575f80fd5b81516001600160a01b03811681146100c1575f80fd5b9392505050565b610dc3806100d55f395ff3fe608060405260043610610138575f3560e01c8063715018a6116100aa578063b88d4fde1161006e578063b88d4fde14610471578063c87b56dd14610490578063e985e9c5146104af578063f04e283e146104ce578063f2fde38b146104e1578063fee81cf4146104f45761013f565b8063715018a61461040a5780638da5cb5b1461041257806395d89b411461042a57806397e5311c1461043e578063a22cb465146104525761013f565b806323b872dd116100fc57806323b872dd1461038a57806325692962146103a957806342842e0e146103b157806354d1f13d146103c45780636352211e146103cc57806370a08231146103eb5761013f565b806301ffc9a7146102a057806306fdde03146102f1578063081812fc14610312578063095ea7b31461034957806318160ddd146103685761013f565b3661013f57005b683602298b8c10b012305f3560e01c63263c69d68190036102045781546001600160a01b0316331461018457604051631b1e598960e11b815260040160405180910390fd5b602036103d5f3e6004356024018036103d5f3e602081033560051b81018036103d5f3e5b8082146101f95781358060601c816001168260a01b60a81c811583028284027fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f38a45050508160200191506101a8565b505060015f5260205ff35b80630f4599e50361029e5760018201546001600160a01b03161561025a5760018201546001600160a01b03166004356001600160a01b03161461025a576040516362cf623d60e11b815260040160405180910390fd5b81546001600160a01b03161561028357604051635fb2b52360e11b815260040160405180910390fd5b81546001600160a01b0319163317825560015f908152602090f35b005b3480156102ab575f80fd5b506102dc6102ba366004610b6a565b6301ffc9a760e09190911c9081146380ac58cd821417635b5e139f9091141790565b60405190151581526020015b60405180910390f35b3480156102fc575f80fd5b50610305610525565b6040516102e89190610b98565b34801561031d575f80fd5b5061033161032c366004610be4565b610578565b6040516001600160a01b0390911681526020016102e8565b348015610354575f80fd5b5061029e610363366004610c16565b6105bb565b348015610373575f80fd5b5061037c61063b565b6040519081526020016102e8565b348015610395575f80fd5b5061029e6103a4366004610c3e565b610674565b61029e610700565b61029e6103bf366004610c3e565b61074d565b61029e61077e565b3480156103d7575f80fd5b506103316103e6366004610be4565b6107b7565b3480156103f6575f80fd5b5061037c610405366004610c77565b6107ed565b61029e610832565b34801561041d575f80fd5b50638b78c6d81954610331565b348015610435575f80fd5b50610305610845565b348015610449575f80fd5b50610331610873565b34801561045d575f80fd5b5061029e61046c366004610c90565b6108a8565b34801561047c575f80fd5b5061029e61048b366004610cc9565b610925565b34801561049b575f80fd5b506103056104aa366004610be4565b61097f565b3480156104ba575f80fd5b506102dc6104c9366004610d5c565b6109d8565b61029e6104dc366004610c77565b610a27565b61029e6104ef366004610c77565b610a64565b3480156104ff575f80fd5b5061037c61050e366004610c77565b63389a75e1600c9081525f91909152602090205490565b60605f610530610873565b905060405191506306fdde035f525f806004601c845afa610553573d5f833e3d82fd5b60205f803e60205f51833e815160205f5101602084013e815160208301016040525090565b5f80610582610873565b905063081812fc5f528260205260205f6024601c845afa601f3d11166105ae573d5f6040513e3d604051fd5b5050600c5160601c919050565b5f6105c4610873565b90508260601b60601c925060405163d10b6e0c5f5283602052826040523360605260205f6064601c34865af1601f3d1116610601573d5f823e3d81fd5b80604052505f6060528183600c5160601c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9255f38a4505050565b5f80610645610873565b905063e2c792815f5260205f6004601c845afa601f3d111661066d573d5f6040513e3d604051fd5b50505f5190565b5f61067d610873565b90508360601b60601c93508260601b60601c925060405163e5eb36c881528460208201528360408201528260608201523360808201526020816084601c840134865af16001825114166106d2573d5f823e3d81fd5b508183857fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f38a450505050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b610758838383610674565b813b156107795761077983838360405180602001604052805f815250610a8a565b505050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b5f806107c1610873565b9050636352211e5f528260205260205f6024601c845afa601f3d11166105ae573d5f6040513e3d604051fd5b5f806107f7610873565b90508260601b60601c60205263f5b100ea5f5260205f6024601c845afa601f3d1116610829573d5f6040513e3d604051fd5b50505f51919050565b61083a610b13565b6108435f610b2d565b565b60605f610850610873565b905060405191506395d89b415f525f806004601c845afa610553573d5f833e3d82fd5b683602298b8c10b01230546001600160a01b0316806108a557604051632d9523d760e11b815260040160405180910390fd5b90565b5f6108b1610873565b90508260601b60601c925060405163813500fc5f52836020528215156040523360605260205f6064601c34865af160015f5114166108f1573d5f823e3d81fd5b83337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206040a360405250505f60605250565b610930858585610674565b833b156109785761097885858585858080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250610a8a92505050565b5050505050565b60605f61098a610873565b905060405191508260205263c87b56dd5f525f806024601c845afa6109b1573d5f833e3d82fd5b60205f803e60205f51833e815160205f5101602084013e8151602083010160405250919050565b5f806109e2610873565b9050604051836040528460601b602c5263e985e9c560601b600c5260205f6044601c855afa601f3d1116610a18573d5f823e3d81fd5b60405250505f51151592915050565b610a2f610b13565b63389a75e1600c52805f526020600c208054421115610a5557636f5e88185f526004601cfd5b5f9055610a6181610b2d565b50565b610a6c610b13565b8060601b610a8157637448fbae5f526004601cfd5b610a6181610b2d565b60405163150b7a028082523360208301528560601b60601c604083015283606083015260808083015282518060a08401528015610ad1578060c08401826020870160045afa505b60208360a48301601c86015f8a5af1610af2573d15610af2573d5f843e3d83fd5b508060e01b825114610b0b5763d1a57ed65f526004601cfd5b505050505050565b638b78c6d819543314610843576382b429005f526004601cfd5b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b5f60208284031215610b7a575f80fd5b81356001600160e01b031981168114610b91575f80fd5b9392505050565b5f602080835283518060208501525f5b81811015610bc457858101830151858201604001528201610ba8565b505f604082860101526040601f19601f8301168501019250505092915050565b5f60208284031215610bf4575f80fd5b5035919050565b80356001600160a01b0381168114610c11575f80fd5b919050565b5f8060408385031215610c27575f80fd5b610c3083610bfb565b946020939093013593505050565b5f805f60608486031215610c50575f80fd5b610c5984610bfb565b9250610c6760208501610bfb565b9150604084013590509250925092565b5f60208284031215610c87575f80fd5b610b9182610bfb565b5f8060408385031215610ca1575f80fd5b610caa83610bfb565b915060208301358015158114610cbe575f80fd5b809150509250929050565b5f805f805f60808688031215610cdd575f80fd5b610ce686610bfb565b9450610cf460208701610bfb565b935060408601359250606086013567ffffffffffffffff80821115610d17575f80fd5b818801915088601f830112610d2a575f80fd5b813581811115610d38575f80fd5b896020828501011115610d49575f80fd5b9699959850939650602001949392505050565b5f8060408385031215610d6d575f80fd5b610d7683610bfb565b9150610d8460208401610bfb565b9050925092905056fea264697066735822122046017508d9d1b2176d68851baafef2615f318a85eacb3292984abe5633db2ece64736f6c63430008180033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000003635c9adc5dea00000000000000000000000000000ff2a5590cabc063fd943512d84ae9f1fbf2e2a42000000000000000000000000000000000000000000000000000000000000000854616c6c4269747300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035442530000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405260043610610143575f3560e01c806354d1f13d116100b5578063a9059cbb1161006e578063a9059cbb1461072f578063c87b56dd1461074e578063dd62ed3e1461076d578063f04e283e146107b9578063f2fde38b146107cc578063fee81cf4146107df5761014a565b806354d1f13d1461068857806355f804b31461069057806370a08231146106af578063715018a6146106fb5780638da5cb5b1461070357806395d89b411461071b5761014a565b8063274e430b11610107578063274e430b146105c35780632a6a935d146105e2578063313ce567146106015780633ccfd60b1461061c57806340c10f19146106305780634ef41efc1461064f5761014a565b806306fdde031461050d578063095ea7b31461053757806318160ddd1461056657806323b872dd1461059c57806325692962146105bb5761014a565b3661014a57005b68a20d6e21d0e52553085f3560e01c63e985e9c58190036101ec5760018201546001600160a01b031633146101925760405163ce5a776b60e01b815260040160405180910390fd5b604436101561019f575f80fd5b6004356001600160a01b038181165f908152600385016020908152604080832060243594851684529091529020546101e99060ff166101de575f6101e1565b60015b60ff16610810565b50505b80636352211e036102505760018201546001600160a01b031633146102245760405163ce5a776b60e01b815260040160405180910390fd5b6024361015610231575f80fd5b60043561024e61024082610818565b6001600160a01b0316610810565b505b8063e5eb36c8036102bc5760018201546001600160a01b031633146102885760405163ce5a776b60e01b815260040160405180910390fd5b6084361015610295575f80fd5b6004356024356044356064356102ad8484848461084e565b6102b76001610810565b505050505b8063813500fc036103545760018201546001600160a01b031633146102f45760405163ce5a776b60e01b815260040160405180910390fd5b6064361015610301575f80fd5b6001600160a01b036044358181165f90815268a20d6e21d0e525530b6020908152604080832060043595861684529091529020805460ff19166024351515908117909155906103506001610810565b5050505b8063d10b6e0c036103b45760018201546001600160a01b0316331461038c5760405163ce5a776b60e01b815260040160405180910390fd5b6064361015610399575f80fd5b6004356024356044356103b0610240848484610bd1565b5050505b8063081812fc0361040a5760018201546001600160a01b031633146103ec5760405163ce5a776b60e01b815260040160405180910390fd5b60243610156103f9575f80fd5b60043561040861024082610ca6565b505b8063f5b100ea036104905760018201546001600160a01b031633146104425760405163ce5a776b60e01b815260040160405180910390fd5b602436101561044f575f80fd5b60043561048e610489826001600160a01b03165f90815268a20d6e21d0e5255310602052604090205463ffffffff600160801b9091041690565b610810565b505b8063e2c79281036104f65760018201546001600160a01b031633146104c85760405163ce5a776b60e01b815260040160405180910390fd5b60043610156104d5575f80fd5b68a20d6e21d0e5255308546104f690600160401b900463ffffffff16610810565b8063b7a94eb80361050b5761050b6001610810565b005b348015610518575f80fd5b50610521610cf0565b60405161052e9190611c34565b60405180910390f35b348015610542575f80fd5b50610556610551366004611c7c565b610d7f565b604051901515815260200161052e565b348015610571575f80fd5b5068a20d6e21d0e525530854600160601b90046001600160601b03165b60405190815260200161052e565b3480156105a7575f80fd5b506105566105b6366004611ca4565b610df3565b61050b610e93565b3480156105ce575f80fd5b506105566105dd366004611cdd565b610ee0565b3480156105ed575f80fd5b5061050b6105fc366004611cf6565b610f2e565b34801561060c575f80fd5b506040516012815260200161052e565b348015610627575f80fd5b5061050b610f3b565b34801561063b575f80fd5b5061050b61064a366004611c7c565b610f4e565b34801561065a575f80fd5b5068a20d6e21d0e5255309546001600160a01b03165b6040516001600160a01b03909116815260200161052e565b61050b610f64565b34801561069b575f80fd5b5061050b6106aa366004611d15565b610f9d565b3480156106ba575f80fd5b5061058e6106c9366004611cdd565b6001600160a01b03165f90815268a20d6e21d0e52553106020526040902054600160a01b90046001600160601b031690565b61050b610fb7565b34801561070e575f80fd5b50638b78c6d81954610670565b348015610726575f80fd5b50610521610fc8565b34801561073a575f80fd5b50610556610749366004611c7c565b610fd7565b348015610759575f80fd5b50610521610768366004611d81565b610fec565b348015610778575f80fd5b5061058e610787366004611d98565b6001600160a01b039182165f90815268a20d6e21d0e525530d6020908152604080832093909416825291909152205490565b61050b6107c7366004611cdd565b61107f565b61050b6107da366004611cdd565b6110b9565b3480156107ea575f80fd5b5061058e6107f9366004611cdd565b63389a75e1600c9081525f91909152602090205490565b805f5260205ff35b5f610822826110df565b61083f5760405163677510db60e11b815260040160405180910390fd5b610848826110fb565b92915050565b68a20d6e21d0e52553086001600160a01b03841661087f57604051633a954ecd60e21b815260040160405180910390fd5b5f816002015f6108b8846007016108968860011b90565b600381901c5f90815260209290925260409091205460059190911b60e0161c90565b63ffffffff16815260208101919091526040015f20546001600160a01b039081169150861681146108fb5760405162a1148160e81b815260040160405180910390fd5b856001600160a01b0316836001600160a01b03161461097d576001600160a01b038087165f90815260038401602090815260408083209387168352929052205460ff1661097d575f8481526004830160205260409020546001600160a01b0384811691161461097d57604051632ce44b5f60e11b815260040160405180910390fd5b5f6109878761114e565b90505f6109938761114e565b8254909150670de0b6b3a76400009083906014906109c2908490600160a01b90046001600160601b0316611ddd565b82546101009290920a6001600160601b0381810219909316918316021790915582546001600160a01b038116670de0b6b3a7640000600160a01b928390048416019092160217825550610a2660078501600188901b610a21848b6111b9565b611259565b5f868152600485016020908152604080832080546001600160a01b03191690556001600160a01b038b168352600687018252808320855463ffffffff60801b198116600160801b9182900463ffffffff9081165f1901908116909202178755631fffffff600382901c168552925282205460059190911b60e0161c6001600160a01b038a165f908152600687016020526040902063ffffffff919091169150610ae790610adb6007880160018b811b01610896565b63ffffffff1683611259565b8154600163ffffffff600160801b80840482169283019091160263ffffffff60801b19909216919091178355610b3960078701610b2784600190811b0190565b610a2160078a0160018d811b01610896565b6001600160a01b0389165f9081526006870160205260409020610b5d90828a611259565b610b706007870160018a811b0183611259565b5050866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef670de0b6b3a7640000604051610bbf91815260200190565b60405180910390a35050505050505050565b5f68a20d6e21d0e52553088168a20d6e21d0e525530a81610bff68a20d6e21d0e525530f600189901b610896565b63ffffffff16815260208101919091526040015f20546001600160a01b03908116915084168114610c71576001600160a01b038082165f90815260038401602090815260408083209388168352929052205460ff16610c71576040516367d9dca160e11b815260040160405180910390fd5b5f8581526004909201602052604090912080546001600160a01b0387166001600160a01b031990911617905590509392505050565b5f610cb0826110df565b610ccd5760405163677510db60e11b815260040160405180910390fd5b505f90815268a20d6e21d0e525530c60205260409020546001600160a01b031690565b60605f8054610cfe90611dfd565b80601f0160208091040260200160405190810160405280929190818152602001828054610d2a90611dfd565b8015610d755780601f10610d4c57610100808354040283529160200191610d75565b820191905f5260205f20905b815481529060010190602001808311610d5857829003601f168201915b5050505050905090565b5f8068a20d6e21d0e5255308335f81815260058301602090815260408083206001600160a01b038a16808552908352928190208890555187815293945090927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b6001600160a01b0383165f90815268a20d6e21d0e525530d6020908152604080832033845290915281205468a20d6e21d0e5255308905f198114610e7c5780841115610e52576040516313be252b60e01b815260040160405180910390fd5b6001600160a01b0386165f9081526005830160209081526040808320338452909152902084820390555b610e8786868661128b565b50600195945050505050565b5f6202a30067ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f80a250565b6001600160a01b0381165f90815268a20d6e21d0e5255310602052604081208054600160581b90046001168203610f1b57823b5b9392505050565b54600160581b9004600216151592915050565b610f383382611747565b50565b610f436117d6565b610f4c336117f0565b565b610f566117d6565b610f608282611809565b5050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f80a2565b610fa56117d6565b6002610fb2828483611e8e565b505050565b610fbf6117d6565b610f4c5f611b12565b606060018054610cfe90611dfd565b5f610fe333848461128b565b50600192915050565b606060028054610ffb90611dfd565b15905061107a575f823060405160200161103192919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b604051602081830303815290604052805190602001205f1c9050600261105682611b4f565b604051602001611067929190611f48565b6040516020818303038152906040529150505b919050565b6110876117d6565b63389a75e1600c52805f526020600c2080544211156110ad57636f5e88185f526004601cfd5b5f9055610f3881611b12565b6110c16117d6565b8060601b6110d657637448fbae5f526004601cfd5b610f3881611b12565b5f806110ea836110fb565b6001600160a01b0316141592915050565b5f68a20d6e21d0e525530868a20d6e21d0e525530a8261112868a20d6e21d0e525530f600187901b610896565b63ffffffff16815260208101919091526040015f20546001600160a01b03169392505050565b6001600160a01b0381165f90815268a20d6e21d0e5255310602052604081208054909168a20d6e21d0e525530891600160581b900460011690036111b3576001833b15611199576002175b825460ff909116600160581b0260ff60581b199091161782555b50919050565b8154600160601b900463ffffffff1668a20d6e21d0e52553085f82900361125257805481905f906111ef9063ffffffff16611fcb565b825463ffffffff8083166101009490940a848102910219909116179092558554600160601b820263ffffffff60601b199091161786555f908152600283016020526040902080546001600160a01b0386166001600160a01b031990911617905591505b5092915050565b826020528160031c5f5260405f206007831660051b815463ffffffff8482841c188116831b8218845550505050505050565b6001600160a01b0382166112b257604051633a954ecd60e21b815260040160405180910390fd5b68a20d6e21d0e52553085f6112c68561114e565b90505f6112d28561114e565b90506113076040518060c001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b825463ffffffff600160801b808304821660808501528454041660a08301526001600160601b03600160a01b909104166040820181905285111561135e57604051631e9acf1760e31b815260040160405180910390fd5b6040810180518690039081905283546001600160601b03808316600160a01b9081026001600160a01b03938416178755855481810483168a016060870181905290921602911617835560808201516113c491670de0b6b3a7640000900480821191030290565b81528154600160581b90046002165f0361143257856001600160a01b0316876001600160a01b0316036113ff57805160808201510360a08201525b61142c670de0b6b3a764000082606001518161141d5761141d611fed565b048260a0015180821191030290565b60208201525b5f6114798260200151835f01510160408051808201909152606081525f60208201526040805101828152806020018360051b81016040528183528083602001525050919050565b82519091501561156e576001600160a01b0388165f908152600686016020526040902060808301518351875463ffffffff600160401b808304821684900382160263ffffffff60401b199092169190911789558754918303908116600160801b0263ffffffff60801b199092169190911787555b5f1991909101600381901c5f90815260208490526040812054919291600584901b60e0161c63ffffffff16905061152989600701825f80611b91565b5f81815260048a016020908152604090912080546001600160a01b0319169055858101805160089390931b60608f901b176001178352910190528082036114ed575050505b6020820151156116cf576001600160a01b0387165f9081526006860160209081526040822060a0850151918501519092908201906115ac878c6111b9565b8954602088015163ffffffff60401b19821663ffffffff600160401b80850482169093018116909202178c55895463ffffffff60801b1916600160801b86831602178a55919250670de0b6b3a7640000600160601b82046001600160601b03160491640100000000909104165b61162a8b6007016108968360011b90565b63ffffffff16156116495760010181811115611644575060015b611619565b611654868683611259565b6116698b600701828588806001019950611b91565b611692878e835f8360200151818360081b8560601b171781526020810185602001525050505050565b600101818111156116a1575060015b838503611619578a5463ffffffff9091166401000000000267ffffffff0000000019909116178a5550505050505b805151156116f05760018501546116f09082906001600160a01b0316611bd5565b50856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405161173691815260200190565b60405180910390a350505050505050565b5f6117518361114e565b8054909150600160581b900460021615158215151461178c57805460ff600160581b80830482166002189091160260ff60581b199091161781555b826001600160a01b03167fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d6420393836040516117c9911515815260200190565b60405180910390a2505050565b638b78c6d819543314610f4c576382b429005f526004601cfd5b5f385f3847855af1610f385763b12d13eb5f526004601cfd5b6001600160a01b03821661183057604051633a954ecd60e21b815260040160405180910390fd5b68a20d6e21d0e52553085f6118448461114e565b8254909150600160601b90046001600160601b031683016b0de0b6b39983494c589bffff84118061188057506b0de0b6b39983494c589bffff81115b1561189e5760405163e5cfe95760e01b815260040160405180910390fd5b82546001600160601b03808316600160601b026bffffffffffffffffffffffff60601b199092169190911784558254600160a01b80820483168701928316026001600160a01b0390911617808455600160581b90046002165f03611aca576001600160a01b0386165f908152600685016020526040812084549091600160801b90910463ffffffff1690670de0b6b3a7640000840490505f6119798383038484110260408051808201909152606081525f60208201526040805101828152806020018360051b81016040528183528083602001525050919050565b80515190915015611ac5578754670de0b6b3a7640000600160601b9091046001600160601b0316045f6119ac898d6111b9565b8a5484515163ffffffff60401b19821663ffffffff600160401b80850482169093018116909202178d558b5463ffffffff60801b1916600160801b88831602178c559192506401000000009004165b611a0c8b6007016108968360011b90565b63ffffffff1615611a2b5760010182811115611a26575060015b6119fb565b611a36878783611259565b611a4b8b600701828489806001019a50611b91565b611a74848e835f8360200151818360081b8560601b171781526020810185602001525050505050565b60010182811115611a83575060015b8486036119fb578a5467ffffffff00000000191664010000000063ffffffff831602178b5560018b0154611ac19085906001600160a01b0316611bd5565b5050505b505050505b50506040518381526001600160a01b038516905f907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350505050565b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a355565b60606080604051019050602081016040525f8152805f19835b928101926030600a8206018453600a900480611b68575050819003601f19909101908152919050565b8163ffffffff168160201b17846020528360021c5f5260405f206003851660061b815467ffffffffffffffff8482841c188116831b82188455505050505050505050565b81516040810363263c69d68152602080820152815160051b604401915060208183601c84015f875af1600182511416611c0c575f81fd5b50505050565b5f5b83811015611c2c578181015183820152602001611c14565b50505f910152565b602081525f8251806020840152611c52816040850160208701611c12565b601f01601f19169190910160400192915050565b80356001600160a01b038116811461107a575f80fd5b5f8060408385031215611c8d575f80fd5b611c9683611c66565b946020939093013593505050565b5f805f60608486031215611cb6575f80fd5b611cbf84611c66565b9250611ccd60208501611c66565b9150604084013590509250925092565b5f60208284031215611ced575f80fd5b610f1482611c66565b5f60208284031215611d06575f80fd5b81358015158114610f14575f80fd5b5f8060208385031215611d26575f80fd5b823567ffffffffffffffff80821115611d3d575f80fd5b818501915085601f830112611d50575f80fd5b813581811115611d5e575f80fd5b866020828501011115611d6f575f80fd5b60209290920196919550909350505050565b5f60208284031215611d91575f80fd5b5035919050565b5f8060408385031215611da9575f80fd5b611db283611c66565b9150611dc060208401611c66565b90509250929050565b634e487b7160e01b5f52601160045260245ffd5b6001600160601b0382811682821603908082111561125257611252611dc9565b600181811c90821680611e1157607f821691505b6020821081036111b357634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b601f821115610fb257805f5260205f20601f840160051c81016020851015611e685750805b601f840160051c820191505b81811015611e87575f8155600101611e74565b5050505050565b67ffffffffffffffff831115611ea657611ea6611e2f565b611eba83611eb48354611dfd565b83611e43565b5f601f841160018114611eeb575f8515611ed45750838201355b5f19600387901b1c1916600186901b178355611e87565b5f83815260208120601f198716915b82811015611f1a5786850135825560209485019460019092019101611efa565b5086821015611f36575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b5f808454611f5581611dfd565b60018281168015611f6d5760018114611f8257611fae565b60ff1984168752821515830287019450611fae565b885f526020805f205f5b85811015611fa55781548a820152908401908201611f8c565b50505082870194505b505050508351611fc2818360208801611c12565b01949350505050565b5f63ffffffff808316818103611fe357611fe3611dc9565b6001019392505050565b634e487b7160e01b5f52601260045260245ffdfea2646970667358221220c340885ff8058a4b3bf0358f2e5af868c762d2dabd6a95b3785b78b54051283f64736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000003635c9adc5dea00000000000000000000000000000ff2a5590cabc063fd943512d84ae9f1fbf2e2a42000000000000000000000000000000000000000000000000000000000000000854616c6c4269747300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035442530000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name_ (string): TallBits
Arg [1] : symbol_ (string): TBS
Arg [2] : initialTokenSupply (uint96): 1000000000000000000000
Arg [3] : initialSupplyOwner (address): 0xFF2a5590CaBc063fd943512D84aE9F1fBf2e2a42
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 00000000000000000000000000000000000000000000003635c9adc5dea00000
Arg [3] : 000000000000000000000000ff2a5590cabc063fd943512d84ae9f1fbf2e2a42
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [5] : 54616c6c42697473000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [7] : 5442530000000000000000000000000000000000000000000000000000000000
Deployed Bytecode Sourcemap
124549:1284:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;95774:20;116699:22;122394:20;116793:3;116770:26;116864:10;116850:24;;;116846:326;;116900:14;;;;-1:-1:-1;;;;;116900:14:0;116886:10;:28;116882:58;;116923:17;;-1:-1:-1;;;116923:17:0;;;;;;;;;;;116882:58;116968:4;116950:8;:22;116946:36;;;116974:8;;;116946:36;117036:4;122394:20;-1:-1:-1;;;;;117121:26:0;;;116990:13;117121:26;;;:19;;;:26;;;;;;;;117098:4;122394:20;117121:36;;;;;;;;;;;117113:53;;117121:36;;:44;;117164:1;117121:44;;;117160:1;117121:44;117113:53;;:7;:53::i;:::-;116876:296;;116846:326;117206:10;117220;117206:24;117202:220;;117256:14;;;;-1:-1:-1;;;;;117256:14:0;117242:10;:28;117238:58;;117279:17;;-1:-1:-1;;;117279:17:0;;;;;;;;;;;117238:58;117324:4;117306:8;:22;117302:36;;;117330:8;;;117302:36;117373:4;122394:20;117386:30;117402:12;122394:20;117402:8;:12::i;:::-;-1:-1:-1;;;;;117386:30:0;:7;:30::i;:::-;117232:190;117202:220;117488:10;117502;117488:24;117484:424;;117538:14;;;;-1:-1:-1;;;;;117538:14:0;117524:10;:28;117520:58;;117561:17;;-1:-1:-1;;;117561:17:0;;;;;;;;;;;117520:58;117606:4;117588:8;:22;117584:36;;;117612:8;;;117584:36;117673:4;122394:20;117729:4;122394:20;117769:4;122394:20;117830:4;122394:20;117845:41;122394:20;;;;117845:16;:41::i;:::-;117892:10;117900:1;117892:7;:10::i;:::-;117514:394;;;;117484:424;117965:10;117979;117965:24;117961:382;;118015:14;;;;-1:-1:-1;;;;;118015:14:0;118001:10;:28;117997:58;;118038:17;;-1:-1:-1;;;118038:17:0;;;;;;;;;;;117997:58;118083:4;118065:8;:22;118061:36;;;118089:8;;;118061:36;-1:-1:-1;;;;;118260:4:0;122394:20;115930:47;;;;;;;:36;:47;;;;;;;;118153:4;122394:20;115930:57;;;;;;;;;;:68;;-1:-1:-1;;115930:68:0;118194:4;122394:20;118180:24;;115930:68;;;;;;118180:24;118327:10;118335:1;118327:7;:10::i;:::-;117991:352;;;117961:382;118396:10;118410;118396:24;118392:367;;118446:14;;;;-1:-1:-1;;;;;118446:14:0;118432:10;:28;118428:58;;118469:17;;-1:-1:-1;;;118469:17:0;;;;;;;;;;;118428:58;118514:4;118496:8;:22;118492:36;;;118520:8;;;118492:36;118584:4;122394:20;118624:4;122394:20;118685:4;122394:20;118700:53;118716:35;122394:20;;;118716:11;:35::i;118700:53::-;118422:337;;;118392:367;118797:10;118811;118797:24;118793:224;;118847:14;;;;-1:-1:-1;;;;;118847:14:0;118833:10;:28;118829:58;;118870:17;;-1:-1:-1;;;118870:17:0;;;;;;;;;;;118829:58;118915:4;118897:8;:22;118893:36;;;118921:8;;;118893:36;118964:4;122394:20;118977:34;118993:16;122394:20;118993:12;:16::i;118977:34::-;118823:194;118793:224;119056:10;119070;119056:24;119052:240;;119106:14;;;;-1:-1:-1;;;;;119106:14:0;119092:10;:28;119088:58;;119129:17;;-1:-1:-1;;;119129:17:0;;;;;;;;;;;119088:58;119174:4;119156:8;:22;119152:36;;;119180:8;;;119152:36;119242:4;122394:20;119257:29;119265:20;122394;-1:-1:-1;;;;;113983:37:0;113962:7;113983:37;;;:30;:37;;;;;:49;;-1:-1:-1;;;113983:49:0;;;;;113893:144;119265:20;119257:7;:29::i;:::-;119082:210;119052:240;119326:10;119340;119326:24;119322:176;;119376:14;;;;-1:-1:-1;;;;;119376:14:0;119362:10;:28;119358:58;;119399:17;;-1:-1:-1;;;119399:17:0;;;;;;;;;;;119358:58;119444:4;119426:8;:22;119422:36;;;119450:8;;;119422:36;95774:20;113810:33;119466:26;;-1:-1:-1;;;113810:33:0;;;;119257:7;:29::i;119466:26::-;119533:10;119547;119533:24;119529:52;;119565:10;119573:1;119565:7;:10::i;:::-;116694:2897;125009:83;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;98905:248;;;;;;;;;;-1:-1:-1;98905:248:0;;;;;:::i;:::-;;:::i;:::-;;;1272:14:1;;1265:22;1247:41;;1235:2;1220:18;98905:248:0;1107:187:1;98233:117:0;;;;;;;;;;-1:-1:-1;95774:20:0;98314:30;-1:-1:-1;;;98314:30:0;;-1:-1:-1;;;;;98314:30:0;98233:117;;;1445:25:1;;;1433:2;1418:18;98233:117:0;1299:177:1;100405:434:0;;;;;;;;;;-1:-1:-1;100405:434:0;;;;;:::i;:::-;;:::i;67502:507::-;;;:::i;111282:261::-;;;;;;;;;;-1:-1:-1;111282:261:0;;;;;:::i;:::-;;:::i;111643:91::-;;;;;;;;;;-1:-1:-1;111643:91:0;;;;;:::i;:::-;;:::i;98107:67::-;;;;;;;;;;-1:-1:-1;98107:67:0;;98167:2;2425:36:1;;2413:2;2398:18;98107:67:0;2283:184:1;125737:93:0;;;;;;;;;;;;;:::i;125549:86::-;;;;;;;;;;-1:-1:-1;125549:86:0;;;;;:::i;:::-;;:::i;113575:110::-;;;;;;;;;;-1:-1:-1;113649:31:0;;-1:-1:-1;;;;;113649:31:0;113575:110;;;-1:-1:-1;;;;;2636:32:1;;;2618:51;;2606:2;2591:18;113575:110:0;2472:203:1;68088:391:0;;;:::i;125640:92::-;;;;;;;;;;-1:-1:-1;125640:92:0;;;;;:::i;:::-;;:::i;98413:134::-;;;;;;;;;;-1:-1:-1;98413:134:0;;;;;:::i;:::-;-1:-1:-1;;;;;98497:37:0;98476:7;98497:37;;;:30;:37;;;;;:45;-1:-1:-1;;;98497:45:0;;-1:-1:-1;;;;;98497:45:0;;98413:134;67255:93;;;:::i;69582:157::-;;;;;;;;;;-1:-1:-1;;;69712:18:0;69582:157;;125097:87;;;;;;;;;;;;;:::i;99624:135::-;;;;;;;;;;-1:-1:-1;99624:135:0;;;;;:::i;:::-;;:::i;125189:291::-;;;;;;;;;;-1:-1:-1;125189:291:0;;;;;:::i;:::-;;:::i;98639:142::-;;;;;;;;;;-1:-1:-1;98639:142:0;;;;;:::i;:::-;-1:-1:-1;;;;;98732:35:0;;;98711:7;98732:35;;;:28;:35;;;;;;;;:44;;;;;;;;;;;;;98639:142;68661:592;;;;;;:::i;:::-;;:::i;66904:289::-;;;;;;:::i;:::-;;:::i;69839:356::-;;;;;;;;;;-1:-1:-1;69839:356:0;;;;;:::i;:::-;70061:19;70055:4;70048:33;;;69938:14;70086:26;;;;70180:4;70164:21;;70158:28;;69839:356;122510:146;122622:1;122616:4;122609:15;122642:4;122636;122629:18;114457:148;114518:7;114537:11;114545:2;114537:7;:11::i;:::-;114532:44;;114557:19;;-1:-1:-1;;;114557:19:0;;;;;;;;;;;114532:44;114588:12;114597:2;114588:8;:12::i;:::-;114581:19;114457:148;-1:-1:-1;;114457:148:0:o;108569:1279::-;95774:20;-1:-1:-1;;;;;108736:16:0;;108732:52;;108761:23;;-1:-1:-1;;;108761:23:0;;;;;;;;;;;108732:52;108791:13;108807:1;:16;;:49;108824:31;108829:1;:4;;108835:19;108851:2;122989:1;122984:6;;122905:90;108835:19;123337:1;123328:10;;;123284:13;123320:19;;;;;;;;;;;;;123359:1;123344:16;;;;;;123320:41;;123210:157;108824:31;108807:49;;;;;;;;;;;;;-1:-1:-1;108807:49:0;;-1:-1:-1;;;;;108807:49:0;;;;-1:-1:-1;108867:13:0;;;;108863:54;;108889:28;;-1:-1:-1;;;108889:28:0;;;;;;;;;;;108863:54;108941:4;-1:-1:-1;;;;;108928:17:0;:9;-1:-1:-1;;;;;108928:17:0;;108924:187;;-1:-1:-1;;;;;108958:25:0;;;;;;;:19;;;:25;;;;;;;;:36;;;;;;;;;;;;108953:153;;109020:20;;;;:16;;;:20;;;;;;-1:-1:-1;;;;;109007:33:0;;;109020:20;;109007:33;109003:97;;109057:35;;-1:-1:-1;;;109057:35:0;;;;;;;;;;;109003:97;109117:35;109155:18;109168:4;109155:12;:18::i;:::-;109117:56;;109178:33;109214:16;109227:2;109214:12;:16::i;:::-;109237:39;;109178:52;;-1:-1:-1;93137:8:0;;109237:39;;:23;;:39;;93137:8;;-1:-1:-1;;;109237:39:0;;-1:-1:-1;;;;;109237:39:0;;:::i;:::-;;;;;;;;-1:-1:-1;;;;;109237:39:0;;;;;;;;;;;;;;;109299:37;;-1:-1:-1;;;;;109299:37:0;;93137:8;-1:-1:-1;;;109299:37:0;;;;;;;;;;;;;;-1:-1:-1;109344:76:0;109349:4;;;-1:-1:-1;122984:6:0;;;109376:43;109401:13;109416:2;109376:24;:43::i;:::-;109344:4;:76::i;:::-;109433:20;;;;:16;;;:20;;;;;;;;109426:27;;-1:-1:-1;;;;;;109426:27:0;;;-1:-1:-1;;;;;109486:13:0;;;;:7;;;:13;;;;;109501:29;;-1:-1:-1;;;;109501:29:0;;-1:-1:-1;;;109501:29:0;;;;;;;;-1:-1:-1;;109501:29:0;;;;;;;;;;123328:10;123337:1;123328:10;;;;123320:19;;;;;;;123359:1;123344:16;;;;;;123320:41;-1:-1:-1;;;;;109542:13:0;;;;;;:7;;;:13;;;;;109461:70;;;;;;-1:-1:-1;109537:67:0;;109557:27;109562:4;;;123132:1;123127:6;;;123126:12;109568:15;123035:113;109557:27;109537:67;;109593:9;109537:4;:67::i;:::-;109624:27;;;;-1:-1:-1;;;109624:27:0;;;;;;;;;;;;-1:-1:-1;;;;109624:27:0;;;;;;;;;109657:63;109662:4;;;109668:22;109680:9;123132:1;123127:6;;;123126:12;;123035:113;109668:22;109692:27;109697:4;;;123132:1;123127:6;;;123126:12;109703:15;123035:113;109657:63;-1:-1:-1;;;;;109731:11:0;;;;;;:7;;;:11;;;;;109726:32;;109744:1;109754:2;109726:4;:32::i;:::-;109764:38;109769:4;;;123132:1;123127:6;;;123126:12;109799:1;109764:4;:38::i;:::-;109283:525;;109834:2;-1:-1:-1;;;;;109819:24:0;109828:4;-1:-1:-1;;;;;109819:24:0;;93137:8;109819:24;;;;1445:25:1;;1433:2;1418:18;;1299:177;109819:24:0;;;;;;;;108677:1171;;;;108569:1279;;;;:::o;115266:437::-;115370:7;95774:20;115370:7;115452:16;115370:7;115469:31;115474:4;122989:1;122984:6;;;115480:19;122905:90;115469:31;115452:49;;;;;;;;;;;;;-1:-1:-1;115452:49:0;;-1:-1:-1;;;;;115452:49:0;;;;-1:-1:-1;115512:18:0;;;;115508:135;;-1:-1:-1;;;;;115543:26:0;;;;;;;:19;;;:26;;;;;;;;:37;;;;;;;;;;;;115538:100;;115596:35;;-1:-1:-1;;;115596:35:0;;;;;;;;;;;115538:100;115649:20;;;;:16;;;;:20;;;;;;:30;;-1:-1:-1;;;;;115649:30:0;;-1:-1:-1;;;;;;115649:30:0;;;;;;115693:5;-1:-1:-1;115266:437:0;;;;;:::o;114884:177::-;114949:7;114968:11;114976:2;114968:7;:11::i;:::-;114963:44;;114988:19;;-1:-1:-1;;;114988:19:0;;;;;;;;;;;114963:44;-1:-1:-1;115019:37:0;;;;:33;:37;;;;;;-1:-1:-1;;;;;115019:37:0;;114884:177::o;125009:83::-;125055:13;125082:5;125075:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;125009:83;:::o;98905:248::-;98979:4;;95774:20;99052:10;99040:23;;;;:11;;;:23;;;;;;;;-1:-1:-1;;;;;99040:32:0;;;;;;;;;;;;:41;;;99093:37;1445:25:1;;;99040:11:0;;-1:-1:-1;99040:32:0;;99093:37;;1418:18:1;99093:37:0;;;;;;;-1:-1:-1;99144:4:0;;98905:248;-1:-1:-1;;;98905:248:0:o;100405:434::-;-1:-1:-1;;;;;100572:17:0;;100493:4;100572:17;;;:11;:17;;;;;;;;100590:10;100572:29;;;;;;;;95774:20;;-1:-1:-1;;100612:28:0;;100608:175;;100661:7;100652:6;:16;100648:52;;;100677:23;;-1:-1:-1;;;100677:23:0;;;;;;;;;;;100648:52;-1:-1:-1;;;;;100723:17:0;;;;;;:11;;;:17;;;;;;;;100741:10;100723:29;;;;;;;100755:16;;;100723:48;;100608:175;100789:27;100799:4;100805:2;100809:6;100789:9;:27::i;:::-;-1:-1:-1;100830:4:0;;100405:434;-1:-1:-1;;;;;100405:434:0:o;67502:507::-;67582:15;66538:9;67600:46;;:15;:46;67582:64;;67776:19;67770:4;67763:33;67815:8;67809:4;67802:22;67860:7;67853:4;67847;67837:21;67830:38;67985:8;67938:45;67935:1;67932;67927:67;67700:300;67502:507::o;111282:261::-;-1:-1:-1;;;;;111377:33:0;;111342:4;111377:33;;;:30;:33;;;;;111419:7;;-1:-1:-1;;;111419:7:0;;93503:6;111419:40;:45;;111415:69;;122140:14;;111473:11;111466:18;111282:261;-1:-1:-1;;;111282:261:0:o;111415:69::-;111496:7;-1:-1:-1;;;111496:7:0;;93634:6;111496:37;:42;;;111282:261;-1:-1:-1;;111282:261:0:o;111643:91::-;111697:32;111709:10;111721:7;111697:11;:32::i;:::-;111643:91;:::o;125737:93::-;70571:13;:11;:13::i;:::-;125779:46:::1;125814:10;125779:34;:46::i;:::-;125737:93::o:0;125549:86::-;70571:13;:11;:13::i;:::-;125613:17:::1;125619:2;125623:6;125613:5;:17::i;:::-;125549:86:::0;;:::o;68088:391::-;68264:19;68258:4;68251:33;68302:8;68296:4;68289:22;68346:1;68339:4;68333;68323:21;68316:32;68461:8;68415:44;68412:1;68409;68404:66;68088:391::o;125640:92::-;70571:13;:11;:13::i;:::-;125708:8:::1;:19;125719:8:::0;;125708;:19:::1;:::i;:::-;;125640:92:::0;;:::o;67255:93::-;70571:13;:11;:13::i;:::-;67322:21:::1;67340:1;67322:9;:21::i;125097:87::-:0;125145:13;125172:7;125165:14;;;;;:::i;99624:135::-;99694:4;99705:33;99715:10;99727:2;99731:6;99705:9;:33::i;:::-;-1:-1:-1;99750:4:0;99624:135;;;;:::o;125189:291::-;125254:20;125291:8;125285:22;;;;;:::i;:::-;:27;;-1:-1:-1;125281:195:0;;125320:12;125370:7;125387:4;125353:40;;;;;;;;6752:19:1;;;6809:2;6805:15;-1:-1:-1;;6801:53:1;6796:2;6787:12;;6780:75;6880:2;6871:12;;6595:294;125353:40:0;;;;;;;;;;;;;125343:51;;;;;;125335:60;;125320:75;;125434:8;125444:24;125463:4;125444:18;:24::i;:::-;125417:52;;;;;;;;;:::i;:::-;;;;;;;;;;;;;125401:69;;125314:162;125281:195;125189:291;;;:::o;68661:592::-;70571:13;:11;:13::i;:::-;68869:19:::1;68863:4;68856:33;68907:12;68901:4;68894:26;68961:4;68955;68945:21;69051:12;69045:19;69032:11;69029:36;69026:127;;;69086:10;69080:4;69073:24;69142:4;69136;69129:18;69026:127;69214:1;69193:23:::0;;69225::::1;69235:12:::0;69225:9:::1;:23::i;66904:289::-:0;70571:13;:11;:13::i;:::-;67058:8:::1;67054:2;67050:17;67040:120;;67089:10;67083:4;67076:24;67149:4;67143;67136:18;67040:120;67169:19;67179:8;67169:9;:19::i;114651:109::-:0;114711:4;;114729:12;114738:2;114729:8;:12::i;:::-;-1:-1:-1;;;;;114729:26:0;;;;114651:109;-1:-1:-1;;114651:109:0:o;114167:184::-;114228:7;95774:20;114297:16;114228:7;114314:31;114319:4;122989:1;122984:6;;;114325:19;122905:90;114314:31;114297:49;;;;;;;;;;;;;-1:-1:-1;114297:49:0;;-1:-1:-1;;;;;114297:49:0;;114167:184;-1:-1:-1;;;114167:184:0:o;112347:353::-;-1:-1:-1;;;;;112486:16:0;;112406:21;112486:16;;;:13;:16;;;;;112513:7;;112486:16;;95774:20;;-1:-1:-1;;;112513:7:0;;93503:6;112513:40;:45;;112509:187;;93503:6;122140:14;;112616:53;;;93634:6;112633:36;112616:53;112675:15;;;;;;-1:-1:-1;;;112675:15:0;-1:-1:-1;;;;112675:15:0;;;;;;112509:187;112429:271;112347:353;;;:::o;112854:394::-;113061:26;;-1:-1:-1;;;113061:26:0;;;;95774:20;112970:19;113096:17;;;113092:152;;113136:14;;113138:1;;:12;;113136:14;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;113156:41;;-1:-1:-1;;;113156:41:0;;-1:-1:-1;;;;113156:41:0;;;;;;-1:-1:-1;113203:30:0;;;:16;;;:30;;;;;:35;;-1:-1:-1;;;;;113203:35:0;;-1:-1:-1;;;;;;113203:35:0;;;;;;113136:14;-1:-1:-1;113092:152:0;112993:255;112854:394;;;;:::o;123429:458::-;123574:8;123568:4;123561:22;123608:5;123605:1;123601:13;123595:4;123588:27;123645:4;123639;123629:21;123699:1;123692:5;123688:13;123685:1;123681:21;123753:1;123747:8;123792:10;123868:5;123864:1;123861;123857:9;123853:21;123850:1;123846:29;123843:1;123839:37;123836:1;123832:45;123829:1;123822:56;;;;;123429:458;;;:::o;105548:2632::-;-1:-1:-1;;;;;105635:16:0;;105631:52;;105660:23;;-1:-1:-1;;;105660:23:0;;;;;;;;;;;105631:52;95774:20;105690:22;105778:18;105791:4;105778:12;:18::i;:::-;105740:56;;105801:33;105837:16;105850:2;105837:12;:16::i;:::-;105801:52;;105860:23;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;105860:23:0;105908:27;;;-1:-1:-1;;;105908:27:0;;;;;105888:17;;;:47;105958:25;;;;105940:15;;;:43;-1:-1:-1;;;;;;;;106004:23:0;;;;105988:13;;;:39;;;106038:22;;106034:56;;;106069:21;;-1:-1:-1;;;106069:21:0;;;;;;;;;;;106034:56;106113:13;;;:23;;;;;;;;;106142:47;;-1:-1:-1;;;;;106142:47:0;;;-1:-1:-1;;;106142:47:0;;;-1:-1:-1;;;;;106142:47:0;;;;;;106240:21;;;;;;;:30;;106226:11;;;:44;;;106195:76;;;;;;;;;106313:17;;;;106299:54;;93137:8;;106332:20;122842:8;;;122852:9;;122838:24;;122697:174;106299:54;106279:74;;106365:19;;-1:-1:-1;;;106365:19:0;;93634:6;106365:49;106279:17;106365:54;106361:222;;106440:2;-1:-1:-1;;;;;106432:10:0;:4;-1:-1:-1;;;;;106432:10:0;;106428:71;;106482:17;;106462;;;;:37;106444:15;;;:55;106428:71;106526:50;93137:8;106540:1;:11;;;:18;;;;;:::i;:::-;;106560:1;:15;;;122842:8;;;122852:9;;122838:24;;122697:174;106526:50;106506:17;;;:70;106361:222;106590:29;106622:56;106660:1;:17;;;106640:1;:17;;;:37;-1:-1:-1;;;;;;;;;;;;;;;;;120449:4:0;120442;120436:11;120432:22;120516:1;120510:4;120503:15;120547:4;120541;120537:15;120589:1;120586;120582:9;120574:6;120570:22;120564:4;120557:36;120608:4;120605:1;120598:15;120639:6;120635:1;120629:4;120625:12;120618:28;;;120280:375;;;;106622:56;106690:17;;106590:88;;-1:-1:-1;106690:22:0;106686:538;;-1:-1:-1;;;;;106751:13:0;;106721:27;106751:13;;;:7;;;:13;;;;;106791:17;;;;106845;;106869:45;;;-1:-1:-1;;;106869:45:0;;;;;;;;;;;-1:-1:-1;;;;106869:45:0;;;;;;;;;106921;;106833:29;;;106921:45;;;-1:-1:-1;;;106921:45:0;-1:-1:-1;;;;106921:45:0;;;;;;;;;106992:226;-1:-1:-1;;107032:11:0;;;;123337:1;123328:10;;;107003;123320:19;;;;;;;;;;;107032:11;;;123359:1;123344:16;;;;;123320:41;107003;;;;107052:43;107080:1;:4;;107086:2;107090:1;107093;107052:27;:43::i;:::-;107110:20;;;;:16;;;:20;;;;;;;;107103:27;;-1:-1:-1;;;;;;107103:27:0;;;120943:12;;;120937:19;;120998:1;120994:10;;;;120986:2;120982:10;;;120979:26;-1:-1:-1;120976:39:0;120961:55;;121042:17;;121021:39;;107196:20;;;106992:226;;106714:510;;;106686:538;107235:17;;;;:22;107231:807;;-1:-1:-1;;;;;107294:11:0;;107266:25;107294:11;;;:7;;;:11;;;;;;;107330:15;;;;107378:17;;;;107294:11;;107368:27;;;;107419:43;107444:13;107302:2;107419:24;:43::i;:::-;107488:13;;107575:17;;;;-1:-1:-1;;;;107548:45:0;;107528:13;-1:-1:-1;;;107548:45:0;;;;;;;;;;;;;;;;107600:41;;-1:-1:-1;;;;107600:41:0;-1:-1:-1;;;107600:41:0;;;;;;;107402:60;;-1:-1:-1;93137:8:0;-1:-1:-1;;;107488:13:0;;-1:-1:-1;;;;;107488:13:0;:20;;107528:13;;;;;107667:332;107685:31;107690:1;:4;;107696:19;107712:2;122989:1;122984:6;;122905:90;107685:31;:36;;;107678:90;;107736:4;;:15;;;107732:27;;;-1:-1:-1;107758:1:0;107732:27;107678:90;;;107775:34;107780:7;107789;107805:2;107775:4;:34::i;:::-;107817:65;107845:1;:4;;107851:2;107855:7;107871:9;;;;;;107817:27;:65::i;:::-;107890:40;107908:10;107920:2;107924;107928:1;120953;120947:4;120943:12;120937:19;121007:7;121001:2;120998:1;120994:10;120990:1;120986:2;120982:10;120979:26;120976:39;120968:6;120961:55;121054:4;121046:6;121042:17;121038:1;121032:4;121028:12;121021:39;;120755:314;;;;;107890:40;107942:4;;:15;;;107938:27;;;-1:-1:-1;107964:1:0;107938:27;107992:5;107981:7;:16;107667:332;;108005:26;;;;;;;;-1:-1:-1;;108005:26:0;;;;;;-1:-1:-1;;;;;107231:807:0;108049:15;;:22;:27;108045:90;;108113:14;;;;108085:43;;108101:10;;-1:-1:-1;;;;;108113:14:0;108085:15;:43::i;:::-;106097:2043;108164:2;-1:-1:-1;;;;;108149:26:0;108158:4;-1:-1:-1;;;;;108149:26:0;;108168:6;108149:26;;;;1445:25:1;;1433:2;1418:18;;1299:177;108149:26:0;;;;;;;;105626:2554;;;;105548:2632;;;:::o;111935:253::-;112001:21;112025:15;112038:1;112025:12;:15::i;:::-;112050:7;;112001:39;;-1:-1:-1;;;;112050:7:0;;93634:6;112050:37;:42;;112049:53;;;;112045:109;;112110:38;;;-1:-1:-1;;;112110:38:0;;;;;93634:6;112110:38;;;;;-1:-1:-1;;;;112110:38:0;;;;;;112045:109;112174:1;-1:-1:-1;;;;;112163:20:0;;112177:5;112163:20;;;;1272:14:1;1265:22;1247:41;;1235:2;1220:18;;1107:187;112163:20:0;;;;;;;;111996:192;111935:253;;:::o;65933:292::-;-1:-1:-1;;66113:18:0;66103:8;66100:32;66090:126;;66154:10;66148:4;66141:24;66205:4;66199;66192:18;3580:343;3820:4;3808:10;3802:4;3790:10;3775:13;3771:2;3764:5;3759:66;3749:165;;3847:10;3841:4;3834:24;3903:4;3897;3890:18;101378:1676;-1:-1:-1;;;;;101447:16:0;;101443:52;;101472:23;;-1:-1:-1;;;101472:23:0;;;;;;;;;;;101443:52;95774:20;101502:22;101588:16;101601:2;101588:12;:16::i;:::-;101664:13;;101552:52;;-1:-1:-1;;;;101664:13:0;;-1:-1:-1;;;;;101664:13:0;101656:31;;93347:25;101697:20;;;:56;;;93347:25;101721:18;:32;101697:56;101693:104;;;101769:21;;-1:-1:-1;;;101769:21:0;;;;;;;;;;;101693:104;101802:42;;-1:-1:-1;;;;;101802:42:0;;;-1:-1:-1;;;101802:42:0;-1:-1:-1;;;;101802:42:0;;;;;;;;;101872:21;;-1:-1:-1;;;101872:21:0;;;;;:30;;101908:41;;;;-1:-1:-1;;;;;101908:41:0;;;;;;;-1:-1:-1;;;101961:19:0;;93634:6;101961:49;101802:13;101961:54;101957:1046;;-1:-1:-1;;;;;102052:11:0;;102024:25;102052:11;;;:7;;;:11;;;;;102088:25;;102052:11;;-1:-1:-1;;;102088:25:0;;;;;;93137:8;102136:9;:16;;-1:-1:-1;102159:29:0;102191:48;122852:9;;;122842:8;;;122838:24;-1:-1:-1;;;;;;;;;;;;;;;;;120449:4:0;120442;120436:11;120432:22;120516:1;120510:4;120503:15;120547:4;120541;120537:15;120589:1;120586;120582:9;120574:6;120570:22;120564:4;120557:36;120608:4;120605:1;120598:15;120639:6;120635:1;120629:4;120625:12;120618:28;;;120280:375;;;;102191:48;102252:15;;:22;102159:80;;-1:-1:-1;102252:27:0;102248:749;;102308:13;;93137:8;-1:-1:-1;;;102308:13:0;;;-1:-1:-1;;;;;102308:13:0;:20;102289:16;102353:43;102378:13;102393:2;102353:24;:43::i;:::-;102417:13;;102465:15;;:22;-1:-1:-1;;;;102438:50:0;;102417:13;-1:-1:-1;;;102438:50:0;;;;;;;;;;;;;;;;102496:41;;-1:-1:-1;;;;102496:41:0;-1:-1:-1;;;102496:41:0;;;;;;;102336:60;;-1:-1:-1;102417:13:0;;;;102565:340;102584:31;102589:1;:4;;102595:19;102611:2;122989:1;122984:6;;122905:90;102584:31;:36;;;102577:92;;102636:4;;:15;;;102632:27;;;-1:-1:-1;102658:1:0;102632:27;102577:92;;;102677:34;102682:7;102691;102707:2;102677:4;:34::i;:::-;102720:65;102748:1;:4;;102754:2;102758:7;102774:9;;;;;;102720:27;:65::i;:::-;102794:40;102812:10;102824:2;102828;102832:1;120953;120947:4;120943:12;120937:19;121007:7;121001:2;120998:1;120994:10;120990:1;120986:2;120982:10;120979:26;120976:39;120968:6;120961:55;121054:4;121046:6;121042:17;121038:1;121032:4;121028:12;121021:39;;120755:314;;;;;102794:40;102847:4;;:15;;;102843:27;;;-1:-1:-1;102869:1:0;102843:27;102898:5;102887:7;:16;102565:340;;102912:26;;-1:-1:-1;;102912:26:0;;;;;;;;;-1:-1:-1;102974:14:0;;;102946:43;;102962:10;;-1:-1:-1;;;;;102974:14:0;102946:15;:43::i;:::-;102281:716;;;102248:749;102017:986;;;;101957:1046;-1:-1:-1;;103017:32:0;;1445:25:1;;;-1:-1:-1;;;;;103017:32:0;;;103034:1;;103017:32;;1433:2:1;1418:18;103017:32:0;;;;;;;101438:1616;;101378:1676;;:::o;65008:870::-;-1:-1:-1;;65774:16:0;;-1:-1:-1;;;;;65644:26:0;;;;;;65734:38;65731:1;;65723:78;65836:27;65008:870::o;17765:1382::-;17821:17;18216:4;18209;18203:11;18199:22;18192:29;;18299:4;18294:3;18290:14;18284:4;18277:28;18364:1;18359:3;18352:14;18450:3;18473:1;18469:6;18658:5;18640:317;18685:11;;;;18833:2;18847;18837:13;;18829:22;18685:11;18816:36;18917:2;18907:13;;18926:25;18640:317;18926:25;-1:-1:-1;;18978:13:0;;;-1:-1:-1;;19075:14:0;;;19119:19;;;19075:14;17765:1382;-1:-1:-1;17765:1382:0:o;123954:588::-;124198:9;124186:10;124182:26;124169:10;124165:2;124161:19;124158:51;124227:8;124221:4;124214:22;124261:2;124258:1;124254:10;124248:4;124241:24;124295:4;124289;124279:21;124346:1;124342:2;124338:10;124335:1;124331:18;124400:1;124394:8;124439:18;124523:5;124519:1;124516;124512:9;124508:21;124505:1;124501:29;124498:1;124494:37;124491:1;124487:45;124484:1;124477:56;;;;;;123954:588;;;;:::o;121162:538::-;121309:1;121303:8;121335:4;121329;121325:15;121385:10;121382:1;121375:21;121451:4;121444;121441:1;121437:12;121430:26;121538:4;121532:11;121529:1;121525:19;121519:4;121515:30;121506:39;;121655:4;121652:1;121649;121642:4;121639:1;121635:12;121632:1;121624:6;121617:5;121612:48;121608:1;121604;121598:8;121595:15;121591:70;121581:110;;121680:4;121677:1;121670:15;121581:110;;;121162:538;;:::o;14:250:1:-;99:1;109:113;123:6;120:1;117:13;109:113;;;199:11;;;193:18;180:11;;;173:39;145:2;138:10;109:113;;;-1:-1:-1;;256:1:1;238:16;;231:27;14:250::o;269:396::-;418:2;407:9;400:21;381:4;450:6;444:13;493:6;488:2;477:9;473:18;466:34;509:79;581:6;576:2;565:9;561:18;556:2;548:6;544:15;509:79;:::i;:::-;649:2;628:15;-1:-1:-1;;624:29:1;609:45;;;;656:2;605:54;;269:396;-1:-1:-1;;269:396:1:o;670:173::-;738:20;;-1:-1:-1;;;;;787:31:1;;777:42;;767:70;;833:1;830;823:12;848:254;916:6;924;977:2;965:9;956:7;952:23;948:32;945:52;;;993:1;990;983:12;945:52;1016:29;1035:9;1016:29;:::i;:::-;1006:39;1092:2;1077:18;;;;1064:32;;-1:-1:-1;;;848:254:1:o;1481:328::-;1558:6;1566;1574;1627:2;1615:9;1606:7;1602:23;1598:32;1595:52;;;1643:1;1640;1633:12;1595:52;1666:29;1685:9;1666:29;:::i;:::-;1656:39;;1714:38;1748:2;1737:9;1733:18;1714:38;:::i;:::-;1704:48;;1799:2;1788:9;1784:18;1771:32;1761:42;;1481:328;;;;;:::o;1814:186::-;1873:6;1926:2;1914:9;1905:7;1901:23;1897:32;1894:52;;;1942:1;1939;1932:12;1894:52;1965:29;1984:9;1965:29;:::i;2005:273::-;2061:6;2114:2;2102:9;2093:7;2089:23;2085:32;2082:52;;;2130:1;2127;2120:12;2082:52;2169:9;2156:23;2222:5;2215:13;2208:21;2201:5;2198:32;2188:60;;2244:1;2241;2234:12;2680:592;2751:6;2759;2812:2;2800:9;2791:7;2787:23;2783:32;2780:52;;;2828:1;2825;2818:12;2780:52;2868:9;2855:23;2897:18;2938:2;2930:6;2927:14;2924:34;;;2954:1;2951;2944:12;2924:34;2992:6;2981:9;2977:22;2967:32;;3037:7;3030:4;3026:2;3022:13;3018:27;3008:55;;3059:1;3056;3049:12;3008:55;3099:2;3086:16;3125:2;3117:6;3114:14;3111:34;;;3141:1;3138;3131:12;3111:34;3186:7;3181:2;3172:6;3168:2;3164:15;3160:24;3157:37;3154:57;;;3207:1;3204;3197:12;3154:57;3238:2;3230:11;;;;;3260:6;;-1:-1:-1;2680:592:1;;-1:-1:-1;;;;2680:592:1:o;3277:180::-;3336:6;3389:2;3377:9;3368:7;3364:23;3360:32;3357:52;;;3405:1;3402;3395:12;3357:52;-1:-1:-1;3428:23:1;;3277:180;-1:-1:-1;3277:180:1:o;3462:260::-;3530:6;3538;3591:2;3579:9;3570:7;3566:23;3562:32;3559:52;;;3607:1;3604;3597:12;3559:52;3630:29;3649:9;3630:29;:::i;:::-;3620:39;;3678:38;3712:2;3701:9;3697:18;3678:38;:::i;:::-;3668:48;;3462:260;;;;;:::o;3727:127::-;3788:10;3783:3;3779:20;3776:1;3769:31;3819:4;3816:1;3809:15;3843:4;3840:1;3833:15;3859:191;-1:-1:-1;;;;;3986:10:1;;;3974;;;3970:27;;4009:12;;;4006:38;;;4024:18;;:::i;4055:380::-;4134:1;4130:12;;;;4177;;;4198:61;;4252:4;4244:6;4240:17;4230:27;;4198:61;4305:2;4297:6;4294:14;4274:18;4271:38;4268:161;;4351:10;4346:3;4342:20;4339:1;4332:31;4386:4;4383:1;4376:15;4414:4;4411:1;4404:15;4440:127;4501:10;4496:3;4492:20;4489:1;4482:31;4532:4;4529:1;4522:15;4556:4;4553:1;4546:15;4698:518;4800:2;4795:3;4792:11;4789:421;;;4836:5;4833:1;4826:16;4880:4;4877:1;4867:18;4950:2;4938:10;4934:19;4931:1;4927:27;4921:4;4917:38;4986:4;4974:10;4971:20;4968:47;;;-1:-1:-1;5009:4:1;4968:47;5064:2;5059:3;5055:12;5052:1;5048:20;5042:4;5038:31;5028:41;;5119:81;5137:2;5130:5;5127:13;5119:81;;;5196:1;5182:16;;5163:1;5152:13;5119:81;;;5123:3;;4698:518;;;:::o;5392:1198::-;5516:18;5511:3;5508:27;5505:53;;;5538:18;;:::i;:::-;5567:94;5657:3;5617:38;5649:4;5643:11;5617:38;:::i;:::-;5611:4;5567:94;:::i;:::-;5687:1;5712:2;5707:3;5704:11;5729:1;5724:608;;;;6376:1;6393:3;6390:93;;;-1:-1:-1;6449:19:1;;;6436:33;6390:93;-1:-1:-1;;5349:1:1;5345:11;;;5341:24;5337:29;5327:40;5373:1;5369:11;;;5324:57;6496:78;;5697:887;;5724:608;4645:1;4638:14;;;4682:4;4669:18;;-1:-1:-1;;5760:17:1;;;5875:229;5889:7;5886:1;5883:14;5875:229;;;5978:19;;;5965:33;5950:49;;6085:4;6070:20;;;;6038:1;6026:14;;;;5905:12;5875:229;;;5879:3;6132;6123:7;6120:16;6117:159;;;6256:1;6252:6;6246:3;6240;6237:1;6233:11;6229:21;6225:34;6221:39;6208:9;6203:3;6199:19;6186:33;6182:79;6174:6;6167:95;6117:159;;;6319:1;6313:3;6310:1;6306:11;6302:19;6296:4;6289:33;5697:887;;5392:1198;;;:::o;6894:1021::-;7070:3;7099:1;7132:6;7126:13;7162:36;7188:9;7162:36;:::i;:::-;7217:1;7234:17;;;7260:133;;;;7407:1;7402:358;;;;7227:533;;7260:133;-1:-1:-1;;7293:24:1;;7281:37;;7366:14;;7359:22;7347:35;;7338:45;;;-1:-1:-1;7260:133:1;;7402:358;7433:6;7430:1;7423:17;7463:4;7508;7505:1;7495:18;7535:1;7549:165;7563:6;7560:1;7557:13;7549:165;;;7641:14;;7628:11;;;7621:35;7684:16;;;;7578:10;;7549:165;;;7553:3;;;7743:6;7738:3;7734:16;7727:23;;7227:533;;;;;7791:6;7785:13;7807:68;7866:8;7861:3;7854:4;7846:6;7842:17;7807:68;:::i;:::-;7891:18;;6894:1021;-1:-1:-1;;;;6894:1021:1:o;7920:201::-;7958:3;7986:10;8031:2;8024:5;8020:14;8058:2;8049:7;8046:15;8043:41;;8064:18;;:::i;:::-;8113:1;8100:15;;7920:201;-1:-1:-1;;;7920:201:1:o;8126:127::-;8187:10;8182:3;8178:20;8175:1;8168:31;8218:4;8215:1;8208:15;8242:4;8239:1;8232:15
Swarm Source
ipfs://46017508d9d1b2176d68851baafef2615f318a85eacb3292984abe5633db2ece
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.