ERC-20
Overview
Max Total Supply
696,900,000 DN
Holders
144
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
17,418,024.672644515863119808 DNValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
DeezNutz
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 100 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // # // @ , // @@@@@@@@@. // #@@@ @@@ @@@* @@@@ // @@@@@ @@@ @@@ @@@@@@ // @ @@@ /@@ @@@ @@@ @ // @@@ @@@@@((@@@@@ @@@ @ // @@@@@@@@@@@@@@@ &@@@@@@@@@@@@@@ ( // @@@@@@@ @@ @@ @@@@@@@@@ // @@ @@@ %@@@ @@ @@@@ // @@@ @@@ @@ @@@ && // @ @@@ @@/ @@ @@@ @ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@ @ // @@@@@@@@@ @@ @@@ *@@@@@@@@@ &@ // @ @@# @@ @@@ ,@@%@@@@@ // * @@@ @@ &@@. @@@ @ // @@@ @@ @@@ @@@ @ // @@@@@@@@@@@@@@@@@@@@@@ @@/ ( // @@@@@@@@@@/ @@@ *@@@@@@@@@@@@@. * // @ @@& @@@ @@@ @@@ @@@@@ // # @@@ @@@ @@ /@@ @. // @ @@@ @@@ %@@ @@@ @ // @@@@@@@@& @@@ @@@ @@. &@@ // @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @ @@@ @@@ @@@ @@@ .@ // @ @@@ @@% @@@ @@@ @@ // @@@, @@@ @@@ @@ @@@ # *@@ // @ .@@@@@@@@&& &@@ @@# #@@@@@@@@@@# // @ @@@ (@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @. // #@ @@@ @@@ @@@ %@@@ @ // /@ @@@ @@@ @@* &@@@ @ // @@@@@ @@@ @@@ @@@ @@@ @@@& // @ ,@@@@@@@@@@@* @@@ @@@ /@@@@@@@@@@@@@ // @ @@@ #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #@ // /@ @@% %@@ @@@ @@@ @ // %@ @@@ @@@ @@@ @@@ @@ // @@@@@@@@@ @@@ @@* .@@@ (@@@@@ // @ @@@@@@@@@@@@&@@@ @@@ &@@@@@@@@@@@@@ // @@ @@@ %@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ,@ // @@ @@@ @@@ &@@# @@@, @@ // @@@@@@@@@ %@@( @@@ @@@@ @@@@@ // @@@@@@@@@@@@/ @@@ % @@@& &@@@@@@@@@@@@ // & @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ &@ // @% @@@@. @@@ .@@@ @@@@@ @ // .@@@@@& @@@ @@@@ %@@@@@@@ // #@@@@@@@@@@@@@@@@# // Deez Nutz $DN // Website: https://deeznutz.africa/ // Telegram: https://t.me/DeezNutz404 // Twitter: https://twitter.com/DeezNutz_404 // Deez Nutz is the future of finance, memes, and tokenomics, a DN404 fork that adds fractionalized yield tied to cute neochibi peanut NFTs. pragma solidity ^0.8.4; import "./DN404Reflect.sol"; import "./DN404Mirror.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract DeezNutz is DN404Reflect, Ownable { string private _name; string private _symbol; string private baseTokenURI; bool private isHidden; bool private tradingEnabled; address private uniswapV2Router; constructor(address uniswapV2Router_) Ownable(tx.origin) { _name = "DeezNutz"; _symbol = "DN"; isHidden = true; uniswapV2Router = uniswapV2Router_; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* METADATA */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ function name() public view override returns (string memory) { return _name; } function symbol() public view override returns (string memory) { return _symbol; } function setTokenURI(string memory _tokenURI) public onlyOwner { baseTokenURI = _tokenURI; } function tokenURI(uint256 id) public view override returns (string memory) { if (!_exists(id)) revert TokenDoesNotExist(); if (isHidden) return baseTokenURI; return string.concat(baseTokenURI, Strings.toString(id), ".json"); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* TRANSFERS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ function transfer( address to, uint256 amount ) public override returns (bool) { if (!tradingEnabled) { require(msg.sender == owner(), "Trading is not enabled"); } _transfer(msg.sender, to, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public override returns (bool) { if (!tradingEnabled) { require( msg.sender == owner() || (msg.sender == uniswapV2Router && from == owner()), "Trading is not enabled" ); } 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; } function _transferFromNFT( address from, address to, uint256 id, address msgSender ) internal override { if (!tradingEnabled) { require(msg.sender == owner(), "Trading is not enabled"); } DN404Reflect._transferFromNFT(from, to, id, msgSender); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ADMIN FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ function initialize( uint96 totalSupply_, address owner_, uint256 wad, address mirror ) public onlyOwner() { _initializeDN404Reflect( totalSupply_, owner_, mirror, wad ); } function reveal(string memory uri) public onlyOwner { baseTokenURI = uri; isHidden = false; } ///@dev exclude account from earning reflections function excludeAccount(address account) external onlyOwner { DN404Storage storage $ = _getDN404Storage(); require(!$.functionsRenounced, "Function is renounced"); AddressData storage accountAddressData = _addressData(account); require(!accountAddressData.isExcluded, "Account is already excluded"); if (accountAddressData.rOwned > 0) { accountAddressData.tOwned = tokenFromReflection( accountAddressData.rOwned ); } accountAddressData.isExcluded = true; $.excluded.push(account); } ///@dev include account to earn reflections function includeAccount(address account) external onlyOwner { DN404Storage storage $ = _getDN404Storage(); AddressData storage accountAddressData = _addressData(account); require(!accountAddressData.isExcluded, "Account is already excluded"); for (uint256 i = 0; i < $.excluded.length; i++) { if ($.excluded[i] == account) { $.excluded[i] = $.excluded[$.excluded.length - 1]; accountAddressData.tOwned = 0; accountAddressData.isExcluded = false; $.excluded.pop(); break; } } } /// @dev function to set reflections fee, cannot be invoked once ownership is renounced, 1-1000 for 1 decimal of precision // i.e. 50 = 5%, 25 = 2.5%, 1 = 0.1% function setTaxFee(uint256 fee) external onlyOwner { DN404Storage storage $ = _getDN404Storage(); require(!$.functionsRenounced, "Function is renounced"); require(fee <= 50, "Reflections fee must be 5% or less"); $.taxFee = fee; } function getTaxFee() external returns (uint256) { return _getDN404Storage().taxFee; } /// @dev renounce setTaxFee and excludeAccount WARNING: CANNOT BE UNDONE function renounceFunctions() external onlyOwner { _getDN404Storage().functionsRenounced = true; } function enableTrading() external onlyOwner { tradingEnabled = true; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.20; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol) pragma solidity ^0.8.20; import {Math} from "./math/Math.sol"; import {SignedMath} from "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant HEX_DIGITS = "0123456789abcdef"; uint8 private constant ADDRESS_LENGTH = 20; /** * @dev The `value` string doesn't fit in the specified `length`. */ error StringsInsufficientHexLength(uint256 value, uint256 length); /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), HEX_DIGITS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toStringSigned(int256 value) internal pure returns (string memory) { return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { uint256 localValue = value; bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = HEX_DIGITS[localValue & 0xf]; localValue >>= 4; } if (localValue != 0) { revert StringsInsufficientHexLength(value, length); } return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal * representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @title DN404Mirror /// @notice DN404Mirror provides an interface for interacting with the /// NFT tokens in a DN404 implementation. /// /// @author vectorized.eth (@optimizoor) /// @author Quit (@0xQuit) /// @author Michael Amadi (@AmadiMichaels) /// @author cygaar (@0xCygaar) /// @author Thomas (@0xjustadev) /// @author Harrison (@PopPunkOnChain) /// /// @dev Note: /// - The ERC721 data is stored in the base DN404 contract. contract DN404Mirror { /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* EVENTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Emitted when token `id` is transferred from `from` to `to`. event Transfer(address indexed from, address indexed to, uint256 indexed id); /// @dev Emitted when `owner` enables `account` to manage the `id` token. event Approval(address indexed owner, address indexed account, uint256 indexed id); /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens. event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved); /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`. uint256 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; /// @dev `keccak256(bytes("Approval(address,address,uint256)"))`. uint256 private constant _APPROVAL_EVENT_SIGNATURE = 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925; /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`. uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE = 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CUSTOM ERRORS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Thrown when a call for an NFT function did not originate /// from the base DN404 contract. error SenderNotBase(); /// @dev Thrown when a call for an NFT function did not originate from the deployer. error SenderNotDeployer(); /// @dev Thrown when transferring an NFT to a contract address that /// does not implement ERC721Receiver. error TransferToNonERC721ReceiverImplementer(); /// @dev Thrown when linking to the DN404 base contract and the /// DN404 supportsInterface check fails or the call reverts. error CannotLink(); /// @dev Thrown when a linkMirrorContract call is received and the /// NFT mirror contract has already been linked to a DN404 base contract. error AlreadyLinked(); /// @dev Thrown when retrieving the base DN404 address when a link has not /// been established. error NotLinked(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct contain the NFT mirror contract storage. struct DN404NFTStorage { address baseERC20; address deployer; } /// @dev Returns a storage pointer for DN404NFTStorage. function _getDN404NFTStorage() internal pure virtual returns (DN404NFTStorage storage $) { /// @solidity memory-safe-assembly assembly { // `uint72(bytes9(keccak256("DN404_MIRROR_STORAGE")))`. $.slot := 0x3602298b8c10b01230 // Truncate to 9 bytes to reduce bytecode size. } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTRUCTOR */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ constructor(address deployer) { // For non-proxies, we will store the deployer so that only the deployer can // link the base contract. _getDN404NFTStorage().deployer = deployer; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ERC721 OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the token collection name from the base DN404 contract. function name() public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x00, 0x06fdde03) // `name()`. if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the token collection symbol from the base DN404 contract. function symbol() public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x00, 0x95d89b41) // `symbol()`. if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the Uniform Resource Identifier (URI) for token `id` from /// the base DN404 contract. function tokenURI(uint256 id) public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x20, id) mstore(0x00, 0xc87b56dd) // `tokenURI()`. if iszero(staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the total NFT supply from the base DN404 contract. function totalSupply() public view virtual returns (uint256 result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0xe2c79281) // `totalNFTSupply()`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := mload(0x00) } } /// @dev Returns the number of NFT tokens owned by `owner` from the base DN404 contract. /// /// Requirements: /// - `owner` must not be the zero address. function balanceOf(address owner) public view virtual returns (uint256 result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x20, shr(96, shl(96, owner))) mstore(0x00, 0xf5b100ea) // `balanceOfNFT(address)`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := mload(0x00) } } /// @dev Returns the owner of token `id` from the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. function ownerOf(uint256 id) public view virtual returns (address result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x6352211e) // `ownerOf(uint256)`. mstore(0x20, id) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, mload(0x0c)) } } /// @dev Sets `spender` as the approved account to manage token `id` in /// the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. /// - The caller must be the owner of the token, /// or an approved operator for the token owner. /// /// Emits an {Approval} event. function approve(address spender, uint256 id) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { spender := shr(96, shl(96, spender)) let m := mload(0x40) mstore(0x00, 0xd10b6e0c) // `approveNFT(address,uint256,address)`. mstore(0x20, spender) mstore(0x40, id) mstore(0x60, caller()) if iszero( and( gt(returndatasize(), 0x1f), call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20) ) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } mstore(0x40, m) // Restore the free memory pointer. mstore(0x60, 0) // Restore the zero pointer. // Emit the {Approval} event. log4(codesize(), 0x00, _APPROVAL_EVENT_SIGNATURE, shr(96, mload(0x0c)), spender, id) } } /// @dev Returns the account approved to manage token `id` from /// the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. function getApproved(uint256 id) public view virtual returns (address result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x081812fc) // `getApproved(uint256)`. mstore(0x20, id) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, mload(0x0c)) } } /// @dev Sets whether `operator` is approved to manage the tokens of the caller in /// the base DN404 contract. /// /// Emits an {ApprovalForAll} event. function setApprovalForAll(address operator, bool approved) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { operator := shr(96, shl(96, operator)) let m := mload(0x40) mstore(0x00, 0x813500fc) // `setApprovalForAll(address,bool,address)`. mstore(0x20, operator) mstore(0x40, iszero(iszero(approved))) mstore(0x60, caller()) if iszero( and(eq(mload(0x00), 1), call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } // Emit the {ApprovalForAll} event. log3(0x40, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), operator) mstore(0x40, m) // Restore the free memory pointer. mstore(0x60, 0) // Restore the zero pointer. } } /// @dev Returns whether `operator` is approved to manage the tokens of `owner` from /// the base DN404 contract. function isApprovedForAll(address owner, address operator) public view virtual returns (bool result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { let m := mload(0x40) mstore(0x40, operator) mstore(0x2c, shl(96, owner)) mstore(0x0c, 0xe985e9c5000000000000000000000000) // `isApprovedForAll(address,address)`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x44, 0x00, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } mstore(0x40, m) // Restore the free memory pointer. result := iszero(iszero(mload(0x00))) } } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// - The caller must be the owner of the token, or be approved to manage the token. /// /// Emits a {Transfer} event. function transferFrom(address from, address to, uint256 id) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { from := shr(96, shl(96, from)) to := shr(96, shl(96, to)) let m := mload(0x40) mstore(m, 0xe5eb36c8) // `transferFromNFT(address,address,uint256,address)`. mstore(add(m, 0x20), from) mstore(add(m, 0x40), to) mstore(add(m, 0x60), id) mstore(add(m, 0x80), caller()) if iszero( and(eq(mload(m), 1), call(gas(), base, callvalue(), add(m, 0x1c), 0x84, m, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } // Emit the {Transfer} event. log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id) } } /// @dev Equivalent to `safeTransferFrom(from, to, id, "")`. function safeTransferFrom(address from, address to, uint256 id) public payable virtual { transferFrom(from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, ""); } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// - The caller must be the owner of the token, or be approved to manage the token. /// - If `to` refers to a smart contract, it must implement /// {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. /// /// Emits a {Transfer} event. function safeTransferFrom(address from, address to, uint256 id, bytes calldata data) public virtual { transferFrom(from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, data); } /// @dev Returns true if this contract implements the interface defined by `interfaceId`. /// See: https://eips.ethereum.org/EIPS/eip-165 /// This function call must use less than 30000 gas. function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) { /// @solidity memory-safe-assembly assembly { let s := shr(224, interfaceId) // ERC165: 0x01ffc9a7, ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f. result := or(or(eq(s, 0x01ffc9a7), eq(s, 0x80ac58cd)), eq(s, 0x5b5e139f)) } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the base DN404 contract. function baseERC20() public view virtual returns (address base) { base = _getDN404NFTStorage().baseERC20; if (base == address(0)) revert NotLinked(); } /// @dev Fallback modifier to execute calls from the base DN404 contract. modifier dn404NFTFallback() virtual { DN404NFTStorage storage $ = _getDN404NFTStorage(); uint256 fnSelector = _calldataload(0x00) >> 224; // `logTransfer(uint256[])`. if (fnSelector == 0x263c69d6) { if (msg.sender != $.baseERC20) revert SenderNotBase(); /// @solidity memory-safe-assembly assembly { // When returndatacopy copies 1 or more out-of-bounds bytes, it reverts. returndatacopy(0x00, returndatasize(), lt(calldatasize(), 0x20)) let o := add(0x24, calldataload(0x04)) // Packed logs offset. returndatacopy(0x00, returndatasize(), lt(calldatasize(), o)) let end := add(o, shl(5, calldataload(sub(o, 0x20)))) returndatacopy(0x00, returndatasize(), lt(calldatasize(), end)) for {} iszero(eq(o, end)) { o := add(0x20, o) } { let d := calldataload(o) // Entry in the packed logs. let a := shr(96, d) // The address. let b := and(1, d) // Whether it is a burn. log4( codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, mul(a, b), mul(a, iszero(b)), shr(168, shl(160, d)) ) } mstore(0x00, 0x01) return(0x00, 0x20) } } // `linkMirrorContract(address)`. if (fnSelector == 0x0f4599e5) { if ($.deployer != address(0)) { if (address(uint160(_calldataload(0x04))) != $.deployer) { revert SenderNotDeployer(); } } if ($.baseERC20 != address(0)) revert AlreadyLinked(); $.baseERC20 = msg.sender; /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x01) return(0x00, 0x20) } } _; } /// @dev Fallback function for calls from base DN404 contract. fallback() external payable virtual dn404NFTFallback {} receive() external payable virtual {} /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* PRIVATE HELPERS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the calldata value at `offset`. function _calldataload(uint256 offset) private pure returns (uint256 value) { /// @solidity memory-safe-assembly assembly { value := calldataload(offset) } } /// @dev Returns if `a` has bytecode of non-zero length. function _hasCode(address a) private view returns (bool result) { /// @solidity memory-safe-assembly assembly { result := extcodesize(a) // Can handle dirty upper bits. } } /// @dev Perform a call to invoke {IERC721Receiver-onERC721Received} on `to`. /// Reverts if the target does not support the function correctly. function _checkOnERC721Received(address from, address to, uint256 id, bytes memory data) private { /// @solidity memory-safe-assembly assembly { // Prepare the calldata. let m := mload(0x40) let onERC721ReceivedSelector := 0x150b7a02 mstore(m, onERC721ReceivedSelector) mstore(add(m, 0x20), caller()) // The `operator`, which is always `msg.sender`. mstore(add(m, 0x40), shr(96, shl(96, from))) mstore(add(m, 0x60), id) mstore(add(m, 0x80), 0x80) let n := mload(data) mstore(add(m, 0xa0), n) if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xc0), n)) } // Revert if the call reverts. if iszero(call(gas(), to, 0, add(m, 0x1c), add(n, 0xa4), m, 0x20)) { if returndatasize() { // Bubble up the revert if the call reverts. returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } } // Load the returndata and compare it. if iszero(eq(mload(m), shl(224, onERC721ReceivedSelector))) { mstore(0x00, 0xd1a57ed6) // `TransferToNonERC721ReceiverImplementer()`. revert(0x1c, 0x04) } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./DN404Mirror.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 DN404Reflect { /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* 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(); /// @dev Amount of token balance that is equal to one NFT. uint256 internal _WAD; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTANTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @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; // tTotal for reflections uint256 tOwned; // rTotal for reflections uint256 rOwned; // Excluded from reflections bool isExcluded; } /// @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; // Total supply of tokens uint256 tTotal; // Reflections remaining uint256 rTotal; // Total transaction fees uint256 tFeeTotal; // Tax Fee (as percentage) uint256 taxFee; // 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; // array of excluded addresses address[] excluded; // Determines whether setTaxFee and ExcludeAccount can be called bool functionsRenounced; // Opens transfers for everyone bool tradingEnabled; } /// @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 _initializeDN404Reflect( uint256 initialTokenSupply, address initialSupplyOwner, address mirror, uint256 wad ) internal virtual { DN404Storage storage $ = _getDN404Storage(); if ($.nextTokenId != 0) revert DNAlreadyInitialized(); if (mirror == address(0)) revert MirrorAddressIsZero(); _linkMirrorContract(mirror); $.nextTokenId = 1; $.mirrorERC721 = mirror; _WAD = wad; if (initialTokenSupply > 0) { if (initialSupplyOwner == address(0)) revert TransferToZeroAddress(); if (initialTokenSupply > _MAX_SUPPLY) revert TotalSupplyOverflow(); $.totalSupply = uint96(initialTokenSupply); $.tTotal = uint256(initialTokenSupply); uint256 MAX = ~uint256(0); $.rTotal = (MAX - (MAX % $.tTotal)); AddressData storage initialOwnerAddressData = _addressData( initialSupplyOwner ); initialOwnerAddressData.balance = uint96(initialTokenSupply); initialOwnerAddressData.rOwned = $.rTotal; 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 result); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* 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` /// Updated for reflections logic function balanceOf(address owner) public view virtual returns (uint256) { AddressData storage ownerAddressData = _getDN404Storage().addressData[ owner ]; if (ownerAddressData.isExcluded) return ownerAddressData.tOwned; return tokenFromReflection(ownerAddressData.rOwned); } /// @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; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* REFLECTION OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev reflects sender's wallet function reflect(uint256 tAmount) public { DN404Storage storage $ = _getDN404Storage(); address sender = msg.sender; AddressData storage senderAddressData = _addressData(sender); require( !senderAddressData.isExcluded, "Excluded addresses cannot call this function" ); (uint256 rAmount, , , , ) = _getValues(tAmount); senderAddressData.rOwned = senderAddressData.rOwned - rAmount; $.rTotal = $.rTotal - rAmount; $.tFeeTotal = $.tFeeTotal + tAmount; } /// @dev returns rAmount from amount of tokens function reflectionFromToken( uint256 tAmount, bool deductTransferFee ) public view returns (uint256) { require( tAmount <= _getDN404Storage().tTotal, "Amount must be less than supply" ); if (!deductTransferFee) { (uint256 rAmount, , , , ) = _getValues(tAmount); return rAmount; } else { (, uint256 rTransferAmount, , , ) = _getValues(tAmount); return rTransferAmount; } } ///@dev returns token amount from rTotal (used for balanceOf) function tokenFromReflection( uint256 rAmount ) public view returns (uint256) { require( rAmount <= _getDN404Storage().rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount / currentRate; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* 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.rOwnedFrom = fromAddressData.rOwned; t.rOwnedTo = toAddressData.rOwned; t.fromBalance = this.balanceOf(from); t.toBalance = this.balanceOf(to); if (amount > t.fromBalance) revert InsufficientBalance(); unchecked { // Reflections transfer logic ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee ) = _getValues(amount); // Transfer from excluded address if (fromAddressData.isExcluded && !toAddressData.isExcluded) { t.tOwnedFrom = fromAddressData.tOwned - amount; t.rOwnedFrom = t.rOwnedFrom - rAmount; t.rOwnedTo = t.rOwnedTo + rTransferAmount; // Update temporary from and to balance t.fromBalance = t.tOwnedFrom; t.toBalance = tokenFromReflection(t.rOwnedTo); } // Transfer to excluded address else if (!fromAddressData.isExcluded && toAddressData.isExcluded) { t.rOwnedFrom = t.rOwnedFrom - rAmount; t.rOwnedTo = t.rOwnedTo + rTransferAmount; t.tOwnedTo = toAddressData.tOwned + tTransferAmount; // Update temporary from and to balance t.fromBalance = tokenFromReflection(t.rOwnedFrom); t.toBalance = t.tOwnedTo; } // Transfer between non-excluded addresses else if (!fromAddressData.isExcluded && !toAddressData.isExcluded) { t.rOwnedFrom = t.rOwnedFrom - rAmount; t.rOwnedTo = t.rOwnedTo + rTransferAmount; // Update temporary from and to balance t.fromBalance = tokenFromReflection(t.rOwnedFrom); t.toBalance = tokenFromReflection(t.rOwnedTo); } // Transfer between both excluded addresses else if (fromAddressData.isExcluded && toAddressData.isExcluded) { t.tOwnedFrom = fromAddressData.tOwned - amount; t.rOwnedFrom = t.rOwnedFrom - rAmount; t.rOwnedTo = t.rOwnedTo + rTransferAmount; t.tOwnedTo = toAddressData.tOwned + tTransferAmount; // Update temporary from and to balance t.fromBalance = t.tOwnedFrom; t.toBalance = t.tOwnedTo; } else { t.rOwnedFrom = t.rOwnedFrom - rAmount; t.rOwnedTo = t.rOwnedTo + rTransferAmount; // Update temporary from and to balance t.fromBalance = tokenFromReflection(t.rOwnedFrom); t.toBalance = tokenFromReflection(t.rOwnedTo); } // Reflect fees to all token holders _reflectFee(rFee, tFee); // Update address data rOwned and tOwned fromAddressData.rOwned = t.rOwnedFrom; toAddressData.rOwned = t.rOwnedTo; fromAddressData.tOwned = t.tOwnedFrom; toAddressData.tOwned = t.tOwnedTo; // Update address balances for nft transfer logic fromAddressData.balance = uint96(t.fromBalance); toAddressData.balance = uint96(t.toBalance); 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); } } // Should be taken care of by internal reflections transfer functions 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); // Transfer without taking reflection fee (uint256 rAmount, , , , ) = _getValues(_WAD); if (fromAddressData.isExcluded) { fromAddressData.tOwned -= _WAD; } if (toAddressData.isExcluded) { toAddressData.tOwned += _WAD; } fromAddressData.rOwned -= rAmount; fromAddressData.balance -= uint96(_WAD); unchecked { toAddressData.balance += uint96(_WAD); toAddressData.rOwned += rAmount; _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; uint256 rOwnedFrom; uint256 rOwnedTo; uint256 tOwnedFrom; uint256 tOwnedTo; } /// @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))))) } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* PRIVATE FUNCTIONS FOR REFLECTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Reflects fee to all holders function _reflectFee(uint256 rFee, uint256 tFee) private { DN404Storage storage $ = _getDN404Storage(); $.rTotal = $.rTotal - rFee; $.tFeeTotal = $.tFeeTotal + tFee; } function _getValues( uint256 tAmount ) private view returns (uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee); } function _getTValues( uint256 tAmount ) private view returns (uint256, uint256) { uint256 tFee = _calculateTaxFee(tAmount); uint256 tTransferAmount = tAmount - tFee; return (tTransferAmount, tFee); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 currentRate ) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount * currentRate; uint256 rFee = tFee * currentRate; uint256 rTransferAmount = rAmount - rFee; return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return (rSupply / tSupply); } /// @dev returns current supply in terms of 'r' and 't' function _getCurrentSupply() private view returns (uint256, uint256) { DN404Storage storage $ = _getDN404Storage(); uint256 rSupply = $.rTotal; uint256 tSupply = $.tTotal; for (uint256 i = 0; i < $.excluded.length; i++) { AddressData storage excludedAddressData = $.addressData[ $.excluded[i] ]; if ( excludedAddressData.rOwned > rSupply || excludedAddressData.tOwned > tSupply ) return ($.rTotal, $.tTotal); rSupply = rSupply - excludedAddressData.rOwned; tSupply = tSupply - excludedAddressData.tOwned; } if (rSupply < $.rTotal / $.tTotal) return ($.rTotal, $.tTotal); return (rSupply, tSupply); } /// @dev returns the total reflected tokens function getTotalReflections() public view returns (uint256) { return _getDN404Storage().tFeeTotal; } function _calculateTaxFee(uint256 amount) private view returns (uint256) { return (amount * _getDN404Storage().taxFee) / (10 ** 3); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ACCESS FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ }
{ "optimizer": { "enabled": true, "runs": 100 }, "viaIR": true, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"uniswapV2Router_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","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"},{"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":"previousOwner","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":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"enableTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"excludeAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"a","type":"address"}],"name":"getSkipNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTaxFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getTotalReflections","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"includeAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"totalSupply_","type":"uint96"},{"internalType":"address","name":"owner_","type":"address"},{"internalType":"uint256","name":"wad","type":"uint256"},{"internalType":"address","name":"mirror","type":"address"}],"name":"initialize","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":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tAmount","type":"uint256"}],"name":"reflect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tAmount","type":"uint256"},{"internalType":"bool","name":"deductTransferFee","type":"bool"}],"name":"reflectionFromToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceFunctions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"skipNFT","type":"bool"}],"name":"setSkipNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setTaxFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"rAmount","type":"uint256"}],"name":"tokenFromReflection","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608034620001d057601f62002d1938819003918201601f19168301916001600160401b03831184841017620001d557808492602094604052833981010312620001d057516001600160a01b03908181168103620001d0573215620001b75760018054326001600160a01b0319821681178355919360009291167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a3620000a9600254620001eb565b601f811162000169575b507f4465657a4e75747a000000000000000000000000000000000000000000000010600255600354620000e690620001eb565b90601f821162000139575b5050600461222760f11b016003556005805461ff01600160b01b03191660109290921b62010000600160b01b031691909117919091179055604051612af09081620002298239f35b6003815283601f60208320930160051c8301925b8381106200015d575050620000f1565b8281550184906200014d565b60028252601f0160051c7f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace9081019084905b828110620001ab575050620000b3565b8381550184906200019b565b604051631e4fbdf760e01b815260006004820152602490fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b90600182811c921680156200021d575b60208310146200020757565b634e487b7160e01b600052602260045260246000fd5b91607f1691620001fb56fe6040608081526004908136109182156106ab575b36156106a957600092833560e01c9163e985e9c5831461064857636352211e83146105d45763e5eb36c883146102df5763813500fc83146102865763d10b6e0c83146101d15763081812fc83146101395763f5b100ea83146100e05763e2c792818314610091578463b7a94eb8841461008857005b80600160209252f35b68a20d6e21d0e525530d54919250906001600160a01b031633036100d257506100ce5768a20d6e21d0e525530854901c63ffffffff168152602090f35b5080fd5b825163ce5a776b60e01b8152fd5b68a20d6e21d0e525530d546001600160a01b03949193509091508316330361012c5750602436106101285761011f6020939263ffffffff923516611928565b5460801c168152f35b8280fd5b5163ce5a776b60e01b8152fd5b68a20d6e21d0e525530d5485906001600160a01b03908690821633036101c25760243610610128578335826101916101738360011b611b2b565b63ffffffff1660005268a20d6e21d0e525530e602052604060002090565b5416156101b25760209450835268a20d6e21d0e52553108452822054168152f35b815163677510db60e11b81528590fd5b5163ce5a776b60e01b81528390fd5b68a20d6e21d0e525530d546001600160a01b039186918691908416330361027857606436106101285760243593806044351692816102146101738860011b611b2b565b541693848103610248575b50602095855268a20d6e21d0e52553108652842091351660018060a01b03198254161790558152f35b610251856118e4565b90865260205260ff818620541615610269578661021f565b516367d9dca160e11b81529050fd5b905163ce5a776b60e01b8152fd5b68a20d6e21d0e525530d546001600160a01b0391869186919084163303610278576064361061012857836102bf602095604435166118e4565b91351683528352812060ff1981541660ff60243515151617905560018152f35b68a20d6e21d0e525530d54849186916001600160a01b0390811633036105c55760843610610128578082351681602435169160443581606435169460ff60055460081c16156105b1575b84156105a35760019582871b938061034361017387611b2b565b541686036105945785820361054b575b505061035e84611ae5565b61036786611ae5565b9188549061037482611b57565b505050509160ff600385015416610535575b5060ff60038501541661051e575b600283016103a3838254611976565b90556001600160601b0390818b5416845460a01c039082821161050b575060209b94958c96856104e98b8f8f908f9061042b600080516020612a9b8339815191529f9a8e936104d09d6104ff9f610425936104046104fa9f6104159361205d565b808754168d5460a01c01168c61205d565b60028b01908154019055896128fa565b8b6129a8565b87815268a20d6e21d0e52553108e522080546001600160a01b03191690556104bb816104a361049d61045c86611906565b9763ffffffff9861047a8a60001981855460801c1601168093612080565b9063ffffffff918160031c60005260205260e06040600020549160051b161c1690565b94611906565b99019885841690866104b48c611b2b565b16906129dd565b83855460801c16988995858388011690612080565b6401fffffffe6104df89611b2b565b92821b16016129a8565b6104f28c611906565b9216916129dd565b6129a8565b86549051908152a38152f35b634e487b7160e01b8c526011905260248bfd5b895461052e8a8601918254611999565b9055610394565b6105438a8501918254611976565b90558b610386565b610554866118e4565b828a5260205260ff8a8a2054166103535783895268a20d6e21d0e5255310602052898920541603610586578880610353565b8751632ce44b5f60e11b8152fd5b895162a1148160e81b81528390fd5b8751633a954ecd60e21b8152fd5b6105c083600154163314612018565b610329565b50825163ce5a776b60e01b8152fd5b68a20d6e21d0e525530d54849186916001600160a01b0391908216330361063a576024361061012857803560011b938261061061017387611b2b565b54161561062d575050610627610173602094611b2b565b54168152f35b5163677510db60e11b8152fd5b835163ce5a776b60e01b8152fd5b68a20d6e21d0e525530d546001600160a01b039350909150821633036100d257604436106106a557918161068360ff936020969535166118e4565b9060243516845284528220541660001461069d5760018152f35b60ff81168152f35b8380fd5b005b6000803560e01c8063053ab1821461168757806306fdde03146115e1578063095ea7b31461156d57806318160ddd1461153a57806323b872dd14611445578063274e430b146114165780632a6a935d146113835780632d83811914611362578063313ce567146113465780633a7374eb146110ea5780634549b039146110bc5780634c26124714610f905780634ef41efc14610f5f57806370a0823114610f32578063715018a614610ed55780638a8c523c14610eaa5780638da5cb5b14610e8157806395d89b4114610da8578063a9059cbb14610d4e578063ae26773514610d27578063c4081a4c14610c8b578063c87b56dd14610c5a578063dc5e08a414610c29578063dd62ed3e14610be2578063e0df5b6f14610ab0578063f2cc0c18146109e9578063f2fde38b1461095e578063f66608fe146109375763f84354f1146107f65750610013565b90346100ce5760203660031901126100ce576108106117ab565b610818611896565b61082181611ae5565b6003918282019361083660ff86541615612a4e565b6001600160a01b0391821690865b68a20d6e21d0e525531580548083101561092b57848661086385611bcd565b9054908b1b1c161461087f57505061087a90611bbe565b610844565b9495919096979293506000199485810190811161091857916108d76001926108b8898c6108ac8f98611bcd565b9054911b1c1691611bcd565b90919082549060031b9160018060a01b03809116831b921b1916179055565b0155805460ff191690558354908115610905575001926108f684611bcd565b81939154921b1b191690555580f35b634e487b7160e01b875260319052602486fd5b634e487b7160e01b8a526011855260248afd5b50505050505050505080f35b5082346100ce57816003193601126100ce5760209068a20d6e21d0e525530c549051908152f35b509250346101285760203660031901126101285761097a6117ab565b90610983611896565b6001600160a01b039182169283156109d3575050600180546001600160a01b031981168417909155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b51631e4fbdf760e01b8152908101849052602490fd5b5034610aad576020366003190112610aad57610a036117ab565b610a0b611896565b610a2260ff68a20d6e21d0e5255316541615612a0a565b610a2b81611ae5565b60016003820191825490610a4260ff831615612a4e565b600281015480610a99575b505060ff191617905568a20d6e21d0e5255315805490600160401b821015610a8657816108b8916001610a839594019055611bcd565b80f35b634e487b7160e01b845260418552602484fd5b610aa38491611a42565b9101558680610a4d565b80fd5b5034610aad57610abf3661182e565b91610ac8611896565b82516001600160401b038111610bcf57610ae28254611ccf565b601f8111610b8a575b50602080601f8311600114610b285750839482939492610b1d575b50508160011b916000199060031b1c191617905580f35b015190508480610b06565b90601f198316958486528286209286905b888210610b7257505083600195969710610b59575b505050811b01905580f35b015160001960f88460031b161c19169055848080610b4e565b80600185968294968601518155019501930190610b39565b82845260208420601f830160051c81019160208410610bc5575b601f0160051c01905b818110610bba5750610aeb565b848155600101610bad565b9091508190610ba4565b634e487b7160e01b835260418252602483fd5b5082346100ce57806003193601126100ce5780602092610c006117ab565b610c11610c0b6117c6565b916118c2565b6001600160a01b039091168252845220549051908152f35b5034610aad5780600319360112610aad57610c42611896565b68a20d6e21d0e5255316805460ff1916600117905580f35b50829034610aad576020366003190112610aad5750610c7c610c879235611d09565b90519182918261177f565b0390f35b5092503461012857602036600319011261012857803591610caa611896565b610cc160ff68a20d6e21d0e5255316541615612a0a565b60328311610cd957505068a20d6e21d0e525530c5580f35b906020608492519162461bcd60e51b8352820152602260248201527f5265666c656374696f6e7320666565206d757374206265203525206f72206c65604482015261737360f01b6064820152fd5b5082346100ce57816003193601126100ce5760209068a20d6e21d0e525530b549051908152f35b5082346100ce57806003193601126100ce57602090610d87610d6e6117ab565b60ff60055460081c1615610d8e575b60243590336120a3565b5160018152f35b610da360018060a01b03600154163314612018565b610d7d565b5082346100ce57816003193601126100ce5780519082600354610dca81611ccf565b80855290600190818116908115610e595750600114610e00575b505050610df682610c879403836117dc565b519182918261177f565b60038352602095507fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b828410610e465750505082610c8794610df69282010194610de4565b8054868501880152928601928101610e2a565b610c879750610df69450602092508693915060ff191682840152151560051b82010194610de4565b5082346100ce57816003193601126100ce5760015490516001600160a01b039091168152602090f35b5034610aad5780600319360112610aad57610ec3611896565b61010061ff0019600554161760055580f35b5034610aad5780600319360112610aad57610eee611896565b600180546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5082346100ce5760203660031901126100ce57602090610f58610f536117ab565b61194a565b9051908152f35b5082346100ce57816003193601126100ce5768a20d6e21d0e525530d5490516001600160a01b039091168152602090f35b5034610aad57610f9f3661182e565b91610fa8611896565b82516001600160401b038111610bcf57610fc28254611ccf565b601f8111611077575b50602080601f83116001146110135750839482939492611008575b50508160011b916000199060031b1c19161790555b60ff196005541660055580f35b015190508480610fe6565b90601f198316958486528286209286905b88821061105f57505083600195969710611046575b505050811b019055610ffb565b015160001960f88460031b161c19169055848080611039565b80600185968294968601518155019501930190611024565b82845260208420601f830160051c810191602084106110b2575b601f0160051c01905b8181106110a75750610fcb565b84815560010161109a565b9091508190611091565b50925034610128578160031936011261012857602435928315158403610aad5750602092610f5891356119a6565b509134610128576080366003190112610128578135916001600160601b038316808403611342576111196117c6565b916001600160a01b0360643581811680820361133e57611137611896565b68a20d6e21d0e52553089163ffffffff835460201c1661132e57811561131e57896024601c82602094630f4599e582523386525af160018a5114161561131257815467ffffffff00000000198116640100000000908117845568a20d6e21d0e525530d80546001600160a01b0319169093179092556044358a5585159384156111be578a80f35b8716988915611302576b0de0b6b39983494c589bffff87116112f2576001600160601b0360601b9060601b169077ffffffffffffffffffffffff00000000ffffffff000000001916171790558268a20d6e21d0e5255309556112df57509161128d6020928587600080516020612a9b833981519152867fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d64203939868a20d6e21d0e525530a8160001906198155600261127388611ae5565b9161127e848461205d565b549101558751908152a3611ae5565b805460581c906001600283161515036112b7575b50505160018152a2818080808080808080808a80f35b805460ff60581b191660ff9290921660021860581b60ff60581b1691909117905585806112a1565b634e487b7160e01b865260129052602485fd5b885163e5cfe95760e01b81528690fd5b8851633a954ecd60e21b81528690fd5b8363d125259c8a52601cfd5b87516339a84a7b60e01b81528590fd5b8751633ab534b960e21b81528590fd5b8880fd5b8480fd5b5082346100ce57816003193601126100ce576020905160128152f35b50829034610aad576020366003190112610aad5750610f5860209235611a42565b50925034610128576020366003190112610128573590811515809203610128576113ac33611ae5565b805460581c9083600283161515036113ee575b5050519081527fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d642039360203392a280f35b805460ff60581b191660ff9290921660021860581b60ff60581b1691909117905538806113bf565b5082346100ce5760203660031901126100ce5760209061143c6114376117ab565b611ac0565b90519015158152f35b50829034610aad576060366003190112610aad576114616117ab565b6114696117c6565b916044359460055460ff8160081c16156114e7575b50611488836118c2565b3383526020528482205490600182016114aa575b602086610d878988886120a3565b8187116114d9575091610d8793918587602098956114c7856118c2565b3385528a52039120559194819361149c565b85516313be252b60e01b8152fd5b60015461150d916001600160a01b03918216338114918215611513575b50509050612018565b8661147e565b8391925060101c163314918261152e575b5050808980611504565b86161490508880611524565b5082346100ce57816003193601126100ce576020906001600160601b0368a20d6e21d0e52553085460601c169051908152f35b5082346100ce57806003193601126100ce576020918161158b6117ab565b9160243591829161159b336118c2565b6001600160a01b039095168082529487522055825190815233907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925908590a35160018152f35b5082346100ce57816003193601126100ce578051908260025461160381611ccf565b80855290600190818116908115610e59575060011461162e57505050610df682610c879403836117dc565b60028352602095507f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b8284106116745750505082610c8794610df69282010194610de4565b8054868501880152928601928101611658565b509134610128576020366003190112610128578135916116a633611ae5565b9160ff60038401541661170457505060026116c083611b57565b5050505091016116d1828254611976565b90556116e868a20d6e21d0e525530a918254611976565b90556116ff68a20d6e21d0e525530b918254611999565b905580f35b906020608492519162461bcd60e51b8352820152602c60248201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460448201526b3434b990333ab731ba34b7b760a11b6064820152fd5b60005b83811061176f5750506000910152565b818101518382015260200161175f565b6040916020825261179f815180928160208601526020868601910161175c565b601f01601f1916010190565b600435906001600160a01b03821682036117c157565b600080fd5b602435906001600160a01b03821682036117c157565b90601f801991011681019081106001600160401b038211176117fd57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116117fd57601f01601f191660200190565b60206003198201126117c1576004356001600160401b0381116117c157816023820112156117c15780600401359061186582611813565b9261187360405194856117dc565b828452602483830101116117c15781600092602460209301838601378301015290565b6001546001600160a01b031633036118aa57565b60405163118cdaa760e01b8152336004820152602490fd5b6001600160a01b0316600090815268a20d6e21d0e52553116020526040902090565b6001600160a01b0316600090815268a20d6e21d0e525530f6020526040902090565b6001600160a01b0316600090815268a20d6e21d0e52553126020526040902090565b6001600160a01b0316600090815268a20d6e21d0e52553146020526040902090565b61195390611928565b60ff60038201541661196f57600261196c910154611a42565b90565b6001015490565b9190820391821161198357565b634e487b7160e01b600052601160045260246000fd5b9190820180921161198357565b9068a20d6e21d0e52553095482116119dd576119cc576119c590611b57565b5050505090565b6119d590611b57565b505050905090565b60405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c79006044820152606490fd5b8115611a2c570490565b634e487b7160e01b600052601260045260246000fd5b68a20d6e21d0e525530a548111611a685761196c90611a62611a62611c05565b90611a22565b60405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608490fd5b611ac981611928565b5460581c6001811615611ae0576002915016151590565b503b90565b90611aef82611928565b916001835460581c1615611b005750565b6001903b611b23575b825460ff60581b191660589190911b60ff60581b16178255565b506003611b09565b63ffffffff908060031c60005268a20d6e21d0e525531360205260e06040600020549160051b161c1690565b906103e8611b6f68a20d6e21d0e525530c5484611bab565b04611b7a8184611976565b90611b9a611b93611b8c611a62611c05565b8096611bab565b9482611bab565b92611ba58486611976565b93929190565b8181029291811591840414171561198357565b60001981146119835760010190565b68a20d6e21d0e52553158054821015611bef5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b68a20d6e21d0e525530a54908168a20d6e21d0e525530954928390600068a20d6e21d0e5255315545b808210611c54575050611c418282611a22565b8310611c4d5750509190565b9350919050565b9095611c79611c6288611bcd565b905460039190911b1c6001600160a01b0316611928565b946002860154908082118015611cc2575b611cb657916001611ca1611caa93611cb095611976565b97015490611976565b96611bbe565b90611c2e565b50505050915092509190565b5082600188015411611c8a565b90600182811c92168015611cff575b6020831014611ce957565b634e487b7160e01b600052602260045260246000fd5b91607f1691611cde565b6001906001600160a01b03611d2261017383851b611b2b565b5416156120065760ff60055416611f4d5790819060009072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8381811015611f3f575b50506d04ee2d6d415b85acef810000000080851015611f30575b50662386f26fc1000080851015611f21575b506305f5e10080851015611f12575b5061271080851015611f03575b506064841015611ef3575b600a80941015611eea575b80820193611dde611dc886611813565b95611dd660405197886117dc565b808752611813565b9382602160209586890197601f1901368937880101905b611ebb575b50505060405193849260009260045490611e1382611ccf565b91818116908115611e9d5750600114611e5b575b5050509080611e4061196c95600595945193849161175c565b0164173539b7b760d91b815203601a198101845201826117dc565b9091929350600460005282600020906000915b838310611e87575050508301019080611e406005611e27565b8054898401860152889650918401918101611e6e565b60ff191684880152505080151502840101915080611e406005611e27565b600019019082906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a835304908382611df55750611dfa565b80910190611db8565b9092606460029104930190611dad565b60049192940493019038611da2565b60089192940493019038611d95565b60109192940493019038611d86565b60209192940493019038611d74565b049350604091503880611d5a565b5060405190816000600454611f6181611ccf565b80845290848116908115611fe55750600114611f85575b5061196c925003826117dc565b600460009081527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b94602093509091905b818310611fcd57505061196c935082010138611f78565b85548784018501529485019486945091830191611fb6565b905061196c94506020925060ff191682840152151560051b82010138611f78565b60405163677510db60e11b8152600490fd5b1561201f57565b60405162461bcd60e51b8152602060048201526016602482015275151c98591a5b99c81a5cc81b9bdd08195b98589b195960521b6044820152606490fd5b80546001600160a01b031660a09290921b6001600160a01b031916919091179055565b805463ffffffff60801b191660809290921b63ffffffff60801b16919091179055565b91906001600160a01b038116156128e8576120bd83611ae5565b6120c682611ae5565b60405161014081018181106001600160401b038211176117fd57604052600081526000602082015260006040820152600060608201526000610100820152600061012082015263ffffffff835460801c16608082015263ffffffff825460801c1660a0820152600283015460c0820152600282015460e08201526040516370a0823160e01b815260018060a01b0387166004820152602081602481305afa9081156128aa576000916128b6575b50604082810191909152516370a0823160e01b81526001600160a01b0385166004820152602081602481305afa9081156128aa57600091612878575b50606082015260408101518511612866576121c985611b57565b9391929060ff600389015416808091612857575b1561271d5750509061221a9189600189015403918261010088015260c08701510360c087015260e086015101908160e08701526040860152611a42565b60608401525b61223568a20d6e21d0e525530a918254611976565b905561224c68a20d6e21d0e525530b918254611999565b905560c0810151600284015560e081015160028301556101008101516001840155610120810151600183015560408101516122906001600160601b0382168561205d565b6122a76001600160601b036060840151168461205d565b60808201516122b96000548093611a22565b808203911102908183526002845460581c16156126d2575b5050805160208201510192604051938460408101106001600160401b036040870111176117fd5760609060408601604052818652600060208701526040519082604083019180835260051b8301016040528652018460200152815161258e575b5060208101516123c2575b50505180519081612374575b50506040519182526001600160a01b03908116921690600080516020612a9b83398151915290602090a3565b6020600092600192838060a01b0368a20d6e21d0e525530d5416603f19820195869363263c69d6855285601f1985015260051b6044019260231901915af191511416156117c1573880612348565b95919290946123d082611906565b9260a08801519160208901518301906123e9858a6128fa565b9761246068a20d6e21d0e5255308549a6124128c6001600160601b036000549160601c16611a22565b9b63ffffffff8160201c169d63ffffffff60208160401b9201511663ffffffff8360401c160160401b169063ffffffff60401b19161768a20d6e21d0e52553085563ffffffff851690612080565b60015b15612544575b60009a929a925b63ffffffff6124818260011b611b2b565b16156124a2576001019a8a8c11612499575b9a612470565b60019b50612493565b6001909b91929399949b6124bd63ffffffff8216888b6129dd565b8187019668a20d6e21d0e52553136020528160021c60005260406000209060c08360061b1682549167ffffffff000000008a63ffffffff169160201b161782821c186001600160401b0316901b18905560208a8101518260081b8a60601b178152018a6020015201988a8a1161253b575b9a93989a92919092612463565b6001995061252e565b82850361246957975097505096919392505067ffffffff0000000068a20d6e21d0e5255308549160201b169067ffffffff0000000019161768a20d6e21d0e525530855388061233c565b969295949161259f86959295611906565b946080810151986125f3825191828c039268a20d6e21d0e52553089081549063ffffffff8060401b911663ffffffff8360401c160360401b169063ffffffff60401b191617905563ffffffff831690612080565b60015b156126bb575b8899602088999a600164ffffffff0061263a60009560001901809d9063ffffffff918160031c60005260205260e06040600020549160051b161c1690565b9268a20d6e21d0e52553138552633fffffff8460021c16600052604060002060c08560061b1681549081811c6001600160401b0316901b18905563ffffffff841660005268a20d6e21d0e525531085526040600020838060a01b031981541690558401519260081b168d60601b17178152018b6020015299989796996125f6565b808a036125fc575091945091949592965038612331565b6126f5916001600160a01b038981169088161461270c575b506060830151611a22565b60a0820151808203911102602082015238806122d1565b60808401510360a0840152386126ea565b80158080612849575b1561276f57505061275a9260c087015103918260c088015260e08701510160e0870152600187015401610120860152611a42565b60408401526101208301516060840152612220565b8061283a575b156127b957505061279d9160c086015103908160c087015260e08601510160e0860152611a42565b60408401526127af60e0840151611a42565b6060840152612220565b9091908061282c575b156128095789600189015403928361010088015260c08701510360c087015260e08601510160e0860152600186015401908161012086015260408501526060840152612220565b905061279d9160c086015103908160c087015260e08601510160e0860152611a42565b5060ff6003880154166127c2565b5060ff60038901541615612775565b5060ff60038a015416612726565b5060ff600389015416156121dd565b604051631e9acf1760e31b8152600490fd5b90506020813d6020116128a2575b81612893602093836117dc565b810103126117c15751386121af565b3d9150612886565b6040513d6000823e3d90fd5b90506020813d6020116128e0575b816128d1602093836117dc565b810103126117c1575138612173565b3d91506128c4565b604051633a954ecd60e21b8152600490fd5b805460601c63ffffffff908116939290841561291557505050565b9091935068a20d6e21d0e525530890815491818316928284146119835763ffffffff191660019390930191821692909217909155835463ffffffff60601b1916606082901b63ffffffff60601b16179093556129898363ffffffff1660005268a20d6e21d0e525530e602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b9068a20d6e21d0e52553136020528160031c60005260e060406000209260051b1682549182821c1863ffffffff16901b189055565b9190916020528160031c60005260e060406000209260051b1682549182821c1863ffffffff16901b189055565b15612a1157565b60405162461bcd60e51b8152602060048201526015602482015274119d5b98dd1a5bdb881a5cc81c995b9bdd5b98d959605a1b6044820152606490fd5b15612a5557565b60405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606490fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122065250705508d1bad1063f376852cfa8aa77dab45a4f2b6b1da05929e9e1bdf5064736f6c634300081400330000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Deployed Bytecode
0x6040608081526004908136109182156106ab575b36156106a957600092833560e01c9163e985e9c5831461064857636352211e83146105d45763e5eb36c883146102df5763813500fc83146102865763d10b6e0c83146101d15763081812fc83146101395763f5b100ea83146100e05763e2c792818314610091578463b7a94eb8841461008857005b80600160209252f35b68a20d6e21d0e525530d54919250906001600160a01b031633036100d257506100ce5768a20d6e21d0e525530854901c63ffffffff168152602090f35b5080fd5b825163ce5a776b60e01b8152fd5b68a20d6e21d0e525530d546001600160a01b03949193509091508316330361012c5750602436106101285761011f6020939263ffffffff923516611928565b5460801c168152f35b8280fd5b5163ce5a776b60e01b8152fd5b68a20d6e21d0e525530d5485906001600160a01b03908690821633036101c25760243610610128578335826101916101738360011b611b2b565b63ffffffff1660005268a20d6e21d0e525530e602052604060002090565b5416156101b25760209450835268a20d6e21d0e52553108452822054168152f35b815163677510db60e11b81528590fd5b5163ce5a776b60e01b81528390fd5b68a20d6e21d0e525530d546001600160a01b039186918691908416330361027857606436106101285760243593806044351692816102146101738860011b611b2b565b541693848103610248575b50602095855268a20d6e21d0e52553108652842091351660018060a01b03198254161790558152f35b610251856118e4565b90865260205260ff818620541615610269578661021f565b516367d9dca160e11b81529050fd5b905163ce5a776b60e01b8152fd5b68a20d6e21d0e525530d546001600160a01b0391869186919084163303610278576064361061012857836102bf602095604435166118e4565b91351683528352812060ff1981541660ff60243515151617905560018152f35b68a20d6e21d0e525530d54849186916001600160a01b0390811633036105c55760843610610128578082351681602435169160443581606435169460ff60055460081c16156105b1575b84156105a35760019582871b938061034361017387611b2b565b541686036105945785820361054b575b505061035e84611ae5565b61036786611ae5565b9188549061037482611b57565b505050509160ff600385015416610535575b5060ff60038501541661051e575b600283016103a3838254611976565b90556001600160601b0390818b5416845460a01c039082821161050b575060209b94958c96856104e98b8f8f908f9061042b600080516020612a9b8339815191529f9a8e936104d09d6104ff9f610425936104046104fa9f6104159361205d565b808754168d5460a01c01168c61205d565b60028b01908154019055896128fa565b8b6129a8565b87815268a20d6e21d0e52553108e522080546001600160a01b03191690556104bb816104a361049d61045c86611906565b9763ffffffff9861047a8a60001981855460801c1601168093612080565b9063ffffffff918160031c60005260205260e06040600020549160051b161c1690565b94611906565b99019885841690866104b48c611b2b565b16906129dd565b83855460801c16988995858388011690612080565b6401fffffffe6104df89611b2b565b92821b16016129a8565b6104f28c611906565b9216916129dd565b6129a8565b86549051908152a38152f35b634e487b7160e01b8c526011905260248bfd5b895461052e8a8601918254611999565b9055610394565b6105438a8501918254611976565b90558b610386565b610554866118e4565b828a5260205260ff8a8a2054166103535783895268a20d6e21d0e5255310602052898920541603610586578880610353565b8751632ce44b5f60e11b8152fd5b895162a1148160e81b81528390fd5b8751633a954ecd60e21b8152fd5b6105c083600154163314612018565b610329565b50825163ce5a776b60e01b8152fd5b68a20d6e21d0e525530d54849186916001600160a01b0391908216330361063a576024361061012857803560011b938261061061017387611b2b565b54161561062d575050610627610173602094611b2b565b54168152f35b5163677510db60e11b8152fd5b835163ce5a776b60e01b8152fd5b68a20d6e21d0e525530d546001600160a01b039350909150821633036100d257604436106106a557918161068360ff936020969535166118e4565b9060243516845284528220541660001461069d5760018152f35b60ff81168152f35b8380fd5b005b6000803560e01c8063053ab1821461168757806306fdde03146115e1578063095ea7b31461156d57806318160ddd1461153a57806323b872dd14611445578063274e430b146114165780632a6a935d146113835780632d83811914611362578063313ce567146113465780633a7374eb146110ea5780634549b039146110bc5780634c26124714610f905780634ef41efc14610f5f57806370a0823114610f32578063715018a614610ed55780638a8c523c14610eaa5780638da5cb5b14610e8157806395d89b4114610da8578063a9059cbb14610d4e578063ae26773514610d27578063c4081a4c14610c8b578063c87b56dd14610c5a578063dc5e08a414610c29578063dd62ed3e14610be2578063e0df5b6f14610ab0578063f2cc0c18146109e9578063f2fde38b1461095e578063f66608fe146109375763f84354f1146107f65750610013565b90346100ce5760203660031901126100ce576108106117ab565b610818611896565b61082181611ae5565b6003918282019361083660ff86541615612a4e565b6001600160a01b0391821690865b68a20d6e21d0e525531580548083101561092b57848661086385611bcd565b9054908b1b1c161461087f57505061087a90611bbe565b610844565b9495919096979293506000199485810190811161091857916108d76001926108b8898c6108ac8f98611bcd565b9054911b1c1691611bcd565b90919082549060031b9160018060a01b03809116831b921b1916179055565b0155805460ff191690558354908115610905575001926108f684611bcd565b81939154921b1b191690555580f35b634e487b7160e01b875260319052602486fd5b634e487b7160e01b8a526011855260248afd5b50505050505050505080f35b5082346100ce57816003193601126100ce5760209068a20d6e21d0e525530c549051908152f35b509250346101285760203660031901126101285761097a6117ab565b90610983611896565b6001600160a01b039182169283156109d3575050600180546001600160a01b031981168417909155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b51631e4fbdf760e01b8152908101849052602490fd5b5034610aad576020366003190112610aad57610a036117ab565b610a0b611896565b610a2260ff68a20d6e21d0e5255316541615612a0a565b610a2b81611ae5565b60016003820191825490610a4260ff831615612a4e565b600281015480610a99575b505060ff191617905568a20d6e21d0e5255315805490600160401b821015610a8657816108b8916001610a839594019055611bcd565b80f35b634e487b7160e01b845260418552602484fd5b610aa38491611a42565b9101558680610a4d565b80fd5b5034610aad57610abf3661182e565b91610ac8611896565b82516001600160401b038111610bcf57610ae28254611ccf565b601f8111610b8a575b50602080601f8311600114610b285750839482939492610b1d575b50508160011b916000199060031b1c191617905580f35b015190508480610b06565b90601f198316958486528286209286905b888210610b7257505083600195969710610b59575b505050811b01905580f35b015160001960f88460031b161c19169055848080610b4e565b80600185968294968601518155019501930190610b39565b82845260208420601f830160051c81019160208410610bc5575b601f0160051c01905b818110610bba5750610aeb565b848155600101610bad565b9091508190610ba4565b634e487b7160e01b835260418252602483fd5b5082346100ce57806003193601126100ce5780602092610c006117ab565b610c11610c0b6117c6565b916118c2565b6001600160a01b039091168252845220549051908152f35b5034610aad5780600319360112610aad57610c42611896565b68a20d6e21d0e5255316805460ff1916600117905580f35b50829034610aad576020366003190112610aad5750610c7c610c879235611d09565b90519182918261177f565b0390f35b5092503461012857602036600319011261012857803591610caa611896565b610cc160ff68a20d6e21d0e5255316541615612a0a565b60328311610cd957505068a20d6e21d0e525530c5580f35b906020608492519162461bcd60e51b8352820152602260248201527f5265666c656374696f6e7320666565206d757374206265203525206f72206c65604482015261737360f01b6064820152fd5b5082346100ce57816003193601126100ce5760209068a20d6e21d0e525530b549051908152f35b5082346100ce57806003193601126100ce57602090610d87610d6e6117ab565b60ff60055460081c1615610d8e575b60243590336120a3565b5160018152f35b610da360018060a01b03600154163314612018565b610d7d565b5082346100ce57816003193601126100ce5780519082600354610dca81611ccf565b80855290600190818116908115610e595750600114610e00575b505050610df682610c879403836117dc565b519182918261177f565b60038352602095507fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b828410610e465750505082610c8794610df69282010194610de4565b8054868501880152928601928101610e2a565b610c879750610df69450602092508693915060ff191682840152151560051b82010194610de4565b5082346100ce57816003193601126100ce5760015490516001600160a01b039091168152602090f35b5034610aad5780600319360112610aad57610ec3611896565b61010061ff0019600554161760055580f35b5034610aad5780600319360112610aad57610eee611896565b600180546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5082346100ce5760203660031901126100ce57602090610f58610f536117ab565b61194a565b9051908152f35b5082346100ce57816003193601126100ce5768a20d6e21d0e525530d5490516001600160a01b039091168152602090f35b5034610aad57610f9f3661182e565b91610fa8611896565b82516001600160401b038111610bcf57610fc28254611ccf565b601f8111611077575b50602080601f83116001146110135750839482939492611008575b50508160011b916000199060031b1c19161790555b60ff196005541660055580f35b015190508480610fe6565b90601f198316958486528286209286905b88821061105f57505083600195969710611046575b505050811b019055610ffb565b015160001960f88460031b161c19169055848080611039565b80600185968294968601518155019501930190611024565b82845260208420601f830160051c810191602084106110b2575b601f0160051c01905b8181106110a75750610fcb565b84815560010161109a565b9091508190611091565b50925034610128578160031936011261012857602435928315158403610aad5750602092610f5891356119a6565b509134610128576080366003190112610128578135916001600160601b038316808403611342576111196117c6565b916001600160a01b0360643581811680820361133e57611137611896565b68a20d6e21d0e52553089163ffffffff835460201c1661132e57811561131e57896024601c82602094630f4599e582523386525af160018a5114161561131257815467ffffffff00000000198116640100000000908117845568a20d6e21d0e525530d80546001600160a01b0319169093179092556044358a5585159384156111be578a80f35b8716988915611302576b0de0b6b39983494c589bffff87116112f2576001600160601b0360601b9060601b169077ffffffffffffffffffffffff00000000ffffffff000000001916171790558268a20d6e21d0e5255309556112df57509161128d6020928587600080516020612a9b833981519152867fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d64203939868a20d6e21d0e525530a8160001906198155600261127388611ae5565b9161127e848461205d565b549101558751908152a3611ae5565b805460581c906001600283161515036112b7575b50505160018152a2818080808080808080808a80f35b805460ff60581b191660ff9290921660021860581b60ff60581b1691909117905585806112a1565b634e487b7160e01b865260129052602485fd5b885163e5cfe95760e01b81528690fd5b8851633a954ecd60e21b81528690fd5b8363d125259c8a52601cfd5b87516339a84a7b60e01b81528590fd5b8751633ab534b960e21b81528590fd5b8880fd5b8480fd5b5082346100ce57816003193601126100ce576020905160128152f35b50829034610aad576020366003190112610aad5750610f5860209235611a42565b50925034610128576020366003190112610128573590811515809203610128576113ac33611ae5565b805460581c9083600283161515036113ee575b5050519081527fb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d642039360203392a280f35b805460ff60581b191660ff9290921660021860581b60ff60581b1691909117905538806113bf565b5082346100ce5760203660031901126100ce5760209061143c6114376117ab565b611ac0565b90519015158152f35b50829034610aad576060366003190112610aad576114616117ab565b6114696117c6565b916044359460055460ff8160081c16156114e7575b50611488836118c2565b3383526020528482205490600182016114aa575b602086610d878988886120a3565b8187116114d9575091610d8793918587602098956114c7856118c2565b3385528a52039120559194819361149c565b85516313be252b60e01b8152fd5b60015461150d916001600160a01b03918216338114918215611513575b50509050612018565b8661147e565b8391925060101c163314918261152e575b5050808980611504565b86161490508880611524565b5082346100ce57816003193601126100ce576020906001600160601b0368a20d6e21d0e52553085460601c169051908152f35b5082346100ce57806003193601126100ce576020918161158b6117ab565b9160243591829161159b336118c2565b6001600160a01b039095168082529487522055825190815233907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925908590a35160018152f35b5082346100ce57816003193601126100ce578051908260025461160381611ccf565b80855290600190818116908115610e59575060011461162e57505050610df682610c879403836117dc565b60028352602095507f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b8284106116745750505082610c8794610df69282010194610de4565b8054868501880152928601928101611658565b509134610128576020366003190112610128578135916116a633611ae5565b9160ff60038401541661170457505060026116c083611b57565b5050505091016116d1828254611976565b90556116e868a20d6e21d0e525530a918254611976565b90556116ff68a20d6e21d0e525530b918254611999565b905580f35b906020608492519162461bcd60e51b8352820152602c60248201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460448201526b3434b990333ab731ba34b7b760a11b6064820152fd5b60005b83811061176f5750506000910152565b818101518382015260200161175f565b6040916020825261179f815180928160208601526020868601910161175c565b601f01601f1916010190565b600435906001600160a01b03821682036117c157565b600080fd5b602435906001600160a01b03821682036117c157565b90601f801991011681019081106001600160401b038211176117fd57604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116117fd57601f01601f191660200190565b60206003198201126117c1576004356001600160401b0381116117c157816023820112156117c15780600401359061186582611813565b9261187360405194856117dc565b828452602483830101116117c15781600092602460209301838601378301015290565b6001546001600160a01b031633036118aa57565b60405163118cdaa760e01b8152336004820152602490fd5b6001600160a01b0316600090815268a20d6e21d0e52553116020526040902090565b6001600160a01b0316600090815268a20d6e21d0e525530f6020526040902090565b6001600160a01b0316600090815268a20d6e21d0e52553126020526040902090565b6001600160a01b0316600090815268a20d6e21d0e52553146020526040902090565b61195390611928565b60ff60038201541661196f57600261196c910154611a42565b90565b6001015490565b9190820391821161198357565b634e487b7160e01b600052601160045260246000fd5b9190820180921161198357565b9068a20d6e21d0e52553095482116119dd576119cc576119c590611b57565b5050505090565b6119d590611b57565b505050905090565b60405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c79006044820152606490fd5b8115611a2c570490565b634e487b7160e01b600052601260045260246000fd5b68a20d6e21d0e525530a548111611a685761196c90611a62611a62611c05565b90611a22565b60405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608490fd5b611ac981611928565b5460581c6001811615611ae0576002915016151590565b503b90565b90611aef82611928565b916001835460581c1615611b005750565b6001903b611b23575b825460ff60581b191660589190911b60ff60581b16178255565b506003611b09565b63ffffffff908060031c60005268a20d6e21d0e525531360205260e06040600020549160051b161c1690565b906103e8611b6f68a20d6e21d0e525530c5484611bab565b04611b7a8184611976565b90611b9a611b93611b8c611a62611c05565b8096611bab565b9482611bab565b92611ba58486611976565b93929190565b8181029291811591840414171561198357565b60001981146119835760010190565b68a20d6e21d0e52553158054821015611bef5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b68a20d6e21d0e525530a54908168a20d6e21d0e525530954928390600068a20d6e21d0e5255315545b808210611c54575050611c418282611a22565b8310611c4d5750509190565b9350919050565b9095611c79611c6288611bcd565b905460039190911b1c6001600160a01b0316611928565b946002860154908082118015611cc2575b611cb657916001611ca1611caa93611cb095611976565b97015490611976565b96611bbe565b90611c2e565b50505050915092509190565b5082600188015411611c8a565b90600182811c92168015611cff575b6020831014611ce957565b634e487b7160e01b600052602260045260246000fd5b91607f1691611cde565b6001906001600160a01b03611d2261017383851b611b2b565b5416156120065760ff60055416611f4d5790819060009072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8381811015611f3f575b50506d04ee2d6d415b85acef810000000080851015611f30575b50662386f26fc1000080851015611f21575b506305f5e10080851015611f12575b5061271080851015611f03575b506064841015611ef3575b600a80941015611eea575b80820193611dde611dc886611813565b95611dd660405197886117dc565b808752611813565b9382602160209586890197601f1901368937880101905b611ebb575b50505060405193849260009260045490611e1382611ccf565b91818116908115611e9d5750600114611e5b575b5050509080611e4061196c95600595945193849161175c565b0164173539b7b760d91b815203601a198101845201826117dc565b9091929350600460005282600020906000915b838310611e87575050508301019080611e406005611e27565b8054898401860152889650918401918101611e6e565b60ff191684880152505080151502840101915080611e406005611e27565b600019019082906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a835304908382611df55750611dfa565b80910190611db8565b9092606460029104930190611dad565b60049192940493019038611da2565b60089192940493019038611d95565b60109192940493019038611d86565b60209192940493019038611d74565b049350604091503880611d5a565b5060405190816000600454611f6181611ccf565b80845290848116908115611fe55750600114611f85575b5061196c925003826117dc565b600460009081527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b94602093509091905b818310611fcd57505061196c935082010138611f78565b85548784018501529485019486945091830191611fb6565b905061196c94506020925060ff191682840152151560051b82010138611f78565b60405163677510db60e11b8152600490fd5b1561201f57565b60405162461bcd60e51b8152602060048201526016602482015275151c98591a5b99c81a5cc81b9bdd08195b98589b195960521b6044820152606490fd5b80546001600160a01b031660a09290921b6001600160a01b031916919091179055565b805463ffffffff60801b191660809290921b63ffffffff60801b16919091179055565b91906001600160a01b038116156128e8576120bd83611ae5565b6120c682611ae5565b60405161014081018181106001600160401b038211176117fd57604052600081526000602082015260006040820152600060608201526000610100820152600061012082015263ffffffff835460801c16608082015263ffffffff825460801c1660a0820152600283015460c0820152600282015460e08201526040516370a0823160e01b815260018060a01b0387166004820152602081602481305afa9081156128aa576000916128b6575b50604082810191909152516370a0823160e01b81526001600160a01b0385166004820152602081602481305afa9081156128aa57600091612878575b50606082015260408101518511612866576121c985611b57565b9391929060ff600389015416808091612857575b1561271d5750509061221a9189600189015403918261010088015260c08701510360c087015260e086015101908160e08701526040860152611a42565b60608401525b61223568a20d6e21d0e525530a918254611976565b905561224c68a20d6e21d0e525530b918254611999565b905560c0810151600284015560e081015160028301556101008101516001840155610120810151600183015560408101516122906001600160601b0382168561205d565b6122a76001600160601b036060840151168461205d565b60808201516122b96000548093611a22565b808203911102908183526002845460581c16156126d2575b5050805160208201510192604051938460408101106001600160401b036040870111176117fd5760609060408601604052818652600060208701526040519082604083019180835260051b8301016040528652018460200152815161258e575b5060208101516123c2575b50505180519081612374575b50506040519182526001600160a01b03908116921690600080516020612a9b83398151915290602090a3565b6020600092600192838060a01b0368a20d6e21d0e525530d5416603f19820195869363263c69d6855285601f1985015260051b6044019260231901915af191511416156117c1573880612348565b95919290946123d082611906565b9260a08801519160208901518301906123e9858a6128fa565b9761246068a20d6e21d0e5255308549a6124128c6001600160601b036000549160601c16611a22565b9b63ffffffff8160201c169d63ffffffff60208160401b9201511663ffffffff8360401c160160401b169063ffffffff60401b19161768a20d6e21d0e52553085563ffffffff851690612080565b60015b15612544575b60009a929a925b63ffffffff6124818260011b611b2b565b16156124a2576001019a8a8c11612499575b9a612470565b60019b50612493565b6001909b91929399949b6124bd63ffffffff8216888b6129dd565b8187019668a20d6e21d0e52553136020528160021c60005260406000209060c08360061b1682549167ffffffff000000008a63ffffffff169160201b161782821c186001600160401b0316901b18905560208a8101518260081b8a60601b178152018a6020015201988a8a1161253b575b9a93989a92919092612463565b6001995061252e565b82850361246957975097505096919392505067ffffffff0000000068a20d6e21d0e5255308549160201b169067ffffffff0000000019161768a20d6e21d0e525530855388061233c565b969295949161259f86959295611906565b946080810151986125f3825191828c039268a20d6e21d0e52553089081549063ffffffff8060401b911663ffffffff8360401c160360401b169063ffffffff60401b191617905563ffffffff831690612080565b60015b156126bb575b8899602088999a600164ffffffff0061263a60009560001901809d9063ffffffff918160031c60005260205260e06040600020549160051b161c1690565b9268a20d6e21d0e52553138552633fffffff8460021c16600052604060002060c08560061b1681549081811c6001600160401b0316901b18905563ffffffff841660005268a20d6e21d0e525531085526040600020838060a01b031981541690558401519260081b168d60601b17178152018b6020015299989796996125f6565b808a036125fc575091945091949592965038612331565b6126f5916001600160a01b038981169088161461270c575b506060830151611a22565b60a0820151808203911102602082015238806122d1565b60808401510360a0840152386126ea565b80158080612849575b1561276f57505061275a9260c087015103918260c088015260e08701510160e0870152600187015401610120860152611a42565b60408401526101208301516060840152612220565b8061283a575b156127b957505061279d9160c086015103908160c087015260e08601510160e0860152611a42565b60408401526127af60e0840151611a42565b6060840152612220565b9091908061282c575b156128095789600189015403928361010088015260c08701510360c087015260e08601510160e0860152600186015401908161012086015260408501526060840152612220565b905061279d9160c086015103908160c087015260e08601510160e0860152611a42565b5060ff6003880154166127c2565b5060ff60038901541615612775565b5060ff60038a015416612726565b5060ff600389015416156121dd565b604051631e9acf1760e31b8152600490fd5b90506020813d6020116128a2575b81612893602093836117dc565b810103126117c15751386121af565b3d9150612886565b6040513d6000823e3d90fd5b90506020813d6020116128e0575b816128d1602093836117dc565b810103126117c1575138612173565b3d91506128c4565b604051633a954ecd60e21b8152600490fd5b805460601c63ffffffff908116939290841561291557505050565b9091935068a20d6e21d0e525530890815491818316928284146119835763ffffffff191660019390930191821692909217909155835463ffffffff60601b1916606082901b63ffffffff60601b16179093556129898363ffffffff1660005268a20d6e21d0e525530e602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b9068a20d6e21d0e52553136020528160031c60005260e060406000209260051b1682549182821c1863ffffffff16901b189055565b9190916020528160031c60005260e060406000209260051b1682549182821c1863ffffffff16901b189055565b15612a1157565b60405162461bcd60e51b8152602060048201526015602482015274119d5b98dd1a5bdb881a5cc81c995b9bdd5b98d959605a1b6044820152606490fd5b15612a5557565b60405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606490fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122065250705508d1bad1063f376852cfa8aa77dab45a4f2b6b1da05929e9e1bdf5064736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
-----Decoded View---------------
Arg [0] : uniswapV2Router_ (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
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.